/* RCA Plataforma — sistema visual
   Marca: vinho #7A0000 / #520000, bege #F7EEEE / #F3E4E4, timbrado #7A0E1E.
   Tipografia: Inter (interface) + Cormorant Garamond (títulos, como no timbrado). */

:root {
  --vinho-950: #2a0004;
  --vinho-900: #3a0006;
  --vinho-800: #520000;
  --vinho-700: #7a0000;
  --vinho-600: #7a0e1e;
  --vinho-500: #9b1b2a;
  --vinho-300: #d9a3a8;
  --bege-50: #fcf8f7;
  --bege-100: #f7eeee;
  --bege-200: #f3e4e4;

  --bg: #f7f2f1;
  --surface: #ffffff;
  --surface-2: #fbf7f6;
  --surface-3: #f5edec;
  --border: #ebdedd;
  --border-strong: #dcc8c7;
  --text: #2a1a1c;
  --text-2: #65504f;
  --text-3: #9a8687;
  --accent: #7a0000;
  --accent-hover: #520000;
  --accent-soft: #f6e7e7;
  --accent-text: #7a0000;
  --on-accent: #ffffff;
  --focus: rgba(122, 0, 0, .28);

  --ok: #2f7d5b; --ok-soft: #e4f2ea;
  --warn: #a8661a; --warn-soft: #fbf0dc;
  --danger: #b42318; --danger-soft: #fbe6e3;
  --info: #3d5a80; --info-soft: #e8eef6;
  --muted: #7d6e70; --muted-soft: #f0eaea;
  --lacuna: #fff1a8;

  --s-triagem: #8a7c7e; --s-producao: #3d5a80; --s-revisao: #b7791f; --s-ajustes: #c2410c;
  --s-aprovada: #2f7d5b; --s-protocolar: #7a0000; --s-protocolada: #5b4b4d;

  --side-bg: linear-gradient(180deg, #5a0006 0%, #3c0005 55%, #2a0004 100%);
  --side-text: rgba(255, 240, 240, .78);
  --side-text-strong: #fff;
  --side-hover: rgba(255, 255, 255, .07);
  --side-active: rgba(255, 255, 255, .12);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-sm: 0 1px 2px rgba(58, 0, 6, .05);
  --shadow: 0 1px 2px rgba(58, 0, 6, .04), 0 10px 28px -14px rgba(58, 0, 6, .22);
  --shadow-lg: 0 24px 64px -20px rgba(42, 0, 4, .45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Cormorant Garamond", "Garamond", Georgia, serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --dark: 1; }
}
:root[data-theme="dark"], :root.tema-escuro {
  --bg: #120c0d;
  --surface: #1b1416;
  --surface-2: #211819;
  --surface-3: #2a1f21;
  --border: #33272a;
  --border-strong: #46363a;
  --text: #f4eaea;
  --text-2: #c4b2b3;
  --text-3: #8f7c7e;
  --accent: #b3323f;
  --accent-hover: #c94451;
  --accent-soft: rgba(201, 68, 81, .14);
  --accent-text: #ec8a93;
  --focus: rgba(236, 138, 147, .35);
  --ok: #5cc092; --ok-soft: rgba(92, 192, 146, .13);
  --warn: #e3a54c; --warn-soft: rgba(227, 165, 76, .13);
  --danger: #f07a6e; --danger-soft: rgba(240, 122, 110, .13);
  --info: #8fb0dc; --info-soft: rgba(143, 176, 220, .13);
  --muted: #a7979a; --muted-soft: rgba(167, 151, 154, .12);
  --lacuna: #6b5a12;
  --s-triagem: #a7979a; --s-producao: #8fb0dc; --s-revisao: #e3a54c; --s-ajustes: #f0915a;
  --s-aprovada: #5cc092; --s-protocolar: #ec8a93; --s-protocolada: #8f7c7e;
  --side-bg: linear-gradient(180deg, #2e0508 0%, #1d0406 60%, #140305 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 64px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--vinho-300); color: var(--vinho-950); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.serif { font-family: var(--serif); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.lg { gap: 20px; }
.between { justify-content: space-between; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- shell */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; z-index: 30;
}
.side::after { /* brilho discreto */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 50% at 0% 0%, rgba(255, 255, 255, .08), transparent 60%);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 20px; position: relative; z-index: 1; }
.brand img { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .14), 0 6px 18px rgba(0, 0, 0, .35); }
.brand-nome { font-family: var(--serif); font-size: 21px; font-weight: 700; color: #fff; letter-spacing: .02em; line-height: 1; }
.brand-sub { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255, 230, 230, .6); margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }
.nav-sec { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 225, 225, .42); padding: 16px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--side-text);
  text-decoration: none; font-weight: 500; transition: background .15s, color .15s; position: relative;
}
.nav a svg { width: 18px; height: 18px; opacity: .85; flex: none; }
.nav a:hover { background: var(--side-hover); color: #fff; }
.nav a.ativo { background: var(--side-active); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.nav a.ativo::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: #f3c6c9; }
.nav .badge-n { margin-left: auto; background: rgba(255, 255, 255, .14); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.side-pe { margin-top: auto; position: relative; z-index: 1; padding-top: 16px; }
.eu { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .18); }
.eu .nome { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.2; }
.eu .papel { font-size: 11.5px; color: rgba(255, 225, 225, .6); }
.eu button { margin-left: auto; background: none; border: 0; color: rgba(255, 230, 230, .7); padding: 6px; border-radius: 8px; cursor: pointer; }
.eu button:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.top h1 { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 0; letter-spacing: .01em; line-height: 1.1; }
.top .crumb { font-size: 12px; color: var(--text-3); }
.busca-btn {
  margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 300px; padding: 8px 12px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px; color: var(--text-3); cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.busca-btn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.busca-btn svg { width: 16px; height: 16px; }
.busca-btn kbd { margin-left: auto; }
kbd { font-family: var(--font); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); }
.conteudo { padding: 24px 28px 64px; max-width: 1480px; width: 100%; margin: 0 auto; }
.conteudo.largo { max-width: none; }
.menu-btn { display: none; }

/* ---------------------------------------------------------------- componentes */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  text-decoration: none !important;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primario { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 6px 16px -8px var(--accent); }
.btn.primario:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.suave { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.btn.suave:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 10%); }
.btn.fantasma { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.fantasma:hover { background: var(--surface-3); color: var(--text); }
.btn.perigo { color: var(--danger); }
.btn.perigo:hover { background: var(--danger-soft); border-color: transparent; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icone { width: 36px; padding: 0; }
.btn.sm.icone { width: 30px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .spin { animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.card-h h3, .sec-t { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase; color: var(--text-2); }
.card-h .acao { margin-left: auto; }
.card-b { padding: 14px 20px 20px; }
.titulo-serif { font-family: var(--serif); font-weight: 700; font-size: 22px; margin: 0; line-height: 1.15; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-painel { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > label, .rotulo { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.campo .ajuda { font-size: 12px; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:hover { border-color: var(--border-strong); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
.input.mono { font-family: var(--mono); font-size: 13px; }
.input-icone { position: relative; }
.input-icone > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-icone .input { padding-left: 34px; }
.obrig::after { content: " *"; color: var(--accent-text); }

.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 10px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; color: var(--text-2); font-weight: 550; cursor: pointer; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--muted-soft); color: var(--muted); white-space: nowrap; }
.pill svg { width: 13px; height: 13px; }
.pill .ponto { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.vinho { background: var(--accent-soft); color: var(--accent-text); }
.pill.contorno { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.pill.st { background: color-mix(in srgb, var(--cor) 13%, transparent); color: var(--cor); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 550; cursor: pointer; transition: all .15s; user-select: none; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip svg { width: 13px; height: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; letter-spacing: .02em; box-shadow: 0 0 0 2px var(--surface); }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avs { display: inline-flex; }
.avs .av + .av { margin-left: -7px; }

.vazio { text-align: center; padding: 40px 20px; color: var(--text-3); }
.vazio svg { width: 34px; height: 34px; opacity: .55; margin-bottom: 8px; }
.vazio b { display: block; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }

.skel { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: brilho 1.3s infinite; border-radius: 8px; }
@keyframes brilho { to { background-position: -200% 0; } }

.tabela { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabela th { text-align: left; font-size: 11.5px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
.tabela td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabela tr.click { cursor: pointer; transition: background .12s; }
.tabela tr.click:hover td { background: var(--surface-2); }
.tabela tr:last-child td { border-bottom: 0; }

.lista > * + * { border-top: 1px solid var(--border); }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; transition: background .12s; }
.item.click { cursor: pointer; }
.item.click:hover { background: var(--surface-2); }
.item .t { font-weight: 600; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; color: var(--text-2); font-weight: 600; cursor: pointer; position: relative; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.tabs button svg { width: 16px; height: 16px; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs .n { font-size: 11px; background: var(--surface-3); color: var(--text-2); padding: 0 6px; border-radius: 99px; }

.aviso { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--text); font-size: 13px; }
.aviso svg { width: 18px; height: 18px; color: var(--warn); flex: none; margin-top: 1px; }
.aviso.info { background: var(--info-soft); } .aviso.info svg { color: var(--info); }
.aviso.erro { background: var(--danger-soft); } .aviso.erro svg { color: var(--danger); }
.aviso.ok { background: var(--ok-soft); } .aviso.ok svg { color: var(--ok); }

/* ---------------------------------------------------------------- painel */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; padding: 26px 28px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #9b1b2a 0%, transparent 55%), linear-gradient(135deg, #7a0000 0%, #520000 55%, #3a0006 100%);
  box-shadow: var(--shadow);
}
.hero img { position: absolute; right: -40px; top: 50%; transform: translateY(-50%); width: 240px; opacity: .13; filter: grayscale(1) brightness(3); pointer-events: none; }
.hero h2 { font-family: var(--serif); font-size: 34px; margin: 0; font-weight: 700; letter-spacing: .01em; }
.hero p { margin: 6px 0 0; color: rgba(255, 235, 235, .82); max-width: 640px; }
.hero .row { margin-top: 18px; position: relative; }
.hero .btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; }
.hero .btn:hover { background: rgba(255, 255, 255, .2); }
.hero .btn.claro { background: #fff; color: var(--vinho-700); border-color: #fff; }
.hero .btn.claro:hover { background: var(--bege-100); }

.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .r { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.kpi .r svg { width: 16px; height: 16px; color: var(--accent-text); }
.kpi .v { font-family: var(--serif); font-size: 44px; font-weight: 700; line-height: 1; margin-top: 10px; letter-spacing: -.01em; font-variant-numeric: lining-nums; }
.kpi .d { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.kpi.alerta .v { color: var(--danger); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 38px; position: absolute; right: 18px; bottom: 18px; }
.spark i { width: 7px; border-radius: 3px 3px 1px 1px; background: var(--accent-soft); display: block; min-height: 3px; }
.spark i:last-child { background: var(--accent); }

.pipeline { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.pipeline i { display: block; height: 100%; transition: flex .5s var(--ease); }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.legenda b { color: var(--text); font-weight: 650; }

.tl { position: relative; padding-left: 4px; }
.tl-i { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.tl-i::before { content: ""; position: absolute; left: 13px; top: 36px; bottom: -10px; width: 1px; background: var(--border); }
.tl-i:last-child::before { display: none; }
.tl-i .tx { font-size: 13px; line-height: 1.45; }
.tl-i .tx b { font-weight: 650; }
.tl-i .qd { font-size: 11.5px; color: var(--text-3); }
.tl-i.comentario .tx { background: var(--surface-2); border: 1px solid var(--border); padding: 9px 12px; border-radius: 4px 12px 12px 12px; margin-top: 3px; white-space: pre-wrap; }

.ag { display: flex; gap: 12px; padding: 10px 20px; align-items: center; }
.ag .dia { width: 46px; text-align: center; flex: none; border-radius: 10px; padding: 5px 0; background: var(--surface-2); border: 1px solid var(--border); }
.ag .dia b { display: block; font-family: var(--serif); font-size: 21px; line-height: 1; }
.ag .dia span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.ag.hoje .dia { background: var(--accent); color: #fff; border-color: var(--accent); }
.ag.hoje .dia span { color: rgba(255, 255, 255, .8); }

.graf { position: relative; }
.graf .bar-g { cursor: default; }
.graf-tip { position: absolute; transform: translateY(-100%); width: 120px; padding: 7px 10px; border-radius: 9px; background: var(--text); color: var(--bg); font-size: 12px; line-height: 1.35; pointer-events: none; box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 5; }
.graf-tip b { font-size: 13.5px; }
.graf-tip span { opacity: .75; }
#mk-kpi .kpi .v { font-size: 38px; }

/* ---------------------------------------------------------------- kanban */
.barra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.quadro { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(264px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; min-height: calc(100vh - 210px); }
.coluna { background: var(--surface-3); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 240px; transition: background .15s, box-shadow .15s; }
.coluna.alvo { background: var(--accent-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.coluna-h { display: flex; align-items: center; gap: 8px; padding: 6px 6px 8px; font-weight: 650; font-size: 13px; }
.coluna-h .ponto { width: 9px; height: 9px; border-radius: 50%; }
.coluna-h .n { margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 600; background: var(--surface); padding: 0 8px; border-radius: 99px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: grab;
  box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s; position: relative;
}
.kcard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }
.kcard.arrastando { opacity: .45; transform: rotate(1.5deg); }
.kcard .tt { font-weight: 650; line-height: 1.35; margin: 6px 0 4px; }
.kcard .meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.kcard .prioridade { position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; }
.coluna .solte { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 18px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ---------------------------------------------------------------- wizard */
.passos { display: flex; gap: 6px; margin-bottom: 22px; }
.passo { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text-3); font-weight: 600; font-size: 13px; cursor: pointer; transition: all .15s; }
.passo .nn { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-size: 12px; flex: none; }
.passo.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px var(--focus); }
.passo.on .nn { background: var(--accent); color: #fff; }
.passo.feito { color: var(--text-2); }
.passo.feito .nn { background: var(--ok-soft); color: var(--ok); }
.opcao { border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: var(--surface); cursor: pointer; transition: all .15s; position: relative; }
.opcao:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.opcao.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.opcao.on::after { content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat; }
.opcao h4 { margin: 0 0 4px; font-size: 14.5px; }
.opcao .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 12px; }
.opcao .ic svg { width: 20px; height: 20px; }
.rodape-wiz { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 0; margin-top: 18px; background: linear-gradient(transparent, var(--bg) 30%); }
.tese-l { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); align-items: flex-start; }
.tese-l + .tese-l { margin-top: 6px; }
.tese-l .t { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.tese-l.fora { opacity: .5; }
.tese-l.fora .t { text-decoration: line-through; }

/* ---------------------------------------------------------------- workspace da peça */
.ws-cab { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ws-cab .titulo { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.1; margin: 2px 0 8px; outline: none; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.ws-cab .titulo:focus { background: var(--surface); box-shadow: 0 0 0 3px var(--focus); }
.progresso { display: flex; align-items: center; gap: 0; margin: 4px 0 20px; overflow-x: auto; }
.progresso .et { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.progresso .et .b { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; background: var(--surface); }
.progresso .et .b svg { width: 12px; height: 12px; }
.progresso .et.feita { color: var(--text-2); }
.progresso .et.feita .b { background: var(--ok); border-color: var(--ok); color: #fff; }
.progresso .et.atual { color: var(--text); }
.progresso .et.atual .b { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); background: var(--accent); }
.progresso .ln { flex: 1; min-width: 18px; height: 2px; background: var(--border); margin: 0 8px; border-radius: 2px; }
.progresso .ln.feita { background: var(--ok); }

.editor-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.editor-wrap.so-editor { grid-template-columns: 1fr; }
.editor-wrap.so-preview { grid-template-columns: 1fr; }
.editor-wrap.so-editor .previa-col, .editor-wrap.so-preview .editor-col { display: none; }
.ferramentas { display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.ferramentas .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.ferramentas .btn.sm { height: 28px; }
.editor {
  width: 100%; min-height: calc(100vh - 330px); border: 0; outline: none; resize: none; padding: 18px 20px;
  font-family: var(--mono); font-size: 13px; line-height: 1.75; background: var(--surface); color: var(--text); border-radius: 0 0 var(--radius) var(--radius); tab-size: 2;
}
.previa-col { position: sticky; top: 84px; max-height: calc(100vh - 104px); overflow-y: auto; border-radius: var(--radius); background: #e9e1e0; padding: 22px; box-shadow: inset 0 2px 10px rgba(0, 0, 0, .06); }
:root[data-theme="dark"] .previa-col, :root.tema-escuro .previa-col { background: #0b0708; }
.folha {
  width: 100%; max-width: 794px; margin: 0 auto; background: #fff; color: #111; box-shadow: 0 4px 24px rgba(0, 0, 0, .14);
  font-family: Verdana, Geneva, sans-serif; font-size: 12px; line-height: 1.5; padding: 0 58px 60px; border-radius: 2px;
}
.folha .faixa { margin: 0 -58px 20px; display: block; width: calc(100% + 116px); }
.folha p { margin: 0; text-align: justify; text-indent: 1.25cm; }
.folha p.l { text-indent: 0; text-align: left; }
.folha p.c { text-indent: 0; text-align: center; }
.folha p.r { text-indent: 0; text-align: right; }
.folha h1 { font-size: 12px; text-align: center; font-weight: 700; margin: 12px 0; text-transform: none; }
.folha h2 { font-size: 12px; font-weight: 700; margin: 18px 0 6px; }
.folha h3 { font-size: 12px; font-weight: 700; margin: 12px 0 4px; }
.folha blockquote { margin: 8px 0 8px 4cm; font-size: 11px; line-height: 1.15; text-align: justify; }
.folha ul, .folha ol { margin: 4px 0 4px 1.2cm; padding: 0; }
.folha table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 10px; }
.folha th { background: #7a0e1e; color: #fff; padding: 5px 7px; text-align: left; }
.folha td { border: 1px solid #ddd; padding: 5px 7px; }
.folha tr:nth-child(even) td { background: #f5ebec; }
.folha .ementa td { background: #f5ebec; border: 1px solid #e3cfd2; }
.folha .ementa tr:first-child td { background: #7a0e1e; color: #fff; font-weight: 700; }
.folha .quebra { border-top: 1px dashed #bbb; margin: 18px -58px; text-align: center; font-size: 9px; color: #999; }
.lac { background: var(--lacuna); color: #111; border-radius: 3px; padding: 0 2px; box-shadow: 0 0 0 1px rgba(160, 120, 0, .25); }
.folha .lac.foco { box-shadow: 0 0 0 2px #b7791f; }

.painel-lado { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 60; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .28s var(--ease); border-left: 1px solid var(--border); }
.painel-lado.aberto { transform: none; }
.painel-lado .ph { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.painel-lado .ph h3 { margin: 0; font-family: var(--serif); font-size: 22px; }
.painel-lado .pb { flex: 1; overflow-y: auto; padding: 18px 20px; }
.veu { position: fixed; inset: 0; background: rgba(20, 4, 6, .38); backdrop-filter: blur(2px); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
.veu.aberto { opacity: 1; pointer-events: auto; }

.modal-bg { position: fixed; inset: 0; background: rgba(20, 4, 6, .45); backdrop-filter: blur(3px); z-index: 70; display: grid; place-items: center; padding: 20px; animation: aparecer .18s; }
.modal { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: subir .22s var(--ease); border: 1px solid var(--border); }
.modal.lg { width: min(760px, 100%); }
.modal-h { padding: 20px 22px 6px; }
.modal-h h3 { margin: 0; font-family: var(--serif); font-size: 24px; }
.modal-b { padding: 12px 22px; overflow-y: auto; }
.modal-p { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.paleta-bg { position: fixed; inset: 0; background: rgba(20, 4, 6, .4); backdrop-filter: blur(3px); z-index: 80; display: flex; justify-content: center; padding-top: 12vh; animation: aparecer .15s; }
.paleta { width: min(640px, calc(100vw - 32px)); background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border); align-self: flex-start; animation: subir .2s var(--ease); }
.paleta .pin { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.paleta .pin svg { width: 18px; height: 18px; color: var(--text-3); }
.paleta .pin input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; }
.paleta .res { max-height: 56vh; overflow-y: auto; padding: 6px; }
.paleta .grp { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 4px; }
.paleta .op { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.paleta .op svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.paleta .op.sel { background: var(--accent-soft); }
.paleta .op.sel svg { color: var(--accent-text); }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; gap: 10px; align-items: flex-start; min-width: 280px; max-width: 420px; padding: 12px 14px; border-radius: 12px; background: #2a1a1c; color: #fff; box-shadow: var(--shadow-lg); animation: subir .25s var(--ease); font-size: 13.5px; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: #7ad3a8; } .toast.erro svg { color: #ff9a8f; } .toast.info svg { color: #f3c6c9; }
.toast.saindo { opacity: 0; transform: translateY(6px); transition: all .2s; }

.md-render h1, .md-render h2 { font-family: var(--serif); font-size: 22px; margin: 18px 0 8px; }
.md-render h3 { font-size: 14px; margin: 16px 0 6px; }
.md-render p { margin: 6px 0; }
.md-render ul { padding-left: 20px; margin: 6px 0; }
.md-render table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.md-render th, .md-render td { border: 1px solid var(--border); padding: 6px 9px; text-align: left; }
.md-render th { background: var(--surface-2); }
.md-render code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.md-render blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--text-2); }

.trecho { white-space: pre-wrap; font-family: var(--serif); font-size: 15.5px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; max-height: 280px; overflow-y: auto; }
.cit { font-family: var(--mono); font-size: 11.5px; }

/* ---------------------------------------------------------------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-arte {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(90% 70% at 85% 10%, #a3202f 0%, transparent 60%), radial-gradient(70% 60% at 0% 100%, #2a0004 0%, transparent 70%), linear-gradient(140deg, #7a0000, #3a0006);
}
.auth-arte::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(80% 80% at 50% 40%, #000, transparent); }
.auth-arte img.marca { width: 112px; border-radius: 50%; box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 255, 255, .15); position: relative; }
.auth-arte h1 { font-family: var(--serif); font-size: 52px; line-height: 1.02; margin: 26px 0 14px; font-weight: 700; position: relative; max-width: 560px; }
.auth-arte p { color: rgba(255, 232, 232, .8); max-width: 480px; font-size: 15px; position: relative; }
.auth-arte .rod { font-size: 12px; color: rgba(255, 225, 225, .55); letter-spacing: .14em; text-transform: uppercase; position: relative; }
.auth-arte .tr { display: flex; gap: 22px; margin-top: 30px; position: relative; flex-wrap: wrap; }
.auth-arte .tr div { font-size: 12.5px; color: rgba(255, 232, 232, .75); }
.auth-arte .tr b { display: block; font-family: var(--serif); font-size: 30px; color: #fff; line-height: 1; margin-bottom: 4px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-form form { width: min(380px, 100%); }
.auth-form h2 { font-family: var(--serif); font-size: 34px; margin: 0 0 6px; }

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-painel, .g3 { grid-template-columns: 1fr; }
  .editor-wrap { grid-template-columns: 1fr; }
  .editor-wrap .previa-col { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-102%); transition: transform .25s var(--ease); }
  .side.aberto { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .busca-btn { min-width: 0; width: 38px; padding: 0; justify-content: center; height: 36px; }
  .busca-btn span, .busca-btn kbd { display: none; }
  .top { padding: 12px 16px; }
  .top h1 { font-size: 22px; }
  .conteudo { padding: 18px 16px 48px; }
  .auth { grid-template-columns: 1fr; }
  .auth-arte { padding: 32px 24px; min-height: 0; }
  .auth-arte h1 { font-size: 36px; }
  .g2 { grid-template-columns: 1fr; }
  .passos .passo span.tx { display: none; }
  .top .acoes-top .btn span { display: none; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .kpi .v { font-size: 34px; }
  .folha { padding: 0 22px 30px; font-size: 10px; }
  .folha .faixa { margin: 0 -22px 14px; width: calc(100% + 44px); }
  .folha blockquote { margin-left: 1.5cm; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
