@font-face { font-family: "Conthrax"; src: url("/conthrax.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }

/* ============ Tokens: claro como base, escuro por preferência ou escolha ============ */
:root {
  --surface: #ffffff; --surface-raised: #f4f5ef; --surface-high: #e9ebe2; --line: #8a8d82; --line-soft: #dcded5;
  --ink: #010101; --ink-muted: #5c5e57;
  --lime: #dfff03; --lime-deep: #708102; --on-lime: #010101;
  --action: #010101; --on-action: #dfff03; --accent-text: #4a5600; --focus-ring: #010101; --danger: #c8281e; --danger-soft: #fcebea;
  --mark: #010101;
  --overlay: rgba(1,1,1,.42);
  --shadow: 0 1px 2px rgba(1,1,1,.06), 0 8px 24px rgba(1,1,1,.06);
  --font-display: "Conthrax", "Barlow", Arial, sans-serif;
  --font-text: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px;
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px;
  --slant: -18deg;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --surface: #010101; --surface-raised: #141414; --surface-high: #1f1f1f; --line: #6b6b6b; --line-soft: #262626;
    --ink: #ffffff; --ink-muted: #a3a3a3;
    --action: #dfff03; --on-action: #010101; --accent-text: #dfff03; --focus-ring: #dfff03; --danger: #ff7a6b; --danger-soft: #2a1412;
    --mark: #dfff03; --overlay: rgba(0,0,0,.66); --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --surface: #010101; --surface-raised: #141414; --surface-high: #1f1f1f; --line: #6b6b6b; --line-soft: #262626;
  --ink: #ffffff; --ink-muted: #a3a3a3;
  --action: #dfff03; --on-action: #010101; --accent-text: #dfff03; --focus-ring: #dfff03; --danger: #ff7a6b; --danger-soft: #2a1412;
  --mark: #dfff03; --overlay: rgba(0,0,0,.66); --shadow: none;
  color-scheme: dark;
}
.logo-on-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-on-dark { display: block; } :root:not([data-theme="light"]) .logo-on-light { display: none; } }
:root[data-theme="dark"] .logo-on-dark { display: block; }
:root[data-theme="dark"] .logo-on-light { display: none; }

html { scroll-padding-top: env(safe-area-inset-top, 0px); }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font-text); font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
#view:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.lucide { width: 20px; height: 20px; stroke-width: 1.75; flex: none; }
a { color: inherit; }

/* ============ Escala tipográfica (5 tamanhos) ============
   Título de página  Conthrax 28/34 (22/28 no celular), caixa alta
   Número            Conthrax 24/30 · 20/26
   Título de bloco   Barlow 600 18/24
   Corpo             Barlow 400 16/24
   Apoio             Barlow 400–600 14/20 */
.t-page { font-family: var(--font-display); font-weight: 600; font-size: 28px; line-height: 34px; letter-spacing: .01em; text-transform: uppercase; margin: 0; }
.t-block { font-weight: 600; font-size: 18px; line-height: 24px; margin: 0; }
.t-sub { color: var(--ink-muted); margin: var(--s1) 0 0; }
.t-small { font-size: 14px; line-height: 20px; }
.muted { color: var(--ink-muted); }
.num { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }

/* ============ Estrutura ============ */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: env(safe-area-inset-top, 0px); height: 100vh; display: flex; flex-direction: column; padding: var(--s6) var(--s4); border-right: 1px solid var(--line-soft); background: var(--surface); }
.side .logo { height: 20px; width: auto; margin: var(--s2) var(--s3) var(--s7); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--s3); height: 44px; padding: 0 var(--s3); color: var(--ink-muted); text-decoration: none; font-weight: 600; border-radius: var(--r-sm) 0 var(--r-sm) 0; position: relative; }
.nav a:hover { color: var(--ink); background: var(--surface-raised); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface-raised); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: 2px; top: 12px; bottom: 12px; width: 3px; background: var(--mark); transform: skewX(var(--slant)); border-radius: 1px; }
.nav .count { margin-left: auto; font-size: 13px; line-height: 20px; font-weight: 700; min-width: 22px; text-align: center; background: var(--action); color: var(--on-action); padding: 0 6px; border-radius: 6px 0 6px 0; }
.side .bottom { margin-top: auto; display: flex; flex-direction: column; gap: var(--s2); }
.store { display: flex; align-items: center; gap: var(--s3); padding: var(--s3); border-radius: var(--r-sm) 0 var(--r-sm) 0; background: var(--surface-raised); }
.store .av { width: 32px; height: 32px; display: grid; place-items: center; background: var(--action); color: var(--on-action); font-weight: 700; font-size: 13px; border-radius: 8px 0 8px 0; flex: none; }
.store b { display: block; font-size: 14px; line-height: 18px; }
.store span { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.side-link { display: flex; align-items: center; gap: var(--s3); height: 40px; padding: 0 var(--s3); background: none; border: 0; color: var(--ink-muted); font-weight: 600; font-size: 14px; cursor: pointer; border-radius: var(--r-sm) 0 var(--r-sm) 0; text-align: left; width: 100%; }
.side-link:hover { color: var(--ink); background: var(--surface-raised); }
.side-link svg { width: 18px; height: 18px; }

.topbar, .tabbar { display: none; }
.main { min-width: 0; }
.view { max-width: 1200px; margin: 0 auto; padding: var(--s7) var(--s7) var(--s8); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s7); }
.section { margin-top: var(--s7); }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.textlink { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 2px; }
.textlink:hover { color: var(--ink); }
.textlink svg { width: 16px; height: 16px; }

/* ============ Botões: 3 níveis ============ */
.btn { font-family: var(--font-text); font-weight: 600; font-size: 15px; line-height: 20px; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 44px; padding: 0 var(--s5); border-radius: var(--r-md) 0 var(--r-md) 0; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color .15s, border-color .15s, filter .15s; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg.lucide { width: 18px; height: 18px; }
.btn-primary { background: var(--action); color: var(--on-action); }
.btn-primary:hover:not([disabled]) { filter: brightness(1.12); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not([disabled]) { background: var(--surface-raised); border-color: var(--ink); }
.btn-tertiary { background: transparent; color: var(--ink); padding: 0 var(--s3); }
.btn-tertiary:hover:not([disabled]) { background: var(--surface-raised); }
.btn-block { width: 100%; }
.iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; background: transparent; border: 0; color: var(--ink); border-radius: var(--r-sm) 0 var(--r-sm) 0; cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--surface-raised); }
.iconbtn svg { width: 20px; height: 20px; }

/* ============ Superfícies ============ */
.card { background: var(--surface-raised); border-radius: var(--r-lg) 0 var(--r-lg) 0; padding: var(--s6); min-width: 0; }

