/* Car Dealer Solutions · sign-in screens, account menu and owner tools (same look as the app) */
:root {
  --bg: #eef1f4; --surface: #ffffff; --sunk: #f5f7f9; --ink: #132130; --muted: #56657a; --line: #d4dbe3;
  --accent: #1c5aa3; --accent-ink: #ffffff; --accent-soft: #e3ecf7; --good: #1d7549; --good-soft: #e2f2e9;
  --warn: #9a5b00; --warn-soft: #fbf0dc; --bad: #ad2a22; --bad-soft: #f8e4e2;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f161e; --surface: #16202b; --sunk: #1b2733; --ink: #e4ebf2; --muted: #93a3b5; --line: #2a3a4b;
    --accent: #7fb0ea; --accent-ink: #0f161e; --accent-soft: #1b3350; --good: #6fd09d; --good-soft: #15352a; --warn: #f0b95a; --warn-soft: #3a2c12;
    --bad: #f28b82; --bad-soft: #3d1f1d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f161e; --surface: #16202b; --sunk: #1b2733; --ink: #e4ebf2; --muted: #93a3b5; --line: #2a3a4b;
  --accent: #7fb0ea; --accent-ink: #0f161e; --accent-soft: #1b3350; --good: #6fd09d; --good-soft: #15352a; --warn: #f0b95a; --warn-soft: #3a2c12;
  --bad: #f28b82; --bad-soft: #3d1f1d; color-scheme: dark;
}

