/* Oficina Fácil — interface (mesma linha visual do Comércio Fácil, com letras e botões maiores) */
:root {
  --primary: #1f5fa8; --primary-600: #1a528f; --primary-700: #123a6b; --primary-50: #eaf2fb; --primary-100: #d4e4f6;
  --accent: #e8730c; --accent-50: #fdf0e3;
  --bg: #f2f5f9; --surface: #ffffff; --surface-2: #f7f9fc; --surface-3: #edf1f6;
  --border: #dbe2ec; --border-strong: #c2ccd9;
  --text: #15202e; --text-2: #3a4757; --muted: #657386;
  --danger: #c0352b; --danger-50: #fdecea; --warn: #a86400; --warn-50: #fff4df; --ok: #1d7a3e; --ok-50: #e7f5ec; --info: #1f5fa8; --info-50: #e8f0fb;
  --side-bg: #0e2340; --side-text: #cfdcee; --side-muted: #8299b8; --side-active: #1d4677;
  --radius: 12px; --radius-sm: 9px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 30, 55, .06); --shadow: 0 4px 16px rgba(15, 30, 55, .09); --shadow-lg: 0 18px 50px rgba(10, 20, 40, .25);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --primary: #5a9be6; --primary-600: #6eaaf0; --primary-700: #a9cdf5; --primary-50: #13243a; --primary-100: #1a3352;
  --accent: #f29a45; --accent-50: #33220f;
  --bg: #0d131b; --surface: #151d28; --surface-2: #1a2431; --surface-3: #212d3d;
  --border: #2a3748; --border-strong: #3a4a5e;
  --text: #e7edf5; --text-2: #c3cfdd; --muted: #8d9cb0;
  --danger: #ef6b5f; --danger-50: #33191a; --warn: #e7a842; --warn-50: #2f2410; --ok: #4cbd74; --ok-50: #132a1c; --info: #6ea8ea; --info-50: #142235;
  --side-bg: #0a1018; --side-text: #c9d6e6; --side-muted: #6f8299; --side-active: #1a3352;
  --shadow: 0 4px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