/* Indicadores */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.stat { background: var(--surface-raised); border-radius: var(--r-lg) 0 var(--r-lg) 0; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.stat-label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); }
.stat-value { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 30px; }
.stat-foot { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.delta { font-weight: 700; }
.delta.good { color: var(--accent-text); } .delta.bad { color: var(--danger); }

/* Badge */
.badge { display: inline-flex; align-items: center; font-size: 13px; line-height: 18px; font-weight: 600; padding: 1px 8px; border-radius: 6px 0 6px 0; white-space: nowrap; background: var(--surface-high); color: var(--ink-muted); }
.badge.strong { background: var(--ink); color: var(--surface); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.good { color: var(--accent-text); background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.offer { position: relative; isolation: isolate; display: inline-flex; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--on-lime); padding: 3px 12px; }
.offer::before { content: ""; position: absolute; inset: 0; background: var(--lime); transform: skewX(var(--slant)); border-radius: 2px; z-index: -1; }

/* Temperatura (SignalBars) */
.sig { display: inline-flex; align-items: center; gap: var(--s2); font-size: 14px; line-height: 20px; color: var(--ink-muted); font-weight: 600; }
.sig-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 14px; }
.sig-bars i { display: block; width: 4px; background: var(--surface-high); transform: skewX(var(--slant)); border-radius: 1px; }
.sig-bars i:nth-child(1) { height: 6px; } .sig-bars i:nth-child(2) { height: 10px; } .sig-bars i:nth-child(3) { height: 14px; }
.sig-bars i.on { background: var(--mark); }
.sig-bars i.on:nth-child(1) { opacity: .5; } .sig-bars i.on:nth-child(2) { opacity: .75; }

/* ============ Linhas clicáveis (substituem botões repetidos) ============ */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 64px; padding: var(--s3) var(--s2); margin: 0 calc(-1 * var(--s2)); width: calc(100% + 2 * var(--s2)); background: none; border: 0; border-top: 1px solid var(--line-soft); cursor: pointer; text-align: left; border-radius: 0; }
.rows li:first-child .row { border-top: 0; }
.row:hover { background: var(--surface-high); border-radius: var(--r-sm) 0 var(--r-sm) 0; }
.row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-muted); flex: none; }
.row .dot.alert { background: var(--danger); }
.row .txt { flex: 1; min-width: 0; }
.row .txt b { display: block; font-weight: 600; }
.row .txt span { display: block; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.row .chev { color: var(--ink-muted); flex: none; }
.row .tag { flex: none; font-size: 14px; font-weight: 600; }
.row .tag.alert { color: var(--danger); }
.empty-ok { color: var(--ink-muted); margin: 0; }

/* Painel */
.dash { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s4); }
.funnel { display: flex; flex-direction: column; gap: var(--s3); }
.frow { display: grid; grid-template-columns: 120px minmax(0, 1fr) 32px; align-items: center; gap: var(--s3); }
.frow .lbl { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.frow .track { height: 16px; position: relative; }
.frow .bar { position: absolute; left: 5px; top: 0; bottom: 0; background: var(--mark); transform: skewX(var(--slant)); border-radius: 2px; min-width: 4px; }
.frow:nth-child(1) .bar { opacity: .45; } .frow:nth-child(2) .bar { opacity: .6; } .frow:nth-child(3) .bar { opacity: .75; } .frow:nth-child(4) .bar { opacity: .88; }
.frow.lost .bar { background: var(--line-soft); opacity: 1; }
.frow .val { font-weight: 700; text-align: right; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.facts div { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.facts b { display: block; font-family: var(--font-display); font-size: 20px; line-height: 26px; color: var(--ink); font-weight: 600; margin-bottom: 2px; }
.divider { border: 0; border-top: 1px solid var(--line-soft); margin: var(--s5) 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; font-size: 14px; line-height: 20px; color: var(--ink-muted); padding: 0 0 var(--s2); }
.table td { padding: var(--s2) 0; border-top: 1px solid var(--line-soft); }
.table .n { text-align: right; font-variant-numeric: tabular-nums; }

/* ============ Filtros ============ */
.toolbar { display: flex; gap: var(--s3); align-items: center; margin-bottom: var(--s6); }
.scroller { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroller::-webkit-scrollbar { display: none; }
.pill { flex: none; height: 40px; padding: 0 var(--s4); border: 1px solid var(--line-soft); background: var(--surface); color: var(--ink-muted); border-radius: var(--r-sm) 0 var(--r-sm) 0; cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill:hover { color: var(--ink); border-color: var(--line); }
.pill[aria-pressed="true"], .pill[aria-selected="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.pill .c { font-weight: 500; opacity: .75; }
.search { position: relative; flex: 0 1 320px; margin-left: auto; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); width: 18px; height: 18px; }
.search input { width: 100%; height: 44px; padding: 0 var(--s3) 0 40px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-sm) 0 var(--r-sm) 0; font-size: 16px; }
.search input:hover { border-color: var(--line); }

/* ============ Card de veículo ============ */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); gap: var(--s4); }
.vc { position: relative; background: var(--surface-raised); border-radius: var(--r-lg) 0 var(--r-lg) 0; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.vc.featured { box-shadow: 0 0 0 2px var(--mark); }
.vc.sold { opacity: .55; }
.vc .ph { aspect-ratio: 16 / 10; background: var(--surface-high); position: relative; display: grid; place-items: center; }
.vc .ph svg.car { width: 64%; height: auto; color: var(--line); }
.vc .ph .tl { position: absolute; left: var(--s3); top: var(--s3); }
.vc .body { padding: var(--s4); display: flex; flex-direction: column; gap: 2px; flex: 1; }
.vc .title { font-weight: 700; font-size: 17px; line-height: 22px; }
.vc .version { font-size: 14px; line-height: 20px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc .meta { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.vc .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-top: var(--s3); }
.vc .price { font-family: var(--font-display); font-size: 18px; line-height: 24px; font-weight: 600; }
.vc .age { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); text-align: right; }
.vc .age.old { color: var(--danger); }
.vc .hit { position: absolute; inset: 0; background: none; border: 0; cursor: pointer; border-radius: var(--r-lg) 0 var(--r-lg) 0; }
.vc:hover { background: var(--surface-high); }
.vc:hover .ph { background: var(--line-soft); }

.empty { padding: var(--s8) var(--s5); text-align: center; color: var(--ink-muted); border: 1px dashed var(--line); border-radius: var(--r-lg) 0 var(--r-lg) 0; }
.empty b { display: block; color: var(--ink); font-size: 18px; line-height: 24px; margin-bottom: var(--s1); }

/* ============ Funil (desktop) ============ */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(248px, 1fr); gap: var(--s3); overflow-x: auto; padding-bottom: var(--s3); }
.kcol { background: var(--surface-raised); border-radius: var(--r-lg) 0 var(--r-lg) 0; padding: var(--s3); min-height: 360px; display: flex; flex-direction: column; gap: var(--s2); outline: 2px dashed transparent; outline-offset: -2px; }
.kcol.over { outline-color: var(--mark); }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s1) var(--s2) var(--s2); font-weight: 600; }
.kcol-head span { color: var(--ink-muted); font-weight: 500; }
.lc { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-sm) 0 var(--r-sm) 0; padding: var(--s3); cursor: pointer; display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%; box-shadow: var(--shadow); }
.lc:hover { border-color: var(--line); }
.lc .top { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.lc .name { font-weight: 700; }
.lc .car, .lc .src { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.lc .wait { margin-top: var(--s2); align-self: flex-start; }
.kcol .none { color: var(--ink-muted); font-size: 14px; padding: 0 var(--s2); margin: 0; }

/* Funil (celular): abas + lista */
.stage-list { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s4); }

/* ============ Integrações ============ */
.igrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.ic { display: flex; flex-direction: column; gap: var(--s4); }
.ic .head { display: flex; align-items: center; gap: var(--s3); }
.ic .mark { width: 44px; height: 44px; display: grid; place-items: center; background: var(--surface-high); border-radius: var(--r-sm) 0 var(--r-sm) 0; font-weight: 700; font-size: 14px; flex: none; }
.ic.on .mark { background: var(--action); color: var(--on-action); }
.ic .head .t-block { font-size: 17px; }
.ic .status { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ic.on .status { color: var(--accent-text); font-weight: 600; }
.ic .meta { display: flex; gap: var(--s6); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ic .meta b { color: var(--ink); font-weight: 700; }
.ic .act { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line-soft); }
.group-title { font-weight: 600; font-size: 14px; line-height: 20px; color: var(--ink-muted); margin: 0 0 var(--s3); }
.note { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); background: var(--surface-raised); border-radius: var(--r-sm) 0 var(--r-sm) 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }

/* Interruptor */
.switch { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.switch input { appearance: none; -webkit-appearance: none; margin: 0; width: 44px; height: 26px; background: var(--surface-high); border: 1px solid var(--line); border-radius: 13px; cursor: pointer; transition: background .15s; display: block; }
.switch input::after { content: ""; position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; background: var(--ink-muted); border-radius: 50%; transition: transform .15s, background .15s; }
.switch input:checked { background: var(--action); border-color: var(--action); }
.switch input:checked::after { transform: translateX(18px); background: var(--on-action); }
.switch input:disabled { opacity: .4; cursor: not-allowed; }

/* ============ Gaveta ============ */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 50; display: flex; justify-content: flex-end; animation: fade .18s ease-out; }
.drawer { background: var(--surface); width: min(560px, 100%); height: 100%; overflow-y: auto; display: flex; flex-direction: column; animation: slide .24s cubic-bezier(.2,.8,.2,1); box-shadow: -8px 0 32px rgba(1,1,1,.12);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.drawer-head { position: sticky; top: 0; background: var(--surface); z-index: 2; padding: var(--s3) var(--s4) 0; border-bottom: 1px solid var(--line-soft); }
.drawer-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 44px; }
.drawer-bar .back { display: inline-flex; align-items: center; gap: var(--s1); height: 44px; padding: 0 var(--s2) 0 var(--s1); background: none; border: 0; cursor: pointer; font-weight: 600; color: var(--ink-muted); border-radius: var(--r-sm) 0 var(--r-sm) 0; }
.drawer-bar .back:hover { color: var(--ink); background: var(--surface-raised); }
.drawer-title { padding: var(--s2) var(--s2) var(--s4); }
.drawer-title h2 { font-weight: 700; font-size: 22px; line-height: 28px; margin: 0; }
.drawer-title p { margin: 2px 0 0; color: var(--ink-muted); font-size: 15px; line-height: 22px; }
.tabs { display: flex; gap: var(--s5); padding: 0 var(--s2); }
.tab { height: 44px; background: none; border: 0; cursor: pointer; font-weight: 600; color: var(--ink-muted); padding: 0; position: relative; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--mark); }
.drawer-body { padding: var(--s6) var(--s6); display: flex; flex-direction: column; gap: var(--s7); }
.drawer-foot { position: sticky; bottom: 0; background: var(--surface); padding: var(--s4) var(--s6); border-top: 1px solid var(--line-soft); display: flex; gap: var(--s3); justify-content: flex-end; margin-top: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.label { font-weight: 600; font-size: 14px; line-height: 20px; color: var(--ink-muted); margin: 0 0 var(--s3); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s6); }
.kv div { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.kv b { display: block; color: var(--ink); font-size: 16px; line-height: 24px; font-weight: 600; }
.kv b.num { font-size: 17px; }
.pos { color: var(--accent-text); } .neg { color: var(--danger); }
.price-line { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.price-big { font-family: var(--font-display); font-size: 28px; line-height: 34px; font-weight: 600; }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-raised); border-radius: var(--r-sm) 0 var(--r-sm) 0; gap: 2px; max-width: 100%; overflow-x: auto; }
.segmented button { height: 38px; padding: 0 var(--s4); border: 0; background: transparent; border-radius: 6px 0 6px 0; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: var(--s2); }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-soft), var(--shadow); }

