/* =====================================================================
   SISTEMA PAULISTA DE AVALIAÇÃO DE PROGRAMAS DE INTEGRIDADE (CGE-SP)
   Vanilla CSS Design System - Paleta Institucional CGE-SP
   Fundo: Tons de Branco | Elementos Médios: Tons Escuros (Preto) | Detalhes: Vermelho
   ===================================================================== */

:root {
  /* Fundo Geral em Tons de Branco e Superfícies Claras */
  --bg-body: #F4F6F9;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F1F5F9;

  /* Elementos Médios: Preto e Grafite Institucional CGE */
  --cge-black-deep: #0B0F19;
  --cge-black-nav: #18181B;
  --cge-black-header: #111827;
  --cge-charcoal: #1F2937;
  --cge-charcoal-light: #374151;

  /* Detalhes, Ações e Destaques: Vermelho CGE-SP */
  --cge-red-primary: #DC2626;
  --cge-red-hover: #B91C1C;
  --cge-red-dark: #991B1B;
  --cge-red-light: #FEF2F2;
  --cge-red-border: rgba(220, 38, 38, 0.35);
  --cge-red-glow: rgba(220, 38, 38, 0.2);

  /* Aliases para compatibilidade de variáveis */
  --gold-primary: #DC2626;
  --gold-glow: #DC2626;
  --gold-light: #FEF2F2;
  --sp-blue-dark: #111827;
  --sp-blue-accent: #DC2626;
  --sp-blue-glow: #DC2626;

  /* Semântica de Auditoria e Status */
  --emerald-success: #15803D;
  --emerald-bg: #F0FDF4;
  --emerald-border: rgba(21, 128, 61, 0.3);

  --amber-warning: #D97706;
  --amber-bg: #FFFBEB;
  --amber-border: rgba(217, 119, 6, 0.3);

  --red-danger: #DC2626;
  --red-bg: #FEF2F2;
  --red-border: rgba(220, 38, 38, 0.3);

  --blue-info: #0284C7;
  --blue-bg: #F0F9FF;
  --blue-border: rgba(2, 132, 199, 0.3);

  /* Tipografia e Contraste em Fundo Branco */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-light: #F8FAFC;

  /* Bordas Claras */
  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-focus: #DC2626;

  /* Fontes */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Raios de Arredondamento */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  /* Sombras Modernas */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow-red: 0 0 18px rgba(220, 38, 38, 0.25);
  --shadow-glow-gold: 0 0 18px rgba(220, 38, 38, 0.25);
}

/* Reset Básico */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(220, 38, 38, 0.025) 0%, transparent 45%),
    radial-gradient(circle at 90% 80%, rgba(17, 24, 39, 0.025) 0%, transparent 45%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Glassmorphism / Card Padrão Claro CGE */
.glassmorphism {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}

.glassmorphism:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

/* =====================================================================
   HEADER GOVERNAMENTAL (Elemento Médio em Tom Escuro / Preto + Vermelho)
   ===================================================================== */
.gov-header {
  background: var(--cge-black-header);
  border-bottom: 3px solid var(--cge-red-primary);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.gov-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.gov-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gov-crest {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #18181B, #0B0F19);
  border: 2px solid var(--cge-red-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow-glow-red);
}

.gov-titles {
  display: flex;
  flex-direction: column;
}

.gov-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #EF4444;
  text-transform: uppercase;
}

.gov-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  letter-spacing: -0.5px;
}

.gov-legal {
  font-size: 12px;
  color: #9CA3AF;
}

.gov-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gov-actions .btn-outline-gold {
  color: #FFFFFF;
  border-color: var(--cge-red-primary);
  background: transparent;
}

