/* ═══════════════════════════════════════════════════════════════════════════
   FO — Nexus Design System
   Paleta Nexus preservada + tipografia/layout modernizado (Linear/Stripe-like)
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://rsms.me/inter/inter.css');

/* ── Tokens / CSS Variables ─────────────────────────────────────────────── */
:root {
  /* Paleta Nexus (preservada) */
  --navy:       #0F3460;
  --navy-d:     #0A2342;
  --navy-l:     #1D3557;
  --roxo:       #4A1A6B;
  --roxo-l:     #6A2C95;
  --green:      #1B4332;
  --green-l:    #E8F5EE;
  --amber:      #B7770D;
  --amber-l:    #FEF9E7;
  --red:        #C0392B;
  --red-l:      #FDECEA;

  /* Cores de classe (preservadas) */
  --cls-pe:     #4A1A6B;
  --cls-vc:     #7A0C2E;
  --cls-re:     #7A3B0A;
  --cls-eq:     #1D3557;
  --cls-pc:     #0B6E4F;
  --cls-mm:     #7A5C00;

  /* Surface system (light mode com hierarquia clara) */
  --bg:         #FAFBFC;
  --bg-2:       #F4F6F8;
  --surface:    #FFFFFF;
  --surface-2:  #F8FAFB;
  --border:     rgba(15, 52, 96, 0.08);
  --border-strong: rgba(15, 52, 96, 0.16);

  /* Text */
  --text:       #0B1929;
  --text-2:     #3D4F66;
  --muted:      #5F7086;   /* escurecido p/ WCAG AA em texto pequeno (era #7A8A9F ~3.4:1) */
  --muted-2:    #B0BAC9;   /* reservar p/ bordas/placeholders, nao texto */

  /* Aliases de compatibilidade — tokens referenciados no JS mas NUNCA definidos (bug
     latente: `var(--gray-500)` etc. nao resolviam -> cor herdada/transparente errada).
     Mapeiam a escala tipo Tailwind p/ os tokens canonicos Nexus. Aditivo, corrige tudo
     sem tocar no JS; tambem sao pre-requisito p/ o dark mode (senao ficariam quebrados). */
  --card:       var(--surface);
  --gray:       var(--muted);
  --gray-50:    var(--bg);
  --gray-100:   var(--surface-2);
  --gray-200:   var(--bg-2);
  --gray-400:   var(--muted-2);
  --gray-500:   var(--muted);
  --gray-600:   var(--muted);
  --gray-700:   var(--text-2);

  /* Effects */
  --shadow-sm:  0 1px 2px rgba(15, 52, 96, 0.04);
  --shadow:     0 1px 3px rgba(15, 52, 96, 0.06), 0 1px 2px rgba(15, 52, 96, 0.04);
  --shadow-lg:  0 12px 32px rgba(15, 52, 96, 0.08), 0 4px 12px rgba(15, 52, 96, 0.04);
  --shadow-xl:  0 24px 64px rgba(15, 52, 96, 0.12), 0 8px 24px rgba(15, 52, 96, 0.06);
  --r-sm:       6px;
  --r:          10px;
  --r-lg:       14px;
  --r-xl:       18px;

  /* Typography */
  --font-sans:  'Inter var', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --font-display: 'Inter var', 'Inter', sans-serif;

  /* Layout */
  --sidebar-w:  220px;
  --topbar-h:   56px;

  /* ── Escala tipografica (ADR design-review, passo 1) ─────────────────────
     Antes: 95 font-size soltos, 17 valores ad-hoc c/ meio-pixel, zero via var().
     Migrar CSS e template strings para estes degraus; nunca <11px em texto
     que carrega informacao. */
  --fs-caption: 11px;
  --fs-sm:      12px;
  --fs-base:    13px;
  --fs-md:      15px;
  --fs-lg:      18px;
  --fs-xl:      22px;
  --fs-2xl:     28px;
  --fs-hero:    40px;
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-bold:    700;
  --fw-heavy:   800;
  --lh-tight:   1.2;
  --lh-base:    1.5;
  --lh-relaxed: 1.6;

  /* Escala de espacamento (base 4px) — substitui px soltos em padding/gap/margin */
  --space-1:    4px;
  --space-2:    8px;
  --space-3:    12px;
  --space-4:    16px;
  --space-5:    24px;
  --space-6:    32px;

  /* Movimento — substitui cubic-bezier literal (~10x) e duracoes espalhadas */
  --ease:       cubic-bezier(.16, 1, .3, 1);
  --dur-fast:   .12s;
  --dur:        .18s;
  --dur-slow:   .4s;

  /* Cor semantica — ganho/perda unico (WCAG 1.4.1: a cor REFORCA, nao carrega
     sozinha; use tambem sinal +/- ou seta). Substitui >=5 verdes e >=6 vermelhos. */
  --pos:        #1B7F3B;
  --pos-bg:     var(--green-l);
  --neg:        var(--red);
  --neg-bg:     var(--red-l);
  /* Ganho/perda sobre TINTA (heatmap de retorno mensal): a celula pinta o fundo
     com a intensidade do retorno, entao o texto precisa ser mais escuro que
     --pos/--neg p/ sobreviver ao fundo saturado. Trocar estes dois por --pos
     derruba o contraste de 4,4:1 para 2,3:1 na celula de 12%+. O par -rgb existe
     porque a intensidade e calculada em JS: rgba(var(--pos-tint-rgb), alpha).
     "tint" no nome de proposito: e a cor de FUNDO SOB TEXTO. Para preenchimento
     de area em grafico (drawdown) o dark quer o oposto — tinta CLARA sobre fundo
     escuro — entao aquele caso nao usa estes tokens. */
  --pos-tx:     #155724;
  --neg-tx:     #721C24;
  --pos-tint-rgb:    40, 167, 69;

  /* ── Series de grafico: ponte do NAV ────────────────────────────────────
     Estes NAO sao --pos/--neg. Ali verde/vermelho significam SINAL (subiu ou
     caiu); aqui a cor significa IDENTIDADE (que parcela da variacao e' aquela
     barra), e o sinal ja e' lido pela direcao da barra em torno do zero.
     Reaproveitar --pos/--neg colocaria "resgate" e "prejuizo" na mesma cor
     apontando para baixo, que sao coisas opostas: uma e' o dono tirando
     dinheiro, a outra e' o gestor perdendo.

     Os tres hues foram escolhidos rodando o validador do skill de dataviz
     (separacao para daltonismo, piso de contraste e banda de luminosidade),
     nos DOIS temas — nao no olho. Quem trocar um valor aqui refaz a checagem:
     azul+laranja+vermelho, o palpite obvio, reprova (laranja x vermelho fica
     em dE 7,1 na visao normal — indistinguiveis lado a lado). */
  --viz-in:     #2A78D6;   /* aporte / capital call — entra */
  --viz-out:    #EB6834;   /* resgate / distribuicao / amortizacao — sai */
  --viz-pnl:    #199E70;   /* resultado do periodo (P&L), sinal pela direcao */
  --viz-nav:    var(--text);           /* a linha do NAV e' o TOTAL, entao usa
                                          tinta de texto: nao disputa hue com
                                          nenhuma das parcelas */
  --viz-nav-fill: rgba(15, 52, 96, 0.10);
  --neg-tint-rgb:    220, 53, 69;
  --on-brand:   #FFFFFF;   /* texto sobre navy/roxo — destrava dark mode */
  --red-d:      #A52818;   /* hover de danger */
  --overlay:    rgba(11, 25, 41, 0.5);
  --row-stripe: rgba(15, 52, 96, 0.03);
  --focus-ring: 0 0 0 3px rgba(15, 52, 96, 0.35);
  --r-pill:     999px;
}

/* ── DARK MODE (Fase 8) ──────────────────────────────────────────────────────
   OPT-IN via <html data-theme="dark"> (toggle no menu do usuario). Nada muda no
   light por padrao. So sobrescreve VALORES de token — o resto do CSS ja aponta p/
   var(--...). Marca fica um pouco mais clara p/ contraste; tints viram escuros. */
:root[data-theme="dark"] {
  --bg:            #0D1520;
  --bg-2:          #111D2C;
  --surface:       #16212F;
  --surface-2:     #1E2A3A;
  --border:        rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text:          #E7ECF3;
  --text-2:        #AEB9C7;
  --muted:         #8A98AB;   /* AA sobre fundo escuro */
  --muted-2:       #5C6B7F;
  --row-stripe:    rgba(255, 255, 255, 0.03);
  --overlay:       rgba(0, 0, 0, 0.6);
  --focus-ring:    0 0 0 3px rgba(120, 165, 225, 0.55);
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:        0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg:     0 12px 32px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-xl:     0 24px 64px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
  /* marca clareada p/ contraste sobre o escuro (botoes/nav/headers seguem visiveis) */
  --navy:          #5A8CC4;
  --navy-l:        #7AA6D6;
  --roxo:          #A47AD0;
  --roxo-l:        #B98FE0;
  /* status: texto claro + tint escuro translucido (chips legiveis no dark) */
  --green:         #4ADE80;  --green-l: rgba(74, 222, 128, 0.14);
  --amber:         #F6C059;  --amber-l: rgba(246, 192, 89, 0.14);
  --red:           #F2726B;  --red-l:   rgba(242, 114, 107, 0.14);
  --pos:           #4ADE80;  --pos-bg:  rgba(74, 222, 128, 0.14);
  --neg:           #F2726B;  --neg-bg:  rgba(242, 114, 107, 0.14);
  /* No dark a logica inverte: a tinta escurece e o TEXTO clareia. Manter o
     #155724 do tema claro deixava o numero do heatmap em 1,4:1 — ilegivel. */
  --pos-tx:        var(--pos);   --pos-tint-rgb: 27, 110, 58;
  --neg-tx:        var(--neg);   --neg-tint-rgb: 120, 30, 26;
  /* Passos escolhidos PARA o fundo escuro e validados contra ele (o mesmo hue
     clareado no automatico cai fora da banda). O verde do P&L e' o unico que
     serve nos dois temas sem troca. */
  --viz-in:        #3987E5;
  --viz-out:       #D95926;
  --viz-pnl:       #199E70;
  --viz-nav-fill:  rgba(122, 166, 214, 0.14);
  /* --on-brand fica #fff: texto sobre botao/marca continua claro. */
}

