/* =====================================================
   LICTUS V2 — Design System
   ===================================================== */

:root {
  /* Paleta principal */
  --lct-blue:        #0D3B6E;   /* azul institucional profundo */
  --lct-blue-mid:    #1A5EA8;   /* azul médio (hover, links) */
  --lct-blue-light:  #E8F1FB;   /* azul claro (backgrounds) */
  --lct-green:       #059669;   /* verde oportunidade */
  --lct-green-light: #D1FAE5;   /* verde claro */
  --lct-amber:       #D97706;   /* âmbar prazos/urgência */
  --lct-amber-light: #FEF3C7;   /* âmbar claro */
  --lct-red:         #DC2626;   /* vermelho erros */
  --lct-red-light:   #FEE2E2;

  /* Fundo de linha de item ganho/perdido (tabela de itens do boletim) */
  --lct-row-win:  rgba(46, 204, 113, 0.03);
  --lct-row-lose: rgba(231, 76, 60, 0.03);

  /* Neutros */
  --lct-bg:          #F1F5F9;
  --lct-surface:     #FFFFFF;
  --lct-surface-alt: #F8FAFC;
  --lct-hover:       #F1F5F9;
  --lct-read-bg:     #EBEEF2;   /* estado persistente "lido" — precisa ser mais perceptível que --lct-hover (transiente) */
  --lct-border:      #E2E8F0;
  --lct-text:        #1E293B;
  /* Apelidos de variáveis usadas em dezenas de views mas NUNCA declaradas antes
     (bug antigo — funcionava "por acaso" via herança da cor de texto/fundo do body,
     escondido enquanto o site só tinha tema claro). Resolvem sozinhos no escuro
     porque var() é dinâmico: acompanham o valor real de --lct-text/--lct-surface-alt
     ativo no elemento, sem precisar repetir no bloco [data-theme="escuro"]. */
  --lct-text-dark:     var(--lct-text);
  --lct-bg-secondary:  var(--lct-surface-alt);
  --lct-main:          var(--lct-blue-mid);
  --lct-main-light:    var(--lct-blue-light);
  --lct-bg-alt:        var(--lct-surface-alt);
  --lct-blue-dark:     var(--lct-blue);
  --lct-card:          var(--lct-surface);
  --lct-card-bg:       var(--lct-surface);
  --lct-purple:        #8B5CF6;
  --lct-text-mid:    #475569;
  --lct-text-muted:  #94A3B8;

  /* Sidebar */
  --lct-sidebar-w:      240px;
  --lct-sidebar-bg:     #0A2744;
  --lct-sidebar-active: #1A5EA8;
  --lct-sidebar-hover:  rgba(255,255,255,0.07);
  --lct-sidebar-text:   rgba(255,255,255,0.75);
  --lct-sidebar-accent: #00D4A0;

  /* Tipografia */
  --lct-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Sombras */
  --lct-shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --lct-shadow:    0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --lct-shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);

  --lct-radius:    8px;
  --lct-radius-lg: 14px;
}

/* =====================================================
   TEMA ESCURO — piloto (dashboard + layout logado)
   Ativado via data-theme="escuro" no <html> (ver templates/layout.php
   e app/Views/templates/_tema_script.php).

   Paleta neutra = GitHub Dark (github.com), testada em produção por milhões
   de usuários — não é uma escala inventada.

   Fundos de "destaque" (--lct-surface-alt, --lct-hover) e as variantes claras
   das cores de acento (--lct-*-light) usam OVERLAY translúcido (rgba) em vez
   de hex sólido. Essa é a técnica que Material Design e GitHub Primer usam
   para elevação/superfícies de destaque: uma camada de branco/cor a X% de
   opacidade por cima do fundo *sempre* fica perceptível, não importa o tom
   exato de baixo — diferente de hex fixo, que pode "sumir" se o contraste
   entre duas camadas vizinhas for escolhido errado (foi o que aconteceu
   nas duas tentativas anteriores, ver docs/memoria/projeto.md).
   ===================================================== */