.gov-actions .btn-outline-gold:hover {
  background: var(--cge-red-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.btn-swagger {
  padding: 6px 12px;
  font-size: 12px;
  border-color: rgba(255, 255, 255, 0.2);
  color: #F3F4F6;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.05);
}

.btn-swagger:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
}

.role-selector-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.role-label {
  font-size: 12px;
  color: #D1D5DB;
}

.gov-select {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.gov-select option {
  background: var(--cge-black-nav);
  color: #FFFFFF;
}

.api-health-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(21, 128, 61, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: #4ADE80;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #22C55E;
  border-radius: 50%;
  box-shadow: 0 0 8px #22C55E;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* =====================================================================
   MENU DE NAVEGAÇÃO PRINCIPAL (Elemento Médio Escuro + Destaque Vermelho)
   ===================================================================== */
.main-nav {
  background: var(--cge-black-nav);
  border-bottom: 1px solid #27272A;
  overflow-x: auto;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.nav-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 0;
}

.nav-tab {
  background: transparent;
  border: none;
  color: #A1A1AA;
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  background: #27272A;
  color: #FFFFFF;
}

.nav-tab.active {
  background: var(--cge-red-primary);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
}

/* =====================================================================
   PAINÉIS DE CONTEÚDO E CARDS (Fundo Branco & Tons Claros)
   ===================================================================== */
.main-content {
  flex: 1;
  padding: 32px 24px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Banner do Dashboard */
.dashboard-banner {
  padding: 36px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--cge-red-primary);
  box-shadow: var(--shadow-sm);
}

.badge-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.gold-glow, .badge-cge {
  background: var(--cge-red-light);
  color: var(--cge-red-primary);
  border: 1px solid var(--cge-red-border);
}

.dashboard-banner h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.dashboard-banner p {
  color: var(--text-secondary);
  max-width: 880px;
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.6;
}

.banner-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: #F8FAFC;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.stat-card:hover {
  background: #FFFFFF;
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.stat-val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Timeline & Radar de Prazos */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.col-span-2 {
  grid-column: span 2;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-radar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  position: relative;
}

.radar-step {
  background: #F8FAFC;
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.radar-step .step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.step-complete {
  border-color: var(--emerald-border);
  background: #F0FDF4;
}
.step-complete .step-circle {
  background: #DCFCE7;
  color: var(--emerald-success);
}

.step-current {
  border-color: var(--cge-red-border);
  background: #FEF2F2;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.15);
}
.step-current .step-circle {
  background: var(--cge-red-primary);
  color: #FFFFFF;
}

.step-future {
  background: #F8FAFC;
}
.step-future .step-circle {
  background: #F1F5F9;
  color: var(--text-muted);
}

.step-fatal {
  border-color: var(--red-border);
  background: #FEF2F2;
}
.step-fatal .step-circle {
  background: #FEE2E2;
  color: var(--red-danger);
}

.step-info {
  display: flex;
  flex-direction: column;
}

.step-info strong {
  font-size: 12.5px;
  color: var(--text-primary);
}

.step-info span {
  font-size: 11px;
  color: var(--text-muted);
}

.countdown-bar-container {
  background: #F8FAFC;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.countdown-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13.5px;
  color: var(--text-primary);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.progress-emerald {
  background: linear-gradient(90deg, #16A34A, #22C55E);
}

/* Alertas */
.alert-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border-left: 4px solid;
}

.alert-info {
  background: var(--blue-bg);
  border-color: var(--blue-info);
  color: #0369A1;
}

.alert-warning {
  background: var(--amber-bg);
  border-color: var(--amber-warning);
  color: #B45309;
}

.alert-success {
  background: var(--emerald-bg);
  border-color: var(--emerald-success);
  color: #15803D;
}

/* =====================================================================
   TABELAS GOVERNAMENTAIS (Cabeçalho Escuro / Preto + Linhas Brancas)
   ===================================================================== */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
}

.gov-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.gov-table th {
  background: var(--cge-black-deep);
  padding: 14px 18px;
  color: #F8FAFC;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--cge-red-primary);
}

.gov-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: #FFFFFF;
}

.gov-table tr:hover td {
  background: #F8FAFC;
}

/* Tags de Status */
.tag-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-green {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.tag-blue {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

.tag-amber {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.tag-red {
  background: #FEE2E2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

/* =====================================================================
   FORMULÁRIOS E INPUTS (Fundo Branco, Bordas Claras, Foco em Vermelho)
   ===================================================================== */
.grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-vertical {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.gov-input, .gov-textarea {
  background: #FFFFFF;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.gov-input:focus, .gov-textarea:focus {
  border-color: var(--cge-red-primary);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.qsa-box {
  background: #F8FAFC;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qsa-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-medium);
  color: var(--text-primary);
}

.qsa-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cpf-masked {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: #E2E8F0;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.checkbox-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: #F8FAFC;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.checkbox-card:hover {
  background: #FFFFFF;
  border-color: var(--border-medium);
}

.checkbox-card input[type="checkbox"] {
  margin-top: 4px;
  cursor: pointer;
  accent-color: var(--cge-red-primary);
  width: 16px;
  height: 16px;
}

.checkbox-body strong {
  font-size: 13.5px;
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.checkbox-body p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Filtros por Eixos Temáticos */
.eixos-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.filter-pill {
  background: #FFFFFF;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-weight: 500;
}

.filter-pill:hover {
  background: #F1F5F9;
  color: var(--text-primary);
  border-color: #94A3B8;
}

.filter-pill.active {
  background: var(--cge-red-primary);
  color: #FFFFFF;
  border-color: var(--cge-red-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* =====================================================================
   LISTA DE QUESTÕES AVALIATIVAS (46 Itens CGE)
   ===================================================================== */
.questions-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.question-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.question-card.is-eliminatoria {
  border-left: 5px solid var(--cge-red-primary);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.question-title-area {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.question-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--cge-red-primary);
}

.question-desc {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.question-badges {
  display: flex;
  gap: 8px;
}

.badge-eliminatoria {
  background: #FEE2E2;
  color: var(--cge-red-primary);
  border: 1px solid #FCA5A5;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.badge-eixo {
  background: #F1F5F9;
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.question-input-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: center;
}

.upload-box {
  background: #F8FAFC;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upload-info {
  display: flex;
  flex-direction: column;
}

.upload-name {
  font-size: 12.5px;
  color: var(--cge-red-primary);
  font-weight: 600;
}

.upload-hash {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

/* =====================================================================
   COCKPIT DE JULGAMENTO CGE (Painel Escuro CGE + Destaques Vermelhos)
   ===================================================================== */
.score-cockpit {
  padding: 28px;
  margin-bottom: 24px;
}

.score-cockpit-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  align-items: center;
}

.score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cge-black-deep);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 2px solid var(--cge-red-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.score-label {
  font-size: 12px;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.score-number-wrapper {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 8px 0;
}

.score-number {
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 800;
  color: #EF4444;
  line-height: 1;
}

.score-max {
  font-size: 18px;
  color: #9CA3AF;
  font-weight: 600;
}

.score-rules-summary h4 {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-weight: 700;
}

.score-rules-summary ul {
  list-style: square inside;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Julgamento Item a Item */
.audit-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.audit-controls-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  background: #F8FAFC;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.ternary-scale-selector {
  display: flex;
  gap: 6px;
}

.btn-grade {
  flex: 1;
  padding: 8px 0;
  background: #FFFFFF;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-grade.grade-0.active {
  background: var(--cge-red-primary);
  color: #FFFFFF;
  border-color: var(--cge-red-primary);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-grade.grade-1.active {
  background: var(--amber-warning);
  color: #FFFFFF;
  border-color: var(--amber-warning);
}

.btn-grade.grade-2.active {
  background: var(--emerald-success);
  color: #FFFFFF;
  border-color: var(--emerald-success);
}

/* =====================================================================
   CERTIFICADO OFICIAL (Fiel e Elegante)
   ===================================================================== */
.certificate-paper {
  background: #FCFDFD;
  color: #1A1A1A;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  margin-top: 24px;
  font-family: 'Times New Roman', Georgia, serif;
  border: 1px solid #E2E8F0;
}

.cert-border-outer {
  border: 4px double #1F2937;
  padding: 16px;
}

.cert-border-inner {
  border: 1px solid #DC2626;
  padding: 40px;
  text-align: center;
}

.cert-header .cert-crest {
  font-size: 42px;
  margin-bottom: 8px;
}

.cert-header h2 {
  font-size: 19px;
  letter-spacing: 2px;
  font-weight: bold;
  color: #0F172A;
  margin-bottom: 4px;
}

.cert-header h3 {
  font-size: 15px;
  letter-spacing: 1px;
  color: #475569;
  margin-bottom: 16px;
}

.cert-divider {
  width: 140px;
  height: 2px;
  background: #DC2626;
  margin: 16px auto;
}

.cert-header h4 {
  font-size: 22px;
  color: #DC2626;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.cert-sub {
  font-size: 12px;
  letter-spacing: 1px;
  color: #64748B;
  font-style: italic;
  display: block;
  margin-bottom: 24px;
}

.cert-body {
  text-align: justify;
  line-height: 1.8;
  font-size: 15px;
  color: #334155;
}

.cert-company-box {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  padding: 14px;
  border-radius: var(--radius-sm);
  margin: 20px 0;
  text-align: center;
}

.cert-company-name {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #0F172A;
}

.cert-company-cnpj {
  display: block;
  font-size: 13px;
  color: #475569;
  font-family: var(--font-mono);
}

.cert-metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
  text-align: left;
  background: #F8FAFC;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #E2E8F0;
  font-family: var(--font-main);
  font-size: 12px;
}

.code-font {
  font-family: var(--font-mono);
  word-break: break-all;
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 48px;
  padding-top: 24px;
}

.cert-qr-box .qr-placeholder {
  width: 90px;
  height: 90px;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-main);
  font-size: 11px;
  color: #64748B;
}

.cert-signature-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-main);
}

.sig-line {
  width: 260px;
  height: 1px;
  background: #475569;
  margin-bottom: 8px;
}

.cert-signature-box strong {
  font-size: 12.5px;
  color: #0F172A;
}

.cert-signature-box span {
  font-size: 11px;
  color: #64748B;
}

/* =====================================================================
   BOTÕES E ELEMENTOS DE AÇÃO (Detalhes em Vermelho CGE-SP)
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  outline: none;
  text-decoration: none;
}

/* Botão Primário CGE: Vermelho Oficial */
.btn-primary, .btn-gold {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover, .btn-gold:hover {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

.btn-primary:active, .btn-gold:active {
  transform: translateY(0);
}

/* Botão Outline CGE: Borda e Texto em Vermelho */
.btn-outline-gold, .btn-outline-red {
  background: transparent;
  color: var(--cge-red-primary);
  border: 1px solid var(--cge-red-primary);
}

.btn-outline-gold:hover, .btn-outline-red:hover {
  background: var(--cge-red-light);
  border-color: var(--cge-red-hover);
  color: var(--cge-red-hover);
}

/* Botão Outline Neutro */
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn-outline:hover {
  background: #F1F5F9;
  color: var(--text-primary);
  border-color: #94A3B8;
}

.btn-outline-amber {
  background: transparent;
  color: var(--amber-warning);
  border: 1px solid var(--amber-warning);
}

.btn-outline-amber:hover {
  background: var(--amber-bg);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

/* =====================================================================
   MODAIS E DIÁLOGOS (Fundo Branco, Bordas e Sombras Limpas)
   ===================================================================== */
.gov-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.gov-modal.show {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  padding: 28px;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--cge-red-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Notificações Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--cge-black-deep);
  border-left: 4px solid var(--cge-red-primary);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  color: #FFFFFF;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Barra de Validação Pública */
.search-verifier-bar {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.search-verifier-bar input {
  flex: 1;
}

.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-emerald { color: var(--emerald-success); }
.text-amber { color: var(--amber-warning); }

/* =====================================================================
   DROPDOWN DE SESSÃO DO USUÁRIO LOGADO (Elemento Médio Escuro)
   ===================================================================== */
.auth-action-wrapper {
  position: relative;
}

.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--cge-black-nav);
  border: 1px solid var(--cge-red-primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  padding: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  border-bottom: 1px solid #27272A;
  padding-bottom: 12px;
}

.user-dropdown-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  display: block;
}

.user-dropdown-email {
  font-size: 12px;
  color: #A1A1AA;
  display: block;
  margin-top: 2px;
}

.user-dropdown-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.user-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-detail-label {
  color: #A1A1AA;
}

.user-detail-val {
  font-family: var(--font-mono);
  color: #FFFFFF;
  font-weight: 600;
}

.btn-logout {
  width: 100%;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid var(--cge-red-primary);
  color: #EF4444;
  padding: 10px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  margin-top: 4px;
}

.btn-logout:hover {
  background: var(--cge-red-primary);
  color: #FFFFFF;
}

/* Bloqueio RBAC */
.nav-tab.tab-hidden-rbac {
  display: none !important;
}

.auth-lock-card {
  background: #FFFFFF;
  padding: 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px 0;
  border: 2px dashed var(--cge-red-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.auth-lock-icon {
  font-size: 48px;
}

.auth-lock-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-lock-card p {
  color: var(--text-secondary);
  max-width: 580px;
  font-size: 14.5px;
}

/* Banner de Visitante e Avisos */
.dash-guest-banner {
  margin-bottom: 24px;
  border: 1px solid var(--cge-red-border);
  background: #FEF2F2;
  padding: 18px 24px;
  border-radius: var(--radius-lg);
}

.dash-guest-title {
  color: var(--cge-red-primary);
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-display);
}

.auth-security-notice {
  margin-top: 14px;
  font-size: 12px;
  color: #374151;
  background: #F8FAFC;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
}

/* Responsividade */
@media (max-width: 992px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .grid-2-cols { grid-template-columns: 1fr; }
  .score-cockpit-grid { grid-template-columns: 1fr; }
  .timeline-radar { grid-template-columns: repeat(2, 1fr); }
  .gov-header-inner { flex-direction: column; align-items: flex-start; }
}