/* ---------------------------------------------------------------- sign-in screens */
body.gated { overflow: hidden; }
.gate { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: var(--bg); display: grid; place-items: start center; align-content: start;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); font-family: var(--body); color: var(--ink); }
.gate-card { width: 100%; max-width: 420px; margin-top: min(9vh, 72px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 22px 22px 18px; box-shadow: 0 1px 0 rgba(19, 33, 48, .04), 0 12px 32px -18px rgba(19, 33, 48, .25); }
.gate-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.gate-brand img { width: 40px; height: 40px; flex: none; }
.gate-brand b { display: block; font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: .01em; line-height: 1.05; }
.gate-brand span { display: block; font-size: 12px; color: var(--muted); }
.gate h1 { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.05; margin: 0 0 4px; }
.gate form, .gate .gate-pane { display: grid; gap: 12px; }
.gate label.f { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.gate input[type=email], .gate input[type=password], .gate input[type=text] {
  width: 100%; font: 500 16px var(--body); color: var(--ink); background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.gate input:focus-visible, .gate button:focus-visible, .acct-panel :focus-visible, .cds-sec :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gate input.code { font: 600 26px var(--mono); letter-spacing: .3em; text-align: center; padding: 10px 8px; }
.gate .chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); font-weight: 500; }
.gate .chk input { width: 18px; height: 18px; accent-color: var(--accent); }
.gate button, .acct-panel button, .cds-sec button { font: 600 14px var(--body); border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 14px; cursor: pointer; }
.gate button.primary, .acct-panel button.primary, .cds-sec button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.gate button.primary { padding: 11px 14px; font-size: 15px; }
.gate button:disabled, .acct-panel button:disabled { opacity: .6; cursor: default; }
.gate .linkish { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.gate-links { margin: 2px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; }
.gate .hint { font-size: 13px; color: var(--muted); margin: 0; }
.gate-msg { margin: 0 0 12px; padding: 9px 11px; border-radius: 8px; font-size: 13px; background: var(--accent-soft); color: var(--ink); }
.gate-msg.bad { background: var(--bad-soft); color: var(--bad); }
.gate-msg.good { background: var(--good-soft); color: var(--good); }
.gate-foot { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.gate-foot a { color: inherit; }
.gate .qr { width: 196px; height: 196px; margin: 4px auto; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.gate .qr svg { display: block; width: 100%; height: 100%; }
.gate .secret { font: 600 14px var(--mono); letter-spacing: .06em; text-align: center; word-break: break-all; background: var(--sunk); border: 1px dashed var(--line); border-radius: 8px; padding: 8px; user-select: all; }
.gate ol { margin: 0; padding-left: 20px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.gate .pick { display: grid; text-align: left; gap: 2px; width: 100%; }
.gate .pick span { font-size: 12px; color: var(--muted); font-weight: 500; }
.gate .row2 { display: flex; flex-wrap: wrap; gap: 8px; }
.gate .spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: cdsspin .8s linear infinite; margin: 12px auto; }
@keyframes cdsspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gate .spin { animation-duration: 2.4s; } }
form.busy { opacity: .85; }

/* ---------------------------------------------------------------- app header: brand, account, status */
.brandline { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.brandline img { width: 20px; height: 20px; }
.brandline .dealer { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--ink); }
.topright { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; }
.acct-btn { display: inline-grid; grid-auto-flow: column; align-items: center; gap: 8px; text-align: left; }
.acct-btn .who { display: grid; line-height: 1.15; }
.acct-btn .who b { font-size: 13px; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn .who span { font-size: 11px; color: var(--muted); font-weight: 500; }
.acct-btn .av { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.acct-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(340px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 16px 40px -16px rgba(19, 33, 48, .35); padding: 14px; display: grid; gap: 12px; font-family: var(--body); }
.acct-head b { display: block; font-size: 14px; word-break: break-all; }
.acct-head span { font-size: 12px; color: var(--muted); }
.acct-sec { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.acct-sec .lbl { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.acct-sec .hint { margin: 0; font-size: 12px; color: var(--muted); }
.acct-out { grid-template-columns: 1fr 1fr; }
.acct-msg { margin: 0; font-size: 12px; color: var(--muted); min-height: 1em; }
.net-pill { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 4px 10px; }
.cds-toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  background: var(--ink); color: var(--surface); font: 600 13px var(--body); padding: 10px 14px; border-radius: 10px; max-width: min(520px, calc(100vw - 32px)); transition: opacity .2s, transform .2s; }
.cds-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- owner tools */
.cds-sec .lt td.acts { white-space: nowrap; text-align: right; }
.cds-sec .lt td.acts button { margin-left: 6px; padding: 5px 10px; font-size: 12px; }
.cds-sec .lt tr.off td { opacity: .65; }
.cds-sec .pill { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; vertical-align: 1px; }
.cds-sec .invform { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: end; }
@media (max-width: 760px) { .cds-sec .invform { grid-template-columns: minmax(0, 1fr); } .acct-out { grid-template-columns: 1fr; } }
.cds-sec .share { border: 1px solid var(--line); background: var(--sunk); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.cds-sec .share textarea { width: 100%; min-height: 120px; font: 13px/1.4 var(--body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px; resize: vertical; }
.cds-sec .btnlink { display: inline-block; font: 600 14px var(--body); border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 9px 14px; text-decoration: none; }
.cds-sec .secgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.cds-sec .secgrid > div { display: grid; gap: 6px; align-content: start; }
.cds-sec .switch { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.cds-sec .switch input { width: 18px; height: 18px; accent-color: var(--accent); }
.cds-sec .nowrap { white-space: nowrap; }
.cds-sec .toast.bad { color: var(--bad); }
.cds-sec .toast.good { color: var(--good); }
.cds-sec .inline { display: flex; gap: 8px; align-items: center; }
.cds-sec .inline input { flex: 1; min-width: 0; }

/* payment notes */
.pwnotes { display: grid; gap: 4px; margin-top: 6px; }
.pwnotes .nt { font-size: 12px; color: var(--ink); background: var(--sunk); border-left: 3px solid var(--accent); border-radius: 4px; padding: 4px 8px; }
.pwnotes .nt i { font-style: normal; color: var(--muted); }
.ntform { display: flex; gap: 6px; margin-top: 6px; }
.ntform input { flex: 1; min-width: 0; }

/* sub-tabs (Payments, Service) */
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; }
.subtabs button { font: 600 14px var(--body); padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.subtabs button[aria-selected="true"] { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.subtabs .badge { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font: 700 11px/20px var(--body); text-align: center; }
.seg.bhtabs button.on, .seg.wom button.on { background: var(--accent); color: var(--surface); }
.logp .grid4 .span2 { grid-column: span 2; }
.logp .grid4 .span4 { grid-column: 1 / -1; }
@media (max-width: 700px) { .logp .grid4 .span2 { grid-column: 1 / -1; } }
.bhbad { color: var(--bad); font-weight: 600; }
.pwnote.bhbad { background: var(--bad-soft); }

/* BHPH accounts */
.bhtools { align-items: center; }
.bhtools input[type=search], .svbar input[type=search] { flex: 1 1 260px; width: auto; }
.bhsetup { margin: 0; font-size: 13px; border: 1px solid var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 8px 12px; }
.bhsetup .linkish { font-size: 13px; }
.bhhours { margin: 0; font-size: 13px; border: 1px solid var(--warn); border-left: 4px solid var(--warn); background: var(--warn-soft); border-radius: 8px; padding: 8px 12px; }
.bhdue { color: var(--bad); }
.bhacct { display: grid; gap: 12px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 14px; }
.bhacct .linkish { font-size: 13px; }
.bhhead { display: grid; gap: 3px; }
.bhhead h3, .sales h3.svname { font-family: var(--display); font-size: 22px; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-transform: none; color: var(--ink); letter-spacing: .01em; }
.bhhead .sub, .svch .sub { margin: 0; font-size: 12.5px; color: var(--muted); max-width: none; }
.chip.late { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.bhprev { margin: 0; font-size: 13px; }
.bhacts, .svbar { align-items: center; }
.bhacts .btnlink { padding: 8px 12px; }
table.bht { min-width: 640px; }
table.bht tr.void td { text-decoration: line-through; opacity: .55; }
table.bht tr.void td .sub { text-decoration: none; }
table.bht tr.paid td, table.svit tr.paid td { color: var(--muted); }
table.bht tr.late td, table.svit tr.late td, table.svpt tr.late td { color: var(--bad); }
table.bht td .sub, table.svit td .sub, table.svpt td .sub, table.svcu td .sub { font-size: 11.5px; color: var(--muted); }
table.bht td.acts, table.svit td.acts, table.svpt td.acts { white-space: nowrap; text-align: right; }
table.bht button, table.svit button, table.svpt button { padding: 3px 8px; font-size: 12px; }
form.bhsub { gap: 8px; }

/* wash-out: who is paid, and which deals */
#woBox .board-head { align-items: center; }
table.wot th.ck, table.wot td.ck { width: 34px; text-align: center; }
table.wot input[type=checkbox], #woAll { width: 17px; height: 17px; accent-color: var(--accent); }
table.wot tr.paidnow td { color: var(--good); }
table.wot .tick { font-weight: 700; color: var(--good); }
.wo-sel { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.spnote { margin: 0; }

/* Service */
.svpane { display: grid; gap: 12px; }
.svbar .wk input[type=date] { width: auto; }
.svday { font: 600 13px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 10px 0 2px; border-top: 1px solid var(--line); }
.rem .svday:first-child { border-top: 0; padding-top: 0; }
.svremind { border: 1px solid var(--warn); border-left: 4px solid var(--warn); border-radius: 10px; padding: 10px 12px; background: var(--surface); display: grid; gap: 4px; }
.svremh { font-size: 13px; }
.svrow .act select { width: auto; padding: 4px 6px; font-size: 12px; }
.svcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); }
.svch { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; }
#svWoList, #svCuList { display: grid; gap: 10px; }
.svcard + .svcard { margin-top: 0; }
table.svit { min-width: 520px; }
table.svit tr.void td { text-decoration: line-through; opacity: .55; }
table.svpt { min-width: 820px; }
table.svcu { min-width: 620px; }
table.svcu tr.drow { cursor: pointer; }
table.svcu tr.drow:hover td { background: var(--sunk); }
#svCuOne { display: grid; gap: 10px; }
.svlines { display: grid; gap: 6px; }
.svline { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1.2fr) 110px 26px; gap: 6px; align-items: center; }
.svline.svpl { grid-template-columns: minmax(0, 1.2fr) minmax(0, 3fr) 70px minmax(0, 1fr) 90px 26px; }
.svline.svvl { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, .7fr) 80px 26px; }
.svline button { background: none; border: 0; color: var(--muted); padding: 0; font-size: 16px; }
.svline input[readonly] { background: transparent; border-color: transparent; }
.svlst { font-size: 12px; color: var(--muted); font-family: var(--mono); text-align: right; }
@media (max-width: 760px) {
  .svline, .svline.svpl, .svline.svvl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svline > :first-child { grid-column: 1 / -1; }
  .svline button { justify-self: end; }
}
.svlinks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.svlinks label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.svtot { font: 600 14px var(--mono); }
body.svconly .topnav { display: none; }
#bhphBox > .toast:empty, #svcBox > .toast:empty { display: none; }
@media (max-width: 700px) { .remi .pwnote { white-space: normal; display: inline-block; } }
