body {
  background-color: #f4f6f9;
}

.menu-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.menu-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1) !important;
}

.card {
  border-radius: 0.75rem;
}

/* ===================== Cards de grupo no Painel de Gestão (Regime/Atividade/Faturamento/Responsável) ===================== */

.painel-card-grupo {
  transition: box-shadow 0.15s ease;
}

.painel-icone-grupo {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.bg-purple-subtle {
  background-color: #ede7f6;
}

.text-purple {
  color: #6f42c1;
}

.painel-lista-grupo {
  max-height: 280px;
  overflow-y: auto;
}

.painel-lista-grupo .list-group-item {
  border-left: none;
  border-right: none;
  padding: 0.65rem 0.25rem;
  font-size: 0.92rem;
  color: #1a1d29;
}

.painel-lista-grupo .list-group-item:first-child {
  border-top: none;
}

.painel-lista-grupo .list-group-item:hover {
  background-color: #f8f9fb;
}

.painel-badge-contagem {
  background-color: #eef1f6;
  color: #495057;
  font-weight: 600;
  min-width: 1.9rem;
}

.painel-avatar-empresa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background-color: #eef1f6;
  color: #495057;
  font-weight: 700;
  font-size: 0.78rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* ===================== Tabelas "bonitas" dos popups do Painel de Gestão ===================== */

.painel-tabela-bonita {
  border-collapse: separate;
  border-spacing: 0;
}

.painel-tabela-bonita thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #f8f9fb;
  color: #495057;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  padding: 0.65rem 0.85rem;
  border-bottom: 2px solid #e9ecef;
}

.painel-tabela-bonita tbody td {
  padding: 0.65rem 0.85rem;
  white-space: nowrap;
  border-bottom: 1px solid #f1f2f5;
  vertical-align: middle;
}

.painel-tabela-bonita tbody tr {
  transition: background-color 0.1s ease;
}

.painel-tabela-bonita tbody tr:nth-child(even) {
  background-color: #fbfbfd;
}

.painel-tabela-bonita tbody tr:hover {
  background-color: #eef2fb;
}

.painel-tabela-bonita tbody tr:last-child td {
  border-bottom: none;
}

/* Filtro dentro dos popups (movido pra cá pra sair da tela principal) */
.painel-filtro-modal {
  background-color: #f8f9fb;
  border-radius: 0.6rem;
  padding: 0.6rem 0.6rem 0.1rem;
  margin-left: 0;
  margin-right: 0;
}

/* ===================== Formulário em etapas (ex: Atribuir Tarefa) ===================== */

.form-step {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid #eef0f3;
}

.form-step:first-of-type {
  padding-top: 0.25rem;
}

.form-step:last-of-type {
  border-bottom: none;
  padding-bottom: 0.5rem;
}