.notice { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: var(--s3) var(--s4); background: var(--danger-soft); color: var(--danger); border-radius: var(--r-sm) 0 var(--r-sm) 0; font-weight: 600; font-size: 15px; line-height: 22px; }
.notice .btn-tertiary { color: var(--danger); height: 36px; text-decoration: underline; text-underline-offset: 3px; }
.okline { display: flex; gap: var(--s2); align-items: center; color: var(--accent-text); font-weight: 600; font-size: 15px; }
.okline svg { width: 18px; height: 18px; }

.stepper { display: flex; gap: 4px; margin-bottom: var(--s3); }
.stepper i { flex: 1; height: 6px; background: var(--surface-high); transform: skewX(var(--slant)); border-radius: 1px; }
.stepper i.done { background: var(--mark); }
.stage-now { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.stage-now b { font-size: 18px; line-height: 24px; }
.stage-actions { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; height: 44px; padding: 0 40px 0 var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md) 0 var(--r-md) 0; font-weight: 600; font-size: 15px; cursor: pointer; }
.select-wrap::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }

.prow { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 60px; padding: var(--s2) 0; border-top: 1px solid var(--line-soft); }
.prow:first-of-type { border-top: 0; }
.prow b { display: block; font-weight: 600; }
.prow span { font-size: 14px; line-height: 20px; color: var(--ink-muted); }