/* ── Anel de foco global (WCAG 2.4.7, passo 2) ───────────────────────────────
   Antes: todas as regras :focus faziam outline:none sem substituto, deixando a
   navegacao por teclado invisivel em botoes/nav/chips/linhas. Usa box-shadow
   (nao outline), entao os outline:none existentes nao o apagam; :where() mantem
   especificidade baixa p/ nao brigar com o anel proprio dos .fg-input. */
:where(a, button, .btn, .nav-item, [role="button"], input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid transparent;   /* visivel em modo de alto contraste */
  outline-offset: 1px;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

/* ── Reset / Base ────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Mãozinha universal: todo elemento com handler de clique inline (div/tr/td/span/svg…)
   ou papel de botão vira cursor:pointer. Cobre os clicáveis que não são <button>/<a>/.btn
   e que antes ficavam sem feedback de "isto é clicável". Disabled fica de fora. */
[onclick]:not([disabled]):not(:disabled),
[role="button"]:not([disabled]):not(:disabled) { cursor: pointer; }

/* Scrollbar minimalista */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ── Layout: Sidebar + Main ──────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-brand-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--navy), var(--roxo));
  display: flex; align-items: center; justify-content: center;
  color: var(--on-brand);
  font-weight: 800;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.sidebar-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.sidebar-brand-sub {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.12s ease;
  position: relative;
  cursor: pointer;      /* <a> sem href nao vira mao sozinho */
  user-select: none;    /* evita cursor/selecao de texto no rotulo */
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--bg-2);
  color: var(--navy);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--navy);
  border-radius: 0 2px 2px 0;
}
.nav-item .lucide {
  width: 15px; height: 15px;
  stroke-width: 2;
  flex-shrink: 0;
}
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red);
  color: var(--on-brand);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.search-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 12px;
  transition: all 0.12s;
}
.search-trigger:hover {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border-strong);
}
.search-trigger .lucide { width: 13px; height: 13px; }
.search-trigger .kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--text);
}
.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
}
.sync-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.15);
}

.page {
  display: none;
  padding: 24px;
  flex: 1;
  animation: pageIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.page.active { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 22px;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 4px;
}
.page-header p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* ── Section ─────────────────────────────────────────────────────────────── */
.section {
  margin-bottom: 28px;
  animation: cardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.section + .section { animation-delay: 0.05s; }
.section + .section + .section { animation-delay: 0.1s; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-subtitle {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  animation: cardIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.card-pad { padding: 16px 18px; }
.card-pad-lg { padding: 22px 24px; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── KPI Cards ───────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: all 0.18s;
  animation: cardIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.kpi:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.kpi-clickable { cursor: pointer; }
.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-label .lucide { width: 12px; height: 12px; }
.kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.kpi-trend {
  font-size: 11px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}
.kpi.kpi-success .kpi-value { color: var(--green); }
.kpi.kpi-warn    .kpi-value { color: var(--amber); }
.kpi.kpi-danger  .kpi-value { color: var(--red); }
.kpi.kpi-info    .kpi-value { color: var(--navy); }
.kpi.kpi-roxo    .kpi-value { color: var(--roxo); }

/* Pequena barra colorida no topo */
.kpi.kpi-success::after,
.kpi.kpi-warn::after,
.kpi.kpi-danger::after,
.kpi.kpi-info::after,
.kpi.kpi-roxo::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
}
.kpi.kpi-success::after { background: var(--green); }
.kpi.kpi-warn::after    { background: var(--amber); }
.kpi.kpi-danger::after  { background: var(--red); }
.kpi.kpi-info::after    { background: var(--navy); }
.kpi.kpi-roxo::after    { background: var(--roxo); }

/* ── Pendências Grid ─────────────────────────────────────────────────────── */
.pend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) {
  .pend-grid { grid-template-columns: 1fr; }
}

.pend-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cardIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.pend-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
}
.pend-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.pend-panel-title .lucide { width: 14px; height: 14px; }
.pend-panel-body {
  max-height: 320px;
  overflow-y: auto;
}
.pend-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.pend-item:last-child { border-bottom: none; }
.pend-item:hover { background: var(--surface-2); }
.pend-item-main { flex: 1; min-width: 0; }
.pend-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pend-item-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.pend-item-meta {
  text-align: right;
  flex-shrink: 0;
}
.pend-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.pend-empty .lucide {
  width: 28px; height: 28px;
  margin: 0 auto 8px;
  display: block;
  color: var(--muted-2);
}

/* ── Analista Cards (grid) ───────────────────────────────────────────────── */
.analista-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.analista-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.analista-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.analista-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--on-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.analista-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
}
.analista-cap {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}
.analista-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.analista-stat {
  text-align: center;
}
.analista-stat-n {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  display: block;
}
.analista-stat-l {
  font-size: 9.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.progress-bar {
  background: var(--border);
  border-radius: 3px;
  height: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.progress-meta {
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 4px;
  text-align: right;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.12s;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .lucide { width: 13px; height: 13px; }

.btn-primary {
  background: var(--navy);
  color: var(--on-brand);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05) inset, var(--shadow-sm);
}
.btn-primary:hover:not(:disabled) {
  background: var(--navy-d);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05) inset, var(--shadow);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--muted-2);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}
.btn-danger {
  background: var(--red);
  color: var(--on-brand);
}
.btn-danger:hover:not(:disabled) { background: #A52818; }
.btn-sm { padding: 5px 10px; font-size: 11px; }

/* Botao de acao em linha de tabela (Entidades, Equipe).
   MORA AQUI, e nao num <style> injetado por pagina: ele estava declarado DUAS
   vezes — entidades.js e equipe.js — com valores diferentes e escopo global.
   Como os dois eram injetados no document, quem renderizasse por ultimo mandava
   nas DUAS telas: o tamanho do botao em Entidades dependia de o usuario ter
   passado pela Equipe antes. Radar de frontend, 28/08. */
.btn-mini {
  font-size: var(--fs-caption); padding: 3px 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--text); cursor: pointer;
}
.btn-mini:hover { border-color: var(--border-strong); }
.btn-lg { padding: 9px 16px; font-size: 13px; }

/* ── Filter Bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-bar .input,
.filter-bar .select {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  transition: all 0.12s;
}
.filter-bar .input { min-width: 220px; flex: 1; max-width: 320px; }
.filter-bar .select { min-width: 130px; }
.filter-bar .input:focus,
.filter-bar .select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}
.filter-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

/* ── Chips / Badges ──────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.chip-success { background: var(--green-l); color: var(--green); }
.chip-warn    { background: var(--amber-l); color: var(--amber); }
.chip-danger  { background: var(--red-l); color: var(--red); }
.chip-info    { background: rgba(15, 52, 96, 0.08); color: var(--navy); }
.chip-roxo    { background: rgba(74, 26, 107, 0.08); color: var(--roxo); }
.chip-neutral { background: var(--bg-2); color: var(--muted); }
/* Variante compacta oficial (>=11px) — substitui os font-size:9px inline nos chips */
.chip-xs { font-size: var(--fs-caption); padding: 1px 6px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  max-width: 400px;
}
.toast {
  background: var(--text);
  color: var(--on-brand);
  padding: 11px 16px;
  border-radius: var(--r);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast .lucide { width: 16px; height: 16px; flex-shrink: 0; }
.toast .toast-acoes { display: flex; gap: 6px; margin-left: auto; padding-left: 8px; flex-shrink: 0; align-items: center; }
.toast .toast-btn {
  background: rgba(255,255,255,.18); color: inherit; border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--r-sm, 6px); padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; min-height: 24px;
}
.toast .toast-btn:hover { background: rgba(255,255,255,.3); }
.toast .toast-fechar { padding: 2px 8px; font-size: 15px; line-height: 1; border-color: transparent; }
/* Estados de container (setEstado) */
.empty.estado-loading .lucide { animation: spin 1s linear infinite; }
.empty.estado-erro .lucide { color: var(--red); }
.empty .estado-acao { margin-top: 10px; }
/* Lamina: botao cliente pendente (falta campo obrigatorio), motivo do bloqueio e loader */
.am-lamina-pendente { position: relative; }
.am-lamina-pendente::after {
  content: ''; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--amber); border: 2px solid var(--surface);
}
.am-lamina-motivo { font-size: 11px; color: var(--muted); margin-right: auto; align-self: center; max-width: 320px; line-height: 1.3; }
.am-spin { animation: spin 1s linear infinite; }
.am-ficha-carregando { font-size: 12px; color: var(--muted); padding: 8px 0; }
/* One-pager "Tese" (Equity do book Teses) */
.am-tese { display: flex; flex-direction: column; gap: 14px; }
.am-tese-lead { font-size: 15px; line-height: 1.5; color: var(--text); }
.am-tese-lead-txt { font-weight: 500; }
.am-tese-carregando { color: var(--muted); font-size: 12px; }
.am-tese-vazia { font-size: 12.5px; color: var(--text-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--r); }
.am-tese-sub { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.am-tese-sub b { color: var(--text); font-weight: 600; }
.am-tese-analista { display: inline-flex; align-items: center; gap: 6px; }
.am-tese-dataref { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.am-tese-dataref label { font-size: 10px; font-weight: 600; }
.am-tese-dataref input { font-size: 11px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); }
.am-tese-badge { font-size: 11px; font-weight: 600; color: var(--amber); }
.am-tese-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.am-tese-num { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.am-tese-num-k { font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.am-tese-num-v { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1.15; }
.am-tese-num-d { font-size: 10px; color: var(--muted); margin-top: 3px; line-height: 1.3; }
.am-tese-quant { font-size: 11.5px; color: var(--text-2); padding: 8px 12px; background: var(--surface-2); border-radius: var(--r-sm); }
.am-tese-quant b { color: var(--text); }
.am-tese-quant-k { font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 6px; }
.am-tese-det { border-top: 1px solid var(--border); padding-top: 8px; }
.am-tese-det > summary { cursor: pointer; font-size: 11px; font-weight: 700; color: var(--navy); text-transform: uppercase; letter-spacing: .06em; list-style: none; display: flex; gap: 10px; align-items: baseline; }
.am-tese-det > summary::before { content: '▸'; color: var(--muted); }
.am-tese-det[open] > summary::before { content: '▾'; }
.am-tese-det-sub { font-size: 10px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--muted); }
.am-tese-cadastro { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.am-tese-cad-v { font-size: 13px; font-weight: 600; }
/* Notas / Q&A por ativo */
.am-nota-composer { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; background: var(--surface-2); margin-bottom: 14px; }
.am-nota-composer-topo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.am-nota-select { font-size: 11px; padding: 3px 6px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); }
.am-nota-dica { font-size: 10.5px; color: var(--muted); }
.am-nota-ta-wrap { position: relative; }
.am-nota-ta { width: 100%; box-sizing: border-box; font: inherit; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); resize: vertical; min-height: 64px; }
.am-nota-menu { position: absolute; left: 8px; bottom: calc(100% - 4px); z-index: 5; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); min-width: 220px; padding: 4px; }
.am-nota-opt { padding: 5px 8px; font-size: 12px; border-radius: var(--r-sm); cursor: pointer; color: var(--text); }
.am-nota-opt.ativa, .am-nota-opt:hover { background: var(--bg-2); color: var(--navy); }
.am-nota-composer-acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.am-notas-lista { display: flex; flex-direction: column; gap: 8px; }
.am-nota { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; background: var(--surface); }
.am-nota-nova { border-left: 3px solid var(--amber); }
.am-nota-cab { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; margin-bottom: 6px; }
.am-nota-quando { color: var(--muted); font-size: 10.5px; }
.am-nota-tag-nova { font-size: 9px; text-transform: uppercase; letter-spacing: .4px; color: var(--amber); border: 1px solid var(--amber); border-radius: var(--r-sm); padding: 1px 5px; }
.am-nota-acoes { margin-left: auto; display: flex; gap: 4px; }
.am-nota-texto { font-size: 12.5px; line-height: 1.55; color: var(--text); word-break: break-word; }
.am-nota-menc { color: var(--navy); font-weight: 600; background: var(--bg-2); border-radius: 3px; padding: 0 3px; }
.am-nota-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-left: 6px; vertical-align: middle; }
.tab .badge.am-badge-nova { background: var(--amber); color: #fff; }
/* Marcadores de log no grafico de retorno acumulado */
.am-logmk:hover rect, .am-logmk:focus-visible rect { stroke-width: 2.4; fill: var(--bg-2); }
.am-logmk:focus { outline: none; }
.am-log-card.am-log-realce { box-shadow: 0 0 0 2px var(--navy) !important; }
/* Saude: veredito do ativo parado + proxima acao */
.sd-veredito { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; max-width: 360px; }
.sd-veredito small { flex-basis: 100%; color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.sd-veredito .sd-curar { padding: 2px 8px; min-height: 22px; font-size: 11px; }
.sd-pill-btn { cursor: pointer; font: inherit; font-size: 10.5px; }
.sd-pill-btn:hover { filter: brightness(.92); }
.sd-parado-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sd-cands h4 { margin: 0 0 4px; font-size: 12px; color: var(--text); }
.sd-cand-lista { margin: 6px 0 14px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sd-cand-lista li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 12px; }
.sd-parado-texto { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.45; white-space: pre-wrap;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px; max-height: 50vh; overflow: auto; margin: 0; }
.dp-form { display: flex; flex-direction: column; gap: 12px; }
.dp-form .cst-campo { display: flex; flex-direction: column; gap: 4px; }
.dp-form .dp-inp { width: 100%; box-sizing: border-box; }
.am-log-pre { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.45; white-space: pre-wrap; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px; max-height: 40vh; overflow: auto; margin: 8px 0 0; }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
.toast.info    { background: var(--navy); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Empty States ────────────────────────────────────────────────────────── */
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .lucide {
  width: 36px; height: 36px;
  color: var(--muted-2);
  margin: 0 auto 12px;
  display: block;
  stroke-width: 1.5;
}
.empty-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}
.empty-sub {
  font-size: 11.5px;
  color: var(--muted);
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Helpers ────────────────────────────────────────────────────────────── */
.text-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* Coluna numerica: alinha a direita + tabular p/ comparar magnitude vertical.
   Aplicar .num nas colunas de R$/%/contagem/data das tabelas de trabalho. */
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.text-muted { color: var(--muted); }
.font-mono { font-family: var(--font-mono); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }

/* ── Tooltip rápido ──────────────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text);
  color: var(--on-brand);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.15s;
  z-index: 100;
}
[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive básico ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 64px; }
  .sidebar-brand-text, .sidebar-brand-sub,
  .nav-item span:not(.lucide):not(.nav-badge),
  .nav-section-title,
  .search-trigger span { display: none; }
  .nav-item { justify-content: center; padding: 9px; }
  .nav-item.active::before { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ADDITIONS — Bloco 2-6
   Tables, Modals, Forms, Sliders, Tabs
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
/* Container com ALTURA -> o overflow-y vira scroll interno e o thead sticky gruda de
   fato (antes so overflow-x, o sticky se ancorava na pagina e o header sumia ao rolar
   Log/Pipeline/DD com 50+ linhas). max-height so limita tabelas altas; curtas ficam no
   tamanho natural. Fase 4 do design-review. */
.table-scroll { overflow: auto; max-height: calc(100vh - 220px); }
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tbl thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.tbl tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.tbl tbody tr:last-child td { border-bottom: none; }
/* Zebra: alterna linhas p/ o olho nao perder a linha em tabelas de 10-18 colunas.
   No <tr> (nao no <td>) p/ o hover, que vem depois, vencer no empate de especificidade. */
.tbl tbody tr:nth-child(even) { background: var(--row-stripe); }
.tbl tbody tr { transition: background var(--dur-fast); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.row-clickable { cursor: pointer; }
.tbl-empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.form-grid .full { grid-column: 1 / -1; }
/* Responsivo (Fase 5 do design-review): grids de coluna FIXA colapsam em telas estreitas
   (13"/iPad), onde hoje os campos/stats espremem ou transbordam. ADITIVO — o desktop
   (acima do breakpoint) fica inalterado. */
@media (max-width: 1100px) {
  .am-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .rating-grid { grid-template-columns: 1fr; }
  .am-stats { grid-template-columns: repeat(2, 1fr); }
}
.fg-label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}
.fg-required {
  color: var(--red);
  margin-left: 2px;
}
.fg-input,
.fg-textarea,
.fg-select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  transition: all .12s;
}
.fg-input:focus,
.fg-textarea:focus,
.fg-select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.1);
}
/* Campo de texto longo. 64px dava ~2,5 linhas: pouco pra nota de reuniao, que e o
   conteudo principal do formulario (e nao um campo acessorio como os inputs ao lado).
   Base sobe pra ~3,5 linhas com corpo de leitura (13px/1.65); os modificadores
   escalonam a altura INICIAL por importancia do campo. Acima disso quem manda e o
   auto-grow (autoGrow em app.js), que cresce conforme o usuario digita. */
