/* GTR Design System — gtr.css — GHBP Brand */

/* ── Variáveis ─────────────────────────────────────────── */
:root {
  /* GHBP Brand Colors */
  --color-primary:  #218DCE;   /* GHBP blue — mesmo valor em tailwind.config.js (primary) */
  --color-primary-rgb: 33, 141, 206;  /* triplo RGB do primary p/ usar em rgba(var(--color-primary-rgb), α) */
  --color-primary-hover: #1A78B0;      /* tom mais escuro do primary p/ estados :hover */
  --color-navy:     #3B5EA9;   /* GHBP navy */
  --color-navy-rgb:   59, 94, 169;
  --color-cyan:     #72B2C9;   /* GHBP light blue */
  --color-cyan-rgb:   114, 178, 201;
  --color-purple:   #582C83;   /* GHBP purple */
  --color-purple-rgb: 88, 44, 131;
  --color-ink:      #070E14;   /* GHBP near-black */
  --color-ink-soft: #0F1C2E;   /* slightly lighter ink for sidebar accents */

  /* UI Surface */
  --color-bg:       #F4F6F9;
  --color-surface:  #FFFFFF;
  --color-border:   #E2E6EA;
  --color-text:     #1A2332;
  --color-muted:    #64748B;

  /* Risk */
  --risk-alto:    #EF4444;
  --risk-medio:   #F59E0B;
  --risk-baixo:   #22C55E;
  --risk-critico: #DC2626;

  /* Typography */
  --font-mono: 'Space Mono', 'IBM Plex Mono', ui-monospace, monospace;
  --font-body: 'Inter', system-ui, sans-serif;
}

/* ── Base ───────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
}

h1, h2 {
  font-family: var(--font-mono);
}

/* ── Sidebar — variáveis de tema ───────────────────────── */
/* Modo claro: branco limpo com acentos GHBP               */
.sidebar-nav {
  --sb-bg:            #FFFFFF;
  --sb-border:        #E2E8F0;
  --sb-section-sep:   #EEF2F7;
  --sb-label:         #94A3B8;
  --sb-muted:         #4B5B6D;
  --sb-faint:         #94A3B8;
  --sb-input-bg:      #F4F6F9;
  --sb-input-border:  #DDE5EF;
  --sb-input-text:    #1A2332;
  --sb-nav-hover:     rgba(33,141,206,0.07);
  --sb-nav-hover-txt: #218DCE;
  --sb-nav-active-txt:#218DCE;
  background: var(--sb-bg);
}

/* Modo escuro: azul-marinho corporativo */
html.dark .sidebar-nav {
  --sb-bg:            #0C1620;
  --sb-border:        rgba(255,255,255,0.09);
  --sb-section-sep:   rgba(255,255,255,0.08);
  --sb-label:         rgba(255,255,255,0.5);
  --sb-muted:         rgba(255,255,255,0.75);
  --sb-faint:         rgba(255,255,255,0.55);
  --sb-input-bg:      #111e2e;
  --sb-input-border:  rgba(255,255,255,0.15);
  --sb-input-text:    rgba(255,255,255,0.9);
  --sb-nav-hover:     rgba(255,255,255,0.08);
  --sb-nav-hover-txt: #ffffff;
  --sb-nav-active-txt:#ffffff;
}

/* ── Botões utilitários do sidebar ─────────────────────── */
/* Ícone simples (recolher, expandir) */
.sb-icon-btn {
  color: var(--sb-label);
  transition: color 0.12s, background 0.12s;
}
.sb-icon-btn:hover {
  color: var(--sb-muted) !important;
  background: var(--sb-section-sep) !important;
}

/* Botão Logout — hover vermelho em ambos os modos */
.sb-logout-btn {
  color: var(--sb-label);
  transition: color 0.12s, background 0.12s;
}
.sb-logout-btn:hover {
  color: rgba(239,68,68,0.9) !important;
  background: rgba(239,68,68,0.1) !important;
}

/* Botão "Novo sistema" tracejado */
.sb-novo-btn {
  color: var(--sb-label);
  border: 1px dashed var(--sb-input-border);
  transition: color 0.12s, border-color 0.12s;
}
.sb-novo-btn:hover {
  color: #218DCE !important;
  border-color: rgba(33,141,206,0.5) !important;
}

