/* ============================================================================
   PROSPERAR INVESTIMENTOS — Design System "Private Banking Ledger"
   Estética: banco privado / certificado patrimonial.
   Verde-petróleo profundo + dourado champagne, serifa Fraunces para números,
   hairlines dourados, grão sutil. Modo escuro padrão + modo claro marfim.
   ========================================================================== */

/* ----------------------------- Tokens de tema ---------------------------- */
:root {
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Archivo", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", monospace;

  /* Tema escuro (padrão) */
  --bg: #0B100E;
  --bg-sidebar: #080C0A;
  --surface: #11181400;
  --card: #121A15;
  --card-2: #17211B;
  --line: rgba(201, 169, 110, .14);
  --line-strong: rgba(201, 169, 110, .32);
  --text: #ECE7DA;
  --text-2: #C2BFB2;
  --muted: #8E9A90;
  --gold: #C9A96E;
  --gold-2: #E8CF9A;
  --gold-grad: linear-gradient(135deg, #C9A96E 0%, #E8CF9A 55%, #B6904F 100%);
  --green: #2F8463;
  --green-deep: #1C5E44;
  --pos: #46B98C;
  --pos-bg: rgba(70, 185, 140, .12);
  --neg: #D26B5B;
  --neg-bg: rgba(210, 107, 91, .12);
  --warn: #D9A648;
  --warn-bg: rgba(217, 166, 72, .12);
  --info: #6FA8C9;
  --info-bg: rgba(111, 168, 201, .12);
  --neutral-bg: rgba(142, 154, 144, .14);
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, .65);
  --shadow-sm: 0 6px 22px -10px rgba(0, 0, 0, .5);
  --radius: 14px;
  --radius-sm: 9px;
  --grain-opacity: .05;
  --chart-grid: rgba(201, 169, 110, .08);
}

[data-theme="light"] {
  --bg: #F2EFE5;
  --bg-sidebar: #122019;
  --card: #FBFAF4;
  --card-2: #F4F1E7;
  --line: rgba(122, 94, 44, .18);
  --line-strong: rgba(122, 94, 44, .38);
  --text: #1B231E;
  --text-2: #3D463F;
  --muted: #6B7568;
  --gold: #8F6F37;
  --gold-2: #6E5526;
  --gold-grad: linear-gradient(135deg, #8F6F37 0%, #B08A45 55%, #74591F 100%);
  --green: #1C5E44;
  --green-deep: #16493A;
  --pos: #177A52;
  --pos-bg: rgba(23, 122, 82, .12);
  --neg: #B0442F;
  --neg-bg: rgba(176, 68, 47, .1);
  --warn: #9A7224;
  --warn-bg: rgba(154, 114, 36, .13);
  --info: #2F6E96;
  --info-bg: rgba(47, 110, 150, .11);
  --neutral-bg: rgba(107, 117, 104, .14);
  --shadow: 0 18px 44px -20px rgba(27, 35, 30, .35);
  --shadow-sm: 0 6px 18px -10px rgba(27, 35, 30, .25);
  --grain-opacity: .035;
  --chart-grid: rgba(122, 94, 44, .12);
}

/* ------------------------------- Base ------------------------------------ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

/* Grão sutil de papel sobre tudo (atmosfera de documento físico) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }

::selection { background: rgba(201, 169, 110, .35); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 560; letter-spacing: .01em; }

/* Scrollbar discreta */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--bg); }

/* ------------------------------ Estrutura -------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease;
}

.conteudo {
  flex: 1;
  margin-left: 264px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Marca / selo */
.marca {
  padding: 26px 24px 20px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--line);
}
.marca .selo {
  width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(232, 207, 154, .22), transparent 60%),
    #0E1511;
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600;
  color: var(--gold-2);
  box-shadow: inset 0 0 0 3px rgba(201, 169, 110, .12);
}
.marca .nome {
  font-family: var(--font-display);
  font-size: 18.5px; font-weight: 560; line-height: 1.12;
  color: #ECE7DA;
}
.marca .nome small {
  display: block;
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 3px;
}

/* Navegação */
.nav-lateral { flex: 1; overflow-y: auto; padding: 14px 0 18px; }
.nav-secao {
  padding: 18px 24px 7px;
  font-size: 9.8px; font-weight: 700;
  letter-spacing: .3em; text-transform: uppercase;
  color: rgba(201, 169, 110, .55);
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9.5px 24px;
  color: #ABB6AC;
  font-size: 13.8px;
  font-weight: 500;
  position: relative;
  transition: color .18s, background .18s;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; }
