/* Layout: the shop at night. Black sign rail with the decal logo, asphalt/concrete floor, garage-floor yellow lines for
   attention, the blue of the "3" for action, checkered flag for "done". Wide italic type like the logo lettering. */
:root {
  color-scheme: dark;
  --bg: #0B0C0E; --surface: #141619; --surface-2: #1B1E22; --surface-3: #262A30;
  --line: #2A2E35; --line-strong: #3B4049;
  --fg: #F3F5F7; --fg-2: #BAC1CA; --muted: #868E99;
  --brand: #1E94DC; --brand-hi: #52B5F3; --brand-soft: rgba(30,148,220,.16); --on-brand: #FFFFFF;
  --hazard: #F4C21C; --hazard-ink: #121212; --hazard-soft: rgba(244,194,28,.14);
  --pos: #3CC47F; --pos-soft: rgba(60,196,127,.14);
  --neg: #F2574C; --neg-soft: rgba(242,87,76,.14);
  --warn: #F2B51B; --warn-soft: rgba(242,181,27,.14);
  --side: #000000; --side-fg: #EEF1F4; --side-muted: #7C8696; --side-line: #17191D;
  --bar-2: #5D6573;
  --decal: #000000;
  --shadow: 0 14px 34px rgba(0,0,0,.5);
  --f-display: "Saira", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-body: "Saira", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 4px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #E6E7E9; --surface: #FFFFFF; --surface-2: #F2F3F4; --surface-3: #E1E3E6;
    --line: #D2D5DA; --line-strong: #B9BEC6;
    --fg: #0B0C0E; --fg-2: #353B44; --muted: #636B77;
    --brand: #0A7DC4; --brand-hi: #0868A4; --brand-soft: rgba(10,125,196,.10);
    --hazard: #E2B000; --hazard-ink: #121212; --hazard-soft: rgba(226,176,0,.16);
    --pos: #158A4D; --pos-soft: rgba(21,138,77,.10);
    --neg: #CC362D; --neg-soft: rgba(204,54,45,.09);
    --warn: #9C6A00; --warn-soft: rgba(226,176,0,.16);
    --bar-2: #A1A9B5;
    --shadow: 0 14px 34px rgba(15,18,24,.16);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #E6E7E9; --surface: #FFFFFF; --surface-2: #F2F3F4; --surface-3: #E1E3E6;
  --line: #D2D5DA; --line-strong: #B9BEC6;
  --fg: #0B0C0E; --fg-2: #353B44; --muted: #636B77;
  --brand: #0A7DC4; --brand-hi: #0868A4; --brand-soft: rgba(10,125,196,.10);
  --hazard: #E2B000; --hazard-ink: #121212; --hazard-soft: rgba(226,176,0,.16);
  --pos: #158A4D; --pos-soft: rgba(21,138,77,.10);
  --neg: #CC362D; --neg-soft: rgba(204,54,45,.09);
  --warn: #9C6A00; --warn-soft: rgba(226,176,0,.16);
  --bar-2: #A1A9B5;
  --shadow: 0 14px 34px rgba(15,18,24,.16);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-hi); }