/* Formulários */
.form { display: flex; flex-direction: column; gap: var(--s5); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s4); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; line-height: 20px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; height: 44px; padding: 0 var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm) 0 var(--r-sm) 0; font-size: 16px; }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field textarea { height: auto; min-height: 168px; padding: var(--s3); resize: vertical; line-height: 24px; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--ink); }
.field .hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.field .err { font-size: 14px; line-height: 20px; color: var(--danger); font-weight: 600; }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.plate-row { display: flex; gap: var(--s2); }
.plate-row input { text-transform: uppercase; font-weight: 700; letter-spacing: .1em; }
.form-section { display: flex; flex-direction: column; gap: var(--s4); }
.form-section + .form-section { padding-top: var(--s6); border-top: 1px solid var(--line-soft); }
.form-section h3 { font-size: 16px; line-height: 24px; font-weight: 700; margin: 0; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.check { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--line-soft); border-radius: var(--r-sm) 0 var(--r-sm) 0; cursor: pointer; font-weight: 600; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.check.off { opacity: .5; cursor: not-allowed; }
.form-err { margin: 0; color: var(--danger); font-weight: 600; }
.ai-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.ai-status { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ai-status.err { color: var(--danger); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 var(--s4) var(--s6); font-size: 15px; line-height: 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 5px; height: 9px; background: var(--mark); transform: skewX(var(--slant)); }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 22px; bottom: 2px; width: 1px; background: var(--line-soft); }
.timeline li:last-child::after { display: none; }
.timeline time { display: block; font-size: 13px; line-height: 18px; color: var(--ink-muted); }

.toast { position: fixed; left: 50%; bottom: calc(var(--s6) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: var(--s3) var(--s5); border-radius: var(--r-sm) 0 var(--r-sm) 0; font-weight: 600; z-index: 80; display: none; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(1,1,1,.2); }
.toast.show { display: block; animation: fade .2s ease-out; }

/* ============ Responsivo ============ */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line-soft); padding: 0 var(--s2) 0 var(--s4); height: 56px; }
  .topbar img { height: 17px; width: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line-soft); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 60px; color: var(--ink-muted); text-decoration: none; font-size: 12px; line-height: 16px; font-weight: 600; position: relative; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 32%; right: 32%; height: 3px; background: var(--mark); transform: skewX(var(--slant)); }
  .tabbar .count { position: absolute; top: 6px; left: calc(50% + 6px); font-size: 11px; line-height: 16px; font-weight: 700; min-width: 18px; padding: 0 4px; text-align: center; background: var(--danger); color: #fff; border-radius: 8px; }
  .view { padding: var(--s5) var(--s4) calc(152px + env(safe-area-inset-bottom, 0px)); }
  .page-head { margin-bottom: var(--s5); align-items: flex-start; }
  .page-head .btn { display: none; }
  .t-page { font-size: 22px; line-height: 28px; }
  .stats { gap: var(--s3); }
  .stat { padding: var(--s4); }
  .stat-value { font-size: 20px; line-height: 26px; }
  .card { padding: var(--s5) var(--s4); }
  .section { margin-top: var(--s6); }
  .toolbar { flex-direction: column-reverse; align-items: stretch; gap: var(--s3); margin-bottom: var(--s5); }
  .toolbar .scroller { margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4); }
  .search { flex: 1 1 auto; margin-left: 0; }
  .vgrid { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .vc { flex-direction: row; }
  .vc .ph { aspect-ratio: auto; width: 112px; flex: none; }
  .vc .ph svg.car { width: 84%; }
  .vc .ph .tl { left: var(--s2); top: var(--s2); }
  .vc .ph .tl .offer { font-size: 10px; padding: 2px 8px; }
  .vc .body { padding: var(--s3) var(--s4); }
  .vc .title { font-size: 16px; }
  .vc .price { font-size: 16px; }
  .fgrid, .checks { grid-template-columns: minmax(0, 1fr); }
  .frow { grid-template-columns: 104px minmax(0, 1fr) 28px; }
  .drawer { width: 100%; box-shadow: none; }
  .drawer-body { padding: var(--s5) var(--s4); gap: var(--s6); }
  .drawer-foot { padding: var(--s3) var(--s4); }
  .drawer-foot .btn { flex: 1; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .fab { position: fixed; right: var(--s4); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 25; height: 52px; padding: 0 var(--s5); box-shadow: 0 6px 20px rgba(1,1,1,.25); }
}
@media (min-width: 861px) { .fab { display: none; } }
@media (max-width: 400px) { .facts b { font-size: 16px; line-height: 22px; } .kv { gap: var(--s4); } }

/* ============ v3: equipe, agenda, diálogos ============ */
.side .shop { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin: calc(-1 * var(--s6)) var(--s3) var(--s6); }
.av { width: 32px; height: 32px; display: inline-grid; place-items: center; background: var(--action); color: var(--on-action); font-weight: 700; font-size: 13px; border-radius: 8px 0 8px 0; flex: none; }
.av.ghost { background: var(--surface-high); color: var(--ink); }
.me-card { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: var(--s3); border: 0; cursor: pointer; text-align: left; border-radius: var(--r-sm) 0 var(--r-sm) 0; background: var(--surface-raised); }
.me-card:hover { background: var(--surface-high); }
.me-card .who { flex: 1; min-width: 0; }
.me-card b { display: block; font-size: 14px; line-height: 18px; }
.me-card span.role { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.topbar .avbtn { background: none; border: 0; padding: 6px; cursor: pointer; border-radius: var(--r-sm) 0 var(--r-sm) 0; }

.scope { display: flex; align-items: center; gap: var(--s3); margin: calc(-1 * var(--s4)) 0 var(--s6); flex-wrap: wrap; }
.scope label { font-size: 14px; font-weight: 600; color: var(--ink-muted); }
.select-wrap.sm select { height: 40px; font-size: 14px; }

.ptabs { display: flex; gap: var(--s5); border-bottom: 1px solid var(--line-soft); margin-bottom: var(--s6); overflow-x: auto; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs .tab { flex: none; }

/* Tarefas */
.tlist { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line-soft); }
.tlist li:first-child .task { border-top: 0; }
.task .chk { width: 24px; height: 24px; margin-top: 10px; flex: none; border: 2px solid var(--line); border-radius: 6px 0 6px 0; background: var(--surface); cursor: pointer; display: grid; place-items: center; padding: 0; color: var(--on-action); }
.task .chk:hover { border-color: var(--ink); }
.task .chk.done { background: var(--action); border-color: var(--action); }
.task .chk svg { width: 14px; height: 14px; }
.task .open { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s3); background: none; border: 0; padding: var(--s2); margin: calc(-1 * var(--s2)) 0; cursor: pointer; text-align: left; border-radius: var(--r-sm) 0 var(--r-sm) 0; }
.task .open:hover { background: var(--surface-high); }
.task .tx { flex: 1; min-width: 0; }
.task .tx b { display: block; font-weight: 600; }
.task.is-done .tx b { text-decoration: line-through; color: var(--ink-muted); }
.task .tx > span { display: block; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.task .when { flex: none; text-align: right; font-size: 14px; line-height: 20px; font-weight: 700; }
.task .when.late { color: var(--danger); }
.task .when small { display: block; font-weight: 500; color: var(--ink-muted); font-size: 13px; }
.tgroup + .tgroup { margin-top: var(--s6); }
.tgroup h2 { font-size: 15px; line-height: 20px; font-weight: 700; margin: 0 0 var(--s2); display: flex; gap: var(--s2); align-items: baseline; }
.tgroup h2 span { color: var(--ink-muted); font-weight: 500; }
.tgroup.late h2 { color: var(--danger); }
.kind { display: inline-flex; align-items: center; gap: 4px; }
.rep { display: inline-flex; align-items: center; gap: 4px; }

.agenda-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s5); align-items: start; }
.weeknav { display: flex; align-items: center; gap: var(--s2); }
.weeknav b { min-width: 150px; text-align: center; font-size: 15px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s2); }
.wday { background: var(--surface-raised); border-radius: var(--r-sm) 0 var(--r-sm) 0; padding: var(--s2); min-height: 260px; display: flex; flex-direction: column; gap: 6px; }
.wday.today { box-shadow: inset 0 3px 0 var(--mark); }
.wday h3 { margin: 0 0 var(--s1); font-size: 13px; line-height: 18px; font-weight: 700; color: var(--ink-muted); display: flex; justify-content: space-between; padding: 2px 4px; }
.wday.today h3 { color: var(--ink); }
.wev { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 6px 0 6px 0; padding: 6px 8px; font-size: 13px; line-height: 17px; text-align: left; cursor: pointer; width: 100%; }
.wev:hover { border-color: var(--line); }
.wev b { display: block; font-weight: 700; }
.wev.done { opacity: .5; text-decoration: line-through; }
.wev.late { border-left: 3px solid var(--danger); }
.wday .none { font-size: 13px; color: var(--ink-muted); padding: 0 4px; }

