/* Pátio v2 — direção visual a partir de 3 referências do Dribbble (fleet management dashboard):
   A) Conceptzilla "Telematics Fleet": 3 painéis lista + mapa + detalhe, claro, pílulas de status.
   B) Ronas IT "Delivera": fundo cinza quente, cartões brancos arredondados, preto + uma cor forte, barra de status hachurada, cartão com caminhão.
   C) Ronas IT "Logistics" (escuro): KPI herói preenchido com a cor de destaque, filtros em pílula com contador.
   Tema e cor de destaque escolhidos pelo cliente (Aparência). Tudo em tokens. */
:root {
  --accent: #f0532b; --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 13%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 45%, var(--surface));
  --ground: #eeeeea; --surface: #ffffff; --raised: #f6f6f3; --active: #e7e7e2; --border: #e3e3de; --rule: #efefeb; --control: #d6d6d0;
  --text: #111214; --muted: #6a6c6f; --faint: #9a9c9f;
  --positive: #16834f; --negative: #d92d20; --warning: #b5650a;
  --ok-bg: #e3f6ea; --ok-ink: #0d5a33; --bad-bg: #fde8e6; --bad-ink: #9b1c13; --warn-bg: #fff1dc; --warn-ink: #8a4a05; --neu-bg: #efefeb; --neu-ink: #3c3d40;
  --bar-muted: #dcdcd6; --track: #efefea; --map-land: #f4f4f0; --map-road: #d9d9d2; --map-water: #dbe9f1;
  --shadow: 0 1px 2px rgba(17, 18, 20, .04), 0 6px 20px rgba(17, 18, 20, .05);
  --shadow-pop: 0 12px 40px rgba(17, 18, 20, .16);
  --plate-blue: #003a8c;
  --r-card: 18px; --r-ctl: 10px; --gap: 20px; --pad: 20px; --row: 52px;
  --f: "Manrope", "Segoe UI", system-ui, sans-serif; --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --fs-kpi: 32px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ground: #0b0c0c; --surface: #17181a; --raised: #1f2022; --active: #26272a; --border: #2a2b2e; --rule: #232427; --control: #3a3b3f;
  --text: #f3f3f1; --muted: #a0a2a5; --faint: #6f7174;
  --positive: #4cc985; --negative: #ff7a6e; --warning: #f0a54a;
  --ok-bg: #123322; --ok-ink: #9fe6bf; --bad-bg: #3d1714; --bad-ink: #ffb3ab; --warn-bg: #3a2810; --warn-ink: #f7cf93; --neu-bg: #26272a; --neu-ink: #d6d7d9;
  --bar-muted: #34363a; --track: #26272a; --map-land: #1c1d20; --map-road: #34363a; --map-water: #1a2730;
  --shadow: none; --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5); --plate-blue: #2f6fd1; color-scheme: dark } }
