/* hub-ds.css — DS v2 Hope (spec S2 FR12–FR15). Tokens = design/design_handoff_painel_v2_m1_m3/README.md */
:root {
  --cv: #F3F0E8; --bk: #FBFAF5; --ink: #1A1915; --gr: #6B6A62; --ln: #D8D4C8;
  --hv: rgba(26,25,21,.06); --zb: rgba(26,25,21,.03);
  --lime: #D9FF3D; --ok: #1F8A4C; --warn: #B7791F; --err: #C0392B;
  /* texto de estado (ruling T10-b, FR14): FR12 acima fica para fundos tonais, bordas, barras e pontos; texto usa
     estes — mesmo matiz/croma em OKLab, só mais escuros, ≥ 4.5:1 em --bk, --cv, linha zebra/hover e fundos tonais */
  --ok-text: #007135; --warn-text: #915500; --err-text: #B42D20;
  --spacing-outer: 10px; --spacing-block: 16px; --spacing-menu: 10px;
  --r-shell: 18px; --r-ctl: 10px; --r-item: 8px; --r-stage: 6px; --r-box: 12px;
  --sans: 'Space Grotesk', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sidebar-w: 200px; --sidebar-w-min: 66px;
  --sh-overlay: 0 10px 30px rgba(0,0,0,.08); --sh-drawer: -10px 0 40px rgba(0,0,0,.12); --sh-modal: 0 20px 60px rgba(0,0,0,.18);
  --logo-filter: none; --scrim: rgba(10,10,8,.38);
}
[data-theme="dark"] {
  --cv: #161613; --bk: #1D1D19; --ink: #F1EEE6; --gr: #A6A398; --ln: #2E2D28;
  --hv: rgba(241,238,230,.07); --zb: rgba(241,238,230,.035);
  --ok: #4CC27E; --warn: #E0A544; --err: #EC6A5C;
  --ok-text: var(--ok); --warn-text: var(--warn); --err-text: #FA7768;   /* --err escuro cai < 4.5 no badge em linha zebra/hover */
  --logo-filter: invert(1) brightness(.95);
}