.num, td.n, .kpi-v, .money { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0,1fr); min-height: 100%; }
.side { background: var(--side); color: var(--side-fg); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--side-line); padding-left: env(safe-area-inset-left, 0px); }
.side-logo { padding: 18px 16px 10px; }
.side-logo img { display: block; width: 100%; height: auto; }
.side-tag { display: flex; align-items: center; gap: 8px; padding: 0 18px 14px; font: 600 11px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--side-muted); }
.stripes { display: inline-flex; flex-direction: column; gap: 2px; }
.stripes i { display: block; height: 3px; background: var(--brand); transform: skewX(-35deg); }
.stripes i:nth-child(1) { width: 22px; } .stripes i:nth-child(2) { width: 18px; } .stripes i:nth-child(3) { width: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; flex: 1; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; color: var(--side-fg); text-decoration: none; font: 600 15px/1 var(--f-display); letter-spacing: .02em; position: relative; }
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .75; }
.nav a:hover { background: #0F1216; }
.nav a.on { background: #10161D; color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; background: var(--brand); transform: skewY(-20deg); }
.nav a.on svg { opacity: 1; color: var(--brand-hi); }
.nav .badge { margin-left: auto; background: var(--brand); color: #fff; font: 700 11px/1 var(--f-body); padding: 3px 7px; border-radius: 10px; }
.nav .badge.warn { background: #B5762A; }
.side-foot { padding: 14px 16px 18px; border-top: 1px solid var(--side-line); font-size: 12px; color: var(--side-muted); display: grid; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pos); margin-right: 6px; vertical-align: 1px; }
.dot.off { background: var(--warn); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-block: 12px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.topbar h1 { margin: 0; font: italic 800 26px/1.05 var(--f-display); letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .grow { flex: 1; }
.top-logo { display: none; height: 30px; }
.content { padding-block: 20px 96px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); display: grid; gap: 20px; min-width: 0; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--fg); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: 14px; }
.banner svg { width: 18px; height: 18px; flex: none; }
.banner > span { flex: 1; min-width: 0; }
.banner.info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.tabbar { display: none; }

/* ---------- primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font: italic 700 15px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; }
.btn-primary:hover { background: var(--brand-hi); border-color: var(--brand-hi); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-danger { color: var(--neg); }
.btn-danger.armed { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn-pos { background: var(--pos); border-color: var(--pos); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 32px; height: 32px; padding: 0; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-3); color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; }

.inp, select.inp, textarea.inp { width: 100%; height: 38px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--fg); min-width: 0; }
textarea.inp { height: auto; min-height: 76px; padding: 8px 10px; resize: vertical; line-height: 1.4; }
.inp:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.inp.r { text-align: right; font-variant-numeric: tabular-nums; }
.inp.plate-in { font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
label.f { display: grid; gap: 5px; min-width: 0; }
label.f > span { font: 600 11px/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fgrid { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0,1fr)); }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 5px; font-weight: 600; font-size: 13px; color: var(--fg-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 0 var(--line-strong), 0 0 0 1px var(--line-strong); }
.seg button .cnt { color: var(--muted); font-weight: 500; margin-left: 4px; }
.seg.tipo button.on[data-v="saida"] { background: var(--neg); color: #fff; box-shadow: none; }
.seg.tipo button.on[data-v="entrada"] { background: var(--pos); color: #fff; box-shadow: none; }
.seg.tipo button.on[data-v="transf"] { background: var(--brand); color: #fff; box-shadow: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; flex-wrap: wrap; }
.card-h h2, .sec-h h2 { margin: 0; font: italic 700 17px/1.1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; }
.card-h .hint, .sec-h .hint { color: var(--muted); font-size: 13px; }
.card-h .grow, .sec-h .grow { flex: 1; }
.card-b { padding: 14px 16px 16px; }
.sec-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-h .stripes { margin-right: 2px; }
.grid2 { display: grid; gap: 20px; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); }
.grid2e { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid3 { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.search { position: relative; min-width: 220px; flex: 1; max-width: 420px; }
.search svg { position: absolute; left: 10px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.search .inp { padding-left: 34px; }
.muted { color: var(--muted); }
.pos { color: var(--pos); } .neg { color: var(--neg); } .warn { color: var(--warn); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--fg); font: italic 700 18px/1.2 var(--f-display); text-transform: uppercase; margin-bottom: 6px; }

/* chips — skewed like the logo lettering */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 9px; font: 700 12px/1.2 var(--f-display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); background: var(--surface-3); color: var(--fg-2); }
.chip.s-orcamento { background: var(--surface-3); color: var(--fg-2); }
.chip.s-enviado { background: var(--warn-soft); color: var(--warn); }
.chip.s-aprovado { background: var(--brand-soft); color: var(--brand-hi); }
.chip.s-concluido { background: var(--pos-soft); color: var(--pos); }
.chip.s-recusado { background: var(--neg-soft); color: var(--neg); }
.chip.p-pago { background: var(--pos-soft); color: var(--pos); }
.chip.p-parcial { background: var(--warn-soft); color: var(--warn); }
.chip.p-aberto { background: var(--neg-soft); color: var(--neg); }
.chip.p-na { background: transparent; color: var(--muted); }
.chip.consig { background: var(--brand-soft); color: var(--brand-hi); }
.chip.ok { background: var(--pos-soft); color: var(--pos); }
.chip.late { background: var(--neg-soft); color: var(--neg); }

/* Mercosul plate */
.plate { display: inline-flex; flex-direction: column; align-items: stretch; border: 1.5px solid #1b1b1b; border-radius: 3px; background: #fff; color: #111; overflow: hidden; line-height: 1; vertical-align: middle; min-width: 74px; }
.plate::before { content: "BRASIL"; display: block; background: #1D4FA3; color: #fff; font: 700 6px/1 var(--f-body); letter-spacing: .25em; text-align: center; padding: 1.5px 0; }
.plate b { font: 700 12px/1 var(--f-mono); letter-spacing: .1em; padding: 3px 6px 3px; text-align: center; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 600 11px/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.n, .tbl th.n { text-align: right; white-space: nowrap; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); border-bottom: 0; }
.tbl .osn { font: 700 13px/1 var(--f-mono); color: var(--fg-2); }
.tbl .who { font-weight: 600; }
.tbl .sm { font-size: 12px; color: var(--muted); }
.mono { font-family: var(--f-mono); }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.kpi-l { font: 600 11px/1 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi-v { font: italic 800 clamp(24px, 2.3vw, 31px)/1.05 var(--f-display); letter-spacing: .01em; overflow-wrap: anywhere; }
.kpi-s { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.kpi.hero { background: linear-gradient(115deg, var(--surface) 0 62%, color-mix(in srgb, var(--brand) 16%, var(--surface)) 62% 66%, var(--surface) 66% 70%, color-mix(in srgb, var(--brand) 16%, var(--surface)) 70% 74%, var(--surface) 74%); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.delta { font-weight: 600; } .delta.up { color: var(--pos); } .delta.down { color: var(--neg); }
.money-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.money-strip > div { padding: 12px 16px; border-right: 1px solid var(--line); display: grid; gap: 4px; min-width: 0; }
.money-strip > div:last-child { border-right: 0; }
.money-strip .v { font: italic 700 21px/1.1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-strip .l { font: 600 11px/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.money-strip .tot { background: var(--surface-2); }

/* chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .ax { font: 500 11px var(--f-body); fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--line-strong); stroke-width: 1; }
.chart .b1 { fill: var(--brand); } .chart .b2 { fill: var(--bar-2); }
.chart .rl { font: 700 11px var(--f-body); }
.chart .rl.p { fill: var(--pos); } .chart .rl.n { fill: var(--neg); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: color-mix(in srgb, var(--fg) 5%, transparent); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--fg-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; z-index: 5; display: grid; gap: 2px; }
.tip b { font-size: 13px; }

.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; font-size: 14px; }
.hbar .track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 4px; background: var(--brand); }
.hbar .fill.alt { background: var(--bar-2); }

.alerts { display: grid; gap: 2px; }
.alert { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.alert:last-child { border-bottom: 0; }
.alert .ic { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); }
.alert .ic svg { width: 15px; height: 15px; }
.alert.crit .ic { background: var(--neg-soft); color: var(--neg); }
.alert.warn .ic { background: var(--warn-soft); color: var(--warn); }
.alert.info .ic { background: var(--brand-soft); color: var(--brand-hi); }
.alert .t { font-weight: 600; } .alert .d { font-size: 13px; color: var(--muted); }
.alert .v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.funnel { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.funnel > div { position: relative; padding: 12px 14px 12px 18px; background: var(--surface-2); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); display: grid; gap: 4px; min-width: 0; }
.funnel > div:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; }
.funnel .n { font: italic 800 24px/1 var(--f-display); }
.funnel .l { font: 600 11px/1.1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.funnel .v { font-size: 13px; color: var(--fg-2); font-variant-numeric: tabular-nums; }

/* ---------- OS editor ---------- */
.os-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.os-no { font: 700 13px/1 var(--f-mono); color: var(--muted); }
.stepper { display: flex; gap: 4px; flex-wrap: wrap; }
.step { padding: 6px 14px 6px 12px; font: 700 12px/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; background: var(--surface-2); color: var(--muted); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.step.done { background: var(--brand-soft); color: var(--brand-hi); }
.step.cur { background: var(--brand); color: #fff; }
.step.cur.s-concluido { background: var(--pos); }
.step.cur.s-recusado { background: var(--neg); }
.os-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; align-items: start; }
.os-main { display: grid; gap: 16px; min-width: 0; }
.os-side { position: sticky; top: 84px; display: grid; gap: 16px; }
.items { display: grid; }
.it-row { display: grid; grid-template-columns: minmax(0,1fr) 56px 96px 92px 92px 84px 32px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.it-row.hd { border-bottom: 1px solid var(--line); padding: 0 0 6px; font: 600 11px/1 var(--f-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.it-row.hd > span.n { text-align: right; }
.it-row .inp { height: 34px; }
.it-row .tot, .it-row .luc { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.it-row .luc.neg { color: var(--neg); }
.it-sub { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.it-sub .inp { height: 30px; font-size: 13px; }
.it-sub .i-orig { width: 130px; flex: none; }
.it-sub .i-forn { flex: 1; max-width: 340px; }
.it-add { display: flex; gap: 8px; padding-top: 10px; flex-wrap: wrap; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.sum-row.big { font: italic 800 26px/1.1 var(--f-display); padding: 10px 0 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.sum-row.int { font-size: 13px; color: var(--muted); }
.sum-row .inp { width: 120px; height: 32px; }
.mbar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 6px 0 2px; }
.mbar i { display: block; height: 100%; background: var(--pos); }
.int-box { border-top: 1px dashed var(--line-strong); margin-top: 8px; padding-top: 8px; }
.int-box .tag { font: 600 10px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pay { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pay:last-child { border-bottom: 0; }
.pay .sm { font-size: 12px; color: var(--muted); }
.act-col { display: grid; gap: 8px; }
.meta { font-size: 12px; color: var(--muted); display: grid; gap: 2px; }
.dirty-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-right: 6px; }

/* caixa */
.quick { display: grid; gap: 10px; grid-template-columns: auto 140px minmax(0,1.6fr) minmax(0,1.2fr) minmax(0,1fr) 130px auto; align-items: end; padding: 14px 16px; }
.quick.transf { grid-template-columns: auto 140px minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) 130px auto; }
.quick .row2 { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.quick .row2 label { display: inline-flex; gap: 6px; align-items: center; }
.pend { display: grid; }
.pend .pr { display: grid; grid-template-columns: 90px minmax(0,1fr) auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.pend .pr:last-child { border-bottom: 0; }

/* semanas */
.wk-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wk-title { font: italic 800 22px/1 var(--f-display); text-transform: uppercase; }
.close-box { display: grid; gap: 2px; }
.close-box .sum-row.big.pos { color: var(--pos); } .close-box .sum-row.big.neg { color: var(--neg); }

/* modal & toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.modal-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; width: min(640px, 100%); max-height: 100%; overflow: auto; box-shadow: var(--shadow); }
.modal-box.wide { width: min(980px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-h h3 { margin: 0; font: italic 700 19px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; flex: 1; }
.modal-b { padding: 16px 18px; display: grid; gap: 14px; }
.modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom, 0px) + 80px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.err { background: var(--neg); color: #fff; }
.loading { display: grid; place-items: center; gap: 14px; padding: 60px 16px; color: var(--muted); }
.speed { display: flex; gap: 5px; }
.speed i { width: 26px; height: 6px; background: var(--brand); transform: skewX(-35deg); animation: zoom 1s ease-in-out infinite; }
.speed i:nth-child(2) { animation-delay: .12s; } .speed i:nth-child(3) { animation-delay: .24s; } .speed i:nth-child(4) { animation-delay: .36s; }
@keyframes zoom { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.kbd { font: 600 11px var(--f-mono); padding: 1px 5px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); }
.check-list { display: grid; gap: 0; max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.check-list label { display: grid; grid-template-columns: 22px 64px minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.check-list label:last-child { border-bottom: 0; }
.how { font-size: 14px; color: var(--fg-2); display: grid; gap: 8px; }
.how p { margin: 0; max-width: 72ch; }
.how b { color: var(--fg); }
.ro .needs-write { display: none !important; }

/* ================= Nitro 3 identity ================= */
body { background-color: var(--bg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); font-stretch: 96%; }
.topbar h1 { font: italic 900 30px/1 var(--f-display); font-stretch: 118%; letter-spacing: -.005em; text-shadow: 3px 3px 0 color-mix(in srgb, var(--brand) 45%, transparent); display: inline-flex; align-items: center; gap: 12px; }
.topbar h1::after { content: ""; flex: none; width: 30px; height: 15px; background: repeating-linear-gradient(to bottom, var(--brand) 0 3px, transparent 3px 5px); clip-path: polygon(18% 0, 100% 0, 78% 100%, 0 100%); }
.topbar .sub { font-stretch: 100%; }
.card { border-radius: var(--r); }
.card-h h2, .sec-h h2 { font-weight: 800; font-stretch: 110%; display: inline-flex; align-items: center; gap: 9px; }
.card-h h2::before { content: ""; width: 5px; height: 15px; background: var(--brand); transform: skewX(-20deg); flex: none; }
.kpi, .money-strip, .modal-box { border-radius: var(--r); }
.kpi-l, .money-strip .l, label.f > span, .tbl th, .it-row.hd, .int-box .tag, .funnel .l, .side-tag { font-stretch: 82%; letter-spacing: .12em; }
.kpi-v, .money-strip .v, .sum-row.big, .funnel .n, .wk-title { font-stretch: 112%; }
.kpi.hero { background: var(--surface); border-color: var(--line); box-shadow: inset 4px 0 0 var(--brand); }
.btn { border-radius: 3px; font-stretch: 100%; }
.btn-primary, .btn-pos { position: relative; isolation: isolate; background: transparent !important; border-color: transparent !important; font: italic 800 15px/1 var(--f-display); font-stretch: 108%; letter-spacing: .04em; text-transform: uppercase; color: #fff; }
.btn-primary::before, .btn-pos::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--brand); transform: skewX(-12deg); border-radius: 2px; transition: background .15s; }
.btn-pos::before { background: var(--pos); }
.btn-primary:hover::before { background: var(--brand-hi); }
.btn-pos:hover::before { filter: brightness(1.1); }
.btn-primary:hover, .btn-pos:hover { border-color: transparent; }
.hazard { background: repeating-linear-gradient(-45deg, var(--hazard) 0 7px, var(--hazard-ink) 7px 14px); }
.alert { position: relative; padding-left: 12px; }
.alert.crit::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 5px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 4px, var(--hazard-ink) 4px 8px); }
.alert.warn .ic { background: var(--hazard-soft); color: var(--warn); }
.chip.late { background: var(--hazard); color: var(--hazard-ink); }
.chip.s-concluido::before, .step.cur.s-concluido::before { content: ""; width: 10px; height: 10px; flex: none; background: conic-gradient(#fff 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / 5px 5px; border: 1px solid #111; }
.step { display: inline-flex; align-items: center; gap: 6px; }
.nav a { font-weight: 600; font-size: 14.5px; font-stretch: 86%; letter-spacing: .01em; }
.money-strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.money-strip .v { font-size: 19px; font-stretch: 100%; }
.nav a.on { background: #0E141B; }
.nav a.on::before { background: var(--brand); width: 5px; }
.side-foot { position: relative; }
.side-foot::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 4px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 7px, #000 7px 14px); opacity: .85; }
.speed i { background: var(--brand); }
/* hero: the garage itself */
.garage { position: relative; border-radius: var(--r); overflow: hidden; min-height: 210px; background: #9aa0a6; display: grid; align-items: end; border: 1px solid var(--line); }
.garage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; image-rendering: pixelated; }
.garage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,7,10,.92) 0%, rgba(5,7,10,.78) 34%, rgba(5,7,10,.15) 64%, rgba(5,7,10,0) 100%); }
.garage-in { position: relative; z-index: 1; padding: 22px 24px 26px; display: grid; gap: 14px; max-width: 640px; color: #fff; }
.garage .eyebrow { display: inline-flex; align-items: center; gap: 10px; font: italic 800 12px/1 var(--f-display); font-stretch: 90%; letter-spacing: .2em; text-transform: uppercase; color: var(--hazard); }
.garage .eyebrow i { width: 9px; height: 9px; border-radius: 50%; background: var(--pos); box-shadow: 0 0 0 3px rgba(60,196,127,.25); }
.garage h2 { margin: 0; font: italic 900 30px/1.05 var(--f-display); font-stretch: 115%; text-shadow: 2px 2px 0 #000; text-wrap: balance; }
.garage .gstats { display: flex; gap: 10px; flex-wrap: wrap; }
.garage .gstat { display: grid; gap: 3px; padding: 8px 14px 8px 12px; background: rgba(0,0,0,.6); border-left: 3px solid var(--brand); text-decoration: none; color: #fff; min-width: 120px; }
.garage .gstat b { font: italic 800 24px/1 var(--f-display); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.garage .gstat span { font: 600 11px/1.1 var(--f-display); font-stretch: 85%; letter-spacing: .1em; text-transform: uppercase; color: #C9D0D8; }
.garage .gstat.hz { border-left-color: var(--hazard); }
.garage .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; z-index: 2; background: repeating-linear-gradient(-45deg, var(--hazard) 0 10px, #000 10px 20px); }
/* integrations added in this round */
body:not(.role-admin) .only-admin { display: none !important; }
.c1 { grid-column: span 1; }
.vchips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 13px; }
.vchip { display: inline-flex; gap: 8px; align-items: center; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface-2); cursor: pointer; color: var(--fg); font-size: 13px; }
.vchip:hover, .vchip.on { border-color: var(--brand); background: var(--brand-soft); }
.it-hint { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--fg-2); padding: 2px 0 2px; }
.it-hint:empty { display: none; }
.it-hint svg { width: 14px; height: 14px; color: var(--brand-hi); flex: none; }
.lnk { border: 0; background: none; padding: 0; color: var(--brand-hi); font-weight: 700; font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.hist { display: grid; max-height: 300px; overflow: auto; }
.hist > div { display: grid; grid-template-columns: 84px minmax(0,1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.hist > div:last-child { border-bottom: 0; }
.hist .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.steps { display: grid; gap: 10px; }
.stp { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.stp .n { width: 30px; height: 30px; display: grid; place-items: center; font: italic 800 16px/1 var(--f-display); background: var(--surface-3); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.stp.done .n { background: var(--pos); color: #fff; }
.cat-list { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }
.cat-list button { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 14px; color: var(--fg); }
.cat-list button:hover { background: var(--surface-2); }
.ai-ask { display: flex; gap: 10px; flex-wrap: wrap; }
.ai-ask .inp { flex: 1; min-width: 220px; }
.ai-answer { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; color: var(--fg); max-width: 80ch; }
.ai-answer:not(:empty) { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.ai-tag { display: inline-flex; align-items: center; gap: 6px; font: italic 800 11px/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--brand-hi); }
.rv-due { display: grid; gap: 2px; }
.rv-due small { color: var(--muted); font-size: 12px; }

@media (max-width: 700px) {
  .topbar { gap: 8px; padding-block: 10px; }
  .topbar > div:nth-child(2) { flex: 1; min-width: 0; }
  .topbar .sub { display: none; }
  .topbar > .grow { display: none; }
  #top-actions { width: 100%; flex-wrap: nowrap; gap: 8px; }
  #top-actions:empty { display: none; }
  #top-actions .btn { flex: 1 1 0; min-width: 0; height: 36px; padding: 0 8px; font-size: 13px; }
  #top-actions .btn-primary, #top-actions .btn-pos { font-size: 13px; }
  #top-actions .btn span, #top-actions .btn { overflow: hidden; text-overflow: ellipsis; }
  .garage::after { background: linear-gradient(0deg, rgba(5,7,10,.96) 0%, rgba(5,7,10,.88) 62%, rgba(5,7,10,.55) 100%); }
  .garage .eyebrow { font-size: 11px; letter-spacing: .14em; }
}
.card-b > .btn { white-space: normal; height: auto; min-height: 38px; padding-block: 8px; text-align: left; }
#tabbar { box-sizing: border-box; width: 100%; }

/* locked OS + placeholders */
.os-locked .os-main .inp, .os-locked #ed-desc { background: var(--surface); border-color: var(--line); color: var(--fg); opacity: 1; cursor: default; }
.os-locked .it-add, .os-locked [data-act="rm-item"], .os-locked [data-act="read-sheet"], .os-locked [data-act="del-os"], .os-locked #ed-flow, .os-locked #pay-form, .os-locked [data-act="rm-pay"], .os-locked .lnk[data-act="hint"], .os-locked [data-act="ai-review"] { display: none !important; }
.os-locked .os-side .card.needs-write { display: none; }
.lock-banner .btn { flex: none; }
.inp::placeholder { color: var(--muted); opacity: .55; }
.inp.plate-in::placeholder { letter-spacing: .04em; }

/* grouped navigation + quick-access blocks */
.nav { gap: 0; padding-top: 2px; }
.nav-g { display: grid; gap: 2px; padding: 4px 0 8px; }
.nav-g + .nav-g { border-top: 1px solid var(--side-line); padding-top: 8px; }
.nav-gh { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 12px 4px; background: none; border: 0; color: var(--side-muted); font: 700 11px/1 var(--f-display); font-stretch: 85%; letter-spacing: .18em; text-transform: uppercase; cursor: pointer; border-radius: 4px; }
.nav-gh:hover { color: var(--side-fg); }
.nav-gh .chev { width: 16px; height: 16px; margin-left: auto; transition: transform .2s var(--ease, ease); }
.nav-g.closed .chev { transform: rotate(-90deg); }
.nav-items { display: grid; gap: 2px; }
.nav-g.closed .nav-items { display: none; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hazard); }
.quick { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr); gap: 12px; padding: 0; align-items: stretch; }
.quick-b { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 10px; align-content: start; }
.quick-b .tile-grid { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
@media (max-width: 1280px) { .quick { grid-template-columns: minmax(0, 1fr); } }
.quick-b .qh { display: flex; align-items: baseline; gap: 10px; }
.quick-b .qh b { font: italic 800 15px/1 var(--f-display); font-stretch: 110%; letter-spacing: .05em; text-transform: uppercase; }
.quick-b .qh span { font-size: 12.5px; color: var(--muted); }
.tile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tile { position: relative; display: grid; gap: 6px; align-content: start; padding: 12px; min-height: 86px; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r); text-decoration: none; color: var(--fg); transition: border-color .16s ease, transform .16s var(--ease, ease), background-color .16s ease; }
.tile:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-2px); }
.tile svg { width: 20px; height: 20px; color: var(--brand-hi); }
.tile b { font: 700 13.5px/1.15 var(--f-display); font-stretch: 95%; }
.tile span { font-size: 12px; color: var(--muted); line-height: 1.25; }
.tile span.hz { color: var(--warn); font-weight: 600; }
.tabbar button { flex: 1 0 64px; display: grid; justify-items: center; gap: 3px; padding: 6px 4px; color: var(--side-muted); background: none; border: 0; font: 600 11px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; border-radius: 6px; cursor: pointer; }
.tabbar button svg { width: 20px; height: 20px; }
.tabbar button.on { color: #fff; background: #10161D; }
@media (max-width: 1100px) { .quick { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .quick-b .tile-grid, .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* layout fixes round 3 */
.money-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr); gap: 12px; }
.money-row .money-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.money-strip .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.money-strip .v { overflow: hidden; text-overflow: ellipsis; }
.kpi-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-s { min-height: 18px; }
.kpis { align-items: stretch; }
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-h { min-height: 30px; }
.card-h .hint { flex: 1 1 260px; min-width: 0; }
.card-h .grow + .hint, .card-h .hint + .grow { flex: 0 1 auto; }
.tbl td.who { min-width: 120px; }
.tbl .chip { vertical-align: middle; }
.sec-h { margin-top: 4px; }
.toolbar > .seg { flex-wrap: wrap; }
@media (max-width: 1440px) {
  .os-grid { grid-template-columns: minmax(0, 1fr) 304px; }
  .it-row { grid-template-columns: minmax(0, 1fr) 52px 90px 86px 86px 80px 30px; gap: 6px; }
}
@media (max-width: 1100px) {
  .money-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .money-row .money-strip { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .money-row .money-strip > div:nth-child(2n) { border-right: 0; }
  .money-row .money-strip > div { border-bottom: 1px solid var(--line); }
}

/* motion: short, eased, never blocking */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }
html { scroll-behavior: smooth; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes popOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rowIn { from { opacity: 0; } to { opacity: 1; } }
#view.enter > * { animation: viewIn .32s var(--ease) both; }
#view.enter > *:nth-child(2) { animation-delay: .04s; } #view.enter > *:nth-child(3) { animation-delay: .08s; } #view.enter > *:nth-child(4) { animation-delay: .12s; } #view.enter > *:nth-child(n+5) { animation-delay: .16s; }
#view.enter .chart .b1, #view.enter .chart .b2 { transform-box: fill-box; transform-origin: 50% 100%; animation: growY .55s var(--ease) both; }
#view.enter .hbar .fill, #view.enter .mbar i { transform-origin: 0 50%; animation: growX .6s var(--ease) both; }
.modal { animation: fadeIn .16s ease-out; }
.modal .modal-box { animation: popIn .22s var(--ease); }
.modal.closing { animation: fadeOut .16s ease-in forwards; }
.modal.closing .modal-box { animation: popOut .16s ease-in forwards; }
.toast { animation: toastIn .24s var(--ease); }
.banner { animation: fadeIn .2s ease-out; }
.btn, .icon-btn, .seg button, .nav a, .tabbar a, .vchip, .lnk, .chip, .inp, .alert, .cat-list button, .garage .gstat { transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease, opacity .16s ease; }
.btn:active, .icon-btn:active, .vchip:active { transform: translateY(1px); }
.btn-primary::before, .btn-pos::before { transition: background-color .16s ease, filter .16s ease, transform .16s var(--ease); }
.btn-primary:hover::before, .btn-pos:hover::before { transform: skewX(-12deg) scale(1.03, 1.06); }
.tbl tbody tr td { transition: background-color .14s ease; }
.alert:hover { background: var(--surface-2); }
.garage .gstat:hover { background: rgba(0,0,0,.78); transform: translateY(-1px); }
.nav a:hover svg { opacity: 1; }
.it-row { animation: rowIn .2s ease-out; }
.login-card { animation: popIn .35s var(--ease); }
.stp.done .n { transition: background-color .25s ease; }

/* login */
body.locked .app { display: none; }
#login { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: #050608; overflow: auto; }
#login .login-bg { position: absolute; inset: 0; overflow: hidden; }
#login .login-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; image-rendering: pixelated; opacity: .3; }
#login .login-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(5,6,8,.35) 0%, rgba(5,6,8,.92) 75%); }
.login-card { position: relative; width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 26px 24px 34px; display: grid; gap: 14px; box-shadow: var(--shadow); overflow: hidden; }
.login-logo { width: 220px; max-width: 100%; justify-self: center; background: #000; padding: 6px 10px; border-radius: 3px; }
.login-t { font: italic 900 22px/1 var(--f-display); font-stretch: 115%; text-transform: uppercase; text-align: center; letter-spacing: .02em; }
.login-err { min-height: 18px; color: var(--neg); font-size: 13.5px; font-weight: 600; }
.login-note { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.login-card .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 10px, #000 10px 20px); }
.login-card .btn-primary { height: 44px; font-size: 16px; }
.colab-off td { opacity: .55; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .os-grid { grid-template-columns: minmax(0,1fr); }
  .os-side { position: static; }
  .grid3 { grid-template-columns: minmax(0,1fr); }
  .quick, .quick.transf { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .quick > * { grid-column: span 3; }
  .quick > .q-desc { grid-column: span 6; }
  .quick > .q-go { grid-column: span 6; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0,1fr); }
  .side { display: none; }
  .top-logo { display: block; }
  .topbar h1 { font-size: 20px; }
  .topbar { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--side); border-top: 1px solid var(--side-line); overflow-x: auto; padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); gap: 2px; }
  .tabbar a { flex: 1 0 64px; display: grid; justify-items: center; gap: 3px; padding: 6px 4px; color: var(--side-muted); text-decoration: none; font: 600 11px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; border-radius: 6px; }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a.on { color: #fff; background: #10161D; }
  .tabbar a.on svg { color: var(--brand-hi); }
  .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .kpis .kpi.hero { grid-column: 1 / -1; }
  .grid2, .grid2e { grid-template-columns: minmax(0,1fr); }
  .funnel { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .fgrid > * { grid-column: span 6; }
  .fgrid > .c12, .fgrid > .c8 { grid-column: span 12; }
  .it-row { grid-template-columns: repeat(6, minmax(0,1fr)); row-gap: 6px; padding: 10px 0; }
  .it-row.hd { display: none; }
  .it-row > .i-desc { grid-column: 1 / -1; }
  .it-row > .i-q { grid-column: span 2; } .it-row > .i-v { grid-column: span 2; } .it-row > .i-c { grid-column: span 2; }
  .it-row > .tot { grid-column: span 3; text-align: left; } .it-row > .luc { grid-column: span 2; }
  .it-row > .i-x { grid-column: span 1; justify-self: end; }
  .it-row .tot::before { content: "Total "; color: var(--muted); font-weight: 500; }
  .it-row .luc::before { content: "Lucro "; color: var(--muted); font-weight: 500; }
  .pend .pr { grid-template-columns: 76px minmax(0,1fr) auto; }
  .pend .pr > .pr-act { grid-column: 1 / -1; justify-self: end; }
}
@media (max-width: 700px) {
  .garage { min-height: 260px; }
  .garage::after { background: linear-gradient(0deg, rgba(5,7,10,.95) 0%, rgba(5,7,10,.7) 55%, rgba(5,7,10,.2) 100%); }
  .garage-in { padding: 16px 16px 22px; }
  .garage h2 { font-size: 22px; }
  .garage .gstat { min-width: 0; flex: 1 1 120px; }
  .topbar h1 { font-size: 21px; }
  .stp { grid-template-columns: 30px minmax(0,1fr); }
  .stp > .btn { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .kpi-v { font-size: 25px; }
  .quick > *, .quick > .q-desc { grid-column: span 6; }
  .search { min-width: 0; max-width: none; }
}