.fg-textarea {
  min-height: 84px;
  resize: vertical;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
}
.fg-textarea-lg { min-height: 132px; }   /* campo secundario de texto corrido (red flags) */
.fg-textarea-xl { min-height: 220px; }   /* campo principal da tela (pontos discutidos) */
.fg-help {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Tabs (sub-navegação) ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  background: transparent;
}
.tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .12s;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
  font-weight: 600;
}
.tab .lucide { width: 14px; height: 14px; }
.tab .badge {
  background: var(--bg-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 25, 41, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  display: none;
  overflow-y: auto;
  padding: 40px 16px;
  animation: backdropIn .25s;
}
.modal-backdrop.show { display: block; }
@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalIn .3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-lg { max-width: 980px; }
.modal-sm { max-width: 480px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--navy);
  color: var(--on-brand);
}
.modal-header.modal-header-roxo { background: var(--roxo); }
.modal-header.modal-header-amber { background: var(--amber); }
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.modal-subtitle {
  font-size: 11.5px;
  opacity: 0.7;
  margin-top: 3px;
}
.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--on-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s;
  border: none;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.22); }
.modal-close .lucide { width: 16px; height: 16px; }
.modal-body {
  padding: 20px 22px;
  max-height: 70vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.modal-fb {
  margin-right: auto;
  font-size: 11.5px;
  color: var(--muted);
}

/* ── Asset 360° ─────────────────────────────────────────────────────────── */
/* Cabecalho de secao do Asset 360 — extraido de 6 estilos inline identicos (Fase 5).
   var(--fs-caption)=11px e var(--fw-bold)=700: MESMA aparencia, agora tokenizada. */
.am-sec-h {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy);
}
/* Grid de cards de KPI do Asset 360 — extraido de 6 inline identicos (Fase 5).
   auto-fit ja e' responsivo; gap 12px = var(--space-3). Mesma aparencia. */
.am-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-3);
}
/* Estados de vazio/erro do Asset 360 — extraidos de inline identicos (Fase 5).
   Os 2 grupos de empty (--muted e --gray-500) sao identicos agora que --gray-500=--muted. */
.am-empty-c { text-align: center; padding: 40px; color: var(--muted); }
.am-err     { padding: 20px; color: var(--red); }
/* Valor de KPI (numero grande) e card do Asset 360 — extraidos de inline identicos.
   #fff -> var(--surface) (mesma cor, pronto p/ dark mode). Mesma aparencia. */
.am-kpi-val { font-size: 20px; font-weight: var(--fw-heavy); color: var(--navy); margin: 6px 0 4px; min-height: 24px; }
.am-card    { background: var(--surface); border-radius: 8px; border: 1px solid var(--border); padding: 14px 16px; }
/* Prosa da ficha qualitativa (descricao expandida, tese, alavancas, rotas de
   saida). Extraida dos dois inline identicos de Estrategia/Observacoes em
   ativos.js — mesmo movimento que gerou .am-sec-h e .am-card acima.

   `color` DECLARADO junto com o fundo, de proposito: sem ele o texto herda
   var(--text) e o bloco fica claro-no-claro no tema escuro, que foi o que
   aconteceu com o preview do e-mail e com a aba Documentos da lamina.
   var(--surface-2) tem par no [data-theme="dark"], entao a regra troca sozinha.

   `pre-wrap` porque o texto vem do xlsx como texto puro: a quebra de paragrafo
   que o analista digitou e' a unica formatacao que existe, e sem isto ela some
   e a tese vira um paragrafo unico de 2.000 caracteres. */
.am-prosa {
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  background: var(--surface-2);
  color: var(--text);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--r);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Grade curta da ficha: os campos que cabem numa linha (perfil de origem,
   concentracao, taxas). Mesmas 3 colunas da grade de Informacoes, aqui com
   minmax para nao espremer rotulo longo em tela estreita. */