:root[data-theme="escuro"] {
  --lct-bg:          #0D1117;              /* fundo da página (GitHub canvas.default) */
  --lct-surface:     #161B22;              /* cards, topbar, inputs (GitHub canvas.subtle) */
  --lct-surface-alt: rgba(255,255,255,0.045); /* destaque dentro de um card — overlay, sempre visível */
  --lct-hover:       rgba(255,255,255,0.08);  /* hover/seleção — overlay mais forte */
  --lct-read-bg:     rgba(255,255,255,0.14);  /* estado persistente "lido" — precisa se notar de longe, não só no hover */
  --lct-border:      #30363D;              /* GitHub border.default */
  --lct-text:        #E6EDF3;              /* GitHub fg.default */
  --lct-text-mid:    #C9D1D9;
  --lct-text-muted:  #8B949E;              /* GitHub fg.muted */

  --lct-blue:        #58A6FF;
  --lct-blue-mid:    #79C0FF;
  --lct-blue-light:  rgba(56,139,253,0.15);   /* overlay azul — combina com qualquer fundo embaixo */
  --lct-green:       #3FB950;
  --lct-green-light: rgba(63,185,80,0.15);
  --lct-amber:       #D29922;
  --lct-amber-light: rgba(210,153,34,0.15);
  --lct-red:         #F85149;
  --lct-red-light:   rgba(248,81,73,0.15);
  --lct-purple:      #A78BFA;

  /* Fundo de linha de item ganho/perdido — alpha bem maior que no claro,
     senão some contra o fundo escuro (ver docs/memoria/tema_escuro.md) */
  --lct-row-win:  rgba(63,185,80,0.16);
  --lct-row-lose: rgba(248,81,73,0.16);

  --lct-sidebar-bg:     #010409;           /* GitHub Dimmed canvas — mais escuro que o fundo da página */
  --lct-sidebar-active: rgba(56,139,253,0.18);
  --lct-sidebar-hover:  rgba(255,255,255,0.06);
  --lct-sidebar-text:   rgba(255,255,255,0.7);

  --lct-shadow-sm: 0 1px 3px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.25);
  --lct-shadow:    0 4px 6px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.25);
  --lct-shadow-lg: 0 10px 25px rgba(0,0,0,0.45), 0 4px 10px rgba(0,0,0,0.3);
}

/* ── Reset & Base ────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--lct-font);
  background: var(--lct-bg);
  color: var(--lct-text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--lct-blue-mid); text-decoration: none; }
a:hover { color: var(--lct-blue); text-decoration: underline; }

/* ── Login Page ──────────────────────────────── */

.login-wrapper {
  min-height: 100vh;
  display: flex;
}

/* Painel esquerdo — branding */
.login-brand {
  flex: 0 0 48%;
  background: linear-gradient(145deg, #0A2744 0%, #0D3B6E 45%, #0e5c58 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 64px;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.login-brand::before {
  content: '';
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -120px; right: -120px;
  pointer-events: none;
}

.login-brand::after {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(0,212,160,0.08);
  bottom: -80px; left: -60px;
  pointer-events: none;
}

.login-brand .brand-logo {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  margin-bottom: 8px;
}

.login-brand .brand-logo span {
  color: var(--lct-sidebar-accent);
}

.login-brand .brand-logo .login-logo-img {
  height: 80px !important;
  width: auto !important;
  max-width: 340px !important;
  display: block !important;
  margin-left: -4px !important;
  margin-top: -32px !important;
}

.login-brand .brand-tagline {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 24px 0 16px;
  max-width: 380px;
}

.login-brand .brand-sub {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.65);
  max-width: 360px;
  line-height: 1.7;
}

.login-brand .brand-stats {
  display: flex;
  gap: 40px;
  margin-top: 48px;
}

.brand-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--lct-sidebar-accent);
  display: block;
}

.brand-stat-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Comunicado na Tela de Login ── */
.login-comunicado-conteudo {
  font-size: 0.83rem;
  color: #1e3a8a;
  line-height: 1.6;
}

.login-comunicado-conteudo a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(37, 99, 235, 0.1);
  transition: background 0.15s, color 0.15s;
}

.login-comunicado-conteudo a:hover {
  background: rgba(37, 99, 235, 0.2);
  color: #1e40af;
  text-decoration: underline;
}

/* ── Gov.BR Badge ── */
.govbr-mini-badge {
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #0066CC 0%, #003399 100%);
  color: #fff;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: -0.5px;
}