:root[data-theme="dark"] {
  --ground: #0b0c0c; --surface: #17181a; --raised: #1f2022; --active: #26272a; --border: #2a2b2e; --rule: #232427; --control: #3a3b3f;
  --text: #f3f3f1; --muted: #a0a2a5; --faint: #6f7174;
  --positive: #4cc985; --negative: #ff7a6e; --warning: #f0a54a;
  --ok-bg: #123322; --ok-ink: #9fe6bf; --bad-bg: #3d1714; --bad-ink: #ffb3ab; --warn-bg: #3a2810; --warn-ink: #f7cf93; --neu-bg: #26272a; --neu-ink: #d6d7d9;
  --bar-muted: #34363a; --track: #26272a; --map-land: #1c1d20; --map-road: #34363a; --map-water: #1a2730;
  --shadow: none; --shadow-pop: 0 12px 40px rgba(0, 0, 0, .5); --plate-blue: #2f6fd1; color-scheme: dark }
:root[data-density="compacta"] { --row: 42px; --gap: 14px; --pad: 14px; --fs-kpi: 26px }

* { box-sizing: border-box }
[hidden] { display: none !important }
html, body { height: 100% }
body { margin: 0; background: var(--ground); color: var(--text); font: 500 14px/1.5 var(--f); -webkit-font-smoothing: antialiased }
button, input, select { font: inherit; color: inherit }
a { color: inherit }
.num, td.r, .kpi-v { font-variant-numeric: tabular-nums }
h1, h2, h3 { text-wrap: balance }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); height: 100%;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px) }
.side { grid-row: 1 / 3; display: flex; flex-direction: column; gap: 2px; padding: 16px 14px; overflow-y: auto }
.brand { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 6px; margin-bottom: 8px; text-decoration: none }
.brand svg { flex: none }
.brand svg .mk { fill: var(--accent) } .brand svg .mk-ink { stroke: var(--accent-ink) }
.brand b { font-size: 18px; font-weight: 800; letter-spacing: -.02em }
.brand small { display: block; font-size: 11px; color: var(--muted); line-height: 1.1; font-weight: 600 }
.scope { margin: 4px 0 14px; padding: 10px 12px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column }
.scope b { font-weight: 700; font-size: 13px } .scope span { font-size: 12px; color: var(--muted) }
.nav-group { font-size: 11.5px; color: var(--faint); padding: 14px 10px 4px; font-weight: 700 }
.nav a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 600; transition: background .15s, color .15s }
.nav a svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
.nav a:hover { color: var(--text); background: var(--active) }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow) }
.nav a[aria-current="page"] svg { stroke: var(--accent) }
.nav a .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; background: var(--accent); color: var(--accent-ink) }
.nav a .count:empty { display: none }
.top { display: flex; align-items: center; gap: 12px; padding: 0 24px 0 4px }
.search { position: relative; flex: 0 1 460px }
.search input { width: 100%; height: 42px; border: 0; background: var(--surface); box-shadow: var(--shadow); border-radius: 21px; padding: 0 56px 0 42px; font-weight: 500 }
.search input::placeholder { color: var(--faint) }
.search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px }
.search svg { position: absolute; left: 16px; top: 13px; width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 1.9 }
.search kbd { position: absolute; right: 12px; top: 11px; font: 700 11px var(--f); color: var(--muted); background: var(--raised); border-radius: 6px; padding: 2px 7px }
.results { position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-pop); z-index: 20; padding: 6px; max-height: 380px; overflow: auto }
.results a { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none }
.results a:hover, .results a:focus-visible { background: var(--raised); outline: none }
.top-actions { display: flex; gap: 8px; align-items: center; margin-left: auto }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; color: var(--text); position: relative }
.icon-btn:hover { background: var(--raised) }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
.icon-btn .dotn { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface) }
.who { display: flex; align-items: center; gap: 10px; background: var(--surface); box-shadow: var(--shadow); border-radius: 22px; padding: 4px 14px 4px 4px }
.who b { display: block; font-size: 13px; line-height: 1.2 } .who small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2 }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--text); display: grid; place-items: center; font-size: 12px; font-weight: 800 }
.menu-btn { display: none }

.sheet { grid-column: 2; grid-row: 2; overflow-y: auto; min-width: 0 }
.page { padding: 8px 24px 32px 4px; display: flex; flex-direction: column; gap: var(--gap); max-width: 1500px }

/* ---------- Título ---------- */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap }
.title-row h1 { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -.025em }
.title-row p { margin: 6px 0 0; color: var(--muted); max-width: 76ch }
.title-row .finding { color: var(--text) }
.title-row .finding b { color: var(--accent); font-weight: 800 }
.actions { display: flex; gap: 8px; flex-wrap: wrap }
.btn { height: 40px; padding: 0 16px; border-radius: var(--r-ctl); border: 0; background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--border); cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; transition: transform .12s, background .15s }
.btn:hover { background: var(--raised) }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none }
.btn.primary:hover { filter: brightness(.95) }
.btn.dark { background: var(--text); color: var(--surface); box-shadow: none }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px }
.btn:active { transform: translateY(1px) }
.btn:focus-visible, .nav a:focus-visible, .tabs button:focus-visible, .icon-btn:focus-visible, a:focus-visible, .row-link:focus-visible, .swatch:focus-visible, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
/* Filtros em pílula com contador (ref. C) */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px }
.tabs button { height: 38px; padding: 0 6px 0 14px; border-radius: 19px; border: 0; background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--border); cursor: pointer; color: var(--text); font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px }
.tabs button:not(:has(.muted)) { padding-right: 14px }
.tabs button .muted { min-width: 26px; height: 26px; border-radius: 13px; display: inline-grid; place-items: center; background: var(--raised); color: var(--text); font-size: 12px }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: none }
.tabs button[aria-selected="true"] .muted { background: var(--surface); color: var(--text) }
.fresh { font-size: 12px; color: var(--muted) }