/* reset + base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { min-height: 100%; background: var(--cv); color: var(--ink); font: 400 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gr { color: var(--gr); } .ok { color: var(--ok-text); } .warn { color: var(--warn-text); } .err { color: var(--err-text); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; } }

/* casca (layout em blocos: 10px da borda, 16px entre blocos, 10px laterais no menu) */
.hub-canvas { display: flex; gap: var(--spacing-block); padding: var(--spacing-outer); height: 100vh; height: 100dvh; }
.hub-sidebar { position: relative; width: var(--sidebar-w); flex: none; display: flex; flex-direction: column; background: var(--bk); border: 1px solid var(--ln); border-radius: var(--r-shell); overflow: hidden; }
.hub-sidebar.is-collapsed { width: var(--sidebar-w-min); align-items: center; }
.hub-sidebar-logo { padding: 14px var(--spacing-menu) 8px; display: flex; justify-content: center; }
.hub-sidebar-logo img { width: 132px; height: auto; display: block; filter: var(--logo-filter); }
.hub-sidebar.is-collapsed .hub-sidebar-logo { padding: 18px 0 12px; font-weight: 700; font-size: 20px; }
.hub-nav { flex: 1; min-height: 0; overflow: auto; padding: 8px var(--spacing-menu) 0; display: flex; flex-direction: column; gap: 2px; }
.hub-nav-item { position: relative; height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 12px; border-radius: var(--r-item); font-weight: 500; text-decoration: none; white-space: nowrap; width: 100%; }
.hub-nav-item:hover { background: var(--hv); }
.hub-nav-item.is-active { background: var(--hv); }
.hub-nav-item.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--ink); }
.hub-nav-item.is-disabled { color: var(--gr); cursor: not-allowed; }
.hub-nav-item.is-disabled:hover { background: transparent; }
.hub-nav-item .caret { font-size: 11px; color: var(--gr); }
.hub-nav-item .aside { font: 400 11px var(--mono); color: var(--gr); }
.hub-sub { display: flex; flex-direction: column; gap: 2px; margin-left: 16px; padding-left: 8px; border-left: 1px solid var(--ln); }
.hub-sub .hub-nav-item { height: 30px; padding: 0 10px; font-size: 13px; font-weight: 400; color: var(--gr); border-radius: 7px; }
.hub-sub .hub-nav-item.is-active { color: var(--ink); }
.hub-nav-sep { height: 1px; background: var(--ln); margin: 10px 4px; flex: none; }
.hub-sidebar.is-collapsed .hub-nav { padding: 8px var(--spacing-menu); }
.hub-sidebar.is-collapsed .hub-nav-item { width: 44px; height: 36px; justify-content: center; padding: 0; font: 500 12px var(--mono); }
.hub-sidebar.is-collapsed .hub-nav-item.is-active::before { left: -10px; top: 9px; bottom: 9px; }
.hub-sidebar.is-collapsed .hub-sub, .hub-sidebar.is-collapsed .caret, .hub-sidebar.is-collapsed .aside, .hub-sidebar.is-collapsed .hub-sidebar-foot-text { display: none; }
.hub-sidebar-foot { padding: 8px var(--spacing-menu) 14px; width: 100%; }
.hub-sidebar-foot-inner { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--ln); }
.hub-sidebar.is-collapsed .hub-sidebar-foot-inner { justify-content: center; padding: 8px 0; border-top: 0; }
.hub-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--hv); display: grid; place-items: center; font: 500 11px var(--mono); flex: none; }
.hub-sidebar-foot-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.hub-sidebar-foot-text b { font-size: 13px; font-weight: 500; } .hub-sidebar-foot-text span { font-size: 12px; color: var(--gr); }
.hub-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--spacing-block); }
.hub-topbar { height: 52px; flex: none; display: flex; align-items: center; gap: var(--spacing-block); padding: 0 8px; }
.hub-topbar-ctx { margin-right: auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hub-topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.hub-topbar-stamp { font: 400 12px var(--mono); color: var(--gr); }
.hub-topbar-stamp button { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.hub-topbar-actions { display: flex; align-items: center; gap: 8px; }
.hub-search { width: 300px; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; border: 1px solid var(--ln); border-radius: var(--r-ctl); background: var(--bk); color: var(--gr); }
.hub-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); }
.hub-search kbd { font: 500 11px var(--mono); padding: 3px 6px; border: 1px solid var(--ln); border-radius: 5px; }
.hub-help { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--ln); background: var(--bk); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.hub-page { flex: 1; min-height: 0; overflow: auto; background: var(--bk); border: 1px solid var(--ln); border-radius: var(--r-shell); padding: var(--spacing-block); display: flex; flex-direction: column; gap: var(--spacing-block); container-type: inline-size; }
.hub-mobile-header, .hub-drawer-scrim, .hub-burger { display: none; }
.hub-collapse { height: 32px; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: var(--r-item); font-size: 13px; color: var(--gr); white-space: nowrap; }
.hub-collapse:hover { background: var(--hv); color: var(--ink); }
.hub-sidebar.is-collapsed .hub-collapse { width: 44px; justify-content: center; padding: 0; }
.hub-drawer-close { display: none; }