.am-ficha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
/* ── Ficha do ativo: a HIERARQUIA ────────────────────────────────────────────
   A primeira versao desenhava tudo com o mesmo peso: uma grade de campos curtos
   (particionada por COMPRIMENTO do valor, nao por assunto) e depois oito blocos
   de prosa identicos. O leitor via "Setores alvo" antes de saber o que o fundo
   E', e a tese central tinha exatamente o mesmo destaque que o perfil de origem.

   O que muda aqui nao e' aparencia: e' a ordem em que as quatro perguntas de
   comite sao respondidas — o que e' / por que ganhamos dinheiro / o que ele
   pode comprar / quanto custa.

   Sete degraus a partir de quatro tamanhos e tres pesos, sem cor nova. */
.am-ficha       { border-top: 1px solid var(--border); padding-top: var(--space-4); margin-bottom: var(--space-5); }
.am-ficha-grupo { margin-bottom: var(--space-5); }
/* Regra DESCENDENTE de proposito: `.am-sec-h` e' de toda a lamina (Sizing,
   Drawdown, Estimates) e por um fio nela seis telas mudariam de cara. */
.am-ficha-grupo > .am-sec-h {
  display: block;
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3);
}
/* O lead: a frase que diz o que o veiculo E'. SEM fundo, de proposito — e' o
   unico paragrafo sem caixa da secao, e e' dai que vem o destaque. Nao fixar
   fundo e' tambem nao ter de fixar cor (DESENVOLVIMENTO.md 6). */
.am-ficha-lead {
  font-size: var(--fs-md);
  line-height: var(--lh-base);
  font-weight: var(--fw-medium);
  color: var(--text);
  margin-bottom: var(--space-3);
}
/* COMPOE com .am-prosa em vez de substitui-la: quem tem o par fundo+cor e' a
   .am-prosa, e ela ja troca sozinha no dark. Aqui entra so' o fio. */
.am-prosa-destaque { border-left: 3px solid var(--navy); }
.am-ficha-bloco    { margin-bottom: var(--space-3); }
/* Rotulo de campo em var(--fs-caption) = 11px, e nao nos 9,5px hardcoded da
   primeira versao: o proprio design system declara 11px como piso para texto
   que carrega informacao. */
.am-ficha-k   { font-size: var(--fs-caption); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: var(--space-1); }
.am-ficha-v   { font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--text); }
.am-ficha-d   { font-size: var(--fs-sm); line-height: var(--lh-base); color: var(--text-2); margin-top: var(--space-1); }
.am-ficha-txt { font-size: var(--fs-base); line-height: var(--lh-base); color: var(--text); }
.am-ficha-ate { color: var(--muted); font-weight: var(--fw-regular); padding: 0 var(--space-1); }
/* Taxa: o valor e a clausula sao UMA informacao. Na primeira versao o valor
   ficava numa grade no topo e o detalhe seis blocos abaixo. minmax maior que os
   180px da .am-ficha-grid porque o terceiro campo e' uma frase inteira. */
.am-ficha-termos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
/* Meritos | Riscos | Mitigantes lado a lado: o mitigante se le AO LADO do risco.
   240px de minimo: abaixo disso (celular) as tres colunas empilham sozinhas, na
   mesma ordem — sem media query. */
/* TEXTO EM ITENS (29/09): lista digitada no Excel continua lista. A divisao vem
   pronta da rota (em_itens); aqui so' o feitio. Marcador e numero em --muted:
   quem carrega a informacao e' o texto do item. */
.am-ficha-par { margin: 0 0 var(--space-2); }
.am-ficha-par:last-child { margin-bottom: 0; }
.am-ficha-lista { margin: 0 0 var(--space-2); padding-left: 1.25em; }
.am-ficha-lista:last-child { margin-bottom: 0; }
.am-ficha-lista > li { margin-bottom: var(--space-1); line-height: var(--lh-base); }
.am-ficha-lista > li::marker { color: var(--muted); }
/* numero ORIGINAL ("a.", "ii.") e nao o contador do <ol>: a lista pode comecar
   em "b)" ou usar letras, e renumerar seria mudar o texto do analista */
ol.am-ficha-lista { list-style: none; padding-left: 1.6em; }
ol.am-ficha-lista > li[data-n]::before { content: attr(data-n); color: var(--muted); display: inline-block; width: 1.6em; margin-left: -1.6em; }
/* fallback sem itens: a quebra digitada nao some (so' .am-prosa tinha pre-wrap) */
.am-ficha-lead, .am-ficha-txt, .am-ficha-d { white-space: pre-line; }
.am-ficha-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
/* coluna em flex: as tres caixas terminam na mesma linha, com textos de tamanhos diferentes */
.am-ficha-col  { min-width: 0; display: flex; flex-direction: column; }
.am-ficha-col > .am-prosa { flex: 1; }
/* Fundo fixo declara a cor na MESMA regra (DESENVOLVIMENTO.md 6). --surface-2 e --text
   tem par no [data-theme="dark"], entao a caixa troca sozinha. */