.nav-item:hover { color: #ECE7DA; background: rgba(201, 169, 110, .06); }
.nav-item.ativo {
  color: var(--gold-2);
  background: linear-gradient(90deg, rgba(201, 169, 110, .14), transparent 78%);
}
.nav-item.ativo::before {
  content: "";
  position: absolute; left: 0; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--gold-grad);
}
.nav-item .pendencia {
  margin-left: auto;
  min-width: 19px; height: 19px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--gold-grad);
  color: #1A1308;
  font-size: 10.5px; font-weight: 700;
  padding: 0 5px;
}

.sidebar-rodape {
  border-top: 1px solid var(--line);
  padding: 14px 24px;
  font-size: 11px; color: #5F6B61;
  letter-spacing: .04em;
}

/* Barra superior */
.topbar {
  height: 64px;
  display: flex; align-items: center; gap: 18px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 90;
}
.topbar .caminho { font-size: 13px; color: var(--muted); }
.topbar .caminho b { color: var(--text); font-weight: 600; }
.topbar .espaco { flex: 1; }

.btn-icone {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .18s, color .18s, transform .12s;
}
.btn-icone:hover { border-color: var(--line-strong); color: var(--gold-2); }
.btn-icone:active { transform: scale(.94); }
.btn-icone svg { width: 17px; height: 17px; }

.usuario-chip {
  display: flex; align-items: center; gap: 11px;
  padding: 5px 6px 5px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.usuario-chip .dados { text-align: right; line-height: 1.2; }
.usuario-chip .dados .n { font-size: 13px; font-weight: 600; }
.usuario-chip .dados .p {
  font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--gold-grad);
  color: #221A0C;
  font-weight: 700; font-size: 13px;
  font-family: var(--font-ui);
}

/* Área principal */
.principal { padding: 30px 32px 60px; animation: entrada .45s cubic-bezier(.22,.8,.34,1) both; }