.form-step-icon {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background-color: #eaf2ff;
  color: var(--sidebar-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.form-step-body {
  flex: 1;
  min-width: 0;
}

.form-step-title {
  font-weight: 600;
  margin-bottom: 0.15rem;
  color: #1a1d29;
}

.form-step-hint {
  color: #6c757d;
  font-size: 0.83rem;
  margin-bottom: 0.9rem;
}

/* Chip (usado pra empresas selecionadas e arquivos anexados) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: #eaf2ff;
  color: #0b5ed7;
  border-radius: 2rem;
  padding: 0.3rem 0.4rem 0.3rem 0.8rem;
  font-size: 0.83rem;
  font-weight: 500;
}

.chip button {
  background: none;
  border: none;
  color: inherit;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip button:hover {
  background-color: rgba(13, 110, 253, 0.15);
}

/* Zona de arrastar-e-soltar arquivos */
.dropzone {
  border: 1.5px dashed #c9d2dc;
  border-radius: 0.75rem;
  padding: 1.75rem 1rem;
  text-align: center;
  color: #6c757d;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  position: relative;
}

.dropzone:hover,
.dropzone.dropzone-over {
  border-color: var(--sidebar-accent);
  background-color: #f5f9ff;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone i {
  font-size: 1.7rem;
  color: var(--sidebar-accent);
}

.arquivo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid #eef0f3;
  border-radius: 0.5rem;
  font-size: 0.85rem;
}

/* ===================== Degradê "Foco" (Ferramentas do Consultor / Dashboards BI) ===================== */
/* Paleta de referência: #D38A2D -> #E68A2E -> #D94A45 -> #C32758 -> #8C123A.
   Texto "Foco" sempre em preto (#000) sobre fundo claro, nunca sobre o
   sidebar escuro (ficaria ilegível). */

.icon-foco {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.05rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, #D38A2D 0%, #E68A2E 25%, #D94A45 50%, #C32758 75%, #8C123A 100%);
}

.icon-foco-lg {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 1.5rem;
}

.badge-foco {
  display: inline-flex;
  align-items: center;
  background-color: #fff;
  color: #000000;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Rótulo de seção "FOCO" no menu lateral, separando os itens em destaque */
.sidebar-section-foco {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0.6rem 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-section-foco-label {
  background-color: #fff;
  color: #000000;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 1rem;
  flex-shrink: 0;
}

.sidebar-section-foco-linha {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background-color: rgba(255, 255, 255, 0.4);
}

.sidebar-link-icone-foco {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #8C123A;
  flex-shrink: 0;
  background-color: rgba(255, 255, 255, 0.92);
}

body.sidebar-recolhida .sidebar-section-foco-label {
  display: none;
}

body.sidebar-recolhida .sidebar-section-foco-linha {
  display: none;
}

/* ===================== Sidebar (menu lateral) ===================== */

:root {
  --sidebar-width: 250px;
  --sidebar-width-collapsed: 72px;
  --sidebar-gradiente: linear-gradient(180deg, #D38A2D 0%, #E68A2E 22%, #D94A45 50%, #C32758 75%, #8C123A 100%);
  --sidebar-bg-hover: rgba(255, 255, 255, 0.16);
  --sidebar-text: rgba(255, 255, 255, 0.88);
  --sidebar-text-active: #ffffff;
  --sidebar-link-ativo: rgba(0, 0, 0, 0.28);
  --sidebar-accent: #0d6efd;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background: var(--sidebar-gradiente);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 1030;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 64px;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05rem;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: #fff;
  border-radius: 0.6rem;
  padding: 0.3rem 0.55rem;
  max-width: 100%;
  overflow: hidden;
}

.sidebar-brand-portal {
  color: #000000;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.sidebar-brand-logo {
  height: 22px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.topbar-brand-logo {
  height: 24px;
  width: auto;
  display: block;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-icon:hover {
  background-color: var(--sidebar-bg-hover);
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-link .sidebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 1.3rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background-color: var(--sidebar-bg-hover);
  color: #fff;
}

.sidebar-link.active {
  background-color: var(--sidebar-link-ativo);
  color: #fff;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.85rem 1rem;
}

.sidebar-tenant {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--sidebar-text);
  margin-bottom: 0.6rem;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-user-nome {
  color: #fff;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-label {
  transition: opacity 0.15s ease;
}

.main-content {
  min-height: 100vh;
}

body.has-sidebar .main-content {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.2s ease;
}

/* Menu recolhido (só ícones) — acionado pelo botão de colapsar, desktop */
body.sidebar-recolhida .sidebar {
  width: var(--sidebar-width-collapsed);
}

body.sidebar-recolhida.has-sidebar .main-content {
  margin-left: var(--sidebar-width-collapsed);
}

body.sidebar-recolhida .sidebar-label,
body.sidebar-recolhida .sidebar-user-info {
  display: none;
}

body.sidebar-recolhida .sidebar-header {
  justify-content: center;
}

body.sidebar-recolhida .sidebar-brand {
  justify-content: center;
}

body.sidebar-recolhida #btnColapsarSidebar i {
  transform: rotate(180deg);
}

body.sidebar-recolhida .sidebar-tenant,
body.sidebar-recolhida .sidebar-user {
  justify-content: center;
}

/* ===================== Barra superior (topbar) ===================== */
/* Fica dentro do main-content, por isso já herda o mesmo deslocamento
   (margin-left) do sidebar — não precisa de cálculo de largura à parte. */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #1a1d29;
}

.topbar-link {
  background: transparent;
  border: none;
  color: #495057;
  height: 38px;
  min-width: 38px;
  padding: 0 0.6rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar-link:hover {
  background-color: #f1f3f5;
  color: #1a1d29;
}

.topbar-link.dropdown-toggle::after {
  margin-left: 0.35rem;
}

.topbar-notificacoes {
  width: 300px;
  padding: 0.85rem 1rem;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--sidebar-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-avatar:hover {
  filter: brightness(1.12);
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }

  body.sidebar-aberta-mobile .sidebar {
    transform: translateX(0);
    box-shadow: 0.5rem 0 1.5rem rgba(0, 0, 0, 0.25);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1025;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.sidebar-aberta-mobile .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .main-content {
    margin-left: 0;
  }

  /* no mobile o botão de colapsar (desktop) some; quem manda é o menu hamburguer */
  body.sidebar-recolhida .sidebar {
    width: var(--sidebar-width);
  }

  body.sidebar-recolhida .main-content {
    margin-left: 0;
  }

  body.sidebar-recolhida .sidebar-label,
  body.sidebar-recolhida .sidebar-user-info {
    display: block;
  }
}