/* Painel direito — form */
.login-form-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--lct-surface);
  min-height: 100vh;
}

.login-form-box {
  width: 100%;
  max-width: 400px;
}

.login-form-box h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--lct-text);
  margin-bottom: 4px;
}

.login-form-box .login-subtitle {
  color: var(--lct-text-muted);
  margin-bottom: 32px;
  font-size: 0.9rem;
}

/* ── App Layout ──────────────────────────────── */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--lct-sidebar-w);
  background: var(--lct-sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow: hidden;
  transition: transform 0.25s ease;
}

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo a {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  text-decoration: none;
}

.sidebar-logo span { color: var(--lct-sidebar-accent); }

.sidebar-logo .logo-img {
  height: 22px !important;
  width: auto !important;
  max-width: 140px !important;
  display: block;
}

.sidebar-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.3);
  padding: 20px 20px 6px;
  font-weight: 600;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--lct-sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s;
  text-decoration: none;
  margin: 1px 8px;
  border-radius: 6px;
}

.sidebar nav a i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.7;
}

.sidebar nav a:hover {
  background: var(--lct-sidebar-hover);
  color: #fff;
}

.sidebar nav a:hover i { opacity: 1; }

.sidebar nav a.active {
  background: var(--lct-sidebar-active);
  color: #fff;
}

.sidebar nav a.active i { opacity: 1; }

.sidebar-footer {
  flex-shrink: 0;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
}

.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--lct-sidebar-active);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Main content */
.main-content {
  margin-left: var(--lct-sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

/* Topbar */
.topbar {
  height: 56px;
  background: var(--lct-surface);
  border-bottom: 1px solid var(--lct-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--lct-text);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Page content area */
.page-content {
  padding: 24px;
  flex: 1;
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--lct-text);
  margin: 0;
}

.page-header p {
  color: var(--lct-text-muted);
  margin: 2px 0 0;
  font-size: 0.875rem;
}

/* ── Cards ───────────────────────────────────── */

.card {
  background: var(--lct-surface);
  border-radius: var(--lct-radius);
  border: 1px solid var(--lct-border);
  box-shadow: var(--lct-shadow-sm);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--lct-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h5 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  color: var(--lct-text);
}

.card-body { padding: 20px; }

/* Stat cards */
.stat-card {
  background: var(--lct-surface);
  border: 1px solid var(--lct-border);
  border-radius: var(--lct-radius);
  padding: 18px 20px;
  box-shadow: var(--lct-shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow 0.15s, transform 0.15s;
}

.stat-card:hover {
  box-shadow: var(--lct-shadow);
  transform: translateY(-1px);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.stat-icon.blue  { background: var(--lct-blue-light);  color: var(--lct-blue); }
.stat-icon.green { background: var(--lct-green-light); color: var(--lct-green); }
.stat-icon.amber { background: var(--lct-amber-light); color: var(--lct-amber); }
.stat-icon.red   { background: var(--lct-red-light);   color: var(--lct-red); }

.stat-body { flex: 1; min-width: 0; }

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--lct-text);
  line-height: 1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--lct-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
}

.stat-delta {
  font-size: 0.75rem;
  margin-top: 4px;
}

.stat-delta.up   { color: var(--lct-green); }
.stat-delta.down { color: var(--lct-red); }

/* ── Formulários ─────────────────────────────── */

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lct-text-mid);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}

.form-control, .form-select {
  border: 1.5px solid var(--lct-border);
  border-radius: var(--lct-radius);
  padding: 9px 14px;
  font-size: 0.875rem;
  color: var(--lct-text);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  background: var(--lct-surface);
  font-family: var(--lct-font);
}

.form-control:focus, .form-select:focus {
  border-color: var(--lct-blue-mid);
  box-shadow: 0 0 0 3px rgba(26,94,168,0.12);
  outline: none;
}

.form-control.is-invalid { border-color: var(--lct-red); }

/* Ícone nativo do calendário (input[type=date]) é desenhado escuro pelo navegador —
   invisível sobre fundo escuro do tema. Inverte a cor só no tema escuro. */