@keyframes entrada {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.cabecalho-pagina {
  display: flex; align-items: flex-end; gap: 18px;
  margin-bottom: 26px; flex-wrap: wrap;
}
.cabecalho-pagina h1 {
  margin: 0; font-size: 30px; font-weight: 560;
  font-variation-settings: "opsz" 40;
}
.cabecalho-pagina .sub { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.cabecalho-pagina .acoes { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* -------------------------------- Botões --------------------------------- */
.btn {
  font-family: var(--font-ui);
  font-size: 13.5px; font-weight: 600;
  border-radius: 10px;
  padding: 9.5px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .12s, box-shadow .2s, border-color .18s, background .18s, color .18s;
  text-decoration: none;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn svg { width: 15px; height: 15px; }

.btn-ouro {
  background: var(--gold-grad);
  color: #221A0C;
  box-shadow: 0 8px 22px -10px rgba(201, 169, 110, .55);
}
.btn-ouro:hover { box-shadow: 0 10px 28px -8px rgba(201, 169, 110, .7); color: #181106; }

.btn-contorno {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-contorno:hover { border-color: var(--gold); color: var(--gold-2); }

.btn-fantasma { background: transparent; color: var(--muted); }
.btn-fantasma:hover { color: var(--text); background: var(--neutral-bg); }

.btn-perigo {
  background: var(--neg-bg);
  border-color: transparent;
  color: var(--neg);
}
.btn-perigo:hover { border-color: var(--neg); }

.btn-mini { padding: 5.5px 11px; font-size: 12px; border-radius: 8px; }

/* -------------------------------- Cards ---------------------------------- */
.cartao {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.cartao-corpo { padding: 22px 24px; }
.cartao-titulo {
  font-size: 11px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
  display: flex; align-items: center; gap: 10px;
}
.cartao-titulo::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

/* KPI — número grande serifado com cantos de certificado */
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.kpi:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi::before, .kpi::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--gold);
  border-style: solid;
  opacity: .5;
  transition: opacity .25s;
}
.kpi::before { top: 9px; left: 9px; border-width: 1.5px 0 0 1.5px; }
.kpi::after { bottom: 9px; right: 9px; border-width: 0 1.5px 1.5px 0; }
.kpi:hover::before, .kpi:hover::after { opacity: 1; }

.kpi .rotulo {
  font-size: 10.3px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.kpi .valor {
  font-family: var(--font-display);
  font-size: clamp(23px, 2.1vw, 30px);
  font-weight: 600;
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.12;
}
.kpi .valor.neutro { background: none; -webkit-text-fill-color: var(--text); }
.kpi .extra { margin-top: 7px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

.delta { font-weight: 700; font-size: 11.5px; padding: 2.5px 8px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.delta.pos { color: var(--pos); background: var(--pos-bg); }
.delta.neg { color: var(--neg); background: var(--neg-bg); }

/* Grades utilitárias */
.grade { display: grid; gap: 16px; }
.grade-kpi { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.grade-2 { grid-template-columns: 2fr 1fr; }
.grade-3 { grid-template-columns: repeat(3, 1fr); }
.grade-meio { grid-template-columns: 1fr 1fr; }

@media (max-width: 1100px) {
  .grade-2, .grade-3, .grade-meio { grid-template-columns: 1fr; }
}

/* -------------------------------- Tabelas -------------------------------- */
.tabela-painel { overflow-x: auto; border-radius: var(--radius); }
table.fin {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.4px;
}
table.fin thead th {
  font-size: 10.2px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  background: var(--card);
  position: sticky; top: 0; z-index: 1;
}
table.fin tbody td {
  padding: 11.5px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
table.fin tbody tr { transition: background .15s; }
table.fin tbody tr:hover { background: rgba(201, 169, 110, .05); }
table.fin tbody tr:last-child td { border-bottom: none; }
table.fin .num { text-align: right; font-feature-settings: "tnum"; white-space: nowrap; }
table.fin .cod { font-family: var(--font-mono); font-size: 12px; color: var(--gold); letter-spacing: .02em; }
table.fin tfoot td {
  padding: 12px 14px;
  border-top: 2px solid var(--line-strong);
  font-weight: 700;
}

.valor-pos { color: var(--pos); font-weight: 600; }
.valor-neg { color: var(--neg); font-weight: 600; }

/* -------------------------------- Badges --------------------------------- */
.badge-st {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.6px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 3.5px 10px;
  border-radius: 7px;
  white-space: nowrap;
}
.badge-st::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-sucesso { color: var(--pos); background: var(--pos-bg); }
.badge-erro { color: var(--neg); background: var(--neg-bg); }
.badge-aviso { color: var(--warn); background: var(--warn-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-neutro { color: var(--muted); background: var(--neutral-bg); }
.badge-ouro { color: var(--gold); background: rgba(201, 169, 110, .14); }

/* ------------------------------ Formulários ------------------------------ */
.form-grade { display: grid; grid-template-columns: repeat(12, 1fr); gap: 15px 16px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; }
.c-6 { grid-column: span 6; } .c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; }
@media (max-width: 900px) { .c-8, .c-6, .c-4, .c-3 { grid-column: span 12; } }

.campo label {
  font-size: 10.6px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.campo label .req { color: var(--neg); }

.campo input, .campo select, .campo textarea,
input.entrada, select.entrada, textarea.entrada {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  width: 100%;
}
.campo textarea { resize: vertical; min-height: 84px; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, .15);
}
.campo input::placeholder { color: var(--muted); opacity: .7; }
.campo select option { background: var(--card); color: var(--text); }

.campo .dica { font-size: 11.5px; color: var(--muted); }

.check-linha { display: flex; align-items: center; gap: 9px; padding-top: 8px; }
.check-linha input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--gold); cursor: pointer;
}
.check-linha label { font-size: 13px; color: var(--text-2); cursor: pointer; letter-spacing: 0; text-transform: none; font-weight: 500; }

/* Filtros em linha */
.filtros {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 18px;
}
.filtros input, .filtros select {
  font-family: var(--font-ui); font-size: 13px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  outline: none;
}
.filtros input:focus, .filtros select:focus { border-color: var(--gold); }

.chip-filtro {
  font-size: 12px; font-weight: 600;
  padding: 6.5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  display: inline-flex; gap: 7px; align-items: center;
}
.chip-filtro:hover { border-color: var(--line-strong); color: var(--text); }
.chip-filtro.ativo {
  background: var(--gold-grad);
  border-color: transparent;
  color: #221A0C;
}
.chip-filtro .qt { opacity: .65; font-variant-numeric: tabular-nums; }

/* -------------------------------- Flash ---------------------------------- */
.flash {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 17px;
  border-radius: 11px;
  font-size: 13.8px; font-weight: 500;
  margin-bottom: 20px;
  border: 1px solid;
  animation: entrada .4s ease both;
}
.flash-sucesso { color: var(--pos); border-color: rgba(70,185,140,.4); background: var(--pos-bg); }
.flash-erro { color: var(--neg); border-color: rgba(210,107,91,.4); background: var(--neg-bg); }
.flash-aviso { color: var(--warn); border-color: rgba(217,166,72,.4); background: var(--warn-bg); }

/* ------------------------------- Login ----------------------------------- */
.login-pagina {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}
@media (max-width: 980px) { .login-pagina { grid-template-columns: 1fr; } .login-brand { display: none; } }

.login-brand {
  background:
    radial-gradient(1100px 500px at -10% -10%, rgba(201, 169, 110, .14), transparent 55%),
    radial-gradient(800px 600px at 110% 110%, rgba(47, 132, 99, .18), transparent 60%),
    #0A0F0C;
  position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 52px 58px;
  overflow: hidden;
}
.login-brand::before {
  content: "";
  position: absolute; inset: 22px;
  border: 1px solid rgba(201, 169, 110, .22);
  border-radius: 4px;
  pointer-events: none;
}
.login-brand .canto { position: absolute; width: 26px; height: 26px; border: 1.5px solid var(--gold); opacity: .8; }
.login-brand .canto.c1 { top: 14px; left: 14px; border-width: 1.5px 0 0 1.5px; }
.login-brand .canto.c2 { top: 14px; right: 14px; border-width: 1.5px 1.5px 0 0; }
.login-brand .canto.c3 { bottom: 14px; left: 14px; border-width: 0 0 1.5px 1.5px; }
.login-brand .canto.c4 { bottom: 14px; right: 14px; border-width: 0 1.5px 1.5px 0; }

.login-brand .selo-grande {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(201, 169, 110, .5);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 31px; color: #E8CF9A;
  background: radial-gradient(circle at 32% 28%, rgba(232,207,154,.25), transparent 62%);
  box-shadow: inset 0 0 0 5px rgba(201, 169, 110, .1);
}
.login-brand h1 {
  font-size: clamp(40px, 4.4vw, 62px);
  line-height: 1.04;
  margin: 26px 0 18px;
  color: #F0EBDC;
  font-weight: 560;
  font-variation-settings: "opsz" 144;
}
.login-brand h1 em {
  font-style: italic;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-brand p { color: #97A399; max-width: 46ch; font-size: 15px; line-height: 1.75; }

.login-brand .metricas {
  display: flex; gap: 38px; flex-wrap: wrap;
  border-top: 1px solid rgba(201, 169, 110, .2);
  padding-top: 26px;
}
.login-brand .metricas div b {
  display: block;
  font-family: var(--font-display);
  font-size: 25px; color: #E8CF9A; font-weight: 600;
}
.login-brand .metricas div span {
  font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: #7E8B80;
}

.login-form-lado {
  display: grid; place-items: center;
  padding: 40px 26px;
  background: var(--bg);
}
.login-caixa { width: min(400px, 100%); }
.login-caixa h2 { font-size: 27px; margin: 0 0 6px; }
.login-caixa .sub { color: var(--muted); font-size: 13.8px; margin-bottom: 30px; }
.login-caixa .campo { margin-bottom: 16px; }
.login-caixa .btn { width: 100%; justify-content: center; padding: 12.5px; font-size: 14.5px; }
.login-rodape { margin-top: 28px; text-align: center; font-size: 11.5px; color: var(--muted); letter-spacing: .06em; }

/* ------------------------------- Gráficos -------------------------------- */
.grafico-area { position: relative; min-height: 270px; }
.grafico-area canvas { max-width: 100%; }

/* Lista de alertas */
.alerta-item {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}
.alerta-item:last-child { border-bottom: none; }
.alerta-data {
  flex-shrink: 0;
  width: 46px; text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 5px 0 7px;
  background: var(--card-2);
}
.alerta-data b { display: block; font-family: var(--font-display); font-size: 17px; line-height: 1.1; color: var(--gold-2); }
.alerta-data span { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.alerta-info { min-width: 0; }
.alerta-info .t { font-size: 13.4px; font-weight: 600; }
.alerta-info .d { font-size: 12px; color: var(--muted); margin-top: 1px; }
.alerta-dias { margin-left: auto; flex-shrink: 0; }

/* ------------------------------- Kanban ---------------------------------- */
.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(225px, 1fr));
  gap: 13px;
  overflow-x: auto;
  padding-bottom: 10px;
}
@media (max-width: 1500px) { .kanban { grid-template-columns: repeat(6, 235px); } }

.kanban-coluna {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.kanban-cabeca {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}
.kanban-cabeca .qt {
  background: var(--neutral-bg);
  border-radius: 7px; padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.kanban-corpo { padding: 11px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; min-height: 70px; }
.kanban-corpo.arrastando { outline: 2px dashed var(--gold); outline-offset: -6px; border-radius: 10px; }

.lead-cartao {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 13px;
  cursor: grab;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.lead-cartao:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.lead-cartao.arrasto { opacity: .45; }
.lead-cartao .n { font-weight: 600; font-size: 13.6px; }
.lead-cartao .a { font-size: 11.6px; color: var(--gold); font-family: var(--font-mono); margin-top: 2px; }
.lead-cartao .v { font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.lead-cartao .rodape { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ------------------------------ Timeline ---------------------------------- */
.linha-tempo { position: relative; padding-left: 26px; }
.linha-tempo::before {
  content: "";
  position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--line-strong), transparent);
}
.evento {
  position: relative;
  padding: 0 0 20px;
}
.evento::before {
  content: "";
  position: absolute; left: -23px; top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 169, 110, .15);
}
.evento .quando { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.evento .que { font-size: 13.8px; margin-top: 3px; }
.evento .quem { font-size: 11.8px; color: var(--muted); margin-top: 2px; }

/* ------------------------------- Modais ----------------------------------- */
.modal-content {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow);
}
.modal-header { border-bottom: 1px solid var(--line); padding: 18px 24px; }
.modal-header .modal-title {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 560;
}
.modal-body { padding: 22px 24px; }
.modal-footer { border-top: 1px solid var(--line); padding: 15px 24px; }
.modal-backdrop.show { opacity: .72; }
.btn-close { filter: invert(.7) sepia(.2); }

/* ------------------------- Detalhe (página show) -------------------------- */
.ficha { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 14px 22px; }
.ficha .item .r {
  font-size: 10px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}
.ficha .item .v { font-size: 14.2px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.ficha .item .v.destaque { font-family: var(--font-display); font-size: 17px; color: var(--gold-2); }

.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
.galeria figure {
  margin: 0; position: relative;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 4/3;
  background: var(--card-2);
  display: grid; place-items: center;
  color: var(--muted); font-size: 11px;
}
.galeria img { width: 100%; height: 100%; object-fit: cover; }

/* Abas simples */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.aba {
  padding: 9px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .18s, border-color .18s;
  text-decoration: none;
}
.aba:hover { color: var(--text); }
.aba.ativa { color: var(--gold-2); border-bottom-color: var(--gold); }

/* Barra de progresso fina */
.progresso { height: 6px; background: var(--neutral-bg); border-radius: 4px; overflow: hidden; }
.progresso > div { height: 100%; background: var(--gold-grad); border-radius: 4px; transition: width .6s ease; }

/* Vazio */
.vazio {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.vazio .selo-vazio {
  width: 52px; height: 52px; margin: 0 auto 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 22px; color: var(--gold);
  opacity: .7;
}

/* Cenários de viabilidade */
.cenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 980px) { .cenarios { grid-template-columns: 1fr; } }
.cenario-cartao {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 19px;
  background: var(--card);
  position: relative;
  transition: border-color .2s, transform .2s;
}
.cenario-cartao:hover { transform: translateY(-2px); }
.cenario-cartao.moderado { border-color: rgba(201, 169, 110, .45); }
.cenario-cartao .faixa {
  font-size: 10px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
}
.cenario-cartao .roi-grande {
  font-family: var(--font-display);
  font-size: 31px; font-weight: 600;
  margin: 9px 0 2px;
  font-variant-numeric: tabular-nums;
}
.cenario-cartao .linhas { margin-top: 12px; display: grid; gap: 6px; }
.cenario-cartao .linhas div { display: flex; justify-content: space-between; font-size: 12.6px; }
.cenario-cartao .linhas span { color: var(--muted); }
.cenario-cartao .linhas b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Resumo calculado (viabilidade form) */
.resumo-calc {
  position: sticky; top: 84px;
}
.resumo-calc .linha-res {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8.5px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.2px;
}
.resumo-calc .linha-res:last-child { border-bottom: none; }
.resumo-calc .linha-res span { color: var(--muted); }
.resumo-calc .linha-res b { font-variant-numeric: tabular-nums; font-size: 14px; }
.resumo-calc .destaque-final {
  margin-top: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 15px 17px;
  background: linear-gradient(160deg, rgba(201, 169, 110, .1), transparent 65%);
}
.resumo-calc .destaque-final .t { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.resumo-calc .destaque-final .v {
  font-family: var(--font-display);
  font-size: 29px; font-weight: 600;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ Impressão -------------------------------- */
.somente-impressao { display: none; }

@media print {
  body { background: #fff; color: #111; font-size: 12px; }
  body::after { display: none; }
  .sidebar, .topbar, .acoes, .filtros, .btn, .nao-imprimir { display: none !important; }
  .conteudo { margin-left: 0; }
  .principal { padding: 0; animation: none; }
  .cartao, .kpi { border: 1px solid #999; box-shadow: none; background: #fff; }
  table.fin thead th { color: #333; border-color: #555; position: static; background: #fff; }
  table.fin tbody td { border-color: #ccc; }
  .somente-impressao { display: block; }
  a { color: #111; }
  .kpi .valor, .resumo-calc .destaque-final .v, .login-brand h1 em {
    background: none; -webkit-text-fill-color: #111; color: #111;
  }
}

/* --------------------------- Responsividade ------------------------------ */
@media (max-width: 920px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.aberta { transform: none; box-shadow: 0 0 80px rgba(0,0,0,.6); }
  .conteudo { margin-left: 0; }
  .principal { padding: 20px 16px 50px; }
  .topbar { padding: 0 16px; }
  .usuario-chip .dados { display: none; }
  .cabecalho-pagina h1 { font-size: 24px; }
}

/* Véu para sidebar móvel */
.veu-movel {
  display: none;
  position: fixed; inset: 0;
  background: rgba(5, 8, 6, .6);
  z-index: 95;
  backdrop-filter: blur(2px);
}
.veu-movel.visivel { display: block; }

/* Animação de números */
@keyframes brilho-ouro {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}
.kpi:hover .valor { animation: brilho-ouro 2.2s ease infinite; }

/* Tooltip custom Chart.js herda as variáveis via JS */

/* ===================================================================
   Componentes — Usuários, Auditoria, Aprovações, Compliance
   =================================================================== */

/* Switch / toggle de linha (form de usuário) */
.switch-linha {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-2); cursor: pointer; margin: 0;
}
.switch-linha input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--gold); cursor: pointer; }
.switch-linha input:disabled { opacity: .6; cursor: not-allowed; }

/* Bloco de JSON na trilha de auditoria */
.json-aud {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10.6px; line-height: 1.5;
  background: var(--card-2); color: var(--text-2);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 7px 9px; margin: 3px 0 0;
  max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.tabela-painel details summary { list-style: none; font-size: 11.5px; }
.tabela-painel details summary::-webkit-details-marker { display: none; }

/* Cartões de aprovação */
.cartao-aprovacao { position: relative; border-left: 3px solid var(--line-strong); }
.cartao-aprovacao.status-pendente  { border-left-color: var(--gold); }
.cartao-aprovacao.status-aprovada  { border-left-color: var(--pos); }
.cartao-aprovacao.status-rejeitada { border-left-color: var(--neg); opacity: .92; }
.valor-destaque {
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 28px); font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* Lista de indicadores (compliance) */
.lista-indicadores { display: grid; gap: 1px; margin-top: 10px; background: var(--line); border-radius: 9px; overflow: hidden; }
.ind-linha {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 13px; background: var(--card); font-size: 13px;
}
.ind-linha span { color: var(--muted); }
.ind-linha strong { font-variant-numeric: tabular-nums; font-family: var(--font-display); font-weight: 600; }
.valor-pos { color: var(--pos); }
.valor-neg { color: var(--neg); }

/* ===================================================================
   Logo / Marca — imagem oficial (fundo escuro removido via blend)
   =================================================================== */
.marca .selo { overflow: hidden; }
.marca .selo img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
  mix-blend-mode: lighten;
}
.login-brand .login-logo {
  width: 250px; max-width: 62%; height: auto;
  display: block; margin: -6px 0 2px -6px;
  mix-blend-mode: lighten;
}
@media (max-width: 980px) { .login-brand .login-logo { width: 200px; } }