/* controles */
.btn { height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-ctl); font-size: 14px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.btn-primary { background: var(--ink); color: var(--cv); }
.btn-secondary { border-color: var(--ln); background: var(--bk); }
.btn-danger { background: var(--err); color: #fff; }
.btn-warn { border-color: var(--warn); color: var(--warn-text); background: var(--bk); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 500; }
.input { height: 42px; width: 100%; padding: 0 12px; border: 1px solid var(--ln); border-radius: var(--r-ctl); background: var(--bk); }
.input:focus { outline: none; border: 1.5px solid var(--ink); }
.input.is-invalid { border: 1.5px solid var(--err); }
.field-error { font-size: 13px; color: var(--err-text); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--ln); border-radius: var(--r-ctl); background: var(--bk); font-size: 13px; font-weight: 500; }
.segmented button { padding: 5px 10px; border-radius: 7px; color: var(--gr); }
.segmented button.is-on { background: var(--hv); color: var(--ink); }
.field .segmented { align-self: flex-start; }
.chip { height: 36px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ln); border-radius: 18px; background: var(--bk); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip.is-on { border-color: var(--ink); background: var(--hv); }
.chip .caret { font-size: 10px; color: var(--gr); }
.chip.is-on button.caret { font-size: 14px; width: 22px; height: 22px; margin-right: -6px; border-radius: 50%; display: grid; place-items: center; } .chip.is-on button.caret:hover { background: var(--ln); color: var(--ink); }
.menu { position: absolute; z-index: 30; width: 300px; padding: 6px; background: var(--bk); border: 1px solid var(--ln); border-radius: var(--r-box); box-shadow: var(--sh-overlay); display: flex; flex-direction: column; gap: 2px; }
.menu-item { height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: var(--r-item); font-size: 14px; text-align: left; width: 100%; }
.menu-item:hover, .menu-item.is-on { background: var(--hv); }
.menu-item .box { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--ln); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--cv); flex: none; }
.menu-item.is-on .box { border-color: var(--ink); background: var(--ink); }
.menu-item .count { margin-left: auto; font: 400 12px var(--mono); color: var(--gr); }
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-ok { background: color-mix(in oklab, var(--ok) 12%, transparent); color: var(--ok-text); }
.badge-warn { background: color-mix(in oklab, var(--warn) 12%, transparent); color: var(--warn-text); }
.badge-err { background: color-mix(in oklab, var(--err) 12%, transparent); color: var(--err-text); }
.badge-gr { background: color-mix(in oklab, var(--gr) 12%, transparent); color: var(--gr); }
.badge-ink { background: color-mix(in oklab, var(--ink) 11%, transparent); color: var(--ink); }
.badge-outline { background: transparent; border: 1px solid var(--ink); color: var(--ink); }
.badge-stage { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: var(--r-stage); border: 1px solid var(--ln); font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge-stage .n { font-family: var(--mono); }
.badge-stage.is-win { background: var(--lime); border-color: var(--lime); color: #1A1915; }

/* KPIs: faixa com réguas, não cards */
.kpis { display: flex; flex-wrap: wrap; padding: 4px 0 20px; border-bottom: 1px solid var(--ln); position: relative; }
.kpi { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 0 16px; border-left: 1px solid var(--ln); position: relative; }
.kpi:first-child { border-left-color: transparent; }
.kpi-value { font: 500 24px/1.1 var(--mono); letter-spacing: -0.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; color: var(--gr); }
.kpi-delta { font: 500 12px var(--mono); }
.kpi-info { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--gr); color: var(--gr); display: grid; place-items: center; font: 700 10px var(--mono); }
.kpi-info.is-warn { border-color: var(--warn); color: var(--warn-text); }
.kpi-info-wrap { position: relative; display: inline-flex; flex: none; }
.popover { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; max-width: calc(100vw - 32px); padding: 12px 14px; text-align: left; white-space: normal; font-weight: 400; background: var(--bk); border: 1px solid var(--ln); border-radius: var(--r-ctl); font-size: 13px; line-height: 1.5; box-shadow: var(--sh-overlay); color: var(--ink); }
.popover b { font-weight: 700; }
@container (max-width: 1199px) { .kpis { row-gap: 16px; } .kpi { flex: 0 0 33.333%; } .kpi:nth-child(3n+1) { border-left-color: transparent; } }
/* celular: 2 por linha (3 cortava o valor); régua some na 1ª célula de cada linha */
@container (max-width: 599px) {
  .kpi { flex: 0 0 50%; padding: 0 12px; } .kpi-value { font-size: 20px; }
  .kpi:nth-child(3n+1) { border-left-color: var(--ln); } .kpi:nth-child(2n+1) { border-left-color: transparent; }
}

/* tabela */
.toolbar { display: flex; align-items: center; gap: 8px; position: relative; flex-wrap: wrap; }
.toolbar .search { width: 340px; max-width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--ln); border-radius: var(--r-ctl); background: var(--bk); }
.toolbar .spacer { margin-left: auto; }
.toolbar .btn { height: 36px; }
.tbl { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tbl-head, .tbl-row { display: grid; grid-template-columns: var(--cols); align-items: center; }
.tbl-head { font-size: 12px; font-weight: 500; color: var(--gr); border-bottom: 1px solid var(--ln); position: sticky; top: 0; background: var(--bk); z-index: 1; }
.tbl-head .tbl-cell { padding: 12px; }
.tbl-row { height: 44px; font-size: 14px; cursor: pointer; }
.tbl-row:nth-child(even) { background: var(--zb); }
.tbl-row:hover { background: var(--hv); }
.tbl-cell { padding: 0 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-cell.right { text-align: right; }
.tbl-cell .sub { display: block; font: 400 11px var(--mono); color: var(--gr); line-height: 1.2; }
.tbl-cell.name { line-height: 1.2; font-weight: 500; }
.tbl-foot { display: flex; align-items: center; gap: 16px; padding-top: 12px; border-top: 1px solid var(--ln); margin-top: auto; flex-wrap: wrap; }
.legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-right: auto; font-size: 12px; color: var(--gr); }
.pager { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--gr); }
.pager .range { font-family: var(--mono); color: var(--ink); }
.pager .sizes { display: flex; border: 1px solid var(--ln); border-radius: var(--r-item); padding: 2px; gap: 2px; font: 500 12px var(--mono); }
.pager .sizes button { padding: 4px 8px; border-radius: 6px; } .pager .sizes button.is-on { background: var(--hv); color: var(--ink); }
.pager .nav { display: flex; gap: 4px; } .pager .nav button { width: 30px; height: 30px; border: 1px solid var(--ln); border-radius: var(--r-item); } .pager .nav button[disabled] { opacity: .45; cursor: not-allowed; }
@container (max-width: 1199px) { .hide-1200 { display: none !important; } .tbl-head, .tbl-row { grid-template-columns: var(--cols-narrow, var(--cols)); } }

