/* =====================================================
   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;

  /* Neutros */
  --lct-bg:          #F1F5F9;
  --lct-surface:     #FFFFFF;
  --lct-border:      #E2E8F0;
  --lct-text:        #1E293B;
  --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;
}

/* ── 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;
}

/* ── 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;
  justify-content: center;
  align-items: center;
  padding: 48px 40px;
  background: #fff;
}

.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: #fff;
  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: #fff;
  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: #fff;
  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: #fff;
  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); }

/* 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: #F1F5F9; color: var(--lct-text-muted); }

/* ── 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: #FAFBFC;
}

.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-bg); }

.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: #991B1B; border-left: 3px solid var(--lct-red); }
.alert-success { background: var(--lct-green-light); color: #065F46; border-left: 3px solid var(--lct-green); }
.alert-warning { background: var(--lct-amber-light); color: #92400E; border-left: 3px solid var(--lct-amber); }
.alert-info    { background: var(--lct-blue-light);  color: #1E40AF; border-left: 3px solid var(--lct-blue-mid); }

/* ── Fase badges (boletim) ───────────────────── */

.fase-preparacao { background: #EFF6FF; color: #1D4ED8; }
.fase-evento     { background: #FFF7ED; color: #C2410C; }
.fase-pos_evento { background: #F0FDF4; color: #15803D; }
.fase-arquivo    { background: #F8FAFC; color: #64748B; }

/* ── 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;
  }

  .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 {
  .print-only {
    display: block !important;
  }
  .no-print,
  .sidebar,
  .topbar,
  .page-header .d-flex.gap-2,
  .dropdown-notif,
  #btnPerfilMenu,
  #sidebarOverlay {
    display: none !important;
  }

  body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .app-wrapper {
    display: block !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .page-content {
    padding: 0 !important;
  }

  .card {
    border: 1px solid #eee !important;
    box-shadow: none !important;
    margin-bottom: 20px !important;
    break-inside: avoid;
  }

  .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;
  }

  /* Forçar cores de fundo em alguns navegadores */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