/* ---------- Grades ---------- */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); align-items: start }
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0 }
.rail { display: flex; flex-direction: column; gap: var(--gap); min-width: 0 }
.rail h2 { margin: 0; font-size: 16px; font-weight: 800 }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap) }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap) }

.card { border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); min-width: 0; overflow: hidden }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px var(--pad) 0; flex-wrap: wrap }
.card-h h2, .card-h h3 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.01em }
.card-h .sub { font-size: 12px; color: var(--muted); font-weight: 500 }
.card-b { padding: 14px var(--pad) var(--pad) }
.chart { width: 100%; min-height: 200px }

/* KPIs como cartões, o primeiro em destaque (ref. C) */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap) }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); position: relative }
.kpi.hero { background: var(--accent); color: var(--accent-ink); box-shadow: none }
.kpi.hero .kpi-l, .kpi.hero .kpi-c, .kpi.hero .kpi-v small, .kpi.hero .up-bad, .kpi.hero .down-good { color: var(--accent-ink); opacity: .85 }
.kpi-l { font-size: 13px; color: var(--muted); font-weight: 700 }
.kpi-v { font-size: clamp(22px, 1.9vw, var(--fs-kpi)); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; white-space: nowrap; margin-top: 6px }
.kpi-v small { font-size: 14px; color: var(--muted); margin-left: 3px; font-weight: 700; letter-spacing: 0 }
.kpi-c { font-size: 12px; color: var(--muted); font-weight: 500 }
.kpi .go { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); text-decoration: none }
.kpi.hero .go { background: color-mix(in srgb, var(--accent-ink) 18%, transparent) }
.kpi .go svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2 }
.up-bad, .down-bad { color: var(--negative) } .up-good, .down-good { color: var(--positive) }

/* Barra de situação hachurada (ref. B) */
.statusbar { display: flex; gap: 4px; height: 34px }
.statusbar > div { border-radius: 8px; min-width: 6px }
.sb-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px }
.sb-legend b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em }
.sb-legend span { font-size: 12px; color: var(--muted); font-weight: 600 }
.hatch { background: repeating-linear-gradient(-45deg, var(--accent) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1.5px var(--accent) }
.hatch-ink { background: repeating-linear-gradient(-45deg, var(--text) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1.5px var(--text) }

/* Placa Mercosul */
.plate { display: inline-flex; flex-direction: column; align-items: stretch; min-width: 80px; border: 1.5px solid var(--text); border-radius: 5px; overflow: hidden; background: #fff; line-height: 1; text-decoration: none; vertical-align: middle }
.plate::before { content: "BRASIL"; display: block; background: var(--plate-blue); color: #fff; font: 800 6.5px/1 var(--f); letter-spacing: .16em; text-align: center; padding: 2.5px 0 2px }
.plate span { font: 600 12.5px/1 var(--f-mono); letter-spacing: .05em; padding: 3px 6px 3.5px; text-align: center; color: #111 }
:root[data-theme="dark"] .plate { border-color: #fff }
.plate.lg { min-width: 140px } .plate.lg::before { font-size: 9px; padding: 3px 0 } .plate.lg span { font-size: 23px; padding: 6px 10px 7px }
a.plate:hover { box-shadow: 0 0 0 3px var(--accent-soft) }

/* Tabelas */
.tbl-wrap { overflow-x: auto }
table { border-collapse: collapse; width: 100%; font-size: 13.5px }
th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px var(--pad); white-space: nowrap; background: var(--raised) }
td { white-space: nowrap; padding: 0 var(--pad); height: var(--row); border-bottom: 1px solid var(--rule); vertical-align: middle }
tr:last-child td { border-bottom: 0 }
th.r, td.r { text-align: right }
td.mono { font-family: var(--f-mono); font-size: 12.5px }
tbody tr.row-link { cursor: pointer }
tbody tr.row-link:hover { background: var(--raised) }
.dash { color: var(--faint) }
.muted { color: var(--muted) }
.pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 700; white-space: nowrap }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink) } .pill.bad { background: var(--bad-bg); color: var(--bad-ink) }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink) } .pill.neutral { background: var(--neu-bg); color: var(--neu-ink) }
.pill.acc { background: var(--accent); color: var(--accent-ink) }