/* Botões de rodapé (Tutorial, Recolher) */
.sb-utility-btn {
  color: var(--sb-label);
  background: var(--sb-section-sep);
  transition: color 0.12s, background 0.12s;
}
.sb-utility-btn:hover {
  color: var(--sb-muted) !important;
  background: var(--sb-input-bg) !important;
}

/* ── Navegação Sidebar ──────────────────────────────────── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.45rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--sb-muted, rgba(255,255,255,0.45));
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
  border-left: 2px solid transparent;
  position: relative;
}

.nav-item:hover {
  background: var(--sb-nav-hover, rgba(255,255,255,0.07));
  color: var(--sb-nav-hover-txt, rgba(255,255,255,0.85));
}

.nav-item.active {
  background: rgba(33,141,206,0.12);
  color: var(--sb-nav-active-txt, #fff);
  border-left-color: #218DCE;
  padding-left: calc(0.875rem - 2px);
}

/* ── Botões ─────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: linear-gradient(135deg, #218DCE 0%, #1872ac 100%);
  box-shadow: 0 2px 8px rgba(33,141,206,0.28);
  color: #fff;
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s, opacity 0.15s;
  text-decoration: none;
  font-size: 0.875rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d7db8 0%, #145f93 100%);
  box-shadow: 0 4px 14px rgba(33,141,206,0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(33,141,206,0.25); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: transparent;
  color: var(--color-navy);
  font-weight: 600;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--color-navy);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  font-size: 0.875rem;
}

.btn-secondary:hover { background: rgba(59,94,169,0.06); }

/* ── Respondent Badges ──────────────────────────────────── */
/* Indica quem deve responder cada pergunta no assessment    */
.badge-respondente {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border-width: 1px;
  border-style: solid;
  line-height: 1.4;
  white-space: nowrap;
}
/* [N] Negócio / Utilizador */
.badge-N { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
/* [T] Técnico / TI */
.badge-T { background: #fef3c7; color: #92400e; border-color: #fde68a; }
/* [J] Jurídico / Compliance / DPO */
.badge-J { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }

/* Assessment stepper sidebar */
.assessment-step-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  text-align: left;
  cursor: pointer;
  border: none;
  background: transparent;
}
.assessment-step-btn:hover { background: #f9fafb; }
.assessment-step-btn.active-base { background: rgba(33,141,206,0.08); color: #218DCE; }
.assessment-step-btn.active-adq  { background: #f0f9ff; color: #0369a1; }
.assessment-step-btn.active-cri  { background: #f0fdf4; color: #166534; }

/* Dark mode support for badges */
html.dark .badge-N { background: rgba(14,165,233,0.15); color: #7dd3fc; border-color: rgba(14,165,233,0.3); }
html.dark .badge-T { background: rgba(245,158,11,0.15); color: #fcd34d; border-color: rgba(245,158,11,0.3); }
html.dark .badge-J { background: rgba(139,92,246,0.15); color: #c4b5fd; border-color: rgba(139,92,246,0.3); }

/* ── Toast ──────────────────────────────────────────────── */
.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  max-width: 380px;
  animation: slide-in 0.25s ease-out;
}

.toast-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.toast-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }
.toast-info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

@keyframes slide-in {
  from { transform: translateX(1rem); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── HTMX Indicator ─────────────────────────────────────── */
.htmx-indicator { opacity: 0; transition: opacity 0.2s; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }

/* ── Alpine.js ──────────────────────────────────────────── */
[x-cloak] { display: none !important; }

/* ── Score Ring ─────────────────────────────────────────── */
.score-number {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Heurísticas de Nielsen: melhorias UX ───────────────── */

/* H5/H10 – Tooltip regulatório */
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: #EFF6FF;
  color: #3B82F6;
  font-size: 0.625rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: help;
  vertical-align: middle;
  margin-left: 0.25rem;
  flex-shrink: 0;
  line-height: 1;
  border: 1px solid #BFDBFE;
  user-select: none;
}

.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 8px);
  background: #111827;
  color: #F9FAFB;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.55;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  width: 230px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 100;
  white-space: normal;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.tip:hover::after { opacity: 1; }

/* Evita tooltip sair da tela no lado esquerdo */
.tip.tip-right::after {
  left: 0;
  transform: none;
}

/* H9 – Toast de erro global */
#global-error-toast {
  transition: opacity 0.2s, transform 0.2s;
}


/* H1 – Status: tab de assessment com indicador de conclusão */
.tab-done-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #22C55E;
  margin-left: 0.375rem;
  vertical-align: middle;
}

/* ── CheckboxSelectMultiple (campo Sistemas) ───────────── */
.sistemas-checkbox-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.sistemas-checkbox-list li {
  margin: 0;
  padding: 0;
}
.sistemas-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8125rem;
  color: #374151;
}
.sistemas-checkbox-list input[type=checkbox] {
  flex-shrink: 0;
  accent-color: var(--color-primary);
}
html.dark .sistemas-checkbox-list {
  background-color: #1C2433 !important;
  border-color: #2D3748 !important;
}
html.dark .sistemas-checkbox-list label { color: #CBD5E1; }

/* H5 – Prevenção de erros: campo obrigatório */
.field-required::after {
  content: ' *';
  color: #EF4444;
  font-size: 0.75rem;
}

/* H9 – Recuperação: estado de erro inline */
.field-error {
  border-color: #FCA5A5 !important;
  background: #FEF2F2 !important;
}

/* H1 – Status: barra de progresso do diagnóstico */
.progress-bar-track {
  height: 0.375rem;
  background: #E5E7EB;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* H8 – Estética: chip de legenda de score */
.score-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
}
.score-legend-high   { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.score-legend-medium { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.score-legend-low    { background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }

/* Navegação mais fluida em trocas HTMX/full reload.
   Evita transform no scroll container: isso quebra filhos position: fixed
   durante a animação em algumas telas. */
#main-content {
  animation: page-in 0.16s ease-out;
  transition: opacity 0.12s ease;
}

#main-content.is-navigating {
  opacity: 0.55;
  pointer-events: none;
}

@keyframes page-in {
  from { opacity: 0.65; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #main-content,
  #main-content.is-navigating,
  .kpi-card,
  .toast {
    animation: none !important;
    transition: none !important;
  }
}

/* Garante animação da sidebar mesmo sem utilitário arbitrário do Tailwind */
.sidebar-nav {
  transition: width 0.2s ease-in-out;
}

/* ── Card hover lift ────────────────────────────────────── */
.card-hover {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.10);
}
html.dark .card-hover:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}

/* ── Staggered card entrance ────────────────────────────── */
.kpi-card {
  animation: card-in 0.3s ease-out both;
}
.kpi-card:nth-child(1) { animation-delay: 0.04s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.16s; }
.kpi-card:nth-child(4) { animation-delay: 0.22s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Overview table row — acento lateral por risco ──────── */
.row-risk-alto   { border-left: 3px solid #EF4444; }
.row-risk-medio  { border-left: 3px solid #F59E0B; }
.row-risk-baixo  { border-left: 3px solid #22C55E; }
.row-risk-na     { border-left: 3px solid #CBD5E1; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* ── Dark Mode ──────────────────────────────────────────── */
/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Variáveis de superfície em modo escuro */
html.dark {
  color-scheme: dark;
  --color-bg:      #0F1923;
  --color-surface: #162030;
  --color-border:  #1E3047;
  --color-text:    #E8EFF8;
  --color-muted:   #7A93B0;
}

/* Corpo e layout base */
body { background: var(--color-bg, #F4F6F9); }
html.dark body { color: var(--color-text); }

/* ── Superfícies ────────────────────────────────────────── */
html.dark .bg-white       { background-color: #162030 !important; }
html.dark .bg-gray-50     { background-color: #192538 !important; }
html.dark .bg-gray-100    { background-color: #1C2940 !important; }
html.dark .bg-gray-200    { background-color: #213050 !important; }
html.dark .hover\:bg-gray-50:hover   { background-color: #192538 !important; }
html.dark .hover\:bg-gray-100:hover  { background-color: #1C2940 !important; }

/* ── Bordas ─────────────────────────────────────────────── */
html.dark .border-gray-100  { border-color: #1E3047 !important; }
html.dark .border-gray-200  { border-color: #253958 !important; }
html.dark .border-gray-300  { border-color: #2E4568 !important; }
html.dark .divide-gray-100 > * + * { border-color: #1E3047 !important; }
html.dark .divide-gray-200 > * + * { border-color: #253958 !important; }

/* ── Texto — hierarquia de contraste WCAG AA ────────────── */
/* Fundo de referência: #161B22 (surface)                   */
/* gray-900 → 12:1  gray-800 → 9:1  gray-700 → 6.5:1       */
/* gray-600 → 4.8:1  gray-500 → 3.7:1  gray-400 → 2.9:1    */
html.dark .text-gray-900 { color: #F0F6FC !important; }
html.dark .text-gray-800 { color: #DDE4ED !important; }
html.dark .text-gray-700 { color: #B8C6D9 !important; }
html.dark .text-gray-600 { color: #8B9EB8 !important; }
html.dark .text-gray-500 { color: #6E83A0 !important; }
html.dark .text-gray-400 { color: #566F89 !important; }
html.dark .hover\:text-gray-700:hover { color: #DDE4ED !important; }
html.dark .hover\:text-gray-600:hover { color: #B8C6D9 !important; }

/* ── Inputs e selects ───────────────────────────────────── */
html.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),
html.dark select,
html.dark textarea {
  background-color: #1C2535 !important;
  border-color: #30404F !important;
  color: #F0F6FC !important;
}

/* Hover e focus: mantém fundo escuro (evita flash branco do browser) */
html.dark input:not([type=checkbox]):not([type=radio]):not([type=range]):hover,
html.dark input:not([type=checkbox]):not([type=radio]):not([type=range]):focus,
html.dark select:hover,
html.dark select:focus,
html.dark textarea:hover,
html.dark textarea:focus {
  background-color: #1E2A3A !important;
  border-color: #3D5166 !important;
  color: #F0F6FC !important;
  outline: none;
}

/* Remove rendering nativo do browser (causa white-hover) */
html.dark input:not([type=checkbox]):not([type=radio]):not([type=range]),
html.dark select {
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
}
/* Seta do select restaurada via SVG */
html.dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E83A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.65rem center !important;
  padding-right: 2rem !important;
}

/* Autofill do browser — sobrescreve fundo/texto forçados pelo Chrome/Safari */
html.dark input:-webkit-autofill,
html.dark input:-webkit-autofill:hover,
html.dark input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #1C2535 inset !important;
  -webkit-text-fill-color: #F0F6FC !important;
  caret-color: #F0F6FC;
  border-color: #30404F !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder { color: #6E83A0; }
html.dark select option { background: #162030; color: #E8EFF8; }
html.dark .focus\:border-primary:focus { border-color: var(--color-primary) !important; }

/* ── Badges coloridos — opacidade aumentada para visibilidade */
html.dark .bg-red-50    { background-color: rgba(239,68,68,0.18) !important; }
html.dark .bg-red-100   { background-color: rgba(239,68,68,0.28) !important; }
html.dark .bg-yellow-50 { background-color: rgba(245,158,11,0.18) !important; }
html.dark .bg-yellow-100{ background-color: rgba(245,158,11,0.28) !important; }
html.dark .bg-green-50  { background-color: rgba(34,197,94,0.15) !important; }
html.dark .bg-green-100 { background-color: rgba(34,197,94,0.24) !important; }
html.dark .bg-blue-50   { background-color: rgba(59,130,246,0.18) !important; }
html.dark .bg-blue-100  { background-color: rgba(59,130,246,0.28) !important; }
html.dark .bg-sky-50    { background-color: rgba(14,165,233,0.18) !important; }
html.dark .bg-amber-50  { background-color: rgba(245,158,11,0.18) !important; }
html.dark .bg-indigo-50 { background-color: rgba(99,102,241,0.18) !important; }
html.dark .bg-purple-50 { background-color: rgba(139,92,246,0.18) !important; }

html.dark .border-red-100   { border-color: rgba(239,68,68,0.35) !important; }
html.dark .border-red-200   { border-color: rgba(239,68,68,0.45) !important; }
html.dark .border-yellow-100{ border-color: rgba(245,158,11,0.35) !important; }
html.dark .border-yellow-200{ border-color: rgba(245,158,11,0.45) !important; }
html.dark .border-green-100 { border-color: rgba(34,197,94,0.30) !important; }
html.dark .border-green-200 { border-color: rgba(34,197,94,0.40) !important; }
html.dark .border-blue-200  { border-color: rgba(59,130,246,0.40) !important; }
html.dark .border-amber-200 { border-color: rgba(245,158,11,0.40) !important; }

/* ── Texto colorido — brilhantes o suficiente para contrastar */
html.dark .text-red-700    { color: #FCA5A5 !important; }
html.dark .text-red-600    { color: #F87171 !important; }
html.dark .text-red-500    { color: #EF4444 !important; }
html.dark .text-yellow-700 { color: #FDE68A !important; }
html.dark .text-yellow-800 { color: #FCD34D !important; }
html.dark .text-yellow-600 { color: #FBBF24 !important; }
html.dark .text-green-700  { color: #86EFAC !important; }
html.dark .text-green-800  { color: #6EE7B7 !important; }
html.dark .text-green-600  { color: #4ADE80 !important; }
html.dark .text-blue-600   { color: #93C5FD !important; }
html.dark .text-blue-500   { color: #60A5FA !important; }
html.dark .text-indigo-500 { color: #A5B4FC !important; }
html.dark .text-sky-700    { color: #7DD3FC !important; }
html.dark .text-amber-700  { color: #FCD34D !important; }
html.dark .text-amber-800  { color: #FDE68A !important; }

/* ── Texto primário / navegação ─────────────────────────── */
html.dark .text-primary { color: #60BAEF !important; }
html.dark .text-navy    { color: #7FA8D4 !important; }

/* ── Hover sobre texto colorido ─────────────────────────── */
html.dark .hover\:text-red-600:hover   { color: #FCA5A5 !important; }
html.dark .hover\:text-gray-700:hover  { color: #DDE4ED !important; }

/* ── Score legends em dark ──────────────────────────────── */
html.dark .score-legend-high   { background: rgba(34,197,94,0.18);  color: #86EFAC; border-color: rgba(34,197,94,0.4); }
html.dark .score-legend-medium { background: rgba(245,158,11,0.18); color: #FDE68A; border-color: rgba(245,158,11,0.4); }
html.dark .score-legend-low    { background: rgba(239,68,68,0.18);  color: #FCA5A5; border-color: rgba(239,68,68,0.4); }

/* ── Toast em dark ──────────────────────────────────────── */
html.dark .toast-success { background: rgba(34,197,94,0.15);  color: #86EFAC; border-color: rgba(34,197,94,0.35); }
html.dark .toast-error   { background: rgba(239,68,68,0.15);  color: #FCA5A5; border-color: rgba(239,68,68,0.35); }
html.dark .toast-info    { background: rgba(59,130,246,0.15); color: #93C5FD; border-color: rgba(59,130,246,0.35); }

/* ── Progress bar track ─────────────────────────────────── */
html.dark .progress-bar-track { background: #243348; }

/* ── Charts e radar: sem filtro escurecedor ─────────────── */
html.dark canvas { filter: none; }

/* ── Tooltip regulatório em dark ────────────────────────── */
html.dark .tip {
  background: rgba(33,141,206,0.20);
  border-color: rgba(33,141,206,0.45);
  color: #93C5FD;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* ── Melhorias visuais para demonstração ────────────────── */
/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Risco crítico — borda pulsante na lista de riscos ──── */
.risco-critico-row {
  border-left: 3px solid #EF4444;
  background: linear-gradient(90deg, rgba(239,68,68,0.055) 0%, transparent 35%);
  transition: background 0.2s;
}
.risco-critico-row:hover {
  background: linear-gradient(90deg, rgba(239,68,68,0.09) 0%, transparent 40%);
}
html.dark .risco-critico-row {
  background: linear-gradient(90deg, rgba(239,68,68,0.12) 0%, transparent 40%);
  border-left-color: #F87171;
}
html.dark .risco-critico-row:hover {
  background: linear-gradient(90deg, rgba(239,68,68,0.18) 0%, transparent 45%);
}

/* ── AI Insight Card — gradiente escuro premium ─────────── */
.ai-insight-card {
  background: linear-gradient(135deg, #312e81 0%, #1e3a8a 45%, #0c4a6e 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.08),
              0 8px 32px rgba(99,102,241,0.22),
              0 1px 0 rgba(255,255,255,0.06) inset;
  animation: insight-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.ai-insight-icon {
  background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
  box-shadow: 0 0 18px rgba(99,102,241,0.55), 0 2px 6px rgba(0,0,0,0.2);
}

@keyframes insight-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Progress bar mais suave ─────────────────────────────── */
.progress-bar-fill {
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
