/* ================== BASE LAYOUT / MOBILE SIDEBAR ================== */
html, body {
  height: 100%;
}

.sigfe-layout {
  min-height: 100vh;
}

.sigfe-sidebar {
  width: 260px;
  min-height: 100vh;
  overflow-y: auto;
}

/* Overlay padrão (desktop não usa, só mobile) */
.sigfe-overlay {
  display: none;
}

@media (max-width: 991.98px) {
  .sigfe-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    z-index: 1040;
    transition: left .2s ease-in-out;
  }
  .sigfe-sidebar.show {
    left: 0;
  }
  .sigfe-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 1039;
    display: none;
  }
  .sigfe-overlay.show {
    display: block;
  }
}

/* ===== Login page (estilo SIGCC) - INTOCADO ===== */
body.login-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #007bff, #00c6ff);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.login-card-header {
  background: linear-gradient(135deg, #0095da, #00c67c);
  color: #ffffff;
  padding: 26px 24px 20px;
}

.login-card-logo {
  max-width: 220px;
}

.login-card-body {
  background: #ffffff;
}

/* ===== NOVO TEMA: "Corporate Blue" ===== */
body:not(.login-page) {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f4f7fa; /* Fundo cinza-claro suave */
  color: #334155; /* Texto escuro (slate) */
}

.sigfe-layout {
  background: transparent;
}

.sigfe-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

/* Cabeçalhos das páginas (Azul corporativo escuro) */
.sigfe-main > .mb-3.d-flex.justify-content-between.align-items-center {
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px !important;
  background: #1e3a8a; /* Azul Índigo Escuro (Cor da Sidebar) */
  color: #f9fafb;
  box-shadow: 0 8px 16px rgba(30, 58, 138, 0.2);
}

.sigfe-main > .mb-3.d-flex.justify-content-between.align-items-center h5 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0;
}

.sigfe-main > .mb-3.d-flex.justify-content-between.align-items-center .text-muted.small {
  color: rgba(224, 231, 255, 0.9) !important; /* Texto claro sobre fundo azul */
}

/* Ajuste do header em telas pequenas: quebra para 2 linhas */
@media (max-width: 767.98px) {
  .sigfe-main > .mb-3.d-flex.justify-content-between.align-items-center {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
    padding: 12px 14px;
  }
}

/* ================== SIDEBAR (Corporate Blue + recolher) ================== */

.sigfe-sidebar,
.coh-sidebar {
  background: #1e3a8a; /* Azul Índigo Escuro */
  color: #e0e7ff;      /* Texto claro (tom de índigo) */
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-right: 1px solid #e0e7ff33;
  padding: 1rem 0.75rem;
  transition: width .25s ease;
}

/* largura padrão */
.sigfe-sidebar,
.coh-sidebar {
  width: 260px;
}

/* Logo da sidebar (desktop) */
.sigfe-sidebar-logo {
  height: 52px;
  width: auto;
  transition: opacity .2s ease, height .2s ease;
}

/* largura quando RECOLHIDA (desktop) */
.sigfe-layout.sidebar-collapsed .sigfe-sidebar,
.sigfe-layout.sidebar-collapsed .coh-sidebar {
  width: 72px;
}

