/* DOMMO CAR — base visual compartilhada (app do cliente, painel e app da equipe) */
:root {
  --bg: #0d0e10;
  --surface: #16171a;
  --raised: #1e1f23;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #edf1f6;
  --muted: #959ca7;
  --faint: #7f879a;
  --gold: #5b8fd0;
  --gold-strong: #2f6aa8;
  --gold-soft: rgba(91,143,208, .12);
  --ok: #7fbf9a;
  --warn: #e0b46a;
  --bad: #e07a6a;
  --info: #a7b4c8;
  --radius: 14px;
  --radius-sm: 10px;
  --display: 'Montserrat', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --on-accent: #07182b;                                              /* texto sobre botão azul */
  --accent-grad: linear-gradient(90deg, #a9c8ee, var(--gold-strong)); /* botões principais */
  --accent-grad-d: linear-gradient(135deg, #a9c8ee, var(--gold-strong));
  --text-grad: linear-gradient(90deg, #dce9f8, var(--gold) 55%, #2f6aa8);
  --glass: rgba(13, 14, 16, .92);
  --glass-2: rgba(22, 23, 26, .96);
  --side-bg: #0f1012;
  --photo-fade: rgba(18, 19, 21, .98);
  --pill-bg: #050506;
  --card-dark: linear-gradient(135deg, #17263a 0%, #17181a 70%);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
/* a letra não cresce sozinha ao girar o celular; nada vaza para os lados */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: clip; }
body { min-height: 100dvh; }
a { color: var(--gold); text-decoration: none; }
img, video { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 28px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
.eyebrow { font: 600 11px/1.2 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* botões */
.btn { appearance: none; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 500 14px/1 var(--sans); letter-spacing: .02em;
  padding: 13px 18px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  transition: background .2s, border-color .2s, transform .1s, opacity .2s; text-align: center; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { background: #9fc0ea; }
.btn.ghost { border-color: transparent; color: var(--gold); padding-inline: 10px; }
.btn.danger { border-color: rgba(224, 122, 106, .5); color: var(--bad); }
.btn.block { width: 100%; }
.btn.sm { min-height: 34px; padding: 8px 14px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }

/* formulário */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: .02em; }
input, select, textarea { width: 100%; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 14px; font: 15px/1.3 var(--sans); outline: none; transition: border-color .2s; }
/* no iPhone, campo com letra menor que 16px dá zoom ao tocar e a tela fica ampliada */
@media (max-width: 1023px) { input, select, textarea { font-size: 16px; } }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { min-height: 96px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--gold); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.check input { margin-top: 3px; }

/* cartões e listas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card + .card { margin-top: 12px; }
.card.tap { cursor: pointer; transition: border-color .2s; }
.card.tap:hover { border-color: var(--line-strong); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > .item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list > .item:last-child { border-bottom: 0; }
.list > .item:hover { background: rgba(255, 255, 255, .02); }
.chev { color: var(--faint); font-size: 18px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); color: var(--muted); white-space: nowrap; }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.ok { background: rgba(127, 191, 154, .12); color: var(--ok); }
.badge.warn { background: rgba(224, 180, 106, .12); color: var(--warn); }
.badge.bad { background: rgba(224, 122, 106, .12); color: var(--bad); }
.badge.info { background: rgba(143, 178, 217, .12); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .ico { font-size: 28px; color: var(--faint); margin-bottom: 8px; }

/* chips de seleção */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 14px; font-size: 13px; cursor: pointer; background: transparent; color: var(--text); font-family: var(--sans); }
.chip.on { background: var(--gold); color: var(--on-accent); border-color: var(--gold); font-weight: 600; }
.chip:disabled { opacity: .35; }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 100;
  background: #26272b; color: var(--text); border: 1px solid var(--line-strong); padding: 12px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow);
  transition: all .3s cubic-bezier(.2, .8, .2, 1); max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#toast.err { border-color: rgba(224, 122, 106, .5); }

/* modal (folha que sobe) */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 80; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: up .3s cubic-bezier(.2, .8, .2, 1); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: -8px auto 16px; }
@media (min-width: 760px) { .sheet-back { align-items: center; } .sheet { border-radius: 22px; border-bottom: 1px solid var(--line); } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* assinatura */
.sig { position: relative; background: #f4f1ea; border-radius: var(--radius-sm); touch-action: none; }
.sig canvas { width: 100%; height: 180px; display: block; border-radius: var(--radius-sm); }
.sig .hint { position: absolute; left: 14px; bottom: 10px; color: #8a867c; font-size: 12px; pointer-events: none; }
.sig .clear { position: absolute; right: 8px; top: 8px; background: rgba(0, 0, 0, .06); border: 0; border-radius: 999px; padding: 6px 10px; font-size: 12px; color: #555; cursor: pointer; }

/* galeria */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.gallery > * { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--raised); position: relative; cursor: zoom-in; }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; }
.gallery .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 2px 8px rgba(0,0,0,.6); pointer-events: none; }
.gallery .rm { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; }
.addmedia { border: 1px dashed var(--line-strong) !important; display: grid !important; place-items: center; color: var(--muted); font-size: 12px; text-align: center; cursor: pointer !important; background: transparent !important; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 120; display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.lightbox img, .lightbox video { max-height: 88dvh; border-radius: 8px; }

/* desenho do carro (vistoria) */
.cardiagram { position: relative; background: var(--raised); border-radius: var(--radius); padding: 10px; }
.cardiagram svg { width: 100%; height: auto; display: block; }
.cardiagram .mark { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--bad); color: #fff; font: 700 11px/24px var(--sans);
  text-align: center; box-shadow: 0 0 0 4px rgba(224, 122, 106, .25); }

/* linha do tempo */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.tl { position: relative; padding-bottom: 20px; }
.tl::before { content: ''; position: absolute; left: -24px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-strong); }
.tl.done::before { background: var(--gold); border-color: var(--gold); }
.tl.now::before { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 5px var(--gold-soft); }
.tl .t { font-weight: 600; } .tl.todo .t { color: var(--faint); font-weight: 500; }

/* utilidades */
.hide { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mt2 { margin-top: 28px; } .mb { margin-bottom: 16px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; }
.kv > :first-child { color: var(--muted); }
.kv.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 600; font-size: 16px; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--line-strong); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.logo { color: var(--gold); display: block; }
.logo svg { width: 100%; height: auto; display: block; }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* foco visível ao navegar pelo teclado */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.btn:focus-visible, .chip:focus-visible { border-radius: 999px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }

/* avatar (foto ou iniciais) */
.avatar { flex: none; border-radius: 50%; background: linear-gradient(135deg, #22364f, #1e1f23); border: 1px solid rgba(91,143,208,.35); color: var(--gold);
  display: inline-grid; place-items: center; font: 600 15px var(--display); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person { display: flex; gap: 12px; align-items: center; }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; font-weight: 600; }
.person .who small { color: var(--muted); }

/* aviso de nova versão */
#updbar { position: fixed; left: 0; right: 0; top: calc(8px + env(safe-area-inset-top)); z-index: 110; display: flex; justify-content: center; padding: 0 12px; pointer-events: none;
  animation: updIn .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes updIn { from { transform: translateY(-120%); opacity: 0; } }
#updbar .upd-in { pointer-events: auto; width: 100%; max-width: 540px; display: flex; gap: 12px; align-items: center; padding: 12px 12px 12px 14px; border-radius: 18px;
  background: rgba(30,31,35,.96); border: 1px solid rgba(91,143,208,.35); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
#updbar .upd-ic { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; color: var(--on-accent); background: linear-gradient(135deg, #a9c8ee, var(--gold-strong)); }
#updbar .upd-ic svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#updbar .upd-tx { flex: 1; min-width: 0; }
#updbar .upd-tx b { display: block; font-size: 14px; font-weight: 600; }
#updbar .upd-tx small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#updbar .upd-x { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; padding: 4px 6px; }

/* borda champanhe metálico, bem sutil, em cartões e ícones (app, painel e equipe) */
:root { --metal: linear-gradient(135deg, rgba(220,233,248,.42) 0%, rgba(91,143,208,.18) 28%, rgba(28,77,125,.14) 55%, rgba(169,200,238,.34) 100%); }
.card, .list, .svc, .vcard2, .herocard, .next, .pointscard, .banner, .action, .opt, .qmenu a, .vpick button, .modes button,
.kpi, .lane, .week .day, .ct,
.svc .th, .svcicon, .quick .qi, .qmenu .qi, .iconbtn, .avatar { position: relative; border-color: transparent !important; }
.card::after, .list::after, .svc::after, .vcard2::after, .herocard::after, .next::after, .pointscard::after, .banner::after, .action::after, .opt::after, .qmenu a::after,
.vpick button::after, .modes button::after, .kpi::after, .lane::after, .week .day::after, .ct::after,
.svc .th::after, .svcicon::after, .quick .qi::after, .qmenu .qi::after, .iconbtn::after, .avatar::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: var(--metal); opacity: .85; transition: opacity .2s;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card.tap:hover::after, .svc:hover::after, .opt:hover::after, .qmenu a:hover::after { opacity: 1; }
/* selecionados continuam com a borda champanhe cheia */
.opt.on::after, .vpick button.on::after, .modes button.on::after { background: linear-gradient(135deg, #dce9f8, var(--gold) 45%, #1c4d7d); opacity: 1; }
.tablewrap { border-color: rgba(91,143,208,.2) !important; }


/* ---------- tema claro (o padrão é o escuro) ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f8; --surface: #ffffff; --raised: #eef2f7;
  --line: rgba(12, 24, 40, .09); --line-strong: rgba(12, 24, 40, .17);
  --text: #0f1722; --muted: #566171; --faint: #5f6979;
  --gold: #1c4d7d; --gold-strong: #005aaa; --gold-soft: rgba(28, 77, 125, .08);
  --ok: #2e8a5c; --warn: #b7791f; --bad: #c2463a; --info: #52627a;
  --shadow: 0 10px 30px rgba(15, 23, 34, .10);
  --on-accent: #ffffff;
  --accent-grad: linear-gradient(90deg, #2f6aa8, #1c4d7d);
  --accent-grad-d: linear-gradient(135deg, #2f6aa8, #1c4d7d);
  --text-grad: linear-gradient(90deg, #005aaa, #1c4d7d 60%, #13334e);
  --glass: rgba(255, 255, 255, .9); --glass-2: rgba(255, 255, 255, .96);
  --side-bg: #ffffff; --photo-fade: rgba(255, 255, 255, .98); --pill-bg: #0f1722;
  --card-dark: linear-gradient(135deg, #e6eef8 0%, #ffffff 70%);
  --metal: linear-gradient(135deg, rgba(28,77,125,.35) 0%, rgba(0,90,170,.12) 30%, rgba(19,51,78,.10) 55%, rgba(47,106,168,.30) 100%);
}
:root[data-theme="light"] .btn.primary { color: #fff; }
:root[data-theme="light"] .btn.primary:hover { background: #163e66; }
:root[data-theme="light"] #toast { background: #0f1722; color: #fff; }
:root[data-theme="light"] input, :root[data-theme="light"] select, :root[data-theme="light"] textarea { background: #f7f9fc; }
:root[data-theme="light"] .sig { background: #fff; border: 1px solid var(--line); }