.am-ficha-termo  { background: var(--surface-2); color: var(--text); border-radius: var(--r); padding: var(--space-3) var(--space-4); }
.am-ficha-det > summary { font-size: var(--fs-caption); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .06em; color: var(--navy); cursor: pointer; margin-bottom: var(--space-2); }
.am-stats {
  display: grid;
  /* 6 colunas desde que a faixa ganhou o card de retorno (Retorno 12m / TVPI):
     era 5 e o 6o quebrava numa segunda linha sozinho, com a borda direita solta.
     auto-fit desde 30/09: o card "Framework" (so' aparece quando ha' macro) e'
     o 7o e, com 6 fixas, o TVPI caia sozinho numa segunda linha. */
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.am-stat {
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid var(--border);
}
.am-stat:last-child { border-right: none; }
.am-stat-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.am-stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ── Mode/Pill switcher (Log: Portfólio/Pipeline/Livre) ───────────────── */
.pill-group {
  display: inline-flex;
  background: var(--bg-2);
  padding: 3px;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.pill {
  padding: 6px 14px;
  background: none;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pill:hover { color: var(--text); }
.pill.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.pill .lucide { width: 13px; height: 13px; }

/* ── Rating Sliders ─────────────────────────────────────────────────────── */
.rating-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.rating-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px;
}
.rating-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.rating-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
}
.rating-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rating-help {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 4px;
  display: block;
}
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--navy);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--navy);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.rating-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--navy), var(--navy-l));
  color: var(--on-brand);
  padding: 14px 18px;
  border-radius: var(--r);
  margin-top: 14px;
}
.rating-summary-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.rating-summary-label {
  font-size: 10px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Sentimento Chips (Pipeline) ────────────────────────────────────────── */
.sent-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sent-btn {
  padding: 7px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.sent-btn:hover { border-color: var(--muted-2); }
.sent-btn.active {
  border-width: 2px;
}
.sent-btn[data-val="Positivo"].active   { background: var(--green-l); color: var(--green); border-color: var(--green); }
.sent-btn[data-val="Construtivo"].active{ background: rgba(15,52,96,0.08); color: var(--navy); border-color: var(--navy); }
.sent-btn[data-val="Neutro"].active     { background: var(--bg-2); color: var(--muted); border-color: var(--muted); }
.sent-btn[data-val="Atenção"].active    { background: var(--amber-l); color: var(--amber); border-color: var(--amber); }
.sent-btn[data-val="Monitoramento"].active { background: var(--red-l); color: var(--red); border-color: var(--red); }
/* Dica de cor SEMPRE-visivel por sentimento (substitui o emoji removido; a cor reforca,
   o texto do botao carrega o significado — WCAG 1.4.1). */
.sent-btn.sent-positivo      { border-left: 3px solid var(--pos); }
.sent-btn.sent-construtivo   { border-left: 3px solid var(--navy); }
.sent-btn.sent-neutro        { border-left: 3px solid var(--muted-2); }
.sent-btn.sent-atencao       { border-left: 3px solid var(--amber); }
.sent-btn.sent-monitoramento { border-left: 3px solid var(--neg); }

/* ── Cobertura (timeline) ───────────────────────────────────────────────── */
.cob-row {
  display: grid;
  grid-template-columns: 200px 80px 1fr 100px;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background .12s;
}
.cob-row:hover { background: var(--surface-2); }
.cob-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cob-bar {
  background: var(--bg-2);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.cob-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cob-bar-fill.verde    { background: var(--green); }
.cob-bar-fill.amarelo  { background: var(--amber); }
.cob-bar-fill.vermelho { background: var(--red); }

/* ── Inherited tag (DD form) ────────────────────────────────────────────── */
.inherited-tag {
  font-size: 9px;
  background: rgba(74, 26, 107, 0.1);
  color: var(--roxo);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 5px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── Quick search ───────────────────────────────────────────────────────── */
.qs-modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 25, 41, 0.55);
  backdrop-filter: blur(6px);
  z-index: 9500;
  padding: 80px 16px 16px;
  display: none;
}
.qs-modal.show { display: block; }
.qs-box {
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalIn .25s cubic-bezier(0.16, 1, 0.3, 1);
}
.qs-input-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.qs-input-row .lucide { width: 16px; height: 16px; color: var(--muted); }
.qs-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--text);
}
.qs-results {
  max-height: 480px;
  overflow-y: auto;
}
.qs-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background .12s;
}
.qs-item.active { background: var(--bg-2); }
.qs-item:hover { background: var(--surface-2); }
.qs-item .lucide { width: 16px; height: 16px; color: var(--muted); }
.qs-footer {
  padding: 8px 14px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: 10.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
/* consolidado.css — anexar ao fim de static/css/styles.css */
/* Contem o deck numa coluna central: sem isso os cards full-width (cs-span3) e o treemap
   esticam ate a borda da janela em telas largas — o que deixa os graficos com ar "esticado". */
#page-consolidado{max-width:1240px;margin-inline:auto}
.cs-top{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.cs-sel{padding:7px 12px;border:1px solid #d4dae1;border-radius:8px;font-size:13px;font-weight:600;color:var(--navy-l);background:var(--surface)}
.cs-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.cs-card{background:var(--surface);border:1px solid #e7ebef;border-radius:12px;padding:16px 18px;box-shadow:0 1px 3px rgba(10,35,66,.04)}
.cs-span2{grid-column:span 2}.cs-span3{grid-column:span 3}
.cs-h{font-size:13px;font-weight:800;color:var(--navy-d);text-transform:uppercase;letter-spacing:.04em;margin-bottom:14px;display:flex;justify-content:space-between;align-items:baseline}
.cs-mut{color:#8a95a1;font-weight:500;font-size:12px}
.cs-donut-wrap{display:flex;gap:20px;align-items:center;flex-wrap:wrap}
.cs-donut-c1{font-size:30px;font-weight:800;fill:var(--navy)}
.cs-donut-c2{font-size:11px;fill:#8a95a1}
.cs-leg-wrap{display:flex;flex-direction:column;gap:7px}
.cs-leg{font-size:13px;color:var(--navy-l)}
.cs-dot{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:7px;vertical-align:middle}
.cs-rating-num{font-size:46px;font-weight:800;line-height:1.05}
.cs-cob-bar{height:7px;background:var(--border);border-radius:4px;margin:10px 0 6px;overflow:hidden}
.cs-cob-bar i{display:block;height:100%;border-radius:4px}
.cs-scale{display:flex;align-items:center;gap:6px;font-size:11px;color:#8a95a1;margin-top:8px}
.cs-grad{display:inline-block;width:120px;height:8px;border-radius:4px;background:linear-gradient(90deg,rgba(15,52,96,.9),var(--border),rgba(192,57,43,.9))}
.cs-empty{padding:22px;text-align:center;color:#8a95a1;font-size:13px}
/* Pares fortes que nao cabem no heatmap (cortado em 24 por largura de tela).
   Sao concentracao de risco real, entao vao por escrito e nao somem no corte. */
.cs-pares{margin-top:10px;border-top:1px solid var(--border);padding-top:8px}
.cs-par{display:flex;align-items:center;gap:8px;font-size:12px;padding:2px 0}
.cs-par>span:first-child{flex:1;color:var(--navy-l)}
.cs-par>b{font-variant-numeric:tabular-nums}
@media(max-width:900px){.cs-grid{grid-template-columns:1fr}.cs-span2,.cs-span3{grid-column:span 1}}

/* ═══ Estimates — tela PERFORMANCE | ESTIMATES ═══════════════════════════════
   Duas tabelas lado a lado (mes fechado x mais atualizado). Formatacao minima,
   sem grid visivel: so o filete do cabecalho separa. Cor SO no numero (positivo
   verde / negativo vermelho) — nome e data ficam no texto padrao, como no deck.
   Tokens do design system (nada de hex solto) p/ o dark mode vir de graca. */
.est-banner {
  background: var(--navy);
  color: var(--on-brand);
  text-align: center;
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: var(--fs-md);
  font-weight: var(--fw-heavy);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.est-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
.est-col { min-width: 0; }
.est-col-h {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-align: center;
  padding: 7px 10px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: var(--space-2);
}
.est-col-sub { font-size: var(--fs-caption); color: var(--muted); text-align: center; margin-bottom: var(--space-3); }
.est-tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.est-tbl th {
  padding: 6px 8px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.est-tbl th:first-child, .est-tbl td:first-child { text-align: left; }
.est-tbl th.est-num, .est-tbl td.est-num { text-align: right; }
.est-tbl th.est-dt, .est-tbl td.est-dt { text-align: center; }
/* A MINHA LISTA da aba Estimates: suspensa com o universo inteiro e uma caixa
   por fundo. É curadoria — escolhe o que aparece, não muda número nenhum.

   `--surface` e `--text` juntos: fundo fixo sem cor de texto herda `var(--text)`
   e o bloco fica branco no branco no tema escuro (o caso do preview de e-mail e
   da aba Documentos). Se fixar o fundo, fixe o texto junto. */
.est-lista-wrap { position: relative; display: inline-block; }
.est-lista-pop {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  width: 320px; max-width: 90vw; padding: 8px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.est-lista-itens { max-height: 320px; overflow-y: auto; margin-top: 6px; }
.est-lista-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px; font-size: var(--fs-sm); cursor: pointer; border-radius: 4px;
}
.est-lista-item:hover { background: var(--surface-2, rgba(127,127,127,.12)); }
.est-lista-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-lista-rodape {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.est-tbl td { padding: 5px 8px; color: var(--text); border: none; }
.est-tbl tbody tr { cursor: pointer; transition: background var(--dur-fast); }
.est-tbl tbody tr:hover { background: var(--surface-2); }
.est-fundo { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.est-pos { color: var(--pos); }
.est-neg { color: var(--neg); }
.est-flag { font-size: var(--fs-caption); color: var(--amber); margin-left: 4px; }
.est-vazio { padding: 22px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
/* Avisos do service (serie mensal defasada, perna de moeda, mes suprimido): texto
   corrido, discreto — e' nota de rodape da base, nao alerta de acao imediata. */
.est-avisos-bloco { margin-bottom: var(--space-3); }
.est-aviso { display: flex; gap: 6px; align-items: flex-start; font-size: var(--fs-caption); line-height: 1.45; padding: 1px 0; }
.est-aviso i { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 2px; }
/* Diagnóstico: uma seção por CULPADO (precalc / sync / cadastro), porque o
   conserto de cada um é em lugar diferente. */
.est-diag-topo {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  font-size: var(--fs-caption); color: var(--muted);
  padding-bottom: var(--space-3); margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.est-diag-sec { margin-bottom: var(--space-5); }
.est-diag-h {
  font-size: var(--fs-caption); font-weight: var(--fw-bold); color: var(--navy);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px;
}
.est-diag-sub { font-size: var(--fs-caption); color: var(--muted); line-height: 1.45; margin-bottom: var(--space-3); }
.est-diag-ok { font-size: var(--fs-sm); color: var(--muted); padding: 6px 0; }
.est-diag-corte {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  font-size: var(--fs-sm); padding: 4px 0; border-bottom: 1px solid var(--border);
}
.est-diag-tag { font-size: var(--fs-caption); color: var(--amber); font-weight: var(--fw-bold); }

/* ═══ Acessos (admin) — caixa do link de senha ═══════════════════════════════
   Destaque de propósito: o link é credencial ao portador e aparece uma vez só. */
.acessos-box {
  border: 1px solid var(--navy); border-radius: var(--r-sm);
  background: var(--surface-2); padding: var(--space-4);
}
.acessos-box-h {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: var(--fs-sm); color: var(--text); margin-bottom: var(--space-3);
}
.acessos-box-h i { width: 15px; height: 15px; color: var(--navy); }
.acessos-ttl {
  font-size: var(--fs-caption); color: var(--muted); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: .06em;
}
.acessos-acoes {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: var(--space-3);
}
.acessos-nota { font-size: var(--fs-caption); color: var(--muted); line-height: 1.45; flex: 1 1 240px; }
/* Fundo sem ponto de dado: fica visivel (com o motivo no tooltip) em vez de sumir
   da lista — ausencia silenciosa foi o que escondeu o problema no 1o uso. */
.est-tbl tbody tr.est-sem-dado td { color: var(--muted); font-style: italic; }
@media (max-width: 1100px) { .est-grid { grid-template-columns: 1fr; } }
/* ── Editor de texto formatado do log (rich-editor.js) ───────────────────── */
/* Sem CSS proprio o contenteditable nao se parece com campo: fica um bloco sem
   borda, sem foco visivel e sem area minima — o usuario nao percebe onde clicar. */
.re-wrap { border:1px solid var(--border); border-radius:var(--r); background:var(--surface); }
.re-toolbar { display:flex; align-items:center; gap:2px; padding:4px 6px;
              border-bottom:1px solid var(--border); background:var(--surface-2);
              border-radius:var(--r) var(--r) 0 0; }
.re-btn { display:inline-flex; align-items:center; justify-content:center;
          width:26px; height:26px; border:0; background:transparent; cursor:pointer;
          border-radius:4px; color:var(--muted); }
.re-btn:hover { background:var(--surface); color:var(--text); }
.re-btn i { width:14px; height:14px; }
.re-sep { width:1px; height:16px; background:var(--border); margin:0 4px; }
.re-status { margin-left:auto; font-size:11px; color:var(--muted); padding-right:4px; }
.re-area { min-height:150px; max-height:460px; overflow-y:auto; padding:10px 12px;
           font-size:12px; line-height:1.6; outline:none; }
.re-area:empty:before { content:attr(data-placeholder); color:var(--muted); }
.re-area:focus { box-shadow:inset 0 0 0 2px var(--accent, #2563eb22); }
/* A imagem NAO manda no layout.
   `max-width:100%` sozinho so resolve a largura: uma captura de tela em pe
   (1000x2400) entra com ~2400px de altura e o log inteiro vira a imagem — a
   pauta, os action items e os contatos somem para baixo da dobra.
   O teto de altura mantem a leitura do log e nao esconde nada: `object-fit:
   contain` preserva a proporcao (sem esmagar) e clicar abre em tamanho real.
   O `style="max-width:100%"` que o editor insere NAO chega aqui — o
   sanitizador remove `style`, e com razao. Por isso a regra e' CSS. */
.re-area img, .rich-view img { max-width:100%; height:auto; border-radius:4px;
                               display:block; margin:6px 0; }
.rich-view img { max-height:340px; object-fit:contain; object-position:left;
                 cursor:zoom-in; background:var(--surface); }
/* Conteudo colado de fora pode trazer palavra/URL sem espaco maior que a caixa.
   Sem isto ele empurra a largura e a lamina ganha barra horizontal. */
.rich-view { max-width:100%; overflow-x:auto; overflow-wrap:anywhere; }
.re-area ul, .re-area ol, .rich-view ul, .rich-view ol { padding-left:20px; margin:6px 0; }
/* O container de exibicao herda white-space:pre-wrap do estilo antigo (texto
   puro). Com HTML real isso duplicaria as quebras: o <p> ja quebra, e o \n do
   markup viraria linha em branco extra. */
.rich-view { white-space:normal !important; }
.rich-view p { margin:0 0 6px; }
.rich-view blockquote { margin:6px 0; padding-left:10px; border-left:3px solid var(--border); color:var(--muted); }

/* Item de painel clicavel (Coberturas Vencidas -> lamina do ativo).
   Sem affordance visual o usuario nao descobre que da p/ clicar — foi
   literalmente o relato: "clico e nao acontece nada". */
.pend-item-click { cursor:pointer; border-radius:4px; transition:background .12s; }
.pend-item-click:hover { background:var(--surface-2); }
.pend-item-click:focus-visible { outline:2px solid var(--accent, #2563eb); outline-offset:-2px; }

/* ── Ponte do NAV (components/nav-bridge.js) ────────────────────────────────
   Mora AQUI, e nao num <style> injetado pelo componente: o DESENVOLVIMENTO.md secao 6
   registra o caso do `.btn-mini`, declarado em duas paginas com valores
   diferentes e escopo global — quem renderizasse por ultimo mandava nas duas
   telas. Prefixo `.navb-` proprio: nenhuma classe de outra tela e' reusada
   (o `.est-tbl` emprestado por Acessos e' a outra metade do mesmo defeito). */
.navb-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:12px; }
.navb-kpi  { background:var(--surface-2); border:1px solid var(--border); border-radius:6px; padding:8px 10px; }
.navb-kpi-l { font-size:9px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); display:flex; align-items:center; gap:5px; }
.navb-kpi-v { font-size:15px; font-weight:700; color:var(--text); margin-top:3px; font-variant-numeric:tabular-nums; }
.navb-sw    { width:9px; height:9px; border-radius:2px; flex:0 0 auto; }
.navb-leg   { display:flex; flex-wrap:wrap; gap:4px 14px; font-size:10px; color:var(--muted); align-items:center; }
.navb-leg span { display:inline-flex; align-items:center; gap:5px; }
/* Dois controles, dois eixos DIFERENTES, e o estilo e' o mesmo de proposito:
   `.am-esc` escolhe a JANELA de tempo da aba inteira (governa os quatro
   graficos); `.navb-gran` escolhe a GRANULARIDADE das barras da ponte dentro
   dessa janela. Um nao substitui o outro — 3 anos em barra mensal e 3 anos em
   barra trimestral sao a mesma janela com leituras diferentes. */
.navb-gran, .am-esc  { display:flex; gap:4px; }
.navb-gran button, .am-esc button {
  font-size:10px; font-weight:600; padding:3px 9px; border-radius:var(--r-pill);
  border:1px solid var(--border); background:var(--surface); color:var(--muted); cursor:pointer;
}
.navb-gran button[aria-pressed="true"], .am-esc button[aria-pressed="true"] {
  background:var(--navy); border-color:var(--navy); color:var(--on-brand);
}
.navb-gran button:focus-visible, .am-esc button:focus-visible { box-shadow:var(--focus-ring); outline:none; }
.navb-nota  { font-size:10px; color:var(--muted); margin-top:8px; line-height:1.5; }
.navb-nota strong { color:var(--amber); font-weight:700; }
/* A tabela nao e' anexo: e' o "relief" que o passo de acessibilidade exige de
   um grafico cujas cores de barra ficam abaixo de 3:1 contra a superficie —
   quem nao distingue as tintas le os mesmos numeros aqui. */
.navb-det   { margin-top:10px; }
.navb-det > summary { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--navy); cursor:pointer; }
.navb-det > summary:focus-visible { box-shadow:var(--focus-ring); outline:none; border-radius:4px; }
.navb-tbl   { width:100%; border-collapse:collapse; font-size:11px; margin-top:8px; font-variant-numeric:tabular-nums; }
.navb-tbl th { padding:5px 7px; text-align:right; font-weight:600; color:var(--muted); background:var(--bg-2); position:sticky; top:0; }
.navb-tbl th:first-child, .navb-tbl td:first-child { text-align:left; }
.navb-tbl td { padding:4px 7px; text-align:right; border-top:1px solid var(--border); color:var(--text-2); }
.navb-tbl tfoot td { font-weight:700; color:var(--text); border-top:2px solid var(--border-strong); }
.navb-wrap-tbl { max-height:260px; overflow:auto; }
@media (max-width: 760px) { .navb-kpis { grid-template-columns:repeat(2,1fr); } }

/* ── Cesta de ativos (pages/cesta.js) ─────────────────────────────────────
   Classes .cst-* so' desta tela: CSS de pagina mora aqui, e uma tela nunca usa
   a classe de outra (DESENVOLVIMENTO.md 6). */
.cst-topo      { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-start; margin-bottom: var(--space-4); }
.cst-seletor   { position: relative; flex: 1 1 320px; min-width: 260px; }
.cst-busca     { width: 100%; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text); font-size: var(--fs-sm); }
.cst-lista     { position: absolute; z-index: 20; left: 0; right: 0; max-height: 320px; overflow: auto; margin-top: var(--space-1); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.cst-opcao     { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-2) var(--space-3); font-size: var(--fs-sm); cursor: pointer; }
.cst-opcao:hover { background: var(--surface-2); }
.cst-opcao small { color: var(--muted); margin-left: auto; }
.cst-chips     { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.cst-chip      { display: inline-flex; align-items: center; gap: var(--space-1); padding: 2px var(--space-2); border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); }
.cst-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: var(--fs-sm); padding: 0 2px; }
/* canto reto do lado da borda: com o raio nos 4 cantos o filete ambar curva
   e le-se como um parentese */
.cst-aviso     { padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); border-left: 3px solid var(--amber); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); border-radius: 0 var(--r) var(--r) 0; }
/* Tabela e grafico rolam DENTRO da propria caixa. Medido a 390px: a tabela
   por ativo (6 colunas) cortava o drawdown e fazia a PAGINA inteira rolar de
   lado, e o grafico encolhia ate o texto ficar com ~5px. O min-width do
   grafico e' o menor em que os rotulos continuam legiveis. */
.cst-rolagem   { overflow-x: auto; margin-bottom: var(--space-4); }
.cst-rolagem > .cst-tabela { margin-bottom: 0; }
.cst-tabela    { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); color: var(--text); margin-bottom: var(--space-4); }
.cst-tabela th { text-align: right; font-size: var(--fs-caption); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: var(--space-2); border-bottom: 1px solid var(--border); }
.cst-tabela th:first-child, .cst-tabela td:first-child { text-align: left; }
.cst-tabela td { text-align: right; padding: var(--space-2); border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.cst-na        { color: var(--muted); }
/* Titulo de secao desta tela. Mesmo desenho do .am-sec-h da lamina, mas
   PROPRIO: usar a classe da lamina aqui faria um ajuste la' mudar esta tela
   sem nada reclamar. */
.cst-sec-h     { font-size: var(--fs-caption); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .06em; color: var(--navy); }
/* "Retornos por Periodo": o bloco de cards da aba Retornos (amRenderTWR),
   com as mesmas medidas, em classes proprias. */
.cst-periodo   { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: var(--space-4); }
.cst-periodo-topo { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: 10px; }
.cst-periodo-meta { font-size: 10px; color: var(--muted); }
.cst-periodo-nota { font-size: 9px; color: var(--muted); text-align: right; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 6px; }
.cst-cards-linha { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cst-cards-rot { font-size: 10px; font-weight: 700; color: var(--muted); min-width: 42px; text-transform: uppercase; }
.cst-cards     { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 6px; flex: 1; }
.cst-card      { background: var(--bg); padding: 8px 10px; border-radius: 5px; border: 1px solid var(--border); text-align: center; }
.cst-card-lab  { font-size: 9px; color: var(--muted); font-weight: 600; }
.cst-card-val  { font-size: 16px; font-weight: 800; margin-top: 2px; }
.cst-card-desde { font-size: 10px; color: var(--muted); margin-top: 2px; }
.cst-card-defasada { color: var(--amber); }
/* Blocos da aba Retornos na cesta: as medidas de amRenderTWR, amChartAcum,
   amRenderDrawdown e amRenderVolRolling, em classes proprias. */
/* o grafico tem largura minima legivel; em tela estreita ele rola DENTRO do
   card, e a pagina nao rola de lado */
.cst-bloco     { margin-bottom: var(--space-4); overflow-x: auto; }
.cst-periodo   { overflow-x: auto; }
.cst-periodo-dir { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cst-bench     { font-size: 10px; color: var(--muted); }
.cst-bench select { font-size: 10px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 4px; color: var(--navy); background: var(--surface); }
.cst-bench-x   { font-size: 11px; line-height: 1; margin-left: 4px; padding: 2px 5px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); background: var(--surface); cursor: pointer; }
.cst-card-bm   { font-size: 10px; color: var(--muted); }
.cst-acum      { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.cst-acum-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-wrap: wrap; gap: 6px; }
.cst-acum-esq  { display: flex; align-items: center; gap: 10px; }
.cst-acum-leg  { display: flex; gap: 14px; font-size: 10px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.cst-graf-tit  { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.cst-graf-cab  { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cst-graf-dir  { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cst-svg       { width: 100%; min-width: 560px; height: auto; display: block; background: var(--bg); }
.cst-mtz-dir   { display: flex; align-items: center; gap: 12px; }
.cst-mtz .cst-mtz-bm { text-align: right; padding: 6px 8px; font-weight: 600; color: var(--muted); min-width: 60px; }
.cst-mtz .cst-mtz-dl { text-align: right; padding: 6px 8px; font-weight: 700; min-width: 60px; }
.cst-mtz th.cst-mtz-dl { color: var(--navy); }
.cst-nota-mtz  { font-size: 10px; color: var(--muted); margin-top: 8px; }
/* Montar por agregador + recalculo automatico */
.cst-agr       { margin: 0 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: var(--space-2) var(--space-3); }
.cst-agr > summary { font-size: var(--fs-caption); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .06em; color: var(--navy); cursor: pointer; }
.cst-agr > summary:focus-visible { box-shadow: var(--focus-ring); outline: none; border-radius: 4px; }
.cst-agr-campos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-2); margin-top: var(--space-2); }
.cst-agr-campos select { width: 100%; }
.cst-agr-acoes { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-2); }
.cst-agr-n     { font-size: var(--fs-sm); color: var(--text); font-weight: 600; }
.cst-status    { min-height: 16px; font-size: var(--fs-caption); color: var(--muted); margin: 0 0 var(--space-2); }
.cst-carregando { opacity: .55; transition: opacity .15s; pointer-events: none; }
/* Composicao do NAV: as medidas da ponte da aba (.navb-*), em classes proprias. */
.cst-pkpis     { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.cst-pkpis-5   { grid-template-columns: repeat(5, 1fr); }
.cst-pkpi      { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; }
.cst-pkpi-l    { font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.cst-pkpi-v    { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 3px; font-variant-numeric: tabular-nums; }
.cst-psw       { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 auto; display: inline-block; }
.cst-pleg      { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 10px; color: var(--muted); align-items: center; margin-bottom: 6px; }
.cst-pleg span { display: inline-flex; align-items: center; gap: 5px; }
.cst-pnota     { font-size: 10px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.cst-pnota strong { color: var(--amber); font-weight: 700; }
.cst-pdet      { margin-top: 10px; }
.cst-pdet > summary { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--navy); cursor: pointer; }
.cst-pdet > summary:focus-visible { box-shadow: var(--focus-ring); outline: none; border-radius: 4px; }
.cst-pwrap     { max-height: 260px; overflow: auto; }
.cst-ptbl      { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.cst-ptbl th   { padding: 5px 7px; text-align: right; font-weight: 600; color: var(--muted); background: var(--bg-2); position: sticky; top: 0; }
.cst-ptbl th:first-child, .cst-ptbl td:first-child { text-align: left; }
.cst-ptbl td   { padding: 4px 7px; text-align: right; border-top: 1px solid var(--border); color: var(--text-2); }
.cst-ptbl tfoot td { font-weight: 700; color: var(--text); border-top: 2px solid var(--border-strong); }
@media (max-width: 760px) { .cst-pkpis, .cst-pkpis-5 { grid-template-columns: repeat(2, 1fr); } }
/* Seletor de janela dos graficos: o mesmo desenho do .am-esc da aba. */
.cst-esc       { display: flex; gap: 4px; }
.cst-esc button { font-size: 10px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; }
.cst-esc button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-brand); }
.cst-esc button:focus-visible { box-shadow: var(--focus-ring); outline: none; }
/* Data-filtro e moeda: rotulo em cima, controle embaixo, como a aba Retornos. */
.cst-campo     { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-caption); color: var(--muted); }
.cst-campo input, .cst-campo select { padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text); font-size: var(--fs-sm); }
/* Matriz ano x mes: o mesmo desenho da aba Retornos da lamina (tamanho,
   espacamento, cabecalho, coluna ANO com filete), em classes proprias. A cor
   da celula e' calculada no JS pela mesma regra da aba. */
.cst-mtz-topo  { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: 0 0 10px; }
.cst-mtz-escala { display: flex; align-items: center; gap: 5px; font-size: 9px; color: var(--muted); }
.cst-mtz-grad  { width: 70px; height: 9px; border-radius: 3px; background: linear-gradient(90deg, rgba(220,53,69,0.6), rgba(220,53,69,0.08), #F8F9FA, rgba(40,167,69,0.08), rgba(40,167,69,0.6)); }
.cst-mtz       { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 11px; }
.cst-mtz th    { padding: 6px 4px; text-align: center; font-weight: 600; color: var(--muted); min-width: 50px; background: var(--bg-2); }
.cst-mtz td    { padding: 6px 4px; text-align: center; font-variant-numeric: tabular-nums; }
.cst-mtz .cst-mtz-ano { text-align: left; padding: 6px 8px; font-weight: 700; color: var(--navy); position: sticky; left: 0; z-index: 1; background: var(--surface); }
.cst-mtz th.cst-mtz-ano { background: var(--bg-2); color: var(--muted); font-weight: 600; }
.cst-mtz .cst-mtz-tot { text-align: right; padding: 6px 8px; font-weight: 700; min-width: 65px; border-left: 2px solid var(--border); }
.cst-mtz th.cst-mtz-tot { color: var(--navy); }
.cst-mtz-cel   { cursor: default; }
.cst-nota      { font-size: var(--fs-caption); color: var(--muted); margin: calc(-1 * var(--space-3)) 0 var(--space-4); }
/* hover: a coluna do mes acende uma linha-guia. Sem JS — o <title> da coluna
   e' o tooltip, e o alvo e' a coluna inteira (maior que o ponto). */
.cst-col .cst-guia { opacity: 0; }
.cst-col:hover .cst-guia { opacity: 1; }

/* ===== Ranking de Retornos (ranking.js): uma linha por ativo, a aba Retornos
   de cada um lado a lado. Cabecalho e as duas primeiras colunas (# e Ativo)
   ficam presos na rolagem — a tabela tem ~25 colunas. Cor da celula de mes:
   a mesma regra da matriz da aba (calculada no JS). */
.rk-filtros    { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2); align-items: end; margin-bottom: var(--space-3); }
.rk-filtros select { width: 100%; }
.rk-busca-campo { min-width: 220px; }
.rk-vazio .btn { margin-left: 4px; }
.rk-resumo     { font-size: var(--fs-sm); color: var(--text-2); margin: 0 0 var(--space-2); }
.rk-aviso      { margin-top: 0; }
.rk-rolagem    { max-height: 72vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); }
.rk-tab        { width: 100%; min-width: 1500px; border-collapse: separate; border-spacing: 0; font-size: 11px; }
.rk-tab th     { position: sticky; top: 0; z-index: 2; padding: 6px 6px; background: var(--bg-2); color: var(--muted); font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; user-select: none; }
.rk-tab th[aria-sort="ascending"], .rk-tab th[aria-sort="descending"] { color: var(--navy); font-weight: 700; }
.rk-tab td     { padding: 5px 6px; border-top: 1px solid var(--border); white-space: nowrap; color: var(--text-2); background-clip: padding-box; }
.rk-tab .rk-num, .rk-tab th.rk-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rk-tab .rk-mes, .rk-tab th.rk-mes { text-align: center; min-width: 52px; font-variant-numeric: tabular-nums; }
.rk-tab .rk-pos { position: sticky; left: 0; z-index: 1; width: 34px; min-width: 34px; text-align: right; color: var(--muted); background: var(--surface); }
.rk-tab .rk-nome { position: sticky; left: 34px; z-index: 1; min-width: 220px; max-width: 280px; white-space: normal; background: var(--surface); border-right: 1px solid var(--border); }
.rk-tab th.rk-pos, .rk-tab th.rk-nome { z-index: 3; background: var(--bg-2); }
.rk-tab .rk-nome small { display: block; color: var(--muted); font-size: 10px; }
.rk-tab .rk-nome div { font-weight: 600; color: var(--text); }
.rk-tab tbody tr:hover td { background-color: var(--surface-2); }
.rk-tab tbody tr:hover td.rk-mes { filter: brightness(0.97); }
.rk-tab .rk-data { color: var(--muted); font-variant-numeric: tabular-nums; }
.rk-tab .rk-larga { outline: 1.5px dotted var(--muted); outline-offset: -3px; }
.rk-tab .rk-est { outline: 1.5px dashed #8A5A00; outline-offset: -2px; }
.rk-e          { color: #8A5A00; }
.rk-tab tr.rk-erro td { color: var(--muted); font-style: italic; }
.rk-tab tfoot td { position: sticky; bottom: 0; background: var(--bg-2); font-weight: 700; border-top: 2px solid var(--border); }
.rk-tab tfoot tr:first-child td { bottom: 26px; }
.rk-tab tfoot .rk-nome, .rk-tab tfoot .rk-pos { z-index: 2; background: var(--bg-2); }
@media (max-width: 640px) {
  .rk-tab .rk-nome { min-width: 150px; }
}

/* ===== Book Private Equity (bookpe.js): previa do slide 13,33x7,5 em escala,
   com as mesmas posicoes do PPTX. O slide e' sempre claro (e' um documento). */
.bpe-check     { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); align-self: flex-end; padding-bottom: 8px; }
.bpe-titulo-campo { min-width: 280px; flex: 1 1 280px; }
.bpe-titulo-campo input { width: 100%; }
.bpe-palco     { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r); padding: var(--space-3); margin-bottom: var(--space-4); }
.bpe-slide-box { position: relative; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #F4F5F7; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.bpe-slide     { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; color: #1F2937; font-family: Aptos, "Segoe UI", Calibri, Arial, sans-serif; }
.bpe-slide .bpe-el { position: absolute; overflow: hidden; }
.bpe-slide table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.bpe-slide td  { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bpe-grade     { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-4); }
.bpe-sec       { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: var(--space-3); min-width: 0; }
.bpe-sec h3    { margin: 0 0 var(--space-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.bpe-sec h4    { margin: var(--space-3) 0 4px; font-size: var(--fs-caption); font-weight: 700; color: var(--text-2); }
.bpe-nota      { font-size: var(--fs-caption); color: var(--muted); margin: 0 0 var(--space-2); }
.bpe-tab       { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.bpe-tab th    { text-align: left; padding: 5px 6px; background: var(--bg-2); color: var(--muted); font-weight: 600; white-space: nowrap; }
.bpe-tab td    { padding: 4px 6px; border-top: 1px solid var(--border); vertical-align: middle; }
.bpe-tab td small { display: block; color: var(--muted); font-size: 10px; }
.bpe-tab select { font-size: 11.5px; padding: 3px 4px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text); }
.bpe-tab tr.bpe-erro td { color: var(--muted); font-style: italic; }
.bpe-sec-txt   { color: var(--muted); font-size: 11px; }
.bpe-hl-bloco  { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
.bpe-hl-cab    { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.bpe-hl-bloco textarea { width: 100%; resize: vertical; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); }
.bpe-tag       { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 4px; color: #FFFFFF; }
.bpe-tag-br    { background: #00A04A; }
.bpe-tag-off   { background: #0E4D6B; }
.bpe-cont      { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.bpe-sec ul    { margin: 0; padding-left: 18px; font-size: var(--fs-caption); color: var(--text-2); }
.bpe-ok        { font-size: var(--fs-caption); color: var(--pos-tx); }
.bpe-fx        { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2); }
.bpe-grade > .bpe-sec:first-child { grid-column: 1 / -1; }
.bpe-commit   { grid-column: 1 / -1; }
.bpe-commit-acoes { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-2) 0; align-items: center; }
.bpe-arquivo  { position: relative; cursor: pointer; }
.bpe-arquivo input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bpe-arquivo:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }
.bpe-commit-resumo { font-size: var(--fs-sm); color: var(--text-2); margin: var(--space-2) 0; }
.bpe-tab .bpe-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bpe-mov-sec   { margin-bottom: var(--space-4); }
.bpe-mov-topo  { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.bpe-mov-topo h3 { margin: 0; }
.bpe-seg       { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.bpe-seg .bpe-seg-on { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }
.bpe-mov-bloco { border-top: 1px solid var(--border); padding-top: var(--space-3); margin-top: var(--space-3); }
.bpe-mov-cab   { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-2); }
.bpe-mov-tot   { margin-left: auto; font-size: var(--fs-caption); color: var(--text-2); font-variant-numeric: tabular-nums; }
.bpe-mov-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.bpe-rk h4     { margin: 0 0 6px; font-size: var(--fs-caption); font-weight: 700; color: var(--text-2); }
.bpe-rk ol     { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bpe-rk li     { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(40px, 1fr) auto; align-items: center; gap: 8px; font-size: 12px; }
.bpe-rk-nome   { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bpe-rk-nome small { display: block; color: var(--muted); font-size: 10.5px; }
.bpe-rk-barra  { height: 8px; background: var(--bg-2); border-radius: 2px; overflow: hidden; }
.bpe-rk-barra > span { display: block; height: 100%; background: var(--navy); border-radius: 2px; }
.bpe-rk-barra > span.bpe-pos { background: var(--pos); }
.bpe-rk-barra > span.bpe-neg { background: var(--neg); }
.bpe-rk-v      { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
.bpe-pos-tx    { color: var(--pos-tx); }
.bpe-neg-tx    { color: var(--neg-tx); }
.bpe-rk-ev li  { grid-template-columns: minmax(0, 1fr) auto; }

/* ===== Movimentacoes (movimentos.js): aportes x entradas por titular e consolidado ===== */
.mv-topo .mv-busca { min-width: 200px; }
.mv-seg        { display: inline-flex; gap: 4px; }
.mv-on         { background: var(--navy) !important; color: #FFFFFF !important; border-color: var(--navy) !important; }
.mv-filtros    { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.mv-dd         { position: relative; }
.mv-dd > summary { list-style: none; cursor: pointer; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; }
.mv-dd > summary::-webkit-details-marker { display: none; }
.mv-dd > summary::after { content: ' ▾'; color: var(--muted); }
.mv-dd[open] > summary { border-color: var(--navy); }
.mv-dd-lista   { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 240px; max-width: min(360px, 90vw); max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: 0 6px 18px rgba(0,0,0,.14); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.mv-dd-lista label { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 4px; font-size: 12.5px; cursor: pointer; color: var(--text); }
.mv-dd-lista label:hover { background: var(--bg-2); }
.mv-dd-lista small { color: var(--muted); font-variant-numeric: tabular-nums; }
.mv-chips      { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: var(--space-2); }
.mv-chip       { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-cards      { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-2); margin-bottom: var(--space-3); }
.mv-card       { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: var(--space-3); display: flex; flex-direction: column; gap: 2px; }
.mv-card span  { font-size: var(--fs-caption); color: var(--muted); font-weight: 600; }
.mv-card b     { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--text); }
.mv-card small { font-size: 11px; color: var(--muted); }
.mv-ent-tx     { color: var(--pos-tx) !important; }
.mv-apo-tx     { color: var(--neg-tx) !important; }
.mv-graf       { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.mv-graf svg   { width: 100%; height: auto; max-height: 240px; display: block; }
.mv-graf-leg   { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mv-lg         { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.mv-lg-ent, .mv-b-ent { background: var(--pos); fill: var(--pos); }
.mv-lg-apo, .mv-b-apo { background: var(--neg); fill: var(--neg); }
.mv-sec        { color: var(--muted); }
.mv-g-eixo     { stroke: var(--border); stroke-width: 1; }
.mv-g-rot      { font-size: 11px; fill: var(--muted); }
.mv-exp        { position: relative; align-self: flex-end; }
.mv-exp > summary { list-style: none; cursor: pointer; }
.mv-exp > summary::-webkit-details-marker { display: none; }
.mv-exp > summary::after { content: ' \25BE'; }
.mv-exp-menu   { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; gap: 4px;
                 min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
                 box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.mv-exp-menu .btn { justify-content: flex-start; text-align: left; width: 100%; }
.mv-abas       { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: var(--space-2); }
.mv-tab td small { display: block; color: var(--muted); font-size: 10.5px; }
.mv-tab th[data-mvsort] { cursor: pointer; user-select: none; }
.mv-mais       { padding: var(--space-2); text-align: center; }
.mv-vazio      { padding: var(--space-4); }

/* ===== Atualizacao dos dados (saude.js): datas por fonte, estado em texto + cor ===== */
.sd-topo       { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.sd-sub        { font-size: var(--fs-sm); color: var(--muted); }
.sd-diag       { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--amber); border-radius: var(--r); padding: var(--space-3); margin-bottom: var(--space-3); }
.sd-diag h3, .sd-bloco h3 { margin: 0 0 var(--space-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.sd-diag ul    { margin: 0 0 var(--space-2); padding-left: 18px; font-size: var(--fs-sm); color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.sd-cards      { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.sd-card       { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: var(--space-3); display: flex; flex-direction: column; gap: 6px; }
.sd-card-cab   { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: var(--fs-sm); color: var(--text); }
.sd-linha      { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); }
.sd-linha b    { color: var(--text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.sd-pill       { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.sd-ok         { background: var(--pos-bg, rgba(40,167,69,.12)); color: var(--pos-tx); }
.sd-atencao    { background: rgba(245, 158, 11, .16); color: #8A5A00; }
.sd-atrasado   { background: rgba(220, 53, 69, .12); color: var(--neg-tx); }
.sd-sem        { background: var(--bg-2); color: var(--muted); }
.sd-bloco      { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: var(--space-3); margin-bottom: var(--space-3); min-width: 0; }
.sd-filtros    { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; margin-bottom: var(--space-2); }
.sd-tab td small { display: block; color: var(--muted); font-size: 10.5px; }
.sd-tab th[data-sdsort] { cursor: pointer; user-select: none; }

/* Atividades: prioridade */
.at-prio-sub   { font-weight: 400; color: var(--muted); font-size: 12px; }
.at-prio-grid  { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .at-prio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.at-nota       { display: flex; flex-direction: column; gap: 2px; }
.at-nota small { color: var(--muted); font-size: 11px; min-height: 28px; }
.at-previa     { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2, rgba(0,0,0,.03)); font-size: 13px; }
.at-como       { margin-top: 8px; font-size: 12px; color: var(--muted); }
.at-como summary { cursor: pointer; }
.at-como p     { margin: 6px 0; }
.at-prio-chip  { border: 0; cursor: pointer; font-weight: 600; }
.at-rever      { color: var(--amber, #b7791f); font-size: 10px; }
.at-editor td  { background: var(--surface-2, rgba(0,0,0,.03)); }

/* ── Framework de acompanhamento (30/09) — aba da lâmina, chips e lista da casa ── */
.fw-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 1px 7px 1px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; line-height: 1.5; vertical-align: middle; font-family: inherit; }
.fw-chip:hover { border-color: var(--navy); }
.fw-chip-bar { width: 26px; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; display: inline-block; }
.fw-chip-bar > span { display: block; height: 100%; background: currentColor; border-radius: 3px; }
.fw-chip-inicio { color: var(--muted); }
.fw-chip-andamento { color: var(--amber); background: var(--amber-l, rgba(245,158,11,.08)); }
.fw-chip-pronto, .fw-chip-concluido { color: var(--green); background: var(--green-l); }
.fw-chip-sem { color: var(--muted); border-style: dashed; font-weight: 600; opacity: .8; }
.fw-chip-sem:hover { opacity: 1; color: var(--navy); }
.fw-vazio-acoes { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.fw-macro { font-size: 12.5px; }
.fw-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.fw-titulo { font-size: 14px; font-weight: 700; color: var(--navy); }
.fw-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fw-prog { margin-bottom: 10px; }
.fw-barra { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.fw-barra > span { display: block; height: 100%; background: var(--navy); border-radius: 4px; transition: width .25s; }
.fw-barra-sm { height: 5px; width: 60px; display: inline-block; vertical-align: middle; margin-right: 6px; }
.fw-prog-txt { font-size: 11.5px; color: var(--text-2); margin-top: 5px; }
.fw-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.fw-toolbar-sep { flex: 1; }
.fw-cat { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); margin-bottom: 8px; }
.fw-cat > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; font-weight: 700; font-size: 12.5px; }
.fw-cat > summary::-webkit-details-marker { display: none; }
.fw-cat > summary::before { content: '\25B8'; font-size: 11px; color: var(--muted); margin-right: 6px; }
.fw-cat[open] > summary::before { content: '\25BE'; }
.fw-cat-nome { flex: 1; }
.fw-cat-prog { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.fw-itens { border-top: 1px solid var(--border); padding: 4px 8px 6px; }
.fw-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; border-bottom: 1px dashed var(--border); }
.fw-item:last-child { border-bottom: 0; }
.fw-item-check { padding-top: 1px; }
.fw-item-check input { width: 15px; height: 15px; cursor: pointer; }
.fw-item-txt { flex: 1; min-width: 0; }
.fw-item-nome { line-height: 1.45; }
.fw-item-feito .fw-item-nome { color: var(--muted); text-decoration: line-through; }
.fw-item-na .fw-item-nome { color: var(--muted); font-style: italic; }
.fw-item-obs { font-size: 11px; color: var(--text-2); margin-top: 2px; white-space: pre-wrap; }
.fw-item-quem { font-size: 10.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.fw-opcional, .fw-avulso { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; margin-left: 4px; vertical-align: middle; }
.fw-na { font-size: 9.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; font-family: inherit; }
.fw-na.on { background: var(--muted); color: #fff; border-color: var(--muted); }
.fw-na:disabled, .fw-item-check input:disabled { cursor: default; opacity: .6; }
.fw-obs-btn { padding: 0 4px; }
.fw-sem-itens { color: var(--muted); font-size: 12px; padding: 10px 4px; }
.fw-outras { font-size: 11px; color: var(--muted); margin-top: 8px; }
.fw-lbl { display: block; font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 4px; }
.fw-hist-l { display: grid; grid-template-columns: 96px 130px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
.fw-hist-q { font-size: 11px; color: var(--muted); }
.fw-hist-quem { font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-tpl-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.fw-tpl { border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 8px; background: var(--surface); }
.fw-tpl > summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; font-size: 12.5px; }
.fw-tpl > summary::-webkit-details-marker { display: none; }
.fw-tpl-itens { border-top: 1px solid var(--border); padding: 6px 12px 10px; }
.fw-tpl-cat-nome { font-weight: 700; font-size: 12px; color: var(--navy); margin: 8px 0 4px; }
.fw-tpl-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; border-bottom: 1px dashed var(--border); }
.fw-tpl-ordem { width: 26px; text-align: right; color: var(--muted); font-size: 11px; }
.fw-tpl-txt { flex: 1; }
.fw-tpl-add { margin-top: 8px; display: flex; gap: 6px; }
.fw-imp-previa { margin-top: 12px; font-size: 12px; line-height: 1.5; padding: 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.fw-imp-erros { color: var(--red); margin-top: 6px; }
.fw-imp-avisos { color: var(--amber); margin-top: 6px; }

/* Cadastro de outro analista (30/09): modal em somente leitura, com o motivo. */
.ent-aviso-leitura { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.ent-modal-ro input:disabled, .ent-modal-ro select:disabled, .ent-modal-ro textarea:disabled { opacity: .75; cursor: default; }