html { font-size: 16px; }
html[data-fs="1"] { font-size: 18px; }
html[data-fs="2"] { font-size: 20px; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 1rem/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
a { color: var(--primary); }
small, .small { font-size: .85rem; color: var(--muted); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; } .grow { flex: 1; } .hidden { display: none !important; }
.svg-ic { width: 1.25em; height: 1.25em; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.svg-ic.big { width: 2.4rem; height: 2.4rem; }

/* ---------- Controles (grandes, fáceis de tocar) ---------- */
button, .btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: .5rem 1rem; border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; text-decoration: none; }
button:hover, .btn:hover { background: var(--primary-600); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary, .btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
button.secondary:hover, .btn.secondary:hover { background: var(--surface-3); }
button.ghost { background: transparent; color: var(--text-2); }
button.ghost:hover { background: var(--surface-3); }
button.danger { background: var(--danger); } button.danger:hover { background: var(--danger); filter: brightness(.95); }
button.danger-soft { background: var(--danger-50); color: var(--danger); }
button.ok, .btn.ok { background: var(--ok); } button.ok:hover { background: var(--ok); filter: brightness(.95); }
button.warn { background: var(--accent); } button.warn:hover { background: var(--accent); filter: brightness(.95); }
button.sm, .btn.sm { min-height: 2.2rem; padding: .3rem .7rem; font-size: .9rem; }
button.lg, .btn.lg { min-height: 3.4rem; padding: .7rem 1.4rem; font-size: 1.1rem; }
button.xl { min-height: 4rem; padding: .8rem 1.6rem; font-size: 1.2rem; border-radius: var(--radius); }
button.icon { padding: 0; width: 2.75rem; }
button.sm.icon { width: 2.2rem; }
button.block, .btn.block { width: 100%; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

input, select, textarea { font: inherit; width: 100%; min-height: 2.9rem; padding: .55rem .75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
input[type=checkbox], input[type=radio] { width: 1.4rem; min-height: 1.4rem; height: 1.4rem; accent-color: var(--primary); margin: 0; flex: 0 0 auto; }
input:disabled, select:disabled { background: var(--surface-3); color: var(--muted); }
input.num { text-align: right; }
input.placa { text-transform: uppercase; font-family: var(--mono); font-size: 1.3rem; font-weight: 700; letter-spacing: .08em; }
label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 650; color: var(--text-2); }
label.check { display: flex; align-items: center; gap: .65rem; font-size: 1rem; font-weight: 500; color: var(--text); cursor: pointer; padding: .35rem 0; }
.hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 0; display: grid; gap: .9rem; }
legend { padding: 0 .4rem; font-weight: 700; color: var(--text-2); }

.grid { display: grid; gap: .9rem; }
.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)); }
.span2 { grid-column: span 2; } .spanall { grid-column: 1 / -1; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.stack { display: grid; gap: 1rem; }
.between { justify-content: space-between; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; overflow: hidden; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1rem .9rem; min-height: 72px; }
.side-brand img, .logo-ph { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; background: #fff; flex: 0 0 auto; }
.logo-ph { display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 800; }
.side-brand b { display: block; color: #fff; font-size: 1rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 165px; }
.side-brand span { font-size: .75rem; color: var(--side-muted); }
.side nav { flex: 1; overflow-y: auto; padding: .3rem .6rem 1rem; scrollbar-width: thin; scrollbar-color: #2b4366 transparent; }
.nav-group { font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; color: var(--side-muted); padding: .9rem .6rem .35rem; font-weight: 700; }
.side nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .7rem; border-radius: 9px; color: var(--side-text); text-decoration: none; font-weight: 550; margin-bottom: 2px; position: relative; font-size: .98rem; }
.side nav a:hover { background: #ffffff12; color: #fff; }
.side nav a.active { background: var(--side-active); color: #fff; }
.side nav a.active::before { content: ""; position: absolute; left: -.6rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side nav a .count { margin-left: auto; background: var(--accent); color: #fff; border-radius: 99px; font-size: .72rem; padding: .05rem .45rem; font-weight: 700; }
.side-foot { padding: .7rem .9rem; font-size: .72rem; color: var(--side-muted); border-top: 1px solid #ffffff14; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; height: 100dvh; }
.topbar { display: flex; align-items: center; gap: .7rem; min-height: 62px; padding: .4rem 1.1rem; background: var(--surface); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.topbar h1 { font-size: 1.2rem; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .back { display: none; }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: .25rem .6rem .25rem .3rem; border-radius: 99px; background: transparent; color: var(--text); border: 1px solid var(--border); min-height: 0; font-weight: 550; }
.user-chip:hover { background: var(--surface-3); }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--primary-100); color: var(--primary-700); font-weight: 750; font-size: .85rem; }
.content { flex: 1; overflow: auto; padding: 1.2rem 1.3rem 2.5rem; }
.page { max-width: 1400px; margin: 0 auto; display: grid; gap: 1rem; }
.bottom-nav { display: none; }
.net-banner { display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; background: var(--warn-50); color: var(--warn); font-weight: 650; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.net-banner.danger { background: var(--danger-50); color: var(--danger); }

/* ---------- Cartões ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-h h2 { font-size: 1.08rem; font-weight: 750; }
.card-h .actions { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
.card-b { padding: 1.1rem; }
.card-b.flush { padding: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .85rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .95rem 1.05rem; display: grid; gap: .2rem; box-shadow: var(--shadow-sm); text-align: left; color: var(--text); font-weight: 400; min-height: 0; white-space: normal; align-content: start; justify-content: stretch; }
a.btn.kpi, button.kpi { background: var(--surface); color: var(--text); border-color: var(--border); }
a.btn.kpi:hover, button.kpi:hover { background: var(--surface-2); border-color: var(--border-strong); }
.kpi .lbl { font-size: .85rem; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.kpi .val { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .82rem; color: var(--muted); }
.kpi.warn .val { color: var(--warn); } .kpi.danger .val { color: var(--danger); } .kpi.ok .val { color: var(--ok); }

.big-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .85rem; }
.big-action { flex-direction: column; align-items: flex-start; gap: .35rem; min-height: 6.2rem; padding: 1rem 1.1rem; border-radius: var(--radius-lg); text-align: left; white-space: normal; box-shadow: var(--shadow-sm); }
.big-action .svg-ic { width: 2rem; height: 2rem; }
.big-action b { font-size: 1.15rem; } .big-action span { font-weight: 450; opacity: .9; font-size: .9rem; }
.big-action.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.big-action.secondary .svg-ic { color: var(--primary); }

.toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 520px; }
.toolbar .search input { padding-left: 2.4rem; }
.toolbar .search .svg-ic { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar select, .toolbar input[type=date] { width: auto; }
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs button { background: transparent; color: var(--muted); border-radius: 0; border-bottom: 3px solid transparent; padding: .6rem 1rem; font-weight: 650; }
.tabs button:hover { color: var(--text); background: transparent; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.chips { display: flex; gap: .45rem; flex-wrap: wrap; }
.chip { background: var(--surface); color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 99px; min-height: 2.4rem; padding: .3rem .9rem; font-weight: 600; }
.chip:hover { background: var(--surface-3); }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip .n { background: color-mix(in srgb, currentColor 16%, transparent); border-radius: 99px; padding: 0 .45rem; font-size: .8rem; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.seg button { border-radius: 0; background: var(--surface); color: var(--text-2); font-weight: 650; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.active { background: var(--primary); color: #fff; }

/* ---------- Tabelas ---------- */
.tw { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 750; text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th.sortable { cursor: pointer; user-select: none; }
td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover td { background: var(--surface-2); }
tr.clickable { cursor: pointer; }
tr.muted td { color: var(--muted); }
tfoot td { font-weight: 750; background: var(--surface-2); border-top: 2px solid var(--border-strong); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; width: 1%; }
td.actions button + button { margin-left: .3rem; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.empty .svg-ic { width: 2.4rem; height: 2.4rem; opacity: .5; margin-bottom: .4rem; }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 7px; font-size: .78rem; font-weight: 750; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag.ok { background: var(--ok-50); color: var(--ok); } .tag.warn { background: var(--warn-50); color: var(--warn); } .tag.danger { background: var(--danger-50); color: var(--danger); } .tag.info { background: var(--info-50); color: var(--info); } .tag.accent { background: var(--accent-50); color: var(--accent); }
.tag.big { font-size: .95rem; padding: .3rem .8rem; border-radius: 99px; }
.placa-tag { display: inline-block; font-family: var(--mono); font-weight: 800; letter-spacing: .06em; background: #fff; color: #111; border: 2px solid #1b2a44; border-top-width: 6px; border-top-color: #1f4fa3; border-radius: 6px; padding: .05rem .45rem; font-size: .92rem; white-space: nowrap; }
.placa-tag.big { font-size: 1.5rem; padding: .1rem .7rem; border-top-width: 9px; }
.pos { color: var(--ok); } .neg { color: var(--danger); }

/* ---------- Lista de OS em cartões (celular e tablet) ---------- */
.os-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: .8rem; }
.os-card { display: grid; gap: .45rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border-strong); border-radius: var(--radius); color: var(--text); text-align: left; font-weight: 400; white-space: normal; min-height: 0; align-content: start; justify-content: stretch; box-shadow: var(--shadow-sm); }
.os-card:hover { background: var(--surface-2); border-color: var(--border-strong); }
.os-card.st-ORCAMENTO, .os-card.st-REPROVADA { border-left-color: var(--warn); }
.os-card.st-APROVADA, .os-card.st-PRONTA { border-left-color: var(--ok); }
.os-card.st-EXECUCAO { border-left-color: var(--accent); }
.os-card.st-ABERTA, .os-card.st-DIAGNOSTICO { border-left-color: var(--info); }
.os-card.atrasada { box-shadow: 0 0 0 2px var(--danger) inset; }
.os-card .top { display: flex; align-items: center; gap: .5rem; justify-content: space-between; }
.os-card .num { font-weight: 800; color: var(--muted); }

/* ---------- Passos da OS ---------- */
.steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem; }
.step { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .65rem .3rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 650; font-size: .85rem; min-height: 0; white-space: normal; text-align: center; }
.step:hover { background: var(--surface-3); }
.step .n { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-weight: 800; }
.step.done { color: var(--ok); } .step.done .n { background: var(--ok); color: #fff; }
.step.current { color: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-100); } .step.current .n { background: var(--primary); color: #fff; }
.step.active { background: var(--primary-50); }

/* ---------- Check-in ---------- */
.fuel { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; }
.fuel button { flex-direction: column; background: var(--surface); color: var(--text); border: 2px solid var(--border-strong); min-height: 4.2rem; gap: .25rem; font-size: .92rem; }
.fuel button .bar { width: 100%; height: .55rem; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.fuel button .bar i { display: block; height: 100%; background: var(--accent); }
.fuel button.active { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.car-map { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 1rem; align-items: start; }
.car-map svg { width: 100%; height: auto; }
.car-map svg.svg-ic { width: 1.25em; height: 1.25em; margin: 0; }
.car-map .zone { fill: var(--surface-3); stroke: var(--border-strong); stroke-width: 2; cursor: pointer; transition: fill .15s; }
.car-map .zone:hover { fill: var(--primary-100); }
.car-map .zone.dmg { fill: #f3b0a9; stroke: var(--danger); }
.car-map .glass { fill: #cfe3f7; }
.avaria-list { display: grid; gap: .4rem; }
.avaria-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: var(--radius-sm); background: var(--danger-50); color: var(--danger); font-weight: 600; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .2rem .9rem; }
.wizard-foot { position: sticky; bottom: 0; display: flex; gap: .6rem; justify-content: space-between; padding: .8rem 0 .2rem; background: linear-gradient(transparent, var(--bg) 30%); }
.big-search { position: relative; }
.big-search input { min-height: 3.6rem; font-size: 1.35rem; padding-left: 3rem; }
.big-search .svg-ic { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 1.5rem; height: 1.5rem; color: var(--muted); }
.pick-list { display: grid; gap: .5rem; }
.pick { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 400; text-align: left; justify-content: flex-start; white-space: normal; min-height: 0; }
.pick:hover { border-color: var(--primary); background: var(--primary-50); }

/* ---------- Raio-X ---------- */
.rx-group { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.rx-group > h3 { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 1.05rem; }
.rx-group > h3 .sum { margin-left: auto; display: flex; gap: .3rem; }
.rx-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: center; padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.rx-item:last-child { border-bottom: 0; }
.rx-item .nome { font-weight: 600; }
.rx-item .obs { grid-column: 1 / -1; }
.rx-btns { display: flex; gap: .35rem; }
.rx-btns button { min-width: 5.6rem; background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-2); font-size: .9rem; }
.rx-btns button[data-s=ok].active { background: var(--ok); border-color: var(--ok); color: #fff; }
.rx-btns button[data-s=atencao].active { background: #e0a100; border-color: #e0a100; color: #fff; }
.rx-btns button[data-s=urgente].active { background: var(--danger); border-color: var(--danger); color: #fff; }
.dot { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; flex: 0 0 auto; background: var(--border-strong); }
.dot.ok { background: var(--ok); } .dot.atencao { background: #e0a100; } .dot.urgente { background: var(--danger); }
.rx-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-weight: 600; font-size: .9rem; }
.rx-legend span { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Itens do orçamento / execução ---------- */
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem 1rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.item-row:last-child { border-bottom: 0; }
.item-row .desc { font-weight: 650; }
.item-row .meta { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; font-size: .88rem; color: var(--muted); }
.item-row .val { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.item-row.reprovado { opacity: .55; } .item-row.reprovado .desc { text-decoration: line-through; }
.item-row .acts { grid-column: 1 / -1; display: flex; gap: .4rem; flex-wrap: wrap; }
.totals { display: grid; gap: .35rem; padding: 1rem 1.1rem; background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 1.4rem; font-weight: 800; color: var(--primary-700); }
.progress { height: .8rem; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.exec-btns { display: flex; gap: .35rem; flex-wrap: wrap; }
.exec-btns button { background: var(--surface); color: var(--text-2); border: 2px solid var(--border-strong); }
.exec-btns button.active[data-e=AGUARDANDO] { background: var(--surface-3); border-color: var(--muted); color: var(--text); }
.exec-btns button.active[data-e=ANDAMENTO] { background: var(--accent); border-color: var(--accent); color: #fff; }
.exec-btns button.active[data-e=CONCLUIDO] { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---------- Fotos ---------- */
.fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .6rem; }
.foto { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface-3); aspect-ratio: 4 / 3; border: 1px solid var(--border); }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.foto .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: .3rem .45rem; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-size: .78rem; font-weight: 600; }
.foto .del { position: absolute; top: .3rem; right: .3rem; width: 2rem; min-height: 2rem; padding: 0; background: rgba(0, 0, 0, .55); }
.foto-add { display: grid; place-items: center; gap: .3rem; border: 2px dashed var(--border-strong); border-radius: var(--radius); aspect-ratio: 4 / 3; background: var(--surface); color: var(--primary); font-weight: 700; cursor: pointer; text-align: center; padding: .5rem; }
.foto-add:hover { background: var(--primary-50); border-color: var(--primary); }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); z-index: 100; display: grid; place-items: center; padding: 1rem; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.lightbox p { color: #fff; text-align: center; margin: .6rem 0 0; }

/* ---------- Assinatura ---------- */
.sign-box { border: 2px dashed var(--border-strong); border-radius: var(--radius); background: #fff; position: relative; touch-action: none; }
.sign-box canvas { display: block; width: 100%; height: 220px; cursor: crosshair; }
.sign-box .line { position: absolute; left: 8%; right: 8%; bottom: 46px; border-top: 1px solid #9aa; pointer-events: none; }
.sign-box .ph { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #889; font-size: .85rem; pointer-events: none; }

/* ---------- Linha do tempo ---------- */
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 1.2rem 1fr; gap: .7rem; padding-bottom: .9rem; position: relative; }
.tl::before { content: ""; position: absolute; left: .5rem; top: 1.1rem; bottom: 0; width: 2px; background: var(--border); }
.tl:last-child::before { display: none; }
.tl i { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--primary); border: 3px solid var(--primary-100); margin-top: .15rem; }
.tl b { font-weight: 600; } .tl small { display: block; }

/* ---------- Modal, toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(8, 15, 28, .55); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 50; padding: 1rem; animation: fade .12s ease; }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(580px, 100%); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; animation: pop .14s ease; }
.modal.wide { width: min(880px, 100%); } .modal.xl { width: min(1150px, 100%); } .modal.sm { width: min(440px, 100%); }
.modal-h { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border); }
.modal-h h3 { font-size: 1.15rem; font-weight: 750; flex: 1; }
.modal-b { padding: 1.15rem; overflow: auto; display: grid; gap: .95rem; }
.modal-f { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.15rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0 } } @keyframes pop { from { transform: scale(.97); opacity: 0 } }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 110; }
.toast { display: flex; align-items: center; gap: .6rem; min-width: 260px; max-width: 440px; padding: .85rem 1rem; border-radius: var(--radius); background: #15202e; color: #fff; box-shadow: var(--shadow-lg); animation: pop .15s ease; font-weight: 550; white-space: pre-line; font-size: 1rem; }
.toast.error { background: var(--danger); } .toast.ok { background: #1d7a3e; }
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem .95rem; border-radius: var(--radius); background: var(--info-50); color: var(--info); font-weight: 550; }
.alert.warn { background: var(--warn-50); color: var(--warn); } .alert.danger { background: var(--danger-50); color: var(--danger); } .alert.ok { background: var(--ok-50); color: var(--ok); }
.alert .grow { min-width: 0; }
.menu { position: fixed; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .3rem; }
.menu button { width: 100%; justify-content: flex-start; background: transparent; color: var(--text); font-weight: 550; }
.menu button:hover { background: var(--surface-3); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: .3rem 0; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .7rem 1rem; }
.detail-grid div span { display: block; font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.detail-grid div b { font-weight: 600; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(150deg, #0a1a30, #123a6b 60%, #1f5fa8); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 1px solid #ffffff1c; right: -200px; bottom: -180px; box-shadow: 0 0 0 60px #ffffff06, 0 0 0 130px #ffffff05; }
.login-art h2 { font-size: 2.2rem; letter-spacing: -.02em; max-width: 440px; }
.login-art p { color: #cfdcee; max-width: 440px; font-size: 1.05rem; }
.login-art ul { padding: 0; list-style: none; display: grid; gap: .55rem; color: #e1ebf7; font-size: 1.02rem; }
.login-art li::before { content: "✓"; color: var(--accent); margin-right: .6rem; font-weight: 800; }
.login-form { display: grid; place-items: center; padding: 2rem; background: var(--surface); }
.login-form form { width: min(380px, 100%); display: grid; gap: 1.05rem; }
.login-form img { width: 80px; height: 80px; border-radius: 20px; object-fit: cover; box-shadow: var(--shadow); }
.login-form h1 { font-size: 1.6rem; }

/* ---------- PDV ---------- */
.pdv { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1rem; align-items: start; }
.pdv-side { position: sticky; top: 0; z-index: 3; }
.pdv-scan { position: relative; }
.pdv-scan input { min-height: 3.6rem; font-size: 1.3rem; padding-left: 3rem; }
.pdv-scan .svg-ic { position: absolute; left: 1rem; top: 1.1rem; width: 1.5rem; height: 1.5rem; color: var(--muted); }
.pdv-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 20; max-height: 420px; overflow: auto; }
.pdv-results .res { display: grid; grid-template-columns: 1fr auto auto; gap: 1rem; align-items: center; padding: .7rem .9rem; cursor: pointer; border-bottom: 1px solid var(--border); }
.pdv-results .res.sel, .pdv-results .res:hover { background: var(--primary-50); }
.pdv-total { background: var(--primary-700); color: #fff; padding: 1rem 1.2rem; border-radius: var(--radius-lg) var(--radius-lg) 0 0; display: grid; gap: .2rem; }
:root[data-theme="dark"] .pdv-total { background: #123052; }
.pdv-total .big { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pdv-total .line { display: flex; justify-content: space-between; color: #cfdcee; font-size: .92rem; }
.pay-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .45rem; }
.pay-btn { background: var(--surface); color: var(--text); border: 2px solid var(--border-strong); min-height: 3.2rem; }
.pay-btn:hover, .pay-btn.active { background: var(--primary-50); border-color: var(--primary); color: var(--primary); }
.change-box { padding: .85rem 1rem; border-radius: var(--radius); background: var(--ok-50); color: var(--ok); display: flex; justify-content: space-between; align-items: center; font-size: 1.05rem; font-weight: 750; }
.change-box b { font-size: 1.7rem; }
.qty-input { width: 5.5rem; text-align: center; }

/* ---------- Gráfico simples ---------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: .5rem; }
.bars div { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars div:hover { background: var(--accent); }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .8rem; align-items: center; }
.hbar .track { grid-column: 1 / -1; height: .5rem; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar .fill { height: 100%; background: var(--primary); border-radius: 4px; }

/* ---------- Página do cliente (acompanhar) ---------- */
.pub { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 3rem; display: grid; gap: 1rem; }
.pub-head { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; background: var(--primary-700); color: #fff; border-radius: var(--radius-lg); }
.pub-head img, .pub-head .logo-ph { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: #fff; flex: 0 0 auto; }
.pub-head .logo-ph { background: var(--accent); }
.pub-head h1 { font-size: 1.25rem; } .pub-head small { color: #cfdcee; }
.decide { display: flex; gap: .4rem; }
.decide button { min-width: 6.5rem; background: var(--surface); border: 2px solid var(--border-strong); color: var(--text-2); }
.decide button[data-d=APROVADO].active { background: var(--ok); color: #fff; border-color: var(--ok); }
.decide button[data-d=REPROVADO].active { background: var(--danger); color: #fff; border-color: var(--danger); }
.pub-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; }
.pub-steps div { text-align: center; font-size: .78rem; font-weight: 650; color: var(--muted); display: grid; gap: .3rem; justify-items: center; }
.pub-steps div i { width: 100%; height: .5rem; border-radius: 99px; background: var(--surface-3); }
.pub-steps div.done { color: var(--ok); } .pub-steps div.done i { background: var(--ok); }
.pub-steps div.cur { color: var(--primary); } .pub-steps div.cur i { background: var(--primary); }

@media (max-width: 1300px) { .pdv { grid-template-columns: minmax(0, 1fr) 340px; } }
@media (max-width: 1100px) { .pdv { grid-template-columns: 1fr; } .pdv-side { position: static; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding-bottom: 4.6rem; }
  .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(--border); padding: .25rem .25rem calc(.25rem + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgba(0, 0, 0, .06); }
  .bottom-nav a { display: grid; justify-items: center; gap: .1rem; padding: .35rem .1rem; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 650; border-radius: 10px; }
  .bottom-nav a .svg-ic { width: 1.6rem; height: 1.6rem; }
  .bottom-nav a.active { color: var(--primary); background: var(--primary-50); }
  .content { padding: 1rem .9rem 2rem; }
  .topbar { padding: .4rem .7rem; }
  .topbar .back { display: inline-flex; }
  .pdv { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .g3, .g2 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .car-map { grid-template-columns: 1fr; } .car-map svg { max-width: 240px; margin: 0 auto; }
  .rx-item { grid-template-columns: 1fr; }
  .rx-btns button { flex: 1; min-width: 0; }
  .hide-sm { display: none !important; }
  .modal-bg { padding: 0; align-items: end; }
  .modal { width: 100% !important; max-height: 94dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .toasts { left: .8rem; right: .8rem; top: .8rem; bottom: auto; } .toast { min-width: 0; max-width: none; }
}
@media (max-width: 520px) { .fuel button { font-size: .8rem; padding: .3rem; } .kpi .val { font-size: 1.4rem; } .decide button { min-width: 0; flex: 1; } .decide { width: 100%; } }

@media print {
  body { background: #fff; }
  .side, .topbar, .toolbar, .no-print, .toasts, .bottom-nav { display: none !important; }
  .app { display: block; height: auto; } .main, .content { height: auto; overflow: visible; padding: 0; }
}
