/* CaixaPro Assistência
   Direção: o balcão e a bancada da assistência. Neutros levemente azulados, o índigo
   do CaixaPro como cor da marca (sempre chapado, sem degradê nem brilho), números em mono
   e o número da OS como etiqueta de bancada. Tema claro e escuro pelas mesmas variáveis.
   Repaginação feita com o método unslop, de Damir Sokolovsky (@heydamir), CC BY 4.0. */
:root {
  color-scheme: light;
  /* neutros */
  --bg: #FFFFFF;
  --bg-soft: #F5F7FA;
  --bg-tint: #ECEFF4;
  --ink: #111827;
  --ink-soft: #4B5565;
  --muted: #6B7487;
  --faint: #9AA1B0;
  --line: #E3E7EE;
  --line-soft: #EEF1F5;
  --line-strong: #CDD3DD;

  /* marca: índigo do CaixaPro */
  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-bg: #EEF0FD;
  --accent-ink: #4338CA;
  --accent-line: #C7CBF6;
  --on-accent: #FFFFFF;
  --chart-bar: #C7CBF6;
  --chart-bar-hover: #A5ACEE;

  /* semânticas */
  --success: #16A34A;
  --success-bg: #EEF8F1;
  --success-ink: #166534;
  --success-line: #BFE3CB;
  --amber: #B45309;
  --amber-bg: #FDF7EC;
  --amber-dot: #D97706;
  --amber-ink: #78350F;
  --amber-line: #F1DDB8;
  --danger: #DC2626;
  --danger-bg: #FDF2F2;
  --danger-ink: #991B1B;
  --danger-line: #F3CFCF;
  --sky: #0284C7;
  --sky-bg: #EFF7FB;
  --orange: #EA580C;
  --orange-bg: #FDF4EC;

  /* barra lateral (o azul-escuro do CaixaPro) */
  --side-bg: #0B1020;
  --side-hover: #151B2F;
  --side-text: #A5B0C6;
  --side-muted: #6B7691;
  --side-line: rgba(255,255,255,.07);

  --pattern-bg: #111827;
  --toast-bg: #111827;
  --toast-fg: #EEF0F5;
  --backdrop: rgba(10,12,20,.45);
  --focus: rgba(79,70,229,.18);
  --sombra: 0 1px 2px rgba(16,24,40,.05);
  --sombra-forte: 0 16px 48px rgba(16,24,40,.16);

  /* tamanhos (pensados para o balcão) */
  --fs: 15px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --h-ctl: 40px;
  --h-ctl-sm: 34px;
  --h-ctl-lg: 48px;
  --h-row: 56px;

  --r-xl: 16px;
  --r-lg: 12px;
  --r-md: 8px;
  --r-sm: 6px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font-display: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --sidebar-w: 260px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11141C;
  --bg-soft: #0B0D14;
  --bg-tint: #1A1E28;
  --ink: #EEF0F5;
  --ink-soft: #A3A9B8;
  --muted: #7A8296;
  --faint: #596174;
  --line: #232836;
  --line-soft: #1A1E28;
  --line-strong: #30364A;

  --accent: #5850EC;
  --accent-hover: #4F46E5;
  --accent-bg: rgba(99,102,241,.14);
  --accent-ink: #A5B4FC;
  --accent-line: rgba(129,140,248,.4);
  --chart-bar: #2A3052;
  --chart-bar-hover: #3A4273;

  --success: #4CC38A;
  --success-bg: rgba(76,195,138,.10);
  --success-ink: #6FD3A1;
  --success-line: rgba(76,195,138,.28);
  --amber: #F5B454;
  --amber-bg: rgba(245,180,84,.10);
  --amber-dot: #F5B454;
  --amber-ink: #F5C77A;
  --amber-line: rgba(245,180,84,.28);
  --danger: #E5484D;
  --danger-bg: rgba(229,72,77,.10);
  --danger-ink: #F07B7E;
  --danger-line: rgba(229,72,77,.3);
  --sky: #38BDF8;
  --sky-bg: rgba(56,189,248,.10);
  --orange: #FB923C;
  --orange-bg: rgba(251,146,60,.10);

  --side-bg: #07080D;
  --side-hover: #11141C;
  --side-text: #A3A9B8;
  --side-muted: #6B7487;
  --side-line: rgba(255,255,255,.06);

  --pattern-bg: #07080D;
  --toast-bg: #232836;
  --toast-fg: #EEF0F5;
  --backdrop: rgba(0,0,0,.6);
  --focus: rgba(129,140,248,.25);
  --sombra: none;
  --sombra-forte: 0 16px 48px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--fs);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent-ink); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 600; letter-spacing: 0; }
