/* Estrutura comum às 10 versões. Cada tema em themes/N.css só define variáveis e ajustes. */
:root {
  --bg: #f5f5f4; --surface: #fff; --surface-2: #f0f0ef; --ink: #1a1a1a; --muted: #5d5d5d; --line: #dededc;
  --accent: #2443d6; --on-accent: #fff; --ok: #1d7a46; --warn: #a86a00; --danger: #b42318;
  --nav-bg: var(--surface); --nav-ink: var(--ink); --nav-active: var(--surface-2);
  --radius: 8px; --radius-sm: 6px; --shadow: none; --gap: 24px;
  --font: system-ui, sans-serif; --font-display: var(--font); --font-num: var(--font);
  --h1: 30px; --h1-weight: 600; --tl-0: var(--accent); --tl-1: #8a4fd8; --tl-2: #d0701c;
  --login-bg: var(--bg); --login-ink: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lead { color: var(--muted); max-width: 68ch; margin: 4px 0 0; }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; }
small { display: block; color: var(--muted); font-size: 12.5px; }
.num, td.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: inherit; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-sm); padding: 9px 16px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { border-color: var(--ink); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .7; cursor: default; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); margin: 2px 4px 2px 0; font-family: var(--font-num); white-space: nowrap; }
.pill.ok { color: var(--ok); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; background: var(--login-bg); color: var(--login-ink); position: relative; }
.login .logo { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 0 0 auto; letter-spacing: -.01em; }
.login h1 { font-family: var(--font-display); font-size: clamp(34px, 5vw, 60px); line-height: 1.05; margin: 0 0 16px; font-weight: var(--h1-weight); letter-spacing: -.02em; max-width: 14ch; }
.login .lead { color: inherit; opacity: .78; font-size: 17px; max-width: 44ch; }
.login-brand { display: flex; flex-direction: column; gap: 0; padding: 48px; }
.login-brand h1 { margin-top: 48px; }
.login-card { background: var(--surface); color: var(--ink); padding: 36px; border-radius: var(--radius); width: min(400px, 100%); display: grid; gap: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.login-card h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 24px; }
.login-card label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; }
.login-card input { padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.login-card .btn { padding: 12px; }
.erro { color: var(--danger); margin: 0; min-height: 1em; font-size: 13.5px; }
.erro:empty { display: none; }
.demo-note { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.hub-link { position: absolute; right: 20px; bottom: 16px; font-size: 12.5px; opacity: .7; }
.login--split { grid-template-columns: 1.15fr 1fr; }
.login--split .login-card { align-self: center; justify-self: center; }
.login--center { place-items: center; align-content: center; gap: 28px; padding: 24px; }
.login--center .login-brand { padding: 0; text-align: center; align-items: center; }
.login--center .login-brand h1 { margin-top: 8px; font-size: clamp(28px, 4vw, 40px); max-width: none; }
.login--center .logo { margin: 0; }
.login--full { grid-template-columns: 1fr auto; align-items: end; padding: 48px; gap: 48px; }
.login--full .login-brand { padding: 0; align-self: stretch; }
@media (max-width: 860px) {
  .login--split, .login--full { grid-template-columns: 1fr; padding: 0; }
  .login--full { padding: 24px; }
  .login-brand { padding: 32px 24px 8px; }
  .login--split .login-card { margin: 0 16px 48px; width: auto; }
}

/* ---------- Shell e menu ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.nav { background: var(--nav-bg); color: var(--nav-ink); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.nav .logo { font-family: var(--font-display); font-size: 22px; font-weight: 700; text-decoration: none; padding: 4px 10px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav ul a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); text-decoration: none; opacity: .82; }
.nav ul a:hover { opacity: 1; background: var(--nav-active); }
.nav ul a[aria-current] { opacity: 1; background: var(--nav-active); font-weight: 600; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; font-size: 14px; flex-wrap: wrap; }
.me small { color: inherit; opacity: .65; }
.me .sair { margin-left: auto; font-size: 13px; opacity: .8; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; }
.ico { width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.ico--mesa { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M9 10v10'/%3E%3C/svg%3E"); }
.ico--processo { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='5' cy='6' r='2'/%3E%3Ccircle cx='19' cy='6' r='2'/%3E%3Ccircle cx='12' cy='18' r='2'/%3E%3Cpath d='M7 6h10M5 8c0 6 7 4 7 8'/%3E%3C/svg%3E"); }
.ico--redacao { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16z'/%3E%3C/svg%3E"); }
.ico--guerra { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 3v18M5 7h14M5 7l-3 7h6zM19 7l-3 7h6z'/%3E%3C/svg%3E"); }

[data-layout="topbar"] .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
[data-layout="topbar"] .nav { flex-direction: row; align-items: center; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 24px; z-index: 5; }
[data-layout="topbar"] .nav ul { grid-auto-flow: column; }
[data-layout="topbar"] .me { margin: 0 0 0 auto; padding: 0; flex-wrap: nowrap; }
[data-layout="topbar"] .me .lbl { display: none; }
[data-layout="float"] .shell { grid-template-columns: 264px 1fr; }
[data-layout="float"] .nav { margin: 12px; height: calc(100vh - 24px); top: 12px; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
[data-layout="rail"] .shell { grid-template-columns: 84px 1fr; }
[data-layout="rail"] .nav { align-items: center; padding: 20px 8px; }
[data-layout="rail"] .nav .logo { padding: 0; font-size: 16px; }
[data-layout="rail"] .nav ul a { flex-direction: column; gap: 4px; font-size: 10.5px; text-align: center; padding: 10px 4px; }
[data-layout="rail"] .nav ul .lbl { max-width: 64px; line-height: 1.2; }
[data-layout="rail"] .me { flex-direction: column; padding: 0; }
[data-layout="rail"] .me .lbl { display: none; }
@media (max-width: 860px) {
  .shell, [data-layout] .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nav, [data-layout] .nav { position: sticky; top: 0; height: auto; flex-direction: row; align-items: center; margin: 0; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; z-index: 5; overflow-x: auto; }
  .nav ul, [data-layout] .nav ul { grid-auto-flow: column; }
  .nav ul .lbl { display: none; }
  .me { margin: 0 0 0 auto; padding: 0; flex-wrap: nowrap; }
  .me .lbl, .me .avatar { display: none; }
}

/* ---------- Conteúdo ---------- */
.view { padding: 36px clamp(16px, 4vw, 48px) 64px; max-width: 1440px; width: 100%; min-width: 0; outline: none; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-family: var(--font-display); font-size: var(--h1); font-weight: var(--h1-weight); margin: 0; line-height: 1.15; letter-spacing: -.01em; }
.page-head .num { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; }
.sec { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-row .sec { margin: 0; }

.radar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-bottom: 36px; }
.faixa { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 10px; align-content: start; }
.faixa h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.count { font-family: var(--font-num); font-size: 12px; background: var(--surface-2); padding: 1px 8px; border-radius: 99px; }
.prazo-hoje { border-top: 4px solid var(--danger); }
.prazo-h48 { border-top: 4px solid var(--warn); }
.prazo-d5 { border-top: 4px solid var(--line); }
.prazo { padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.prazo-ato { font-weight: 600; margin: 0; }
.prazo-proc { margin: 0; font-size: 13.5px; color: var(--muted); }
.selo { font-weight: 600; color: var(--ink); background: var(--surface-2); padding: 0 6px; border-radius: 4px; }
.fim { font-family: var(--font-num); }
.prazo-hoje .fim { color: var(--danger); font-weight: 600; }
.acoes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.prazo.is-ok .prazo-ato::after { content: " ✓"; color: var(--ok); }
.prazo.is-done { opacity: .55; }
.prazo.is-done .prazo-ato { text-decoration: line-through; }

.duo { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap); margin-bottom: 36px; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 14px; display: flex; gap: 12px; }
.lista li > a { display: grid; grid-template-columns: 52px 1fr; column-gap: 12px; text-decoration: none; width: 100%; }
.lista li > a span { grid-column: 2; color: var(--muted); font-size: 13.5px; }
.lista time { font-family: var(--font-num); color: var(--muted); font-size: 13px; min-width: 52px; }
.lista li > span { color: var(--muted); margin-left: auto; }
.decisorio { border-left: 3px solid var(--accent); padding-left: 12px !important; }
.bur summary { cursor: pointer; color: var(--muted); padding: 10px 0; font-size: 14px; }
.ingest { display: grid; gap: 14px; align-content: start; }
.ingest .sec { margin: 0; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface); }
.drop:hover { border-color: var(--accent); color: var(--ink); }
.cnj-form { display: flex; gap: 8px; align-items: end; }
.cnj-form label { flex: 1; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.cnj-form input, .ask input, .filtro select { padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; font-family: var(--font-num); }
.progresso p { margin: 0 0 6px; font-size: 14px; }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .06s linear; }
.etapas { margin: 10px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.etapas .feito { color: var(--ok); }
.etapas .feito::after { content: " ✓"; }

.tabela-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr:last-child > * { border-bottom: 0; }
td.num a { white-space: nowrap; }
.fase { font-size: 12.5px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.filtro { font-size: 13.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

/* Processo */
.agora { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 24px; }
.agora p { margin: 0 8px 0 0; }
.chip { font-size: 13px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); }
.chip--ativo { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip--alerta { border-color: var(--danger); color: var(--danger); }
.proc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); }
.tl-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.toggle button { border: 0; background: transparent; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.toggle [aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.tl-scroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.timeline { display: block; font-family: var(--font); }
.trilho { fill: none; stroke-width: 3; stroke-linecap: round; }
.trilho-0 { stroke: var(--tl-0); color: var(--tl-0); }
.trilho-1 { stroke: var(--tl-1); color: var(--tl-1); }
.trilho-2 { stroke: var(--tl-2); color: var(--tl-2); }
.no { cursor: pointer; outline: none; }
.no circle { fill: var(--surface); stroke: currentColor; stroke-width: 3; transition: r .15s; }
.no.sel circle, .no:hover circle { fill: currentColor; }
.no:focus-visible circle { stroke-width: 5; }
.no.menor circle { stroke-width: 2; }
.no.aberto circle { stroke-dasharray: 3 3; }
.no.alerta circle { stroke: var(--danger); }
.no text { text-anchor: middle; fill: var(--ink); stroke: none; }
.no .t { font-size: 12px; font-weight: 600; }
.no.menor .t { font-weight: 400; fill: var(--muted); font-size: 11px; }
.no .d { font-size: 11px; fill: var(--muted); font-family: var(--font-num); }
.rot { font-size: 11.5px; fill: var(--muted); font-family: var(--font-num); }
.marco { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; max-width: 72ch; }
.marco h3 { margin: 4px 0 6px; font-family: var(--font-display); font-size: 20px; }
.marco p { margin: 0 0 10px; }
.chat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.msgs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; font-size: 14px; flex: 1; align-content: start; }
.msgs li { padding: 10px 12px; border-radius: var(--radius-sm); }
.msgs .eu { background: var(--surface-2); justify-self: end; max-width: 90%; }
.msgs .ia { border: 1px solid var(--line); }
.ask { display: flex; gap: 6px; }
.ask input { flex: 1; font-family: var(--font); }

/* Redação */
.redacao { display: grid; grid-template-columns: 22fr 48fr 30fr; gap: var(--gap); align-items: start; }
.ctx, .editor, .inspetor { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.arvore { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 14px; }
.arvore label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.arvore input { accent-color: var(--accent); }
.cmds { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cmds code { font-size: 12.5px; padding: 3px 8px; background: var(--surface-2); border-radius: 4px; }
.doc { font-family: var(--font-doc, Georgia, serif); font-size: 15.5px; line-height: 1.7; outline: none; max-width: 68ch; }
.doc p { margin: 0 0 14px; }
mark { background: transparent; border-bottom: 2px solid var(--ok); color: inherit; padding: 0 1px; }
mark.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pdf { background: var(--surface-2); padding: 14px; border-radius: var(--radius-sm); font-family: var(--font-num); font-size: 13px; margin-bottom: 14px; }
.pdf mark { background: color-mix(in srgb, var(--warn) 30%, transparent); border: 0; }
.pdf p { margin: 0 0 6px; }
.semaforo { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; font-size: 13.5px; }
.semaforo li { display: flex; gap: 8px; align-items: baseline; }
.semaforo li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.semaforo .ok::before { background: var(--ok); }
.semaforo .warn::before { background: var(--warn); }

/* Sala de guerra */
.matriz th[scope="row"] { width: 26%; font-weight: 600; }
.matriz ul { margin: 0 0 6px; padding-left: 18px; }
.parecer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.parecer, .riscos { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.parecer h2 { font-family: var(--font-display); font-size: 22px; margin: 8px 0 10px; line-height: 1.25; }
.cracha { display: inline-block; margin: 0; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.parecer details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.parecer summary { cursor: pointer; font-weight: 600; }
.riscos h3 { font-size: 14px; margin: 0 0 8px; }
.riscos h3:not(:first-child) { margin-top: 18px; }
.riscos ul { margin: 0; padding-left: 18px; font-size: 14px; }
.riscos ul.risco { list-style: none; padding: 0; display: grid; gap: 6px; }
.nivel { display: inline-block; min-width: 64px; font-size: 12px; font-weight: 600; margin-right: 8px; }
.nivel.baixo { color: var(--ok); } .nivel.medio { color: var(--warn); }

@media (max-width: 1100px) {
  .radar, .duo, .proc-grid, .redacao, .parecer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Camada de efeitos (todas as versões) ---------- */
:root { color-scheme: dark; --glow: var(--accent); --fx-a: var(--accent); --fx-b: var(--tl-1); }
#app { position: relative; z-index: 1; }
.fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fx canvas { position: absolute; inset: 0; }
.fx i { position: absolute; display: block; }
.fx i { border-radius: 50%; filter: blur(110px); }
.fx--aurora i { width: 60vmax; height: 60vmax; opacity: .3; }
.fx--aurora i:nth-child(1) { background: var(--fx-a); left: -15vmax; top: -25vmax; animation: deriva 22s ease-in-out infinite alternate; }
.fx--aurora i:nth-child(2) { background: var(--fx-b); right: -20vmax; bottom: -30vmax; animation: deriva 28s ease-in-out infinite alternate-reverse; }
@keyframes deriva { to { transform: translate(18vmax, 12vmax) scale(1.15); } }
/* Malha em azuis girando devagar */
.fx--mesh i:nth-child(1) { inset: -35%; border-radius: 0; filter: blur(50px); opacity: .7; animation: gira 60s linear infinite;
  background: radial-gradient(at 20% 30%, color-mix(in srgb, var(--fx-a) 70%, transparent), transparent 40%), radial-gradient(at 80% 15%, color-mix(in srgb, var(--fx-b) 60%, transparent), transparent 42%), radial-gradient(at 70% 85%, #0ea5e955, transparent 40%), radial-gradient(at 15% 85%, #1e3a8a, transparent 45%); }
.fx--mesh i:nth-child(2) { display: none; }
/* Halo que respira atrás do conteúdo */
.fx--glow i:nth-child(1) { width: 80vmax; height: 50vmax; left: 50%; top: -28vmax; translate: -50% 0; background: var(--fx-a); opacity: .35; animation: respira 7s ease-in-out infinite alternate; }
.fx--glow i:nth-child(2) { width: 40vmax; height: 40vmax; right: -12vmax; bottom: -18vmax; background: var(--fx-b); opacity: .18; }
@keyframes respira { to { opacity: .2; transform: scale(1.08); } }
/* Constelação e estrelas: canvas + dois halos */
.fx--stars i:nth-child(1), .fx--constellation i:nth-child(1) { width: 70vmax; height: 50vmax; left: 30%; top: -30vmax; background: var(--fx-a); opacity: .22; animation: respira 9s ease-in-out infinite alternate; }
.fx--stars i:nth-child(2), .fx--constellation i:nth-child(2) { width: 45vmax; height: 45vmax; left: -15vmax; bottom: -25vmax; background: var(--fx-b); opacity: .14; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Brilho que acompanha o mouse */
.glow { position: relative; isolation: isolate; }
.glow::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; z-index: 2; padding: 1px; opacity: 0; transition: opacity .3s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.glow::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--glow) 10%, transparent), transparent 60%); }
.glow:hover::after, .glow:hover::before { opacity: 1; }

/* Botões: reflexo que atravessa e leve elevação */
.btn { position: relative; overflow: hidden; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, filter .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); translate: -120% 0; transition: translate .6s; }
.btn--primary:hover::after { translate: 120% 0; }
.btn--primary:hover { box-shadow: 0 8px 28px -8px var(--accent); }
.nav ul a { transition: background .2s, opacity .2s, color .2s, transform .2s; }
.nav ul a:hover { transform: translateX(2px); }
[data-layout="topbar"] .nav ul a:hover { transform: translateY(-1px); }
.lista li > a, tbody tr { transition: background .2s; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.prazo { transition: opacity .3s; }

/* Entradas em cascata */
@keyframes sobe { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }
.view > * { animation: sobe .6s cubic-bezier(.2,.8,.2,1) both; }
.view > *:nth-child(2) { animation-delay: .06s; } .view > *:nth-child(3) { animation-delay: .12s; }
.view > *:nth-child(4) { animation-delay: .18s; } .view > *:nth-child(5) { animation-delay: .24s; }
.radar .faixa { animation: sobe .6s cubic-bezier(.2,.8,.2,1) both; }
.radar .faixa:nth-child(2) { animation-delay: .1s; } .radar .faixa:nth-child(3) { animation-delay: .2s; }
.login-brand > * { animation: sobe .8s cubic-bezier(.2,.8,.2,1) both; }
.login-brand > :nth-child(2) { animation-delay: .12s; } .login-brand > :nth-child(3) { animation-delay: .24s; }
.login-card { animation: sobe .8s .3s cubic-bezier(.2,.8,.2,1) both; }
.login-card input { transition: border-color .2s, box-shadow .2s; }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.erro:not(:empty) { animation: treme .35s; }
@keyframes treme { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Linha do tempo se desenha */
.trilho { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: desenha 1.6s cubic-bezier(.6,0,.2,1) forwards; }
.trilho-1 { animation-delay: .5s; } .trilho-2 { animation-delay: .8s; }
.no { animation: surge .5s ease-out both; animation-delay: .9s; }
.no.sel circle { filter: drop-shadow(0 0 8px currentColor); }
@keyframes desenha { to { stroke-dashoffset: 0; } }
@keyframes surge { from { opacity: 0; } }
.marco > * { animation: sobe .4s both; }

/* Transição entre telas (View Transitions) */
::view-transition-old(root) { animation: .25s ease-in both some; }
::view-transition-new(root) { animation: .35s ease-out both aparece; }
@keyframes some { to { opacity: 0; transform: scale(.99); } }
@keyframes aparece { from { opacity: 0; transform: scale(1.01); } }
@media (prefers-reduced-motion: reduce) { .trilho { stroke-dashoffset: 0; } .fx i { animation: none !important; } }

/* ---------- Rodada 2: marca, menu lateral e organizações da Mesa ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.mark { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 17px; font-weight: 700; line-height: 1;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2, #1e3a8a)); box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 55%, transparent); }
.login--center .logo { flex-direction: column; gap: 14px; }
.login--center .mark { width: 60px; height: 60px; border-radius: 16px; font-size: 28px; box-shadow: 0 0 60px color-mix(in srgb, var(--accent) 70%, transparent); }
.login--center .logo .nome { display: none; }

/* Trilho que abre ao passar o mouse */
[data-layout="rail"] .shell { grid-template-columns: 84px 1fr; }
[data-layout="rail"] .nav { width: 84px; align-items: stretch; padding: 20px 14px; overflow: hidden; z-index: 20; transition: width .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s; }
[data-layout="rail"] .nav:hover, [data-layout="rail"] .nav:focus-within { width: 248px; box-shadow: 20px 0 60px -20px rgba(0,0,0,.6); }
[data-layout="rail"] .nav ul a { flex-direction: row; font-size: 14px; text-align: left; padding: 10px 12px; white-space: nowrap; }
[data-layout="rail"] .nav .logo { padding: 4px 6px; white-space: nowrap; }
[data-layout="rail"] .nav .lbl, [data-layout="rail"] .nav .logo .nome { opacity: 0; transition: opacity .2s; }
[data-layout="rail"] .nav:hover .lbl, [data-layout="rail"] .nav:focus-within .lbl, [data-layout="rail"] .nav:hover .nome, [data-layout="rail"] .nav:focus-within .nome { opacity: 1; }
[data-layout="rail"] .me { flex-direction: row; flex-wrap: nowrap; padding: 8px 4px; white-space: nowrap; }
[data-layout="rail"] .me .lbl { display: block; }

.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); text-decoration: none; display: block; min-width: 0; }
a.tile { transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s; }
a.tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.tile h2, .tile h3 { margin: 4px 0 8px; font-family: var(--font-display); }
.vazio { color: var(--muted); font-size: 13.5px; margin: 8px 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot--hoje { background: var(--danger); box-shadow: 0 0 8px var(--danger); } .dot--h48 { background: var(--warn); } .dot--d5 { background: var(--accent); }
.mesa { display: block; }
.mesa > * { animation: sobe .6s cubic-bezier(.2,.8,.2,1) both; }
.mesa > :nth-child(2) { animation-delay: .07s; } .mesa > :nth-child(3) { animation-delay: .14s; } .mesa > :nth-child(4) { animation-delay: .21s; } .mesa > :nth-child(5) { animation-delay: .28s; }

/* Comando */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; display: grid; gap: 2px; transition: transform .25s; }
.kpi:hover { transform: translateY(-3px); }
.kpi b { font-size: 40px; font-weight: 300; line-height: 1; font-family: var(--font-num); }
.kpi span { color: var(--muted); font-size: 13.5px; }
.kpi--alerta b { color: var(--danger); text-shadow: 0 0 24px color-mix(in srgb, var(--danger) 60%, transparent); }
.cmd { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.cmd-dir { display: grid; gap: var(--gap); }
.mini-tl { display: flex; gap: 6px; margin: 14px 0 10px; }
.mini-tl i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); }
.mini-tl i.feito { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.mini-tl i.atual { background: var(--accent); box-shadow: 0 0 12px var(--accent); }

/* Bento */
.bento { display: grid; gap: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: "hoje hoje h48 d5" "inbox inbox ingest guerra" "proc proc proc proc"; }
.b-hoje { grid-area: hoje; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--surface)), var(--surface)); padding: 28px; }
.b-hoje h2 { font-size: 30px; margin: 6px 0; } .b-48 { grid-area: h48; } .b-5 { grid-area: d5; } .b-inbox { grid-area: inbox; } .b-ingest { grid-area: ingest; } .b-guerra { grid-area: guerra; } .b-proc { grid-area: proc; }
.b-48 .faixa, .b-5 .faixa { border: 0; padding: 0; background: none; box-shadow: none; backdrop-filter: none; }
.b-proc .tabela-wrap { border: 0; background: none; box-shadow: none; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); align-items: start; }
.kanban .faixa { min-height: 320px; }
.prazo-ok { border-top: 4px solid var(--ok); }
.prazo-ok .prazo { animation: sobe .4s both; }

/* Caixa de entrada em duas colunas */
.split { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: var(--gap); margin-bottom: var(--gap); min-height: 460px; }
.split-lista { display: grid; gap: 6px; align-content: start; }
.item { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; transition: border-color .2s, background .2s, transform .2s; }
.item:hover { transform: translateX(3px); }
.item.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.item small { color: var(--muted); }
.tag { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.item--prazo .tag { color: var(--warn); } .item--burocratico .tag { color: var(--muted); }
.split-leitura { padding: 28px; } .split-leitura h2 { font-size: 26px; }
.split-leitura > * { animation: sobe .35s both; }
.ingest--linha { display: grid; grid-template-columns: auto 1fr 1fr; gap: 16px; align-items: center; }
.ingest--linha .sec { margin: 0; } .ingest--linha .progresso { grid-column: 1 / -1; }

/* Agenda */
.agenda { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: var(--gap); }
.dia { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-height: 260px; min-width: 0; }
.dia h3 { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.dia.hoje { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 40px -12px var(--accent); }
.dia.hoje h3 { color: var(--accent); }
.dia .prazo .acoes { flex-direction: column; }

/* Foco */
.foco { display: grid; grid-template-columns: minmax(0, 720px) 300px; gap: 40px; justify-content: center; }
.dia-linha { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 2px solid var(--line); display: grid; gap: 18px; }
.ev { position: relative; display: grid; gap: 6px; }
.ev::before { content: ""; position: absolute; left: -36px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.ev--prazo::before { background: var(--danger); border-color: var(--danger); box-shadow: 0 0 14px var(--danger); }
.ev time { font-size: 13px; color: var(--muted); font-family: var(--font-num); }
.ev .prazo { background: var(--surface); border: 1px solid color-mix(in srgb, var(--danger) 50%, var(--line)); border-radius: var(--radius); padding: 16px; }
.ev p { margin: 4px 0 0; }
.foco-lado { display: grid; gap: var(--gap); align-content: start; position: sticky; top: 24px; }
.anel { display: flex !important; gap: 16px; align-items: center; }
.anel svg { width: 84px; height: 84px; transform: rotate(-90deg); flex: none; }
.anel circle { fill: none; stroke-width: 10; }
.anel-fundo { stroke: var(--surface-2); } .anel-valor { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px var(--accent)); }
.anel p { margin: 0; display: grid; } .anel b { font-size: 22px; } .anel span { color: var(--muted); font-size: 13px; }

/* Galeria */
.chips-prazo { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--gap); }
.chip--hoje { border-color: var(--danger); color: var(--danger); } .chip--h48 { border-color: var(--warn); color: var(--warn); }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.proc-card .num { font-size: 12.5px; color: var(--muted); margin: 0; }
.proc-card p { margin: 4px 0; }
.trilha { list-style: none; display: flex; padding: 0; margin: 16px 0 10px; }
.trilha li { flex: 1; height: 4px; background: var(--surface-2); position: relative; }
.trilha li.feito { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.trilha li.atual { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.trilha span { position: absolute; top: 9px; left: 0; font-size: 10.5px; color: var(--muted); white-space: nowrap; display: none; }
.trilha li.atual span { display: block; color: var(--accent); font-weight: 600; }
.trilha li:last-child.atual span { left: auto; right: 0; }
.prox { font-size: 13.5px; font-weight: 600; margin-top: 18px !important; }
.prox--hoje { color: var(--danger); } .prox--h48 { color: var(--warn); }

/* Tabela com gaveta */
.tabela-lay { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); margin-bottom: var(--gap); align-items: start; }
.tabela-lay tbody tr { cursor: pointer; }
.tabela-lay tbody tr.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.gaveta { position: sticky; top: 24px; } .gaveta > * { animation: sobe .3s both; }
.gaveta .prazo { margin: 12px 0; }

/* Mapa */
.mapa-hero { margin-bottom: 32px; padding-bottom: 20px; }
.mapa-hero .timeline { margin: 8px 0 12px; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cmd, .split, .foco, .tabela-lay, .kanban { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; grid-template-areas: "hoje" "h48" "d5" "inbox" "ingest" "guerra" "proc"; }
  .agenda { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ingest--linha { grid-template-columns: 1fr; }
  .foco-lado { position: static; }
}
@media (max-width: 860px) {
  [data-layout="rail"] .nav, [data-layout="rail"] .nav:hover { width: auto; box-shadow: none; }
  [data-layout="rail"] .lbl, [data-layout="rail"] .logo .nome { opacity: 1; }
  .nav .logo .nome { display: none; }
}

/* ---------- Rodada 2: base azul/preto compartilhada ---------- */
:root { --bg: #060b18; --surface: rgba(18, 30, 58, .62); --surface-2: rgba(148, 180, 255, .08); --ink: #eef3ff; --muted: #94a3c0; --line: rgba(148, 180, 255, .14);
  --accent: #3b82f6; --accent-2: #1d4ed8; --on-accent: #fff; --ok: #34d399; --warn: #f5b544; --danger: #ff5d6c;
  --nav-bg: rgba(6, 11, 24, .55); --nav-active: rgba(59, 130, 246, .14); --radius: 16px; --radius-sm: 10px; --shadow: 0 24px 60px -30px rgba(0, 0, 0, .7);
  --tl-0: var(--accent); --tl-1: #22d3ee; --tl-2: #cbd5e1; --login-bg: transparent; --login-ink: var(--ink); --fx-a: #1d4ed8; --fx-b: #0ea5e9; --star: #9cc3ff; }
body { background: var(--bg); }
.nav, .login-card, .faixa, .tabela-wrap, .tl-box, .chat, .ctx, .editor, .inspetor, .parecer, .riscos, .tile, .kpi, .item, .dia { backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); }
.login-card input, .cnj-form input, .ask input, .filtro select { background: rgba(0, 0, 0, .28); }
.filtro select option { background: var(--bg); }
.nav ul a[aria-current] { color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.selo { background: rgba(59, 130, 246, .16); color: var(--ink); }
.btn--primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent)); border-color: transparent; }
.cracha { background: var(--accent); }
/* Login dividido: painel de vidro arredondado à esquerda (layout que Vinicius gostou na rodada 1) */
.login--split .login-brand { margin: 16px; border-radius: 32px; border: 1px solid var(--line); backdrop-filter: blur(24px);
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 28%, transparent), rgba(255, 255, 255, .02) 60%); }
.login--split .login-brand h1 { font-size: clamp(40px, 5.5vw, 76px); }
/* Login em tela cheia: texto grande à esquerda, cartão de vidro à direita */
.login--full h1 { font-size: clamp(42px, 6vw, 80px); font-weight: 300; letter-spacing: -.035em; max-width: 13ch; }
.login--full .login-card { background: rgba(8, 14, 30, .7); }
/* Login centralizado com halo */
.login--center::before { content: ""; position: absolute; left: 50%; top: 38%; width: 640px; height: 640px; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 38%, transparent), transparent 65%); animation: respira 6s ease-in-out infinite alternate; }
.login--center > * { position: relative; }
.login--center .login-card { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 40px 100px -40px var(--accent); }
.login--center .login-brand h1 { color: #fff; }
.login-card { background: rgba(10, 16, 32, .78); }
.login-card::before { content: none; }
.login::after { content: none; }
.login::before { z-index: 0; }
.drop { display: block; }
.tile.ingest { display: grid; gap: 14px; align-content: start; }
.cnj-form { flex-wrap: wrap; } .cnj-form label { min-width: 180px; }
@media (max-width: 860px) {
  [data-layout="rail"] .shell { grid-template-columns: 1fr; }
  [data-layout="rail"] .nav { width: auto !important; flex-direction: row; align-items: center; padding: 8px 12px; overflow-x: auto; }
  [data-layout="rail"] .nav ul a { padding: 9px 10px; }
  [data-layout="rail"] .nav .lbl { display: none; }
  [data-layout="rail"] .me { margin-left: auto; padding: 0; }
}