/* Header da sidebar */
.coh-sidebar-header {
  padding: 0.25rem 0.75rem 0.75rem;
  border-bottom: 1px solid rgba(224, 231, 255, 0.2);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.coh-sidebar-header .fs-5 {
  font-size: 0.9rem !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  font-weight: 600;
  transition: opacity .2s ease;
}

/* Botão dentro da sidebar para recolher/expandir (desktop) */
.btn-sidebar-collapse {
  border-radius: 999px;
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  border: 1px solid rgba(191, 219, 254, 0.8);
  background: rgba(15, 23, 42, 0.35);
  color: #e0f2fe;
}

.btn-sidebar-collapse .bi {
  transition: transform 0.2s ease;
}

/* Navegação */
.coh-sidebar-nav .nav-link {
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: rgba(224, 231, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease,
              box-shadow .18s ease, border-color .18s ease,
              transform .1s ease;
}

.coh-sidebar-nav .nav-link .bi {
  font-size: 1rem;
  opacity: 0.9;
}

/* texto do label (usado para animar no recolhido) */
.coh-sidebar-nav .nav-link .label-text {
  transition: opacity 0.2s ease, width 0.2s ease, margin 0.2s ease;
}

.coh-sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Link ativo (Azul brilhante) */
.coh-sidebar-nav .nav-link.active {
  background: #3b82f6; /* Azul Brilhante */
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* === Modo RECOLHIDO (desktop): só ícones, botão no lugar do logo === */

/* some logo quando recolhido (desktop) */
.sigfe-layout.sidebar-collapsed .sigfe-sidebar-logo {
  opacity: 0;
  display: none;
}

/* se ainda usar algum texto fs-5 no header, some também */
.sigfe-layout.sidebar-collapsed .coh-sidebar-header .fs-5 {
  opacity: 0;
}

/* alinha header para a esquerda: botão fica onde estava o logo */
.sigfe-layout.sidebar-collapsed .coh-sidebar-header {
  justify-content: flex-start;
}

/* Esconde texto dos links */
.sigfe-layout.sidebar-collapsed .coh-sidebar-nav .nav-link .label-text {
  opacity: 0;
  width: 0;
  margin: 0;
}

/* Centraliza ícones nos 72px */
.sigfe-layout.sidebar-collapsed .coh-sidebar-nav .nav-link {
  justify-content: center;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

/* Seta gira quando recolhida */
.sigfe-layout.sidebar-collapsed #btnSidebarCollapse .bi {
  transform: rotate(180deg);
}

/* ===== Sidebar no MOBILE: ajustes gerais ===== */
@media (max-width: 991.98px) {
  .sigfe-sidebar,
  .coh-sidebar {
    padding: 0.75rem 0.5rem;
    width: 260px;
  }

  .coh-sidebar-header {
    padding: 0.25rem 0.5rem 0.5rem;
    margin-bottom: 0.5rem;
    justify-content: center; /* não estica o header */
    gap: 0;
  }

  /* container do logo NÃO ocupa 100% */
  .coh-sidebar-header .d-flex.align-items-center.gap-2 {
    max-width: 140px !important;
    justify-content: center !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
  }

  /* logo visível e pequeno no mobile */
  .sigfe-sidebar-logo {
    height: 32px !important;
    width: auto !important;
    max-width: 120px !important;
    object-fit: contain !important;
    display: block !important;
  }

  .coh-sidebar-nav .nav-link {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
  }

  .sigfe-main {
    padding: 0.75rem 0.75rem 1.5rem;
  }

  /* Esconde o botão de recolher no mobile (só usa o do topo) */
  #btnSidebarCollapse {
    display: none !important;
  }
}

/* ================== TOPBAR (Branca e limpa) ================== */
.sigfe-topbar.navbar {
  background: #ffffff;
  color: #334155;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  border-bottom: 1px solid #e2e8f0;
}

.sigfe-topbar .navbar-brand {
  color: #1e3a8a !important; /* Cor da sidebar */
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.sigfe-topbar .navbar-brand .bi {
  font-size: 1.1rem;
}

.sigfe-topbar .small.text-muted {
  color: #475569 !important;
}

/* Botão do menu no topo (MOBILE) */
.sigfe-topbar-toggle {
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  color: #1e3a8a;
  background-color: #eff6ff;
  padding: 0.25rem 0.55rem;
}

.sigfe-topbar-toggle .bi {
  font-size: 1.1rem;
}

.sigfe-topbar-toggle:hover {
  background-color: #dbeafe;
  border-color: #3b82f6;
}

/* Botão sair */
.sigfe-topbar .btn-outline-danger {
  border-color: #ef4444;
  color: #ef4444;
}
.sigfe-topbar .btn-outline-danger:hover {
  background-color: #ef4444;
  border-color: #ef4444;
  color: #f9fafb;
}

/* ================== CARDS (conteúdo e busca) ================== */
.sigfe-card,
.sigfe-search-card {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #1e293b;
  /* Sombra mais pronunciada */
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem; /* Adiciona espaço entre os cards */
}

.sigfe-card .card-header {
  background: #f8fafc; /* Fundo do cabeçalho do card */
  border-bottom: 1px solid #e2e8f0;
  color: #1e3a8a; /* Cor da sidebar */
  font-weight: 600;
  border-radius: 12px 12px 0 0;
  padding: 0.75rem 1.25rem;
}

.sigfe-search-card {
  border-color: #dbeafe; /* Borda azul clara sutil */
}

.sigfe-search-card .card-body {
  padding: 1rem 1.25rem 1.15rem;
}

.sigfe-search-card .form-label {
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b; /* Cinza-azulado */
  font-weight: 500;
}

/* ================== TABELAS ================== */
.sigfe-table-wrapper {
  max-height: 60vh;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-clip-margin: 0;
}

.sigfe-table {
  color: #334155;
  border-color: #e2e8f0;
}

.sigfe-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #3b82f6; /* Azul Brilhante (Impacto) */
  color: #f9fafb;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sigfe-table thead th {
  border-bottom-width: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

/* Listras (Zebra) claras */
.sigfe-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}
.sigfe-table tbody tr:nth-child(odd) {
  background-color: #ffffff;
}

/* Efeito Hover */
.sigfe-table tbody tr:hover {
  background-color: #e0f2fe; /* Azul-claro */
}

.sigfe-table td,
.sigfe-table th {
  border-color: #e2e8f0;
}

/* ================== EMPTY STATE & PÍLULAS ================== */
.sigfe-empty-state {
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
  color: #64748b;
}
.sigfe-empty-state .bi {
  font-size: 1.6rem;
  opacity: 0.45;
  display: block;
  margin-bottom: 0.35rem;
}

/* Pílulas de informação (Tema Azul) */
.sigfe-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: #dbeafe; /* Fundo azul-claro */
  color: #1e40af;     /* Texto azul-escuro */
  font-weight: 500;
}

/* Ajustes de texto */
.sigfe-card .text-muted {
  color: #64748b !important;
}

/* ================== BOTÕES EM CABEÇALHO AZUL ================== */
/* Qualquer btn-outline-secondary dentro do cabeçalho azul fica branco */
.sigfe-main > .mb-3.d-flex.justify-content-between.align-items-center .btn-outline-secondary {
  border-color: #ffffff;
  color: #ffffff;
  background-color: transparent;
}

.sigfe-main > .mb-3.d-flex.justify-content-between.align-items-center .btn-outline-secondary:hover {
  background-color: #ffffff;
  color: #1e3a8a;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
}