:root[data-theme="escuro"] input[type="date"]::-webkit-calendar-picker-indicator,
:root[data-theme="escuro"] input[type="datetime-local"]::-webkit-calendar-picker-indicator,
:root[data-theme="escuro"] input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* Custom premium styling for file inputs */
input[type="file"].form-control {
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  line-height: normal;
  cursor: pointer;
  background: var(--lct-surface);
  height: 38px !important;
  overflow: hidden;
}

input[type="file"].form-control::file-selector-button {
  background: var(--lct-blue-light);
  color: var(--lct-blue-mid);
  border: none;
  border-right: 1.5px solid var(--lct-border);
  border-radius: 0;
  padding: 0 16px;
  height: 100% !important;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: 14px;
  font-family: var(--lct-font);
}

input[type="file"].form-control::file-selector-button:hover {
  background: var(--lct-blue-mid);
  color: #fff;
  border-color: transparent;
}

input[type="file"].form-control::-webkit-file-upload-button {
  background: var(--lct-blue-light);
  color: var(--lct-blue-mid);
  border: none;
  border-right: 1.5px solid var(--lct-border);
  border-radius: 0;
  padding: 0 16px;
  height: 100% !important;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: 14px;
  font-family: var(--lct-font);
}

input[type="file"].form-control::-webkit-file-upload-button:hover {
  background: var(--lct-blue-mid);
  color: #fff;
  border-color: transparent;
}

.invalid-feedback {
  font-size: 0.78rem;
  color: var(--lct-red);
  margin-top: 4px;
}

/* ── Botões ──────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--lct-radius);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--lct-font);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
}

.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(13,59,110,0.15); }

.btn-primary {
  background: var(--lct-blue);
  border-color: var(--lct-blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--lct-blue-mid);
  border-color: var(--lct-blue-mid);
  color: #fff;
}

.btn-success {
  background: var(--lct-green);
  border-color: var(--lct-green);
  color: #fff;
}

.btn-success:hover { filter: brightness(1.1); color: #fff; }

.btn-outline {
  background: transparent;
  border-color: var(--lct-border);
  color: var(--lct-text-mid);
}

.btn-outline:hover {
  background: var(--lct-bg);
  border-color: var(--lct-text-muted);
  color: var(--lct-text);
}

.btn-danger {
  background: var(--lct-red);
  border-color: var(--lct-red);
  color: #fff;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn-block { width: 100%; }

/* ── Badges / Pills ──────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-blue   { background: var(--lct-blue-light);  color: var(--lct-blue); }
.badge-green  { background: var(--lct-green-light); color: var(--lct-green); }
.badge-amber  { background: var(--lct-amber-light); color: var(--lct-amber); }
.badge-red    { background: var(--lct-red-light);   color: var(--lct-red); }
.badge-gray   { background: var(--lct-hover); color: var(--lct-text-mid); }

/* ── Tabelas ─────────────────────────────────── */

.table-lct {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table-lct thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--lct-text-muted);
  border-bottom: 2px solid var(--lct-border);
  background: var(--lct-surface-alt);
}

.table-lct tbody tr {
  border-bottom: 1px solid var(--lct-border);
  transition: background 0.1s;
}

.table-lct tbody tr:last-child { border-bottom: none; }

.table-lct tbody tr:hover { background: var(--lct-hover); }

.table-lct tbody td {
  padding: 11px 14px;
  color: var(--lct-text);
  vertical-align: middle;
}

/* ── Alertas ─────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--lct-radius);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-danger  { background: var(--lct-red-light);   color: var(--lct-red);      border-left: 3px solid var(--lct-red); }
.alert-success { background: var(--lct-green-light); color: var(--lct-green);    border-left: 3px solid var(--lct-green); }
.alert-warning { background: var(--lct-amber-light); color: var(--lct-amber);    border-left: 3px solid var(--lct-amber); }
.alert-info    { background: var(--lct-blue-light);  color: var(--lct-blue-mid); border-left: 3px solid var(--lct-blue-mid); }

/* ── Fase badges (boletim) ───────────────────── */

.fase-preparacao { background: var(--lct-blue-light);  color: var(--lct-blue-mid); }
.fase-evento     { background: var(--lct-amber-light); color: var(--lct-amber); }
.fase-pos_evento { background: var(--lct-green-light); color: var(--lct-green); }
.fase-arquivo    { background: var(--lct-surface-alt);  color: var(--lct-text-muted); }