/* Equipe */
.perf { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.pc { display: flex; flex-direction: column; gap: var(--s4); position: relative; }
.pc .who { display: flex; align-items: center; gap: var(--s3); }
.pc .who b { display: block; font-size: 17px; line-height: 22px; }
.pc .who span { font-size: 14px; color: var(--ink-muted); }
.pc .rank { margin-left: auto; font-family: var(--font-display); font-size: 20px; color: var(--ink-muted); }
.pc.top .rank { color: var(--accent-text); }
.pc .kv { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.member-row .txt b { display: flex; gap: var(--s2); align-items: center; }
.team-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s6); }

/* Cards de status no lead */
.outcome { padding: var(--s4); border-radius: var(--r-sm) 0 var(--r-sm) 0; background: var(--surface-raised); display: flex; flex-direction: column; gap: var(--s2); }
.outcome .row-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.outcome b.big { font-family: var(--font-display); font-size: 22px; line-height: 28px; }
.outcome p { margin: 0; color: var(--ink-muted); font-size: 15px; line-height: 22px; }
.outcome.lost { box-shadow: inset 3px 0 0 var(--danger); }
.outcome.won { box-shadow: inset 3px 0 0 var(--mark); }

/* Diálogo central (perda, venda) */
.dlg-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 60; display: grid; place-items: center; padding: var(--s4); animation: fade .15s ease-out; }
.dlg { background: var(--surface); width: min(500px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; border-radius: var(--r-lg) 0 var(--r-lg) 0; box-shadow: 0 24px 64px rgba(1,1,1,.3); display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.2,.8,.2,1); }
.dlg-head { padding: var(--s6) var(--s6) var(--s2); }
.dlg-head h2 { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; }
.dlg-head p { margin: var(--s1) 0 0; color: var(--ink-muted); }
.dlg-body { padding: var(--s4) var(--s6); display: flex; flex-direction: column; gap: var(--s5); }
.dlg-foot { padding: var(--s4) var(--s6) var(--s6); display: flex; gap: var(--s3); justify-content: flex-end; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.radios { display: flex; flex-direction: column; gap: var(--s2); }
.radio { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 var(--s4); border: 1px solid var(--line-soft); border-radius: var(--r-sm) 0 var(--r-sm) 0; cursor: pointer; font-weight: 600; }
.radio:hover { border-color: var(--line); }
.radio input { width: 18px; height: 18px; accent-color: var(--ink); margin: 0; }
.radio:has(input:checked) { border-color: var(--ink); background: var(--surface-raised); }
.calc { padding: var(--s3) var(--s4); background: var(--surface-raised); border-radius: var(--r-sm) 0 var(--r-sm) 0; font-size: 15px; line-height: 22px; display: flex; flex-direction: column; gap: 2px; }
.calc b { font-weight: 700; }
.money { font-family: var(--font-display); font-size: 20px !important; letter-spacing: .02em; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { width: 44px; height: 44px; border: 1px solid var(--line-soft); background: var(--surface); border-radius: var(--r-sm) 0 var(--r-sm) 0; font-weight: 700; cursor: pointer; }
.days button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.kinds { display: flex; gap: var(--s2); flex-wrap: wrap; }
.kinds .pill { height: 40px; }

/* Lembretes */
.reminders { position: fixed; right: var(--s5); top: calc(var(--s5) + env(safe-area-inset-top, 0px)); z-index: 70; display: flex; flex-direction: column; gap: var(--s2); width: min(360px, calc(100% - 32px)); }
.rem { background: #010101; color: #ffffff; border: 1px solid #2a2a2a; border-radius: var(--r-md) 0 var(--r-md) 0; padding: var(--s4); box-shadow: 0 12px 32px rgba(1,1,1,.3); animation: pop .2s ease-out; }
.rem .rt { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); font-size: 13px; font-weight: 700; color: var(--lime); }
:root[data-theme="light"] .rem .rt { color: var(--lime); }
.rem .rt button { background: none; border: 0; color: inherit; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; opacity: .8; }
.rem p { margin: 2px 0 var(--s3); font-weight: 600; font-size: 16px; line-height: 22px; }
.rem p small { display: block; font-weight: 500; opacity: .75; font-size: 14px; }
.rem .ra { display: flex; gap: var(--s2); }
.rem .ra button { height: 36px; padding: 0 var(--s4); border-radius: var(--r-sm) 0 var(--r-sm) 0; font-weight: 700; cursor: pointer; border: 1px solid rgba(255,255,255,.3); background: transparent; color: inherit; }
.rem .ra button.go { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.acct-list .row .txt span { display: inline; }

@media (max-width: 1100px) { .agenda-grid { grid-template-columns: minmax(0, 1fr); } .team-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .scope { margin-top: calc(-1 * var(--s2)); margin-bottom: var(--s5); }
  .week { grid-template-columns: minmax(0, 1fr); }
  .wday { min-height: 0; }
  .wday.empty-day { display: none; }
  .pc .kv { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dlg-overlay { place-items: end center; padding: 0; }
  .dlg { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .dlg-head, .dlg-body, .dlg-foot { padding-left: var(--s4); padding-right: var(--s4); }
  .dlg-foot .btn { flex: 1; }
  .reminders { right: var(--s3); left: var(--s3); width: auto; top: calc(62px + env(safe-area-inset-top, 0px)); }
  .rem { padding: var(--s3) var(--s4); }
  .rem p { font-size: 15px; margin-bottom: var(--s2); }
  .weeknav b { min-width: 0; flex: 1; }
}
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.row[aria-current="true"] { background: var(--surface-raised); border-radius: var(--r-sm) 0 var(--r-sm) 0; }

/* ============ v4: conversa do WhatsApp ============ */
:root { --out-bg: #eef7b8; --out-ink: #010101; --chat-bg: #f7f8f3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --out-bg: #2b3305; --out-ink: #ffffff; --chat-bg: #0a0a0a; } }
:root[data-theme="dark"] { --out-bg: #2b3305; --out-ink: #ffffff; --chat-bg: #0a0a0a; }
.drawer-body.chat-body { gap: var(--s3); padding: var(--s4) var(--s5) var(--s5); background: var(--chat-bg); flex: 1; }
.ctx { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.ctx-btn { height: 36px; font-size: 14px; }
.chat { display: flex; flex-direction: column; gap: 6px; }
.chat-empty { text-align: center; color: var(--ink-muted); padding: var(--s8) var(--s4); font-size: 15px; line-height: 22px; }
.chat-empty b { display: block; color: var(--ink); margin-bottom: var(--s1); }
.daysep { align-self: center; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--ink-muted); background: var(--surface-high); padding: 3px 10px; border-radius: 6px 0 6px 0; margin: var(--s3) 0 var(--s1); }
.msg { max-width: 82%; padding: 7px 10px 5px 12px; background: var(--surface); color: var(--ink); border-radius: 14px 14px 14px 3px; align-self: flex-start; font-size: 15px; line-height: 21px; box-shadow: 0 1px 1px rgba(1,1,1,.06); border: 1px solid var(--line-soft); }
.msg.out { align-self: flex-end; background: var(--out-bg); color: var(--out-ink); border-radius: 14px 14px 3px 14px; border-color: transparent; }
.mtext { white-space: pre-wrap; overflow-wrap: anywhere; }
.mtpl { font-size: 12px; line-height: 16px; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.mmeta { font-size: 12px; line-height: 16px; opacity: .65; text-align: right; margin-top: 2px; display: flex; justify-content: flex-end; gap: 3px; white-space: nowrap; }
.ticks { letter-spacing: -3px; padding-right: 3px; font-weight: 700; }
.ticks.read { color: #2f7ff0; opacity: 1; }
.msg.out .mmeta:has(.ticks.read) { opacity: .85; }
.mimg { position: relative; width: 240px; max-width: 100%; aspect-ratio: 4 / 3; background: var(--surface-high); border-radius: 10px 0 10px 0; display: grid; place-items: center; margin: 3px 0 4px; overflow: hidden; }
.msg.out .mimg { background: rgba(1,1,1,.08); }
.mimg svg.car { width: 76%; height: auto; color: var(--line); }
.mimg .more { position: absolute; right: 8px; bottom: 8px; background: rgba(1,1,1,.7); color: #fff; font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 6px 0 6px 0; }
.mcap { font-size: 14px; }
.mdoc { display: flex; align-items: center; gap: var(--s3); min-width: 220px; padding: 8px; margin: 3px 0; background: rgba(1,1,1,.05); border-radius: 8px 0 8px 0; }
.mdoc b { display: block; font-size: 14px; line-height: 18px; }
.mdoc small { font-size: 12px; opacity: .7; }
.maudio { display: flex; align-items: center; gap: var(--s2); min-width: 220px; padding-top: 3px; }
.maudio .play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; padding-left: 2px; }
.maudio .play.playing { background: var(--accent-text); }
.wave { display: flex; align-items: center; gap: 2px; flex: 1; height: 24px; }
.wave i { width: 3px; background: currentColor; opacity: .45; border-radius: 2px; }
.maudio small { font-size: 12px; opacity: .7; }
.msg.typing { display: flex; gap: 4px; padding: 12px 14px; }
.msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-muted); animation: blink 1.2s infinite; }
.msg.typing span:nth-child(2) { animation-delay: .2s; } .msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.drawer-foot.chat-foot { display: block; padding: var(--s2) var(--s3) var(--s3); position: sticky; }
.win { font-size: 12px; line-height: 16px; color: var(--ink-muted); text-align: center; padding: 0 0 var(--s2); }
.composer { display: flex; align-items: flex-end; gap: 4px; }
.composer textarea { flex: 1; min-width: 0; resize: none; height: 44px; min-height: 44px; max-height: 140px; padding: 11px 14px; border: 1px solid var(--line-soft); border-radius: 14px 0 14px 0; background: var(--surface-raised); font-size: 16px; line-height: 22px; }
.composer textarea:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0; }
.sendbtn { width: 44px; height: 44px; flex: none; background: var(--action); color: var(--on-action); border: 0; border-radius: 14px 0 14px 0; display: grid; place-items: center; cursor: pointer; }
.sendbtn:hover { filter: brightness(1.12); }
.attach-menu { position: absolute; left: var(--s3); bottom: calc(100% - 8px); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md) 0 var(--r-md) 0; box-shadow: 0 12px 32px rgba(1,1,1,.18); padding: 6px; display: flex; flex-direction: column; min-width: 240px; z-index: 5; }
.attach-menu[hidden] { display: none; }
.attach-menu button { display: flex; align-items: center; gap: var(--s3); height: 44px; padding: 0 var(--s3); background: none; border: 0; border-radius: var(--r-sm) 0 var(--r-sm) 0; font-weight: 600; cursor: pointer; text-align: left; color: var(--ink); }
.attach-menu button:hover, .attach-menu button:focus-visible { background: var(--surface-raised); }
.closed-win { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: var(--s2) var(--s2); }
.closed-win span { flex: 1 1 240px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.closed-win b { display: block; color: var(--ink); font-size: 15px; }
.tplopt { align-items: flex-start; padding: var(--s3) var(--s4); min-height: 0; }
.tplopt input { margin-top: 3px; }
.tplopt small { display: block; font-weight: 400; color: var(--ink-muted); font-size: 14px; line-height: 20px; margin-top: 4px; }

.lc .last { font-size: 14px; line-height: 20px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lc .last.new { color: var(--ink); font-weight: 600; }
.unread { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #25a244; color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
@media (max-width: 860px) {
  .drawer-body.chat-body { padding: var(--s3) var(--s3) var(--s4); }
  .msg { max-width: 88%; }
  .drawer-foot.chat-foot { padding: var(--s2) var(--s2) calc(var(--s2) + env(safe-area-inset-bottom, 0px)); }
}

/* ============ v5: títulos menores e quadro de leads ============ */
.t-page { font-size: 20px; line-height: 26px; letter-spacing: .02em; }
.t-sub { font-size: 15px; line-height: 22px; margin-top: 2px; }
.page-head { margin-bottom: var(--s6); }
.view { padding-top: var(--s6); }
.view.wide { max-width: none; padding-left: var(--s6); padding-right: var(--s6); padding-bottom: var(--s5); }
.scope { margin: calc(-1 * var(--s3)) 0 var(--s5); }

.ltools { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s4); flex-wrap: wrap; }
.ltools > .select-wrap, .ltools > .btn { flex: none; }
.ltools .search { flex: 0 1 280px; min-width: 220px; margin: 0; }
.ltools .search input { height: 40px; }
.ltools .scroller { flex: 1 1 520px; min-width: 0; order: 5; }
.ltools > .btn { order: 6; }
.ltools .pill { height: 36px; padding: 0 var(--s3); font-size: 14px; }

.board { display: flex; gap: var(--s3); overflow-x: auto; scrollbar-width: none; align-items: stretch; padding-bottom: var(--s2); scroll-snap-type: x proximity; }
.kcol { flex: 1 1 0; min-width: 200px; max-width: 340px; min-height: 0; display: flex; flex-direction: column; gap: 0; padding: 0; background: var(--surface-raised); border-radius: var(--r-lg) 0 var(--r-lg) 0; outline: 2px dashed transparent; outline-offset: -2px; transition: outline-color .12s, background-color .12s; scroll-snap-align: start; }
.kh { position: relative; padding: var(--s4) var(--s4) var(--s3); border-bottom: 1px solid var(--line-soft); }
.kmark { display: inline-block; width: 4px; height: 14px; background: var(--mark); transform: skewX(var(--slant)); flex: none; border-radius: 1px; }
.kcol.perdido .kmark { background: var(--danger); }
.kh-top { display: flex; align-items: center; gap: var(--s2); }
.kh h2 { margin: 0; font-size: 15px; line-height: 20px; font-weight: 700; }
.kcount { font-size: 13px; line-height: 18px; font-weight: 700; color: var(--ink-muted); background: var(--surface-high); padding: 0 7px; border-radius: 6px 0 6px 0; }
.kh-top .iconbtn.sm { width: 32px; height: 32px; margin-left: auto; }
.kh-sub { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin-top: 2px; }
.kbody { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); scrollbar-width: none; }
.kdrop { border: 1px dashed var(--line); border-radius: var(--r-sm) 0 var(--r-sm) 0; color: var(--ink-muted); font-size: 14px; text-align: center; padding: var(--s6) var(--s3); }
body.is-dragging .kcol { outline-color: var(--line-soft); }
.kcol.over { outline-color: var(--mark) !important; background: var(--surface-high); }
.kcol.slim { flex: 0 0 52px; min-width: 52px; max-width: 52px; }
.slim-btn { flex: 1; width: 100%; background: none; border: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: var(--s3); padding: var(--s4) 0; color: var(--ink-muted); font-weight: 700; border-radius: var(--r-lg) 0 var(--r-lg) 0; }
.slim-btn:hover { color: var(--ink); background: var(--surface-high); }
.slim-btn .vname { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 14px; letter-spacing: .02em; }

.lc { gap: 4px; padding: var(--s3); box-shadow: 0 1px 2px rgba(1,1,1,.05); transition: border-color .12s, box-shadow .12s, transform .12s; }
.lc:hover { border-color: var(--line); box-shadow: 0 4px 14px rgba(1,1,1,.08); }
.lc.is-waiting { box-shadow: inset 3px 0 0 var(--danger), 0 1px 2px rgba(1,1,1,.05); }
.lc.dragging { opacity: .35; transform: scale(.98); }
.lc .name { font-size: 15px; line-height: 20px; }
.lc .car { display: flex; justify-content: space-between; gap: var(--s2); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.lc .car span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc .car b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.lc .last { font-size: 14px; line-height: 20px; }
.lstep { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.lstep::before { content: ""; width: 4px; height: 10px; background: var(--mark); transform: skewX(var(--slant)); flex: none; }
.lstep.late { color: var(--danger); } .lstep.late::before { background: var(--danger); }
.lstep.none { color: var(--ink-muted); font-weight: 500; } .lstep.none::before { background: var(--line); }
.lc .foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: 4px; }
.lc .foot .src { font-size: 13px; line-height: 18px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-av { width: 24px; height: 24px; flex: none; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--surface-high); color: var(--ink); border-radius: 6px 0 6px 0; margin-left: auto; }
.lc .wait { display: none; }

@media (max-width: 860px) {
  .t-page { font-size: 18px; line-height: 24px; }
  .view.wide { padding-left: var(--s4); padding-right: var(--s4); padding-bottom: calc(152px + env(safe-area-inset-bottom, 0px)); }
  .ltools { flex-wrap: wrap; }
  .ltools .search { flex: 1 1 100%; }
  .ltools > .select-wrap { flex: 1 1 40%; min-width: 0; }
  .ltools > .select-wrap select { width: 100%; }
  .ltools .scroller { margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4); }
}
.ltools .select-wrap.sm select { height: 40px; }

.nav a[aria-current="page"]::before { display: none; }
.board::-webkit-scrollbar { display: none; }
.vpick { max-height: 52vh; overflow-y: auto; }
.vopt { gap: var(--s3); min-height: 64px; padding: var(--s2) var(--s3); }
.vopt[hidden] { display: none; }
.vthumb { width: 64px; height: 44px; flex: none; display: grid; place-items: center; background: var(--surface-high); border-radius: 6px 0 6px 0; }
.vthumb svg.car { width: 52px; height: auto; color: var(--line); }
.vinfo { flex: 1; min-width: 0; }
.vinfo b { display: block; font-size: 15px; line-height: 20px; }
.vinfo small { display: block; font-weight: 400; color: var(--ink-muted); font-size: 13px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vprice { flex: none; text-align: right; font-weight: 700; font-size: 14px; }
.vprice small { display: block; font-size: 12px; font-weight: 600; color: var(--accent-text); }
.kbody::-webkit-scrollbar { display: none; }

/* ============ v6: configurações ============ */
.side .shop { display: flex; align-items: center; gap: var(--s3); margin: calc(-1 * var(--s5)) var(--s3) var(--s6); }
.side .shop b { display: block; font-size: 14px; line-height: 18px; color: var(--ink); }
.side .shop span span, .side .shop > span:last-child { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.shop-logo { width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; background: var(--surface-high); color: var(--ink); font-weight: 700; font-size: 13px; border-radius: 8px 0 8px 0; overflow: hidden; }
.has-img { padding: 0 !important; overflow: hidden; background: var(--surface-high); }
.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.side-link { text-decoration: none; }
.side-link[aria-current="page"] { color: var(--ink); background: var(--surface-raised); }
.side-link i, .side-link svg { width: 18px; height: 18px; }

.cfg { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: var(--s7); align-items: start; }
.cfg-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--s5) + env(safe-area-inset-top, 0px)); }
.cfg-nav a { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3); text-decoration: none; color: var(--ink-muted); font-weight: 600; border-radius: var(--r-sm) 0 var(--r-sm) 0; }
.cfg-nav a:hover { color: var(--ink); background: var(--surface-raised); }
.cfg-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-raised); }
.cfg-nav a b { font-weight: 600; }
.cfg-nav svg.lucide { width: 18px; height: 18px; }
.cfg-main { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.cfg-form { gap: var(--s5); }
.cfg-card { background: var(--surface-raised); border-radius: var(--r-lg) 0 var(--r-lg) 0; padding: var(--s6); display: flex; flex-direction: column; gap: var(--s4); }
.cfg-card h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 700; }
.cfg-card h3 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700; }
.cfg-help { margin: calc(-1 * var(--s2)) 0 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.cfg-card .field input, .cfg-card .field textarea, .cfg-card .field select { background: var(--surface); }
.cfg-card .field input:disabled, .cfg-card .field textarea:disabled { opacity: .7; }
.cfg-card .prow { padding: var(--s3) 0; }
.cfg-card .prow:first-of-type { border-top: 0; }

.uploader { display: flex; align-items: center; gap: var(--s5); }
.up-prev { width: 88px; height: 88px; flex: none; display: grid; place-items: center; background: var(--surface-high); border-radius: 50%; overflow: hidden; font-weight: 700; font-size: 26px; color: var(--ink-muted); }
.up-prev.sq { border-radius: var(--r-lg) 0 var(--r-lg) 0; }
.up-prev img { width: 100%; height: 100%; object-fit: cover; }
.up-btns { display: flex; gap: var(--s2); margin-bottom: var(--s2); flex-wrap: wrap; }
.up-btns label.btn { cursor: pointer; }
.up-btns label.btn:focus-within { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.uploader .hint, .uploader .err { display: block; font-size: 13px; line-height: 18px; }
.uploader .hint { color: var(--ink-muted); }
.uploader .err { color: var(--danger); font-weight: 600; }

.hours { display: flex; flex-direction: column; }
.hrow { display: flex; align-items: center; gap: var(--s3); min-height: 56px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.hours .hrow:first-child { border-top: 0; }
.hday { width: 88px; font-weight: 600; }
.hrow.off .hday { color: var(--ink-muted); }
.hrow input[type="time"] { height: 40px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: var(--r-sm) 0 var(--r-sm) 0; background: var(--surface); font-size: 15px; }
.hclosed { font-size: 15px; }

.savebar { position: sticky; bottom: calc(var(--s4) + env(safe-area-inset-bottom, 0px)); z-index: 15; display: flex; align-items: center; gap: var(--s3); justify-content: flex-end; max-width: 1000px; margin: var(--s6) 0 0 auto; padding: var(--s3) var(--s3) var(--s3) var(--s5); background: var(--ink); color: var(--surface); border-radius: var(--r-md) 0 var(--r-md) 0; box-shadow: 0 12px 32px rgba(1,1,1,.25); }
.savebar[hidden] { display: none; }
.savebar span { margin-right: auto; font-weight: 600; }
.savebar .btn-tertiary { color: var(--surface); }
.savebar .btn-tertiary:hover { background: rgba(127,127,127,.2); }
.savebar .btn-primary { background: var(--lime); color: var(--on-lime); }

.wa-head { display: flex; align-items: center; gap: var(--s4); }
.wa-head > div { flex: 1; min-width: 0; }
.wa-mark { width: 48px; height: 48px; flex: none; display: grid; place-items: center; background: #25a244; color: #fff; border-radius: var(--r-md) 0 var(--r-md) 0; }
.wa-mark.off { background: var(--surface-high); color: var(--ink-muted); }
.kv3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wiz-steps { list-style: none; margin: 0; padding: var(--s4) 0; display: flex; gap: var(--s5); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.wiz-steps li { display: flex; align-items: center; gap: var(--s2); font-weight: 600; color: var(--ink-muted); font-size: 15px; }
.wiz-steps li span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); font-size: 13px; font-weight: 700; }
.wiz-steps li span svg { width: 14px; height: 14px; }
.wiz-steps li.now { color: var(--ink); }
.wiz-steps li.now span { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.wiz-steps li.done span { border-color: var(--action); background: var(--action); color: var(--on-action); }
.wiz-body { display: flex; flex-direction: column; gap: var(--s4); }
.checklist { margin: 0; padding-left: var(--s5); color: var(--ink); line-height: 26px; }
.qr-box { display: flex; gap: var(--s5); align-items: center; padding: var(--s4); background: var(--surface); border-radius: var(--r-md) 0 var(--r-md) 0; flex-wrap: wrap; }
.qr { width: 156px; height: 156px; flex: none; border-radius: 6px; }
.qr-box > div { flex: 1 1 220px; display: flex; flex-direction: column; gap: var(--s2); }
.steps-sm { margin: 0; padding-left: var(--s5); color: var(--ink-muted); font-size: 15px; line-height: 24px; }
.tpl-preview { background: var(--chat-bg); padding: var(--s4); border-radius: var(--r-md) 0 var(--r-md) 0; display: flex; flex-direction: column; margin-top: var(--s2); }
.cfg-back { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-muted); text-decoration: none; font-weight: 600; margin: 0 0 var(--s2) calc(-1 * var(--s1)); min-height: 36px; }

@media (max-width: 860px) {
  .cfg { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cfg-nav { position: static; gap: 0; }
  .cfg-nav a { min-height: 72px; padding: var(--s3) 0; border-top: 1px solid var(--line-soft); border-radius: 0; color: var(--ink); }
  .cfg-nav a:first-child { border-top: 0; }
  .cfg-nav a > span { flex: 1; }
  .cfg-nav a small { display: block; font-weight: 400; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
  .cfg-nav a[aria-current="page"] { background: none; }
  .cfg-main { margin-top: var(--s4); }
  .cfg-card { padding: var(--s5) var(--s4); }
  .uploader { gap: var(--s4); align-items: flex-start; }
  .up-prev { width: 72px; height: 72px; }
  .kv3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hday { width: 72px; }
  .savebar { position: fixed; left: var(--s3); right: var(--s3); bottom: calc(68px + env(safe-area-inset-bottom, 0px)); margin: 0; padding: var(--s2) var(--s2) var(--s2) var(--s4); }
  .savebar span { font-size: 14px; }
  body.cfg-dirty .fab { display: none; }
}
.row .txt b .badge { display: inline-flex; margin-left: 6px; vertical-align: 1px; font-size: 12px; line-height: 16px; }
.cfg-card .plate-row input { text-transform: none; letter-spacing: normal; font-weight: 400; }
body.cfg-dirty .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 860px) {
  .savebar span { display: none; }
  .savebar .btn { flex: 1; }
  .savebar { padding: var(--s2); }
  body.cfg-dirty .toast { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }
}