b, strong { font-weight: 600; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-xs); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-bg); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none;
  background: var(--side-bg);
  color: var(--side-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--side-line);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; height: 68px; padding: 0 20px; border-bottom: 1px solid var(--side-line); }
.brand img { width: 30px; height: 30px; }
.brand-text { display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.brand-text strong { font-size: 17px; font-weight: 600; color: #F1F3F8; }
.brand-text small { font-size: 17px; font-weight: 400; color: var(--side-text); }
.nav { flex: 1; overflow-y: auto; padding: 8px 12px 12px; }
.nav-group { font-size: var(--fs-sm); color: var(--side-muted); padding: 0 12px; margin: 24px 0 8px; }
.nav-group:first-child { margin-top: 12px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 12px; margin: 0 0 2px; border-radius: var(--r-md);
  color: var(--side-text); font-size: var(--fs);
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav a svg.i { color: var(--side-muted); transition: color .15s var(--ease); }
.nav a:hover { background: var(--side-hover); color: #F1F3F8; }
.nav a:hover svg.i { color: var(--side-text); }
.nav a.active { background: var(--accent); color: #fff; }
.nav a.active svg.i { color: #fff; }
.nav a .count { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--side-muted); }
.nav a.active .count { color: rgba(255,255,255,.8); }
.nav a .count.warn { color: #F5B454; }
.sidebar-foot { padding: 16px 20px; border-top: 1px solid var(--side-line); font-size: var(--fs-xs); color: var(--side-muted); }
.sync { display: flex; align-items: center; gap: 8px; }
.sync .dot { width: 6px; height: 6px; border-radius: 50%; background: #4CC38A; }
.sync.pending .dot { background: #F5B454; }
.sync.offline .dot { background: var(--side-muted); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: 68px; padding: 0 32px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.page-head { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.page-head h1 { font-size: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head p { margin: 0; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head p:empty { display: none; }
.page-head p::first-letter { text-transform: uppercase; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.view { padding: 24px 32px 48px; flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; }
.only-mobile { display: none !important; }
.sidebar-backdrop { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h-ctl); padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer; font-weight: 500; font-size: var(--fs);
  white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
  background: var(--bg); color: var(--ink);
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--bg); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.btn-soft { background: var(--accent-bg); color: var(--accent-ink); }
.btn-soft:hover { border-color: var(--accent-line); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(.94); }
:root[data-theme="dark"] .btn-success { color: #052E16; }
.btn-danger { background: var(--bg); color: var(--danger-ink); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-wa { background: var(--bg); color: var(--success-ink); border-color: var(--success-line); }
.btn-wa:hover { background: var(--success-bg); }
.btn-sm { height: var(--h-ctl-sm); padding: 0 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-sm svg.i { width: 16px; height: 16px; }
.btn-lg { height: var(--h-ctl-lg); padding: 0 20px; font-size: 16px; }
.btn-block { width: 100%; }
.icon-btn {
  width: var(--h-ctl-sm); height: var(--h-ctl-sm); border-radius: var(--r-sm); border: 1px solid transparent;
  background: transparent; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.icon-btn:hover { background: var(--bg-tint); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.topbar .icon-btn { border-color: var(--line); background: var(--bg); color: var(--ink-soft); }
.topbar .icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }

/* ---------- Cards / grid ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sombra); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { font-size: 16px; font-weight: 600; white-space: nowrap; }
.card-head .sub { color: var(--muted); font-size: var(--fs-sm); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.kpi { padding: 20px 24px; position: relative; display: block; }
.kpi .label { color: var(--ink-soft); font-size: var(--fs-sm); display: flex; align-items: center; gap: 8px; }
.kpi .label .ic { display: none; }
.kpi .value { font-size: 30px; font-weight: 500; line-height: 1; margin-top: 12px; color: var(--ink); }
.kpi .hint { color: var(--muted); font-size: var(--fs-sm); margin-top: 8px; }
.kpi.key { background: var(--accent); border-color: var(--accent); }
.kpi.key .label { color: rgba(255,255,255,.78); }
.kpi.key .value { color: #fff; }
.kpi.key .hint { color: rgba(255,255,255,.72); }
a.kpi { color: inherit; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
a.kpi:hover { border-color: var(--line-strong); }
a.kpi.key:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- Etiqueta da OS (assinatura) ---------- */
.os-tag {
  position: relative; display: inline-flex; align-items: center;
  height: 24px; padding: 0 8px 0 20px; border-radius: 4px;
  border: 1px solid var(--line-strong); background: var(--bg);
  font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 500; color: var(--ink);
  white-space: nowrap; vertical-align: middle;
}
.os-tag::before {
  content: ''; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -4px;
  border-radius: 50%; border: 1px solid var(--accent); background: var(--bg-soft);
}
.os-tag.lg { height: 40px; padding: 0 14px 0 34px; font-size: 22px; border-radius: 6px; }
.os-tag.lg::before { left: 12px; width: 9px; height: 9px; margin-top: -5.5px; }
.t .os-tag, .cell-title .os-tag { margin-left: 4px; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: var(--fs-sm); font-weight: 500; color: var(--muted);
  height: 40px; padding: 0 16px; background: var(--bg-soft);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { height: var(--h-row); padding: 8px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--accent-bg); }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .actions-cell { text-align: right; white-space: nowrap; width: 1%; }
.cell-title { font-weight: 500; }
.cell-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg.i { width: 32px; height: 32px; stroke-width: 1.4; color: var(--accent-line); margin-bottom: 12px; }
.empty h4 { color: var(--ink); font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }

/* ---------- Status ---------- */
.badge {
  --c: var(--faint);
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  background: var(--bg-tint); color: var(--ink-soft);
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.badge.plain::before { display: none; }
.badge.plain { color: var(--c); background: transparent; padding: 0; height: auto; font-family: var(--font-mono); }
.badge.blue { --c: var(--sky); }
.badge.indigo { --c: var(--accent); }
.badge.amber { --c: var(--amber-dot); }
.badge.orange { --c: var(--orange); }
.badge.green { --c: var(--success); }
.badge.red { --c: var(--danger); }
.badge.gray { --c: var(--faint); }
.badge.dark { --c: var(--ink); }
.badge.plain.gray, .badge.plain.dark { color: var(--muted); }
td .badge.red.plain, .os-tag + .badge.plain { font-family: var(--font-body); margin-left: 8px; }

/* ---------- Formulários ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0,1fr)); }
.form-grid > * { grid-column: span 12; }
.c-2 { grid-column: span 2 !important; } .c-3 { grid-column: span 3 !important; } .c-4 { grid-column: span 4 !important; }
.c-5 { grid-column: span 5 !important; } .c-6 { grid-column: span 6 !important; } .c-7 { grid-column: span 7 !important; }
.c-8 { grid-column: span 8 !important; } .c-9 { grid-column: span 9 !important; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label-sm { font-size: var(--fs-sm); font-weight: 500; color: var(--ink-soft); }
.field .help { font-size: var(--fs-xs); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: var(--h-ctl); padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); outline: none;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.textarea { height: auto; min-height: 88px; padding: 8px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input.lg { height: var(--h-ctl-lg); font-size: 16px; }
.input-icon { position: relative; }
.input-icon svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 40px; }
.input-money { position: relative; }
.input-money::before { content: 'R$'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: var(--fs-sm); pointer-events: none; }
.input-money .input { padding-left: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input-icon { flex: 1; min-width: 240px; max-width: 440px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: var(--h-ctl-sm); padding: 0 12px;
  border-radius: var(--r-md); border: 1px solid transparent; background: transparent; cursor: pointer;
  font-size: var(--fs-sm); color: var(--ink-soft); transition: background-color .15s var(--ease), color .15s var(--ease);
}
.chip:hover { background: var(--bg-tint); color: var(--ink); }
.chip.active { background: var(--accent-bg); color: var(--accent-ink); border-color: var(--accent-line); font-weight: 500; }
.chip .n { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); }
.chip.active .n { color: var(--accent-ink); }

.section-title { font-size: var(--fs-sm); color: var(--ink-soft); font-weight: 500; margin: 0 0 12px; }

/* ---------- Checklist ---------- */
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.ck {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: var(--h-ctl); padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg); cursor: pointer; user-select: none; font-size: var(--fs-sm); text-align: left;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.ck:hover { border-color: var(--line-strong); }
.ck .st { font-size: var(--fs-xs); font-weight: 500; padding: 0 6px; border-radius: 4px; color: var(--muted); }
.ck.ok { border-color: var(--success-line); background: var(--success-bg); }
.ck.ok .st { color: var(--success-ink); }
.ck.def { border-color: var(--danger-line); background: var(--danger-bg); }
.ck.def .st { color: var(--danger-ink); }

/* ---------- Senha em desenho ---------- */
.pattern-wrap { display: flex; gap: 16px; align-items: center; }
.pattern { position: relative; width: 140px; height: 140px; background: var(--pattern-bg); border-radius: 12px; flex: none; }
.pattern svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pattern button {
  position: absolute; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #4B5565;
  background: transparent; cursor: pointer; transform: translate(-50%, -50%); padding: 0;
  color: #fff; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
}
.pattern button.on { background: #4F46E5; border-color: #A5B4FC; }

/* ---------- OS detalhe ---------- */
.os-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.os-num { font-size: 22px; font-weight: 600; }
.status-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.status-steps button {
  height: var(--h-ctl-sm); border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-sm); padding: 0 12px;
  font-size: var(--fs-sm); cursor: pointer; color: var(--ink-soft); transition: border-color .15s var(--ease), color .15s var(--ease);
}
.status-steps button:hover { border-color: var(--accent-line); color: var(--accent-ink); }
.status-steps button.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 20px; font-size: var(--fs-sm); }
.timeline li::before { content: ''; position: absolute; left: 3px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent-line); box-sizing: border-box; }
.timeline li:first-child::before { border-color: var(--accent); background: var(--accent); }
.timeline li::after { content: ''; position: absolute; left: 6.5px; top: 19px; bottom: 2px; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-family: var(--font-mono); font-size: var(--fs-xs); }
.sum-line { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.sum-line.total { font-size: 22px; font-weight: 600; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.sum-line.due { color: var(--danger-ink); font-weight: 500; }
.sum-line.paid { color: var(--success-ink); font-weight: 500; }
.client-card { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); }
.avatar {
  width: 40px; height: 40px; border-radius: var(--r-md); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-bg); color: var(--accent-ink); font-weight: 500; font-size: var(--fs-sm);
}
.items-table .input { height: var(--h-ctl-sm); }
.items-table td { height: auto; padding: 8px; }

/* ---------- PDV ---------- */
.pdv { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.pdv-search { padding: 16px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 0 16px 16px; max-height: calc(100vh - 300px); overflow-y: auto; }
.prod-tile {
  text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-md);
  padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 116px;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), transform .1s var(--ease);
}
.prod-tile:hover { border-color: var(--accent-line); background: var(--accent-bg); }
.prod-tile:active { transform: scale(.98); }
.prod-tile .nm { font-weight: 500; font-size: 14px; line-height: 1.35; }
.prod-tile .meta { font-size: var(--fs-xs); color: var(--muted); }
.prod-tile .pr { margin-top: auto; font-family: var(--font-mono); font-weight: 500; font-size: 16px; color: var(--accent-ink); }
.prod-tile.out { opacity: .5; }
.cart { position: sticky; top: 92px; display: flex; flex-direction: column; max-height: calc(100vh - 116px); }
.cart-items { flex: 1; overflow-y: auto; min-height: 140px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.cart-item .nm { font-weight: 500; font-size: 14px; }
.cart-item .sub { color: var(--muted); font-size: var(--fs-sm); }
.cart-item .tot { font-family: var(--font-mono); font-weight: 500; text-align: right; }
.qty { justify-self: start; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.qty button { width: 32px; height: 28px; border: none; background: var(--bg); cursor: pointer; font-weight: 500; color: var(--ink-soft); }
.qty button:hover { background: var(--bg-tint); }
.qty span { min-width: 32px; text-align: center; font-family: var(--font-mono); font-size: var(--fs-sm); }
.cart-foot { padding: 16px 20px; border-top: 1px solid var(--line); background: var(--bg-soft); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 16px; }
.cart-total .v { font-size: 34px; font-weight: 500; }
.kbd { font-family: var(--font-mono); font-size: 11px; line-height: 16px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--bg); color: var(--muted); }
.btn .kbd { background: transparent; border-color: rgba(255,255,255,.35); color: rgba(255,255,255,.85); }
.btn-ghost .kbd, .btn-soft .kbd { border-color: var(--line-strong); color: var(--muted); }

/* ---------- Pagamento ---------- */
.pay-total { text-align: center; padding: 4px 0 16px; }
.pay-total .v { font-size: 40px; font-weight: 500; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-opt { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); transition: border-color .15s var(--ease); }
.pay-opt.filled { border-color: var(--accent); background: var(--accent-bg); }
.pay-opt .top { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; }
.pay-opt .top svg.i { color: var(--accent-ink); }
.pay-opt .top button { margin-left: auto; }
.pay-opt .input { height: var(--h-ctl); }
.pay-status { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: var(--r-md); margin-top: 16px; font-weight: 500; }
.pay-status.due { background: var(--amber-bg); color: var(--amber); }
.pay-status.ok { background: var(--success-bg); color: var(--success-ink); }
.pay-status .v { font-family: var(--font-mono); font-size: 22px; }

/* ---------- Caixa ---------- */
.caixa-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.big-money { font-size: 34px; font-weight: 500; }
.diff-ok { color: var(--success); } .diff-bad { color: var(--danger); }

/* ---------- Gráfico principal ---------- */
.chart { --gutter: 72px; }
.plot { position: relative; height: 232px; margin: 24px 0 0 var(--gutter); }
.plot .gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.plot .gl:last-of-type { border-top-style: solid; border-color: var(--line-strong); }
.plot .gl span { position: absolute; right: calc(100% + 12px); top: -8px; font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 16px; color: var(--muted); white-space: nowrap; }
.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 12px; padding: 0 8px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.bar { position: relative; width: 100%; max-width: 44px; border-radius: 4px 4px 0 0; background: var(--chart-bar); min-height: 1px; transition: background-color .15s var(--ease); }
.bar-col:hover .bar { background: var(--chart-bar-hover); }
.bar-col.today .bar { background: var(--accent); }
.bar .vl { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.bar-col.today .bar .vl { color: var(--accent-ink); font-weight: 500; }
.bars.dense { gap: 4px; padding: 0; }
.bars.dense .vl { display: none; }
.bar-labels { display: flex; gap: 12px; padding: 0 8px; margin: 8px 0 0 var(--gutter); }
.bar-labels.dense { gap: 4px; padding: 0; }
.bar-labels span { flex: 1; min-width: 0; text-align: center; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; }
.bar-labels span.today { color: var(--accent-ink); font-weight: 500; }

.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar .top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.hbar .top span:last-child { font-family: var(--font-mono); }
.hbar .track { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 3px; background: var(--accent); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 20px; border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: none; }
.list li.click { cursor: pointer; transition: background-color .15s var(--ease); }
.list li.click:hover { background: var(--accent-bg); }
.list .grow { flex: 1; min-width: 0; }
.list .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .t:has(.tt) { display: flex; align-items: center; gap: 8px; }
.list .t .tt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list .t .os-tag { flex: none; margin-left: 0; }
.list .s { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list.links { padding: 8px; }
.list.links li { min-height: 0; padding: 0; border-bottom: none; }
.list.links a { flex: 1; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: var(--r-md); color: var(--ink); transition: background-color .15s var(--ease); }
.list.links a svg.i { color: var(--accent-ink); }
.list.links a:hover { background: var(--accent-bg); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick a {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 12px; border-radius: var(--r-md);
  border: 1px solid var(--line); color: var(--ink); font-size: 14px; background: var(--bg);
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.quick a:hover { border-color: var(--accent-line); background: var(--accent-bg); }
.quick a .ic { display: inline-flex; color: var(--accent-ink); }

.alert { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r-md); background: var(--amber-bg); color: var(--amber-ink); border: 1px solid var(--amber-line); font-size: 14px; }
.alert.info { background: var(--accent-bg); color: var(--ink-soft); border-color: var(--accent-line); }
.alert.ok { background: var(--success-bg); color: var(--success-ink); border-color: var(--success-line); }
.alert > svg.i { flex: none; }
.alert .grow { flex: 1; }
.alert b { display: block; margin-bottom: 2px; color: inherit; font-weight: 600; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--backdrop);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px;
  z-index: 100; animation: fade .16s var(--ease); overflow-y: auto;
}
.modal {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-xl); width: 100%; max-width: 580px;
  box-shadow: var(--sombra-forte); animation: rise .2s var(--ease); display: flex; flex-direction: column;
  max-height: 84vh;
}
.modal.sm { max-width: 440px; } .modal.lg { max-width: 780px; } .modal.xl { max-width: 1000px; }
.modal-head { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 24px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-head .icon-btn { margin-left: auto; margin-right: -8px; }
.modal-body { padding: 20px 24px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line-soft); background: var(--bg-soft); border-radius: 0 0 var(--r-xl) var(--r-xl); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.pick-list { max-height: 400px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); margin-top: 12px; }
.pick-list .list li { min-height: 0; padding: 8px 12px; }

/* ---------- Avisos ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 400px;
  background: var(--toast-bg); color: var(--toast-fg); padding: 12px 16px; border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: rise .2s var(--ease); font-size: 14px;
}
.toast .ic { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: #4CC38A; flex: none; }
.toast.error .ic { color: #F07B7E; }
.toast.warn .ic { color: #F5B454; }
.toast svg.i { width: 18px; height: 18px; stroke-width: 2; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { border: none; background: none; height: 44px; padding: 0 12px; cursor: pointer; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s var(--ease); }
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- Usuário logado, sem internet e avisos ---------- */
[hidden] { display: none !important; }
/* o que só o balcão (dono e atendente) faz some para o técnico */
body.papel-tecnico .so-balcao { display: none !important; }
.status-steps button:disabled { opacity: .45; cursor: not-allowed; }

.me { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.me .avatar { width: 34px; height: 34px; background: var(--side-hover); color: #E4E8F2; font-size: var(--fs-xs); }
.me .who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.me .who b { color: #F1F3F8; font-weight: 500; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-acts { display: flex; gap: 2px; }
.me .icon-btn { width: 32px; height: 32px; color: var(--side-muted); }
.me .icon-btn:hover { background: var(--side-hover); color: #F1F3F8; }

.list li.inativo .t, .list li.inativo .s { opacity: .55; }
.alert.erro { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-line); }

.offline-bar { display: none; }
body.sem-internet .offline-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: sticky; top: 0; z-index: 90; padding: 8px 16px; text-align: center;
  background: var(--amber-bg); color: var(--amber-ink); border-bottom: 1px solid var(--amber-line); font-size: var(--fs-sm);
}
.tela-aviso { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-soft); }

/* ---------- Mensalidade ---------- */
.aviso-topo { padding: 20px 32px 0; width: 100%; max-width: 1600px; margin: 0 auto; }
.aviso-topo .alert { flex-wrap: wrap; }
.pg-pix { display: flex; flex-direction: column; gap: 12px; }
.pg-qr { align-self: center; padding: 8px; background: #fff; border-radius: var(--r-md); border: 1px solid var(--line); line-height: 0; }
.pg-qr svg { width: 232px; height: 232px; max-width: 100%; }
.pg-valor { text-align: center; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pg-codigo { resize: none; font-size: 12px; line-height: 1.4; word-break: break-all; }
.pg-status { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-soft); }
.pg-ponto { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--amber, #D97706); animation: pg-pisca 1.4s ease-in-out infinite; }
@keyframes pg-pisca { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pg-ponto { animation: none; } }
@media (max-width: 860px) { .aviso-topo { padding: 12px 16px 0; } }

/* ---------- Tela de entrar / criar conta ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-side { background: var(--side-bg); color: var(--side-text); padding: 40px 48px; display: flex; flex-direction: column; gap: 32px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 30px; height: 30px; }
.auth-brand strong { font-size: 17px; font-weight: 600; color: #F1F3F8; }
.auth-brand span { font-size: 17px; color: var(--side-text); }
.auth-side h1 { color: #F1F3F8; font-size: 30px; line-height: 1.2; font-weight: 600; max-width: 17ch; margin: auto 0 0; }
.auth-side p { margin: 0; line-height: 1.6; max-width: 44ch; }
.auth-fila { display: flex; flex-direction: column; gap: 8px; margin-bottom: auto; max-width: 460px; }
.auth-fila div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--side-line); border-radius: var(--r-md); font-size: var(--fs-sm); }
.auth-fila .os-tag { color: #E4E8F2; background: var(--side-hover); border-color: rgba(255,255,255,.12); }
.auth-fila .st { margin-left: auto; color: var(--side-muted); white-space: nowrap; }
.auth-fila .st.ok { color: #4CC38A; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg-soft); }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h2 { font-size: 24px; font-weight: 600; margin: 0 0 6px; }
.auth-box .lead { color: var(--muted); margin: 0 0 24px; line-height: 1.5; }
.auth-box form { display: flex; flex-direction: column; gap: 16px; }
.auth-box .tabs { margin-bottom: 24px; }
.auth-troca { margin-top: 20px; font-size: var(--fs-sm); color: var(--muted); text-align: center; }
.auth-troca a { color: var(--accent-ink); font-weight: 500; }
.senha-wrap { position: relative; }
.senha-wrap .input { padding-right: 46px; }
.senha-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

/* ---------- Painel do administrador ---------- */
.adm-top { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px; background: var(--side-bg); color: var(--side-text); }
.adm-top .tag { font-size: var(--fs-sm); color: var(--side-muted); border-left: 1px solid var(--side-line); padding-left: 12px; }
.adm-top .icon-btn { color: var(--side-muted); }
.adm-top .icon-btn:hover { background: var(--side-hover); color: #F1F3F8; }
.adm-wrap { max-width: 1240px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 18px 20px 22px; gap: 14px; }
  .auth-side h1 { font-size: 19px; margin: 0; max-width: none; }
  .auth-side p, .auth-fila { display: none; }
  .auth-main { align-items: flex-start; padding: 24px 20px 40px; }
  .adm-top { padding: 0 16px; }
  .adm-wrap { padding: 16px; }
}

/* ---------- Barra de baixo e itens só do celular ---------- */
.tabbar { display: none; }
.only-sm { display: none !important; }
.pdv-mbar { display: none; }
.os-cards li { align-items: flex-start; }
.oc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.oc-top .t { flex: 1; min-width: 0; }
.oc-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: var(--fs-sm); color: var(--ink-soft); }
.oc-foot .late { color: var(--danger); }
.oc-foot > span:first-child { min-width: 0; }
.oc-val { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; flex: none; }
.oc-val b { font-weight: 500; color: var(--ink); }
.oc-val small { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Responsivo ---------- */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-main-side { grid-template-columns: minmax(0,1fr) 300px; }
  .pdv { grid-template-columns: minmax(0,1fr) 380px; }
}
@media (max-width: 1024px) {
  .g-main-side, .pdv, .g-3 { grid-template-columns: minmax(0,1fr); }
  .cart { position: static; max-height: none; }
  .quick { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
  :root { --tabbar-h: 64px; }
  .only-mobile { display: inline-flex !important; }
  .only-sm { display: block !important; }
  .hide-sm { display: none !important; }

  /* menu lateral vira gaveta; a barra de baixo faz a navegação */
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: min(var(--sidebar-w), 84vw); transform: translateX(-100%); transition: transform .3s var(--ease); }
  .app.menu-open .sidebar { transform: none; }
  .app.menu-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
  #btn-menu { display: none !important; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0,1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg); border-top: 1px solid var(--line);
  }
  .tabbar a {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: var(--muted); font-size: 11px; font-weight: 500; -webkit-tap-highlight-color: transparent;
  }
  .tabbar a svg.i { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent-ink); }
  .tabbar a.active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); }
  .tabbar .n { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; font-family: var(--font-mono); }

  .topbar { height: 56px; padding: 0 16px; padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); gap: 8px; }
  .page-head h1 { font-size: 18px; }
  .page-head p { display: none; }
  .topbar-actions { gap: 6px; }
  .view { padding: 16px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }

  /* grades: nunca mais largas que a tela */
  .g-2, .g-3 { grid-template-columns: minmax(0,1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .grid, .stack { gap: 12px; }
  .kpi { padding: 16px; }
  .kpi .value { font-size: 22px; margin-top: 8px; }
  .kpi .hint { font-size: var(--fs-xs); margin-top: 4px; }
  .form-grid > [class*="c-"] { grid-column: span 12 !important; }

  .card-head { flex-wrap: wrap; padding: 12px 16px; }
  .card-head h3 { white-space: normal; }
  .card-head .actions { margin-left: auto; flex-wrap: wrap; }
  .card-body { padding: 16px; }
  .list li { padding: 12px 16px; }
  .toolbar .input-icon { min-width: 0; max-width: none; flex-basis: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .table td { white-space: nowrap; }

  /* campos com 16px para o iPhone não dar zoom ao tocar */
  .input, .select, .textarea { font-size: 16px; }
  .input, .select { height: 44px; }
  .btn { min-height: 40px; }

  /* PDV */
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; padding: 0 12px 12px; }
  .prod-tile { min-height: 104px; }
  .pdv-mbar.on {
    display: flex; align-items: center; gap: 8px;
    position: fixed; left: 8px; right: 8px; z-index: 44;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px);
    padding: 8px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: rise .2s var(--ease);
  }
  .pdv-mbar .mb-sum { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 0; border: none; background: none; padding: 0 8px; cursor: pointer; text-align: left; }
  .pdv-mbar .mb-sum span { font-size: var(--fs-xs); }
  .pdv-mbar .mb-sum b { font-size: 18px; font-weight: 600; color: var(--ink); }
  .pdv-mbar .btn { height: 44px; }
  .view:has(.pdv-mbar.on) { padding-bottom: calc(var(--tabbar-h) + 104px + env(safe-area-inset-bottom)); }

  /* janelas abrem de baixo para cima */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.sm, .modal.lg, .modal.xl { max-width: none; max-height: 92vh; border-radius: var(--r-xl) var(--r-xl) 0 0; border-bottom: none; }
  .modal-head { padding: 12px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-radius: 0; }
  .modal-foot .btn { flex: 1; }
  .pay-grid { grid-template-columns: minmax(0,1fr); }
  .pay-total .v { font-size: 32px; }

  .toasts { left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }
  .toast { min-width: 0; max-width: none; }

  .chart { --gutter: 56px; }
  .bars, .bar-labels { gap: 4px; padding: 0; }
  .bar .vl { display: none; }
  .os-tag.lg { height: 34px; font-size: 18px; }
  .os-side { order: -1; } /* no celular, status e valores da OS vêm primeiro */
  .pattern-wrap { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  #top-os .lbl { display: none; }
  #top-os { width: var(--h-ctl-sm); padding: 0; }
  .kpi .value { font-size: 20px; }
  .checklist { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ Acompanhamento da OS pelo cliente (/os/<código>) ============ */
.ac-body { background: var(--bg-soft); min-height: 100vh; }
.ac { max-width: 560px; margin: 0 auto; padding: 0 16px 32px; display: flex; flex-direction: column; gap: 14px; }
.ac .card-body { padding: 18px 20px; }
.ac-carregando { padding: 80px 0; text-align: center; color: var(--muted); }
.ac-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 2px 4px; font-weight: 600; font-size: 16px; }
.ac-top .muted { font-weight: 400; font-size: var(--fs-sm); }
.ac-ola { margin: 0 0 12px; color: var(--ink-soft); }
.ac-aparelho { display: flex; align-items: center; gap: 14px; }
.ac-aparelho b { display: block; font-size: 18px; line-height: 1.25; }
.ac-aparelho .muted { font-size: var(--fs-sm); }
.ac-status { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md); font-weight: 600; font-size: 17px;
  background: var(--accent-bg); color: var(--accent-ink); border: 1px solid var(--accent-line); }
.ac-status.st-orcamento { background: var(--amber-bg); color: var(--amber-ink); border-color: var(--amber-line); }
.ac-status.st-pronta, .ac-status.st-entregue { background: var(--success-bg); color: var(--success-ink); border-color: var(--success-line); }
.ac-status.st-semreparo, .ac-status.st-cancelada { background: var(--danger-bg); color: var(--danger-ink); border-color: var(--danger-line); }
.ac-prev { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--ink-soft); font-size: var(--fs-sm); }
.ac-prev .i { width: 16px; height: 16px; }
.ac-destaque { border-color: var(--amber-line); box-shadow: 0 0 0 3px var(--amber-bg); }
.ac-diag { margin: 0 0 12px; line-height: 1.5; }
.ac-itens { list-style: none; margin: 0; padding: 0; }
.ac-itens li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.ac-itens b { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.ac-tot { margin-top: 8px; }
.ac-tot div { display: flex; justify-content: space-between; padding: 4px 0; font-family: var(--font-mono); }
.ac-tot div span:first-child { font-family: var(--font-body); }
.ac-tot .big { font-size: 19px; font-weight: 600; padding-top: 8px; }
.ac-tot .falta { color: var(--amber-ink); font-weight: 600; }
.ac-resp { display: flex; gap: 10px; margin-top: 16px; }
.ac-resp .btn { flex: 1; height: var(--h-ctl-lg); justify-content: center; }
.ac-nota { margin: 10px 0 0; font-size: var(--fs-sm); }
.ac-respondido { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: var(--r-md); font-weight: 500;
  background: var(--success-bg); color: var(--success-ink); }
.ac-respondido.recusar { background: var(--bg-soft); color: var(--ink-soft); }
.ac-passos { list-style: none; margin: 0; padding: 0; }
.ac-passos li { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.ac-passos li:last-child { padding-bottom: 0; }
.ac-passos li:not(:last-child)::after { content: ''; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--line); }
.ac-passos li.feito:not(:last-child)::after { background: var(--accent); }
.ac-ponto { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--bg); display: grid; place-items: center; }
.ac-ponto .i { width: 14px; height: 14px; color: var(--on-accent); stroke-width: 3; }
.ac-passos li.feito .ac-ponto { background: var(--accent); border-color: var(--accent); }
.ac-passos li.agora .ac-ponto { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 12px var(--accent); }
.ac-passos li.depois b { color: var(--faint); font-weight: 500; }
.ac-passos b { display: block; line-height: 24px; }
.ac-quando, .ac-sub { display: block; font-size: var(--fs-sm); color: var(--muted); }
.ac-sub { color: var(--orange); }
.ac-fim { display: flex; gap: 12px; align-items: flex-start; }
.ac-fim .i { color: var(--danger); flex: none; margin-top: 2px; }
.ac-fim span { display: block; color: var(--ink-soft); font-size: var(--fs-sm); margin-top: 2px; }
.ac-garantia { display: flex; gap: 12px; align-items: flex-start; }
.ac-garantia .i { flex: none; width: 24px; height: 24px; margin-top: 1px; }
.ac-garantia.vale .i { color: var(--success); }
.ac-garantia.venceu .i { color: var(--faint); }
.ac-garantia span { display: block; color: var(--ink-soft); font-size: var(--fs-sm); margin-top: 2px; }
.ac-texto { margin: 0 0 8px; line-height: 1.5; white-space: pre-line; }
.ac-loja h2 { font-size: 16px; margin: 0 0 4px; }
.ac-loja p { margin: 2px 0; display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.ac-loja p .i { width: 15px; height: 15px; }
.ac-wa { margin-top: 12px; width: 100%; justify-content: center; height: var(--h-ctl-lg); }
.ac-pe { text-align: center; color: var(--muted); font-size: var(--fs-xs); }
.ac-pe .link { background: none; border: 0; padding: 0; color: var(--accent-ink); font: inherit; text-decoration: underline; cursor: pointer; }
.ac-aviso { text-align: center; padding: 56px 12px 16px; }
.ac-aviso > .i { width: 40px; height: 40px; color: var(--muted); }
.ac-aviso h1 { font-size: 20px; margin: 12px 0 8px; }
.ac-aviso p { color: var(--ink-soft); line-height: 1.5; margin: 0 0 8px; }
.ac-aviso .btn { margin-top: 12px; }

/* link do cliente na ficha da OS */
.link-os { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-soft); font-size: var(--fs-sm);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