/* estados */
.empty { padding: 64px 48px; max-width: 560px; display: flex; flex-direction: column; gap: 16px; }
.empty h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.015em; } .empty.sm { padding: 72px 12px; gap: 10px; } .empty.sm h2 { font-size: 20px; }
.empty p { font-size: 16px; line-height: 1.5; color: var(--gr); } .empty.sm p { font-size: 14px; }
.empty .link { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.empty .row { display: flex; gap: 8px; flex-wrap: wrap; }
.skeleton { background: var(--hv); border-radius: 6px; animation: hub-pulse 1.2s ease-in-out infinite; }
@keyframes hub-pulse { 50% { opacity: .55; } }
.chart-wrap { position: relative; height: 260px; }
.chart-empty { height: 220px; border: 1px dashed var(--ln); border-radius: 14px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 0 32px; }
.chart-empty b { font-size: 16px; font-weight: 700; } .chart-empty p { font-size: 14px; color: var(--gr); }

/* drawer / modal / toast */
.drawer { position: fixed; right: var(--spacing-outer); top: var(--spacing-outer); bottom: var(--spacing-outer); width: 480px; max-width: calc(100vw - 20px); z-index: 50; background: var(--bk); border: 1px solid var(--ln); border-radius: var(--r-shell); box-shadow: var(--sh-drawer); display: flex; flex-direction: column; overflow: hidden; transform: translateX(16px); opacity: 0; transition: transform .2s ease-out, opacity .2s ease-out; }
.drawer.is-open { transform: none; opacity: 1; }
.drawer-scrim { position: fixed; inset: 0; z-index: 49; background: var(--scrim); }
.drawer-head { padding: 20px 20px 16px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--ln); }
.drawer-head .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
.drawer-head .code { font: 400 13px var(--mono); color: var(--gr); }
.drawer-head .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.drawer-body { padding: 16px 20px; overflow: auto; display: flex; flex-direction: column; gap: 18px; }
.drawer-body section { display: flex; flex-direction: column; gap: 10px; } .drawer-body section + section { border-top: 1px solid var(--ln); padding-top: 16px; }
.drawer-body h3 { font-size: 14px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; } .kv div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv span { font-size: 12px; color: var(--gr); } .kv b { font-weight: 400; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.close { width: 32px; height: 32px; border: 1px solid var(--ln); border-radius: var(--r-item); display: grid; place-items: center; flex: none; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; min-height: 32px; }
.tl-item .rail { position: relative; display: flex; justify-content: center; } .tl-item .rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ln); }
.tl-item .dot { position: relative; margin-top: 5px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--ink); }
.tl-todo .dot { border-color: var(--gr); background: var(--bk); } .tl-todo .txt { color: var(--gr); }
.tl-admin .dot { border-radius: 2px; border-color: var(--gr); background: var(--bk); }
.tl-item .txt { font-size: 14px; line-height: 1.35; padding-bottom: 8px; } .tl-item .when { font: 400 12px var(--mono); color: var(--gr); padding-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.confirm { padding: 12px; border-radius: var(--r-box); background: color-mix(in oklab, var(--err) 9%, transparent); border: 1px solid color-mix(in oklab, var(--err) 35%, transparent); display: flex; flex-direction: column; gap: 10px; width: 100%; }
.confirm b { color: var(--err-text); } .confirm .row { display: flex; gap: 8px; }
.modal-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; place-items: center; padding: 16px; }
.modal { width: 520px; max-width: 100%; max-height: calc(100vh - 32px); overflow: auto; background: var(--bk); border: 1px solid var(--ln); border-radius: var(--r-shell); box-shadow: var(--sh-modal); display: flex; flex-direction: column; }
.modal.wide { width: 720px; }
.modal-head { padding: 20px 20px 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal.wide .modal-head { padding-bottom: 20px; border-bottom: 1px solid var(--ln); }
.modal-head h2 { font-size: 20px; font-weight: 700; } .modal-head p { font-size: 14px; color: var(--gr); margin-top: 4px; }
.modal-head .meta { display: flex; gap: 12px; font: 400 12px var(--mono); color: var(--gr); margin-top: 6px; flex-wrap: wrap; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-body .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.modal-body .section { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--ln); padding-top: 16px; }
.modal-body .section-head { display: flex; align-items: baseline; justify-content: space-between; } .modal-body .section-head b { font-size: 14px; font-weight: 700; } .modal-body .section-head span { font-size: 12px; color: var(--gr); }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--ln); display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.modal-foot .dirty { margin-right: auto; font-size: 13px; color: var(--gr); }
.toast-stack { position: fixed; right: 26px; bottom: 26px; width: 400px; max-width: calc(100vw - 24px); z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px; background: var(--bk); border: 1px solid var(--ln); border-radius: var(--r-box); font-size: 14px; line-height: 1.45; box-shadow: var(--sh-overlay); }
.toast .ico { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.toast-ok .ico { background: color-mix(in oklab, var(--ok) 14%, transparent); color: var(--ok-text); }
.toast-err { border-color: color-mix(in oklab, var(--err) 40%, var(--ln)); } .toast-err .ico { background: color-mix(in oklab, var(--err) 14%, transparent); color: var(--err-text); }
.toast .msg { flex: 1; font-weight: 500; } .toast .x { color: var(--gr); }

/* login / sessão expirada */
.login-canvas { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 24px; }
.login-logo { width: 200px; height: auto; filter: var(--logo-filter); }
.login-card { width: 400px; max-width: 100%; padding: 32px; background: var(--bk); border: 1px solid var(--ln); border-radius: var(--r-shell); display: flex; flex-direction: column; gap: 20px; }
.login-card .step { font: 500 12px var(--mono); color: var(--gr); } .login-card h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.015em; } .login-card .lead { font-size: 15px; line-height: 1.5; color: var(--gr); }
.login-card .lead .link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.login-card .input { height: 44px; } .login-card .btn { height: 44px; font-size: 15px; width: 100%; }
.login-card .note { font-size: 13px; color: var(--gr); line-height: 1.5; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { height: 56px; width: 100%; text-align: center; border: 1.5px solid var(--ln); border-radius: var(--r-ctl); background: var(--bk); font: 500 26px var(--mono); }
.otp input:focus { outline: none; border-color: var(--ink); }
.otp.is-invalid input { border-color: var(--err); background: color-mix(in oklab, var(--err) 5%, transparent); }
/* FR14: o inválido tem a mesma especificidade do :focus e vem depois; sem isto o campo focado com erro não tem anel */
.input.is-invalid:focus, .otp.is-invalid input:focus { outline: 2px solid var(--ink); outline-offset: 2px; }
.alert-err { padding: 10px 12px; border-radius: var(--r-ctl); background: color-mix(in oklab, var(--err) 10%, transparent); color: var(--err-text); font-size: 14px; font-weight: 500; line-height: 1.4; }
.resend { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--gr); } .resend .t { font-family: var(--mono); } .resend button { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.resend-bar { height: 3px; border-radius: 2px; background: var(--ln); overflow: hidden; } .resend-bar div { height: 100%; background: var(--gr); transition: width 1s linear; }
.expired { position: fixed; inset: 0; z-index: 80; background: var(--cv); color: var(--ink); display: flex; flex-direction: column; justify-content: space-between; padding: 48px 64px; }
.expired .body { display: flex; flex-direction: column; gap: 24px; max-width: 760px; }
.expired h1 { font-size: 64px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.02; } .expired p { font-size: 20px; color: var(--gr); }
.expired .btn { align-self: flex-start; height: 48px; padding: 0 22px; font-size: 16px; }
.expired .stamp { font: 400 12px var(--mono); color: var(--gr); }

/* gráfico de barras (DOM, sem lib) */
.bars-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bars-head b { font-size: 16px; font-weight: 700; }
.bars-goal { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gr); } .bars-goal i { width: 18px; border-top: 1.5px dashed var(--ink); } .bars-goal .mono { color: var(--ink); }
.bars { position: relative; height: 260px; display: grid; grid-template-columns: 48px repeat(var(--n), minmax(0, 1fr)); column-gap: 20px; align-items: end; padding-bottom: 28px; }
.bars .axis { position: absolute; left: 0; right: 0; top: 0; bottom: 28px; display: flex; flex-direction: column; justify-content: space-between; font: 400 11px var(--mono); color: var(--gr); pointer-events: none; }
.bars .axis div { display: flex; align-items: center; gap: 8px; height: 0; } .bars .axis span { width: 40px; text-align: right; } .bars .axis i { flex: 1; border-top: 1px solid var(--ln); }
.bars .goal-line { position: absolute; left: 56px; right: 0; border-top: 1.5px dashed var(--ink); z-index: 1; }
.bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar .v { font: 500 12px var(--mono); color: var(--gr); white-space: nowrap; } .bar.is-current .v { color: var(--ink); }
.bar .b { flex: none; width: 100%; max-width: 64px; background: var(--ink); border: 1px solid var(--ink); border-radius: 4px 4px 0 0; }
.bar.is-current .b { background: var(--bk); border: 1.5px solid var(--ink); }
.bar.is-current.is-win .b { background: var(--lime); border: 1px solid #1A1915; }
.bar .m { position: absolute; bottom: -24px; font-size: 12px; color: var(--gr); }
.side-list { display: flex; flex-direction: column; gap: 12px; }
.side-list .row { display: flex; flex-direction: column; gap: 6px; }
.side-list .l { display: flex; align-items: baseline; gap: 8px; font-size: 14px; } .side-list .l b { flex: 1; min-width: 0; font-weight: 500; } .side-list .l .n { font: 400 12px var(--mono); color: var(--gr); } .side-list .l .v { font: 500 13px var(--mono); width: 96px; text-align: right; white-space: nowrap; }
.side-list .track { height: 6px; border-radius: 3px; background: var(--zb); } .side-list .track div { height: 100%; border-radius: 3px; }
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.kpis + .two-col { margin-top: var(--spacing-block); }
.two-col > section { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.two-col > section:first-child { padding-right: 16px; border-right: 1px solid var(--ln); }
@container (max-width: 899px) { .two-col { grid-template-columns: 1fr; } .two-col > section:first-child { padding-right: 0; border-right: 0; } }

/* celular (< 720px): sem moldura */
@media (max-width: 719px) {
  .hub-canvas { display: block; padding: 0; height: auto; }
  /* fechada: visibility:hidden tira os links do Tab (FR14); o hidden só entra depois do slide de saída */
  .hub-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 55; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease-out, visibility 0s linear .2s; border-radius: 0 var(--r-shell) var(--r-shell) 0; }
  .hub-sidebar.is-mobile-open { transform: none; visibility: visible; transition-delay: 0s; box-shadow: 8px 0 30px rgba(0,0,0,.15); }
  @media (prefers-reduced-motion: reduce) { .hub-sidebar { transition-delay: 0s !important; } }
  .hub-drawer-scrim.is-on { display: block; position: fixed; inset: 0; z-index: 54; background: rgba(10,10,8,.45); }
  .hub-topbar { display: none; }
  .hub-mobile-header { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 14px; background: var(--bk); border-bottom: 1px solid var(--ln); position: sticky; top: 0; z-index: 10; }
  .hub-burger, .hub-mobile-header .hub-help { display: grid; width: 38px; height: 38px; border: 1px solid var(--ln); border-radius: var(--r-ctl); place-items: center; background: var(--bk); }
  .hub-mobile-header .ctx { margin-right: auto; min-width: 0; } .hub-mobile-header .hub-topbar-title { font-size: 17px; } .hub-mobile-header .hub-topbar-stamp { font-size: 11px; }
  .hub-page { border: 0; border-radius: 0; padding: 16px; overflow: visible; }
  .btn-primary, .btn-secondary { width: 100%; height: 48px; }
  .toast-stack { left: 12px; right: 12px; bottom: 16px; width: auto; }
  .drawer { right: 0; top: 0; bottom: 0; width: 100vw; max-width: 100vw; border-radius: 0; }
  .empty { padding: 40px 0; }
  .expired { padding: 32px 20px; } .expired h1 { font-size: 40px; }
  .hub-collapse { display: none; }
  .hub-drawer-close.is-on { display: grid; place-items: center; position: fixed; left: 270px; top: 12px; z-index: 56; width: 38px; height: 38px; border: 1px solid var(--ln); border-radius: var(--r-ctl); background: var(--bk); font-size: 18px; }
}