/* Listas e filas */
.list { border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); overflow: hidden }
.li { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--rule); min-height: 54px; text-decoration: none }
.li:last-child { border-bottom: 0 }
a.li:hover { background: var(--raised) }
.li .grow { flex: 1; min-width: 0 }
.li .t { font-weight: 700; display: block } .li .s { font-size: 12px; color: var(--muted); display: block }
.sev { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--bar-muted) }
.sev.bad { background: var(--negative); box-shadow: 0 0 0 4px var(--bad-bg) } .sev.warn { background: var(--warning); box-shadow: 0 0 0 4px var(--warn-bg) }
.view-all { align-self: flex-start }

.action-card { border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); padding: 18px 20px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: start }
.action-card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; letter-spacing: -.01em }
.action-card p { margin: 0; color: var(--muted) }
.action-card .evid { margin-top: 10px; padding: 10px 12px; background: var(--raised); border-radius: 10px; font-size: 13px; color: var(--text); border-left: 3px solid var(--accent) }
.action-card .money { font-size: 20px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-align: right }
.action-card .money small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0 }
.done { opacity: .5 }

/* Detalhe */
.detail-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap) }
.facts > div { padding: 16px 18px; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow) }
.timeline { display: flex; flex-direction: column }
.tl { display: grid; grid-template-columns: 96px 14px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); align-items: start }
.tl:last-child { border-bottom: 0 }
.tl .dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--bar-muted) }
.tl .dot.c { background: var(--negative) } .tl .dot.p { background: var(--positive) } .tl .dot.f { background: var(--accent) }
.verdict { border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 8px; border-top: 4px solid var(--accent) }
.verdict b { font-size: 18px; font-weight: 800 }

/* Gráficos próprios */
.bars { display: block; width: 100%; height: auto; overflow: visible }
.bars text { font: 600 11px var(--f); fill: var(--muted) }
.bars .grid { stroke: var(--rule) }
.bars rect { transition: opacity .15s }
.bars rect:hover { opacity: .8 }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center }
.hbar .lbl { font-weight: 700 }
.hbar .trk { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--track); overflow: hidden }
.hbar .trk i { display: block; height: 100%; border-radius: 5px; background: var(--accent) }

/* Mapa esquemático (ref. A e B) */
.map { position: relative; border-radius: var(--r-card); overflow: hidden; background: var(--map-land) }
.map svg { display: block; width: 100%; height: 100% }
.map .road { stroke: var(--map-road); fill: none; stroke-linecap: round }
.map .road-lbl { font: 700 10.5px var(--f); fill: var(--faint) }
.map .city { font: 800 11.5px var(--f); fill: var(--muted) }
.map .veh { cursor: pointer }
.map .veh circle { stroke: var(--surface); stroke-width: 2 }
.map .veh:hover circle, .map .veh.sel circle { stroke: var(--text); stroke-width: 2.5 }
.map .pulse { animation: pulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center }
@keyframes pulse { from { opacity: .55; transform: scale(1) } to { opacity: 0; transform: scale(3) } }
.map-legend { position: absolute; left: 12px; bottom: 12px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 8px 12px; display: flex; gap: 14px; font-size: 12px; font-weight: 700; flex-wrap: wrap }
.map-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0 }
.live { display: grid; grid-template-columns: 290px minmax(0, 1fr) 300px; gap: var(--gap); height: min(640px, calc(100vh - 170px)); min-height: 520px }
.live .list { overflow-y: auto }
.live .map { height: 100% }
.vcard { padding: 12px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; display: flex; flex-direction: column; gap: 6px }
.vcard:hover { background: var(--raised) }
.vcard.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent) }
.vcard .row1 { display: flex; align-items: center; gap: 8px; justify-content: space-between }
.vcard .s { font-size: 12px; color: var(--muted) }
.truck-art { width: 100%; height: auto; display: block }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: 13px }
.kv dt { color: var(--muted); font-weight: 600 } .kv dd { margin: 0; font-weight: 700; text-align: right }

