/* Central de operações Afianci. Tema claro editorial sobre papel quente; tokens no topo, componentes abaixo. */
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Plex"; src: url("fonts/plex.woff2") format("woff2"); font-weight: 100 700; font-display: swap; }

:root {
  --paper: #fbfaf7; --surface: #ffffff; --surface-2: #f4f1ea; --surface-3: #ebe7dc;
  --line: #e4dfd3; --line-strong: #cdc6b6;
  --ink: #17201d; --ink-2: #47514c; --ink-3: #66706a;
  --brand: #0e4f45; --brand-2: #0a3d35; --brand-soft: #e2efe9; --brand-ink: #ffffff; --gold: #eda100;
  --good: #0ca30c; --good-soft: #e3f4e3; --good-ink: #0a660a;
  --warn: #fab219; --warn-soft: #fdf1d2; --warn-ink: #755200;
  --serious: #ec835a; --serious-soft: #fbe6dc; --serious-ink: #94401e;
  --crit: #d03b3b; --crit-soft: #f9dfdf; --crit-ink: #a02323;
  --info-soft: #e4eefb; --info-ink: #1d559f;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #8d968f;
  --seq0: #eef4fb; --seq1: #cfe2f6; --seq2: #a3c8ee; --seq3: #6fa8e3; --seq4: #2a78d6; --seq5: #1a56a3;
  --display: "Bricolage", "Plex", system-ui, sans-serif;
  --ui: "Plex", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-md: .9375rem; --fs-lg: 1.0625rem;
  --fs-h1: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem); --fs-h2: clamp(1.1rem, 1rem + .5vw, 1.3rem); --fs-kpi: clamp(1.45rem, 1.1rem + 1.2vw, 2.05rem);
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem; --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --shadow-1: 0 1px 0 rgba(23, 32, 29, .04), 0 1px 3px rgba(23, 32, 29, .06);
  --shadow-2: 0 10px 30px -12px rgba(23, 32, 29, .25), 0 2px 6px rgba(23, 32, 29, .06);
  --fast: 120ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --side: 252px; --bottom: 62px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--fs-md)/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ic { flex: none; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.strong { font-weight: 600; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.mt { margin-top: var(--sp-4); }
.mt-lg { margin-top: var(--sp-6); }
.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.rowflex { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.boot { min-height: 100dvh; display: grid; place-items: center; color: var(--ink-3); padding: var(--sp-5); text-align: center; }

/* ---------- estrutura ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; overflow: hidden; background: var(--brand-2); color: #dfe9e4; display: flex; flex-direction: column; padding: var(--sp-4) var(--sp-3); }
.side-brand { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-4); }
.side-brand img { width: 36px; height: 36px; border-radius: 9px; }
.side-brand b { display: block; font: 700 1.05rem/1.1 var(--display); color: #fff; letter-spacing: .01em; }
.side-brand span { font-size: var(--fs-xs); color: #a9c2b8; }
.side nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .28) transparent; margin-right: calc(var(--sp-3) * -1); padding-right: var(--sp-3); }
.nav-title { font-size: .6875rem; letter-spacing: .09em; text-transform: uppercase; color: #8fb0a4; padding: var(--sp-4) var(--sp-2) var(--sp-1); }
.nav-link { display: flex; align-items: center; gap: var(--sp-3); padding: .5rem var(--sp-2); border-radius: var(--r-sm); text-decoration: none; color: #dfe9e4; font-size: .9rem; min-height: 40px; transition: background-color var(--fast) var(--ease); }
.nav-link:hover { background: rgba(255, 255, 255, .08); }
.nav-link.active { background: #fbfaf7; color: var(--brand-2); font-weight: 600; }
.nav-link .ic { width: 18px; height: 18px; opacity: .9; }
.nav-count { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 99px; background: var(--gold); color: #2b1d00; font-size: .6875rem; font-weight: 700; text-align: center; line-height: 18px; }
.nav-link:focus-visible, .side .btn:focus-visible { outline-color: #fff; }
.side-foot { flex: none; padding: var(--sp-3) var(--sp-2) var(--sp-1); border-top: 1px solid rgba(255, 255, 255, .12); font-size: var(--fs-xs); color: #a9c2b8; }
.side-foot .who { color: #fff; font-size: var(--fs-sm); word-break: break-all; }
.side-foot .btn { margin-top: var(--sp-3); width: 100%; background: transparent; border-color: rgba(255, 255, 255, .25); color: #fff; }
.side-foot .btn:hover { background: rgba(255, 255, 255, .1); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); background: rgba(251, 250, 247, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .brand-mini { display: none; align-items: center; gap: var(--sp-2); font: 700 1rem var(--display); text-decoration: none; }
.topbar .brand-mini img { width: 28px; height: 28px; border-radius: 7px; }
.search { position: relative; flex: 1 1 auto; max-width: 440px; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 18px; height: 18px; }
.search input { width: 100%; padding: .5rem .75rem .5rem 2.2rem; border: 1px solid var(--line-strong); border-radius: 99px; background: var(--surface); min-height: 40px; }
.save { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }
.save::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.save[data-state="pendente"]::before, .save[data-state="salvando"]::before { background: var(--warn); }
.save[data-state="erro"]::before { background: var(--crit); }
.content { padding: var(--sp-5) var(--sp-5) var(--sp-7); width: 100%; max-width: 1320px; margin: 0 auto; flex: 1; }
.bottom-nav { display: none; }
.menu-btn { display: none; }
.drawer-backdrop { display: none; }

/* ---------- cabeçalho de página ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5); }
.eyebrow { font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--brand); font-weight: 600; }
h1 { font: 700 var(--fs-h1)/1.08 var(--display); letter-spacing: -.015em; }
.lead { color: var(--ink-2); max-width: 68ch; margin-top: var(--sp-2); }
.head-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
h2 { font: 650 var(--fs-h2)/1.2 var(--display); letter-spacing: -.005em; }
h3 { font: 600 var(--fs-md)/1.3 var(--ui); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin: var(--sp-6) 0 var(--sp-3); flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); text-decoration: none; font-size: var(--fs-sm); margin-bottom: var(--sp-3); min-height: 32px; }
.back:hover { color: var(--brand); }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 .95rem; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); font-weight: 550; font-size: .875rem; text-decoration: none; transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); }
.btn-danger { color: var(--crit-ink); border-color: #e9b9b9; }
.btn-danger:hover { background: var(--crit-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 32px; padding: 0 .65rem; font-size: var(--fs-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; border-radius: var(--r-sm); color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 550; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- superfícies ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: var(--sp-4) var(--sp-4) var(--sp-4); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.card-sub { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 2px; }
.card.tinted { background: var(--surface-2); box-shadow: none; }
.card.feature { background: var(--brand-2); color: #eef5f1; border-color: var(--brand-2); box-shadow: var(--shadow-2); }
.card.feature .card-sub, .card.feature .muted { color: #b5cdc3; }
.card.feature .btn { background: #fbfaf7; color: var(--brand-2); border-color: #fbfaf7; }
.grid { display: grid; gap: var(--sp-4); }
.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-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.g-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); align-items: start; }

/* ---------- indicadores ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.kpis { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); border-top: 3px solid var(--line-strong); min-width: 0; }
.kpi-label { font-size: var(--fs-xs); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { font: 700 var(--fs-kpi)/1.15 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; overflow-wrap: anywhere; }
.kpi-hint { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.kpi.t-brand { border-top-color: var(--brand); }
.kpi.t-ok { border-top-color: var(--good); }
.kpi.t-warn { border-top-color: var(--warn); }
.kpi.t-crit { border-top-color: var(--crit); }
.kpi.hero { grid-column: span 2; background: var(--brand-2); border-color: var(--brand-2); border-top-color: var(--gold); color: #fff; }
.kpi.hero .kpi-label, .kpi.hero .kpi-hint { color: #b5cdc3; }
.kpi.hero .kpi-value { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem); }
.kpis-lead .kpi.hero { grid-column: 1 / -1; }
@media (min-width: 1360px) { .kpis-lead { grid-template-columns: minmax(0, 1.75fr) repeat(4, minmax(0, 1fr)); } .kpis-lead .kpi.hero { grid-column: auto; } .kpis-lead .kpi:not(.hero) .kpi-value { font-size: clamp(1.3rem, .55rem + 1.1vw, 1.9rem); white-space: nowrap; } }

/* ---------- etiquetas ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: var(--fs-xs); font-weight: 600; line-height: 20px; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.b-ok { background: var(--good-soft); color: var(--good-ink); }
.b-warn { background: var(--warn-soft); color: var(--warn-ink); }
.b-serious { background: var(--serious-soft); color: var(--serious-ink); }
.b-crit { background: var(--crit-soft); color: var(--crit-ink); }
.b-info { background: var(--info-soft); color: var(--info-ink); }
.b-example { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-3); font-weight: 500; }
.b-example::before { display: none; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--s8); flex: none; }
.c1 { background: var(--s1); } .c2 { background: var(--s2); } .c3 { background: var(--s3); } .c4 { background: var(--s4); }
.c5 { background: var(--s5); } .c6 { background: var(--s6); } .c7 { background: var(--s7); } .c8 { background: var(--s8); }
.f1 { fill: var(--s1); } .f2 { fill: var(--s2); } .f3 { fill: var(--s3); } .f4 { fill: var(--s4); }
.f5 { fill: var(--s5); } .f6 { fill: var(--s6); } .f7 { fill: var(--s7); } .f8 { fill: var(--s8); }
.k1 { stroke: var(--s1); } .k2 { stroke: var(--s2); } .k3 { stroke: var(--s3); } .k4 { stroke: var(--s4); } .k5 { stroke: var(--s5); } .k6 { stroke: var(--s6); } .k7 { stroke: var(--s7); } .k8 { stroke: var(--s8); }
.linetag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; }

/* ---------- abas e filtros ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: var(--sp-4); overflow-x: auto; scrollbar-width: thin; }
.tab { border: 0; background: none; padding: .6rem .9rem; min-height: 44px; color: var(--ink-2); font-weight: 550; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab .nav-count { margin-left: 6px; }
.filters { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: end; margin-bottom: var(--sp-4); }
.filters .field { min-width: 150px; flex: 0 1 190px; }
.filters .field.wide { flex: 1 1 240px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span, .field > label { font-size: var(--fs-xs); color: var(--ink-2); font-weight: 550; }
.field input, .field select, .field textarea, .input { width: 100%; min-height: 40px; padding: .45rem .65rem; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); }
.field textarea { min-height: 84px; resize: vertical; }
.field input[type="checkbox"], .field input[type="range"] { width: auto; min-height: 0; padding: 0; }
.field .hint { font-size: var(--fs-xs); color: var(--ink-3); }
.form-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-4); flex-wrap: wrap; }
.check { display: flex; align-items: flex-start; gap: var(--sp-3); padding: .45rem 0; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.check.done span { color: var(--ink-3); text-decoration: line-through; }
input[type="range"] { accent-color: var(--brand); width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 0 .8rem; min-height: 38px; font-size: var(--fs-sm); font-weight: 550; color: var(--ink-2); }
.seg button.active { background: var(--brand); color: #fff; }

/* ---------- tabelas e listas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; padding: .6rem .75rem; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th.n, .table td.n { text-align: right; white-space: nowrap; }
.table tr.total td { font-weight: 700; background: var(--surface-2); }
.table tr.sub td { font-weight: 600; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: #faf7f0; }
.table .neg { color: var(--crit-ink); }
.table td:first-child, .table th:first-child { position: sticky; left: 0; background: inherit; }
.table th:first-child { background: var(--surface-2); z-index: 1; }
.table td:first-child { background: var(--surface); }
.table tr.total td:first-child { background: var(--surface-2); }
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); min-width: 0; }
.item:last-child { border-bottom: 0; }
.item[data-href] { cursor: pointer; }
.item[data-href]:hover .item-title { color: var(--brand); }
.item-main { flex: 1 1 auto; min-width: 0; }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
.item-meta { font-size: var(--fs-sm); color: var(--ink-2); display: flex; gap: 4px 12px; flex-wrap: wrap; margin-top: 2px; }
.item-side { text-align: right; flex: none; font-size: var(--fs-sm); }
.sev { width: 4px; align-self: stretch; border-radius: 4px; background: var(--line-strong); flex: none; }
.sev.critico { background: var(--crit); } .sev.atencao { background: var(--warn); } .sev.info { background: var(--s1); } .sev.ok { background: var(--good); }
.empty { padding: var(--sp-5); text-align: center; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.note { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--info-soft); color: #173e73; font-size: var(--fs-sm); align-items: flex-start; }
.note.warn { background: var(--warn-soft); color: #5c4000; }
.note.crit { background: var(--crit-soft); color: #7d1b1b; }
.note.ok { background: var(--good-soft); color: #0a520a; }
.note.plain { background: var(--surface-2); color: var(--ink-2); }
.banner { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5); background: var(--warn-soft); color: #5c4000; font-size: var(--fs-sm); border-bottom: 1px solid #ecd9a6; flex-wrap: wrap; }
.banner.crit { background: var(--crit-soft); color: #7d1b1b; border-color: #ecc0c0; }
.banner .btn { margin-left: auto; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 6px var(--sp-3); font-size: var(--fs-sm); }
.kv dt { color: var(--ink-3); }
.kv dd { font-weight: 550; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .8125rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3); white-space: pre-wrap; overflow-wrap: anywhere; }
.keybox { font: 700 1.15rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: .08em; background: var(--surface-2); border: 1px dashed var(--brand); border-radius: var(--r-md); padding: var(--sp-4); text-align: center; overflow-wrap: anywhere; }

/* ---------- progresso ---------- */
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter-fill { height: 100%; width: 0; border-radius: 99px; background: var(--brand); }
.meter-fill.ok { background: var(--good); } .meter-fill.warn { background: var(--warn); } .meter-fill.crit { background: var(--crit); }
.meter.tall { height: 14px; position: relative; overflow: visible; }
.meter.tall .meter-fill { border-radius: 99px; }
.meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); left: 0; }

/* ---------- workflow ---------- */
.phases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.phase { padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.phase.is-done { background: var(--good-soft); border-color: #c5e6c5; }
.phase.is-now { background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.phase b { display: block; font: 650 .95rem var(--display); }
.phase span { font-size: var(--fs-xs); color: var(--ink-2); }
.steps { margin-top: var(--sp-4); }
.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: var(--sp-3); position: relative; padding-bottom: var(--sp-4); }
.step::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink-3); font-size: var(--fs-xs); font-weight: 700; z-index: 1; }
.step.is-done .step-dot { background: var(--good); border-color: var(--good); color: #fff; }
.step.is-done::before { background: var(--good); }
.step.is-now .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.step-body { min-width: 0; padding-top: 4px; }
.step-name { font-weight: 600; }
.step.is-next .step-name, .step.is-next .step-meta { color: var(--ink-3); }
.step-meta { font-size: var(--fs-sm); color: var(--ink-2); display: flex; gap: 4px 12px; flex-wrap: wrap; }
.step-card { margin-top: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--brand); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-2); }
.step-why { color: var(--ink-2); font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding-bottom: var(--sp-3); }
.tl::before { content: ""; position: absolute; left: -22px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--good); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--good); }
.tl.planned::before { background: var(--surface); box-shadow: 0 0 0 2px var(--line-strong); }
.tl.today::before { background: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.tl-date { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-label { font-weight: 600; font-size: .9rem; }
.tl-detail { font-size: var(--fs-sm); color: var(--ink-2); }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-2); scroll-snap-type: x proximity; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--sp-3); scroll-snap-align: start; min-width: 0; }
.kcol-head { display: flex; justify-content: space-between; gap: var(--sp-2); align-items: baseline; margin-bottom: var(--sp-2); }
.kcol-head b { font: 650 .9rem var(--display); }
.kcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3); margin-top: var(--sp-2); text-decoration: none; box-shadow: var(--shadow-1); border-left: 4px solid var(--line-strong); transition: transform var(--fast) var(--ease); }
button.kcard { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.kcard:hover { transform: translateY(-2px); }
.kcard.critico { border-left-color: var(--crit); } .kcard.atencao { border-left-color: var(--warn); } .kcard.info { border-left-color: var(--s1); }
.kcard b { display: block; font-size: .875rem; overflow-wrap: anywhere; }
.kcard span { font-size: var(--fs-xs); color: var(--ink-2); display: block; }

/* ---------- gráficos ---------- */
.chart { width: 100%; min-height: 60px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 400 11px var(--ui); fill: var(--ink-3); }
.chart .val { fill: var(--ink); font-weight: 600; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dash { stroke-dasharray: 5 4; }
.chart .ring { stroke: var(--surface); stroke-width: 2; }
.chart .proj { opacity: .42; }
.chart .target { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .hit { fill: transparent; }
.chart .hit:hover, .chart .hit:focus { fill: rgba(23, 32, 29, .05); outline: none; }
.chart .today-line { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 3 3; }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: var(--sp-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg-line { width: 16px; height: 2px; background: var(--ink); border-radius: 2px; }
.legend .lg-proj { opacity: .42; }
.barlist { display: flex; flex-direction: column; gap: 10px; }
.bl-row { display: grid; grid-template-columns: minmax(90px, 30%) minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; font-size: var(--fs-sm); }
.bl-row[data-href] { cursor: pointer; }
.bl-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bl-track { height: 16px; background: transparent; position: relative; }
.bl-bar { height: 16px; width: 0; min-width: 2px; background: var(--s1); border-radius: 0 4px 4px 0; }
.bl-bar.neutral { background: var(--s8); }
.bl-val { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; text-align: right; }
.bl-val small { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.stackbar { display: flex; height: 22px; gap: 2px; border-radius: 4px; overflow: hidden; }
.stackbar > span { display: block; min-width: 3px; width: 0; }
.heat { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: var(--fs-xs); }
.heat th { font-weight: 550; color: var(--ink-2); text-align: left; padding: 4px 6px; white-space: nowrap; }
.heat thead th { text-align: center; }
.heat td { text-align: center; padding: 8px 4px; border-radius: 4px; font-variant-numeric: tabular-nums; min-width: 54px; color: var(--ink); }
.h0 { background: var(--surface-2); color: var(--ink-3) !important; } .h1 { background: var(--seq1); } .h2 { background: var(--seq2); } .h3 { background: var(--seq3); }
.h4 { background: var(--seq4); color: #fff !important; } .h5 { background: var(--seq5); color: #fff !important; }
.tooltip { position: fixed; z-index: 100; pointer-events: none; background: var(--ink); color: #fff; font-size: var(--fs-xs); line-height: 1.45; padding: 6px 10px; border-radius: var(--r-sm); max-width: 260px; white-space: pre-line; box-shadow: var(--shadow-2); opacity: 0; transition: opacity var(--fast) var(--ease); left: 0; top: 0; }
.tooltip.on { opacity: 1; }
.spark { width: 100%; height: 34px; }

/* ---------- janelas e avisos ---------- */
.modal { border: 0; border-radius: var(--r-lg); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow-2); background: var(--surface); color: var(--ink); }
.modal-wide { width: min(820px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(23, 32, 29, .5); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-4) var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-body { padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.toasts { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 200; display: flex; flex-direction: column; gap: var(--sp-2); max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: var(--r-md); font-size: var(--fs-sm); box-shadow: var(--shadow-2); transition: opacity 300ms var(--ease), transform 300ms var(--ease); }
.toast-erro { background: var(--crit-ink); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- entrada ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-art { background: var(--brand-2); color: #eef5f1; padding: clamp(1.5rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-6); position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(237, 161, 0, .16); }
.login-art h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); max-width: 14ch; color: #fff; }
.login-art p { color: #b5cdc3; max-width: 46ch; }
.login-art ul { display: grid; gap: var(--sp-3); position: relative; z-index: 1; }
.login-art li { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: .9rem; color: #dfe9e4; }
.login-art li .ic { color: var(--gold); margin-top: 2px; }
.login-form { display: grid; place-items: center; padding: clamp(1.25rem, 4vw, 3rem); }
.login-box { width: min(400px, 100%); }
.login-box h2 { font-size: 1.5rem; }
.login-box .field { margin-top: var(--sp-4); }
.login-box .btn-primary { width: 100%; margin-top: var(--sp-5); min-height: 46px; }
.login-box .err { margin-top: var(--sp-3); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-wrap .icon-btn { position: absolute; right: 0; top: 0; }

/* ---------- guia ---------- */
.prose { max-width: 74ch; }
.prose p + p, .prose p + ul, .prose ul + p, .prose ol + p, .prose p + ol { margin-top: var(--sp-3); }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose li + li { margin-top: 6px; }
.numbered { counter-reset: n; display: grid; gap: var(--sp-3); }
.numbered > li { counter-increment: n; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.numbered > li::before { content: counter(n); width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font: 700 1.05rem var(--display); display: grid; place-items: center; }

/* ---------- telas menores ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform 220ms var(--ease); height: 100dvh; }
  .shell.drawer-open .side { transform: none; box-shadow: var(--shadow-2); }
  .shell.drawer-open .drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(23, 32, 29, .5); z-index: 50; border: 0; width: 100%; }
  .topbar { padding: var(--sp-2) var(--sp-3); gap: var(--sp-2); }
  .topbar .brand-mini { display: inline-flex; }
  .topbar .brand-mini b { display: none; }
  .menu-btn { display: inline-grid; }
  .save span { display: none; }
  .content { padding: var(--sp-4) var(--sp-3) calc(var(--bottom) + var(--sp-7)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(23, 32, 29, .06); }
  .bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--bottom); font-size: .6875rem; color: var(--ink-2); text-decoration: none; border: 0; background: none; position: relative; }
  .bn-item.active { color: var(--brand); font-weight: 600; }
  .bn-item .nav-count { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
  .toasts { bottom: calc(var(--bottom) + var(--sp-4)); left: var(--sp-3); right: var(--sp-3); max-width: none; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { padding: var(--sp-5); gap: var(--sp-4); }
  .login-art ul { display: none; }
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { align-items: flex-start; }
  .banner { padding: var(--sp-3); }
}
@media (max-width: 640px) {
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.hero { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filters .field { flex: 1 1 46%; min-width: 0; }
  .item { flex-wrap: wrap; }
  .item-side { text-align: left; flex: 1 1 100%; padding-left: calc(4px + var(--sp-3)); }
  .bl-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bl-track { grid-column: 1 / -1; order: 3; }
  .head-actions .btn { flex: 1 1 auto; }
  .kv { grid-template-columns: minmax(96px, 42%) 1fr; }
  .modal-body { padding: var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- impressão ---------- */
@media print {
  body { background: #fff; font-size: 11pt; }
  .side, .topbar, .bottom-nav, .head-actions, .btn, .icon-btn, .tabs, .filters, .banner, .toasts, .no-print { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card, .kpi, .table-wrap { box-shadow: none; break-inside: avoid; }
  .kpi.hero, .card.feature { background: #fff; color: #000; border: 1px solid #999; }
  .kpi.hero .kpi-label, .kpi.hero .kpi-hint { color: #333; }
  a { text-decoration: none; }
}