/* ── Utilidades ──────────────────────────────── */

.text-muted   { color: var(--lct-text-muted) !important; }
.text-mid     { color: var(--lct-text-mid) !important; }
.text-green   { color: var(--lct-green) !important; }
.text-blue    { color: var(--lct-blue) !important; }
.text-amber   { color: var(--lct-amber) !important; }
.text-red     { color: var(--lct-red) !important; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.divider {
  border: none;
  border-top: 1px solid var(--lct-border);
  margin: 16px 0;
}

/* Grid simples */
.row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.col { flex: 1; padding: 0 10px; }
.col-auto { flex: 0 0 auto; padding: 0 10px; }

.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.ms-auto { margin-left: auto; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

/* ── Responsivo ──────────────────────────────── */

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--lct-sidebar-w)));
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .login-brand {
    display: none;
  }

  .login-form-panel {
    padding: 32px 24px;
  }
}

@media (max-width: 576px) {
  .page-content { padding: 16px; }
  .stat-value { font-size: 1.2rem; }
}

.print-only {
  display: none !important;
}

/* ── Impressão (Print) ────────────────────────── */

@media print {

  /* 1. Ocultar elementos de navegação e interface */
  .no-print,
  .sidebar,
  .topbar,
  .page-header .d-flex.gap-2,
  .dropdown-notif,
  #btnPerfilMenu,
  #sidebarOverlay {
    display: none !important;
  }

  /* 2. Exibir elementos exclusivos de impressão */
  .print-only {
    display: block !important;
  }

  /* 3. Reset de layout para impressão (sem .card nem div genérico para não quebrar o no-print) */
  html,
  body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    overflow-y: visible !important;
    position: static !important;
  }

  .app-wrapper {
    display: block !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  .main-content {
    display: block !important;
    margin-left: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
    flex: none !important;
  }

  .page-content {
    display: block !important;
    padding: 0 !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    flex: none !important;
  }

  /* 4. Estilo dos cards visíveis (não afeta os .no-print pois display:none tem prioridade) */
  .card:not(.no-print) {
    border: 1px solid #eee !important;
    box-shadow: none !important;
    margin-bottom: 20px !important;
    break-inside: auto !important;
    overflow: visible !important;
    height: auto !important;
  }

  .card-body {
    overflow: visible !important;
    height: auto !important;
  }

  /* 5. Overflow nas tabelas */
  div[style*="overflow-x: auto"],
  .table-responsive {
    overflow: visible !important;
    overflow-x: visible !important;
  }

  /* 6. Estilo da tabela */
  .card-header {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #eee !important;
  }

  .table-lct thead th {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #000 !important;
    color: #000 !important;
  }

  .table-lct tbody td {
    border-bottom: 1px solid #eee !important;
  }

  .badge {
    border: 1px solid #ccc !important;
    background: #fff !important;
    color: #000 !important;
  }

  /* 7. Forçar cores de fundo em alguns navegadores */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 8. Impressão é sempre no tema claro, mesmo com o tema escuro ativo na tela.
     Reseta as variáveis de :root[data-theme="escuro"] para os valores claros
     — como esta regra vem depois no arquivo com a mesma especificidade, vence
     na hora de imprimir. Sem isso, .card/tabelas/textos (que usam var(--lct-*))
     continuam resolvendo para as cores escuras sobre o fundo #fff forçado acima. */
  :root[data-theme="escuro"] {
    --lct-bg:          #F1F5F9;
    --lct-surface:     #FFFFFF;
    --lct-surface-alt: #F8FAFC;
    --lct-hover:       #F1F5F9;
    --lct-read-bg:     #EBEEF2;
    --lct-border:      #E2E8F0;
    --lct-text:        #1E293B;
    --lct-text-mid:    #475569;
    --lct-text-muted:  #94A3B8;

    --lct-blue:        #0D3B6E;
    --lct-blue-mid:    #1A5EA8;
    --lct-blue-light:  #E8F1FB;
    --lct-green:       #059669;
    --lct-green-light: #D1FAE5;
    --lct-amber:       #D97706;
    --lct-amber-light: #FEF3C7;
    --lct-red:         #DC2626;
    --lct-red-light:   #FEE2E2;
  }
}