/* Ajuda, aparência, toast */
.help { position: fixed; top: 70px; right: 24px; width: min(390px, calc(100vw - 32px)); max-height: calc(100vh - 90px); overflow: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop); z-index: 30; padding: 22px; display: flex; flex-direction: column; gap: 14px }
.help h2 { margin: 0; font-size: 17px; font-weight: 800 } .help ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface); padding: 12px 18px; border-radius: 12px; z-index: 40; font-weight: 700; box-shadow: var(--shadow-pop) }
.banner { font-size: 12px; color: var(--muted); padding: 0 8px; margin-top: auto }
.swatches { display: flex; gap: 10px; flex-wrap: wrap }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); position: relative }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; box-shadow: 0 0 0 2.5px var(--text) }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100% }
.opt-row { display: flex; flex-direction: column; gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--rule) }
.opt-row:last-child { border-bottom: 0 }
.opt-row > b { font-size: 14px }
.seg { display: inline-flex; background: var(--raised); border-radius: 12px; padding: 4px; gap: 4px }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; cursor: pointer; color: var(--muted); font-weight: 700; border-radius: 9px }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow) }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
.filters input, .filters select { height: 40px; border: 0; box-shadow: var(--shadow), inset 0 0 0 1px var(--border); border-radius: var(--r-ctl); background: var(--surface); padding: 0 12px; font-weight: 600 }
.bar-in { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; min-width: 60px }
.bar-in i { display: block; height: 100%; border-radius: 4px; background: var(--accent) }
.bar-in i.bad { background: var(--negative) } .bar-in i.warn { background: var(--warning) }
.lesson { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center }
.preview-mini { border-radius: 14px; background: var(--ground); padding: 14px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px }
.preview-mini div { height: 54px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow) }
.preview-mini div:first-child { background: var(--accent) }

/* ---------- Telas menores ---------- */
@media (max-width: 1280px) { .live { grid-template-columns: 290px minmax(0, 1fr); } .live .det { grid-column: 1 / -1 } .live { height: auto } .live .map { height: 520px } .live .list { max-height: 520px } }
@media (max-width: 1180px) { .overview { grid-template-columns: minmax(0, 1fr) } .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) } }
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr) }
  .side { position: fixed; inset: 0 auto 0 0; width: 270px; background: var(--ground); z-index: 50; transform: translateX(-100%); transition: transform .2s; padding-top: calc(16px + env(safe-area-inset-top, 0px)) }
  .side.open { transform: none; box-shadow: 0 0 0 100vw rgba(0,0,0,.35) }
  .menu-btn { display: grid }
  .top { padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); gap: 8px }
  .search kbd, .who .txt, .top-actions .hide-sm { display: none }
  .who { padding: 4px }
  .sheet { grid-column: 1 }
  .page { padding: 8px max(14px, env(safe-area-inset-right, 0px)) 32px max(14px, env(safe-area-inset-left, 0px)) }
  .grid-2, .grid-3, .live { grid-template-columns: minmax(0, 1fr) !important }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) } .kpi.hero { grid-column: 1 / -1 }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .sb-legend { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .action-card { grid-template-columns: minmax(0, 1fr) } .action-card .money { text-align: left }
  .live .map { height: 380px }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important } }

/* Cabeçalho do setor com foto real */
.title-row.has-photo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 40%); grid-template-rows: 1fr auto; gap: 0 24px; align-items: end; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; min-height: 196px }
.title-row.has-photo > div:first-child { padding: 26px 0 10px 26px; align-self: start }
.title-row.has-photo > .actions { padding: 0 0 22px 26px; grid-column: 1 }
.title-row.has-photo > .tabs { padding: 0 0 22px 26px; grid-column: 1 }
.title-row.has-photo h1 { font-size: 30px }
.tr-photo { grid-column: 2; grid-row: 1 / span 2; margin: 10px; border-radius: 16px; overflow: hidden; align-self: stretch; min-height: 176px; position: relative }
.tr-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block }
.photo-in { width: 100%; object-fit: cover; border-radius: 14px; display: block }
@media (max-width: 860px) {
  .title-row.has-photo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto }
  .tr-photo { grid-column: 1; grid-row: 1; min-height: 150px; margin: 8px 8px 0 }
  .title-row.has-photo > div:first-child { padding: 16px 18px 6px }
  .title-row.has-photo > .actions, .title-row.has-photo > .tabs { padding: 0 18px 18px }
}
.map .city, .map .road-lbl { paint-order: stroke; stroke: var(--map-land); stroke-width: 4px; stroke-linejoin: round }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important } }
