/* The admin and Vinzuu Sellers & Garages dashboards: a sidebar layout with soft cards, stat tiles
   with icons, and a light/dark switch. Loaded after styles.css on admin.html and business.html
   only, so the customer site is untouched. Every rule is scoped to body.dash. */

/* ---------- colours (light, then dark) ---------- */

.dash {
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --surface-2: #F7F9FB;
  --ink: #10283B;
  --ink-2: #5A6B7A;
  --line: #E2E8EE;
  --line-strong: #C3CDD6;
  --blue: #0F4C81;
  --blue-soft: rgba(15, 76, 129, 0.1);
  --yellow-soft: rgba(245, 183, 0, 0.18);
  --green-soft: rgba(20, 128, 74, 0.12);
  --violet: #6D4AC7;
  --violet-soft: rgba(109, 74, 199, 0.12);
  --row-hover: #F6F8FB;
  --side-bg: #10283B;
  --side-ink: #C3D0DC;
  --side-muted: #7F95A8;
  --shadow: 0 1px 2px rgba(16, 40, 59, 0.04), 0 6px 18px rgba(16, 40, 59, 0.06);
  --radius-card: 16px;
  --side-w: 264px;
}
:root[data-theme='dark'] .dash {
  --bg: #0D1520;
  --surface: #152130;
  --surface-2: #1A2838;
  --ink: #E6EDF4;
  --ink-2: #9BADBD;
  --line: #243446;
  --line-strong: #3A4E63;
  --blue: #73AEEA;
  --blue-soft: rgba(115, 174, 234, 0.14);
  --yellow-soft: rgba(245, 183, 0, 0.16);
  --green: #4CC38A;
  --green-bg: rgba(76, 195, 138, 0.14);
  --green-soft: rgba(76, 195, 138, 0.14);
  --amber: #F0A35E;
  --amber-bg: rgba(240, 163, 94, 0.14);
  --danger: #F2847C;
  --violet: #A68CF0;
  --violet-soft: rgba(166, 140, 240, 0.15);
  --row-hover: #1A2838;
  --side-bg: #0A111A;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 22px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}
body.dash { background: var(--bg); color: var(--ink); }
.dash a { color: var(--blue); }
.dash .skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px;
  background: var(--yellow); color: #10283B; font-weight: 700;
}
.dash .skip-link:focus { top: 12px; }

/* ---------- frame: sidebar, top bar, content ---------- */

.dash-side {
  position: fixed; inset: 0 auto 0 0; z-index: 60; width: var(--side-w);
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  background: var(--side-bg); color: var(--side-ink);
}
.dash:not(.dash-ready) .dash-side, .dash:not(.dash-ready) .dash-burger { display: none; }
.dash-ready .dash-main { margin-left: var(--side-w); }
.dash-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 20px 18px 10px 20px; }
.dash .dash-brand { color: #fff; font-size: 24px; }
.dash-brand .brand-mark { width: 40px; height: 40px; }
.dash-brand > span { display: flex; flex-direction: column; line-height: 1; }
.dash-brand small { margin-top: 4px; font: 600 12.5px/1.2 var(--font-body); color: var(--side-muted); letter-spacing: 0; white-space: normal; }
.dash-side-switch { padding: 6px 18px 0; }
.dash-side-switch .seg { display: flex; width: 100%; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.07); padding: 4px; gap: 4px; }
.dash-side-switch .seg[hidden] { display: none; }
.dash .dash-side-switch .seg button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--side-ink); }
.dash .dash-side-switch .seg button + button { border-left: 0; }
.dash .dash-side-switch .seg button[aria-pressed='true'] { background: var(--yellow); color: #10283B; }
.dash .dash-side-switch .seg button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

.dash-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 14px 12px; flex: 1 0 auto; }
.dash-nav-label { margin: 16px 12px 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; color: var(--side-muted); }
.dash-nav-item, .dash-side .portal-link, .dash-signout {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; color: var(--side-ink);
  font: 600 14.5px/1.2 var(--font-body); text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.dash-nav-item svg, .dash-signout svg { width: 20px; height: 20px; flex: none; }
.dash-nav-item:hover, .dash-side .portal-link:hover, .dash-signout:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.dash-nav-item:focus-visible, .dash-side .portal-link:focus-visible, .dash-signout:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }
.dash-nav-item[aria-selected='true'] { background: rgba(245, 183, 0, 0.13); color: #fff; }
.dash-nav-item[aria-selected='true'] svg { color: var(--yellow); }
.dash-nav-item[aria-selected='true']::before {
  content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--yellow);
}
.dash-nav-text { flex: 1; min-width: 0; }
.dash-badge { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font: 700 12px/1 var(--font-body); background: var(--yellow); color: #10283B; }
.dash-badge-warn { background: #E5534B; color: #fff; }

.dash-side-foot { padding: 4px 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.dash-side .portal-switch { display: flex; flex-direction: column; gap: 2px; }
.dash-side .portal-link { padding-left: 6px; }
.dash-side .portal-link .acct-portal-icon { width: 30px; height: 30px; border-radius: 8px; }
.dash-side .portal-link.is-current { background: rgba(255, 255, 255, 0.08); color: #fff; }
.dash-side .portal-link .acct-admin { background: #2A4A66; }
.dash-signout { margin-top: 6px; color: #F2A49E; }
.dash-signout:hover { color: #FFC2BD; }

.dash-scrim { display: none; }

.dash-main { min-width: 0; }
.dash-top {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px;
  padding: 14px 32px; min-height: 76px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.dash .dash-top-brand { color: var(--ink); }
.dash-top-brand .brand-mark { width: 38px; height: 38px; }
.dash-ready .dash-top-brand { display: none; }
.dash-top-brand .biz-brand-sub { margin-left: 4px; }
.dash:not(.dash-ready) .dash-heading { display: none; }
.dash-heading { min-width: 0; }
.dash-crumb { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-heading h1 { margin: 0; font-size: 30px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.dash-icon-btn {
  flex: none; width: 42px; height: 42px; display: inline-grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer;
  box-shadow: var(--shadow);
}
.dash-icon-btn svg { width: 20px; height: 20px; }
.dash-icon-btn:hover { border-color: var(--line-strong); }
.dash-icon-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.dash-burger { display: none; }
.dash-close { display: none; background: transparent; border-color: rgba(255, 255, 255, 0.14); color: #fff; box-shadow: none; }
.dash .acct-btn { color: var(--ink); }
.dash .acct-btn .nav-online { border-color: var(--bg); }
.dash-ready .dash-customer-link { display: none; }

.dash-content { padding: 24px 32px 64px; max-width: 1320px; }
.dash:not(.dash-ready) .dash-content { max-width: none; padding-top: 32px; }
.dash .demo-banner { color: #10283B; }

/* ---------- cards, headings, boxes ---------- */

.dash h2 { font-size: 26px; margin: 28px 0 12px; }
.dash h3 { font-size: 20px; }
.dash .panel, .dash .chart-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow);
}
.dash .panel { padding: 20px; }
.dash .chart-card { padding: 18px; }
.dash .panel > h2:first-child, .dash .downloads h2 { margin-top: 0; }
.dash .note-box { border-radius: 12px; border-left-width: 4px; }
.dash .biz-alert { background: rgba(229, 83, 75, 0.1); border-color: var(--danger); color: var(--danger); }
.dash #panel > div > h2:first-child, .dash #panel > form > h2:first-child { margin-top: 4px; }

/* The welcome card at the top of each overview, and the shop or garage card on the seller side. */
.dash-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 0 0 20px; padding: 22px 24px; border-radius: var(--radius-card);
  background: linear-gradient(120deg, #10283B 0%, #16426A 62%, #1D5A8C 100%); color: #E8F0F7;
  box-shadow: var(--shadow);
}
.dash-hero::after {
  content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 183, 0, 0.28), rgba(245, 183, 0, 0) 70%); pointer-events: none;
}
.dash-hero-icon {
  flex: none; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--yellow); color: #10283B;
}
.dash-hero-icon svg { width: 28px; height: 28px; }
.dash-hero-text { position: relative; z-index: 1; min-width: 0; flex: 1 1 260px; }
.dash .dash-hero h2 { margin: 2px 0 6px; color: #fff; font-size: clamp(26px, 4vw, 34px); }
.dash-hero .biz-side-label, .dash-hero-kicker { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--yellow); }
.dash-hero p { margin: 0; }
.dash-hero .biz-sub { color: #C7D5E2; }
.dash-hero .biz-verified { color: #6EE7A8; }
.dash-hero .biz-unverified { color: #FFC58A; }
.dash-hero .muted { color: #B6C6D4; }
.dash-hero .stars, .dash-hero .star { color: var(--yellow); }
.dash-hero .link-btn { color: var(--yellow); }
.dash-todo { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.dash-todo li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.dash-hero-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.dash-hero .btn-secondary { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.dash-hero .btn-secondary:hover:not([disabled]) { background: rgba(255, 255, 255, 0.18); }

/* ---------- stat tiles ---------- */

.dash .stat-grid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; margin-bottom: 20px; }
.dash .stat {
  display: flex; align-items: center; gap: 14px; padding: 18px; min-height: 92px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow);
}
.dash .stat-icon { flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.dash .stat-icon svg { width: 24px; height: 24px; }
.dash .stat:nth-child(4n+2) .stat-icon { background: var(--yellow-soft); color: #B07F00; }
.dash .stat:nth-child(4n+3) .stat-icon { background: var(--green-soft); color: var(--green); }
.dash .stat:nth-child(4n+4) .stat-icon { background: var(--violet-soft); color: var(--violet); }
:root[data-theme='dark'] .dash .stat:nth-child(4n+2) .stat-icon { color: var(--yellow); }
.dash .stat-body { display: flex; flex-direction: column; min-width: 0; color: var(--ink); font-size: inherit; }
.dash .stat b { font-size: 32px; line-height: 1; }
.dash .stat-body span { margin-top: 4px; color: var(--ink-2); font-size: 14px; line-height: 1.3; }
.dash .stat-new { border-color: var(--blue); box-shadow: var(--shadow), inset 0 0 0 1px var(--blue); }
.dash .stat.stat-new .stat-icon { background: var(--blue); color: #fff; }
.dash .stat-warn { border-color: var(--amber); box-shadow: var(--shadow), inset 0 0 0 1px var(--amber); }
.dash .stat.stat-warn .stat-icon { background: var(--amber); color: #fff; }
:root[data-theme='dark'] .dash .stat.stat-new .stat-icon, :root[data-theme='dark'] .dash .stat.stat-warn .stat-icon { color: #0D1520; }

/* ---------- charts ---------- */

.dash .chart-grid { gap: 16px; margin-bottom: 16px; }
.dash .chart-card figcaption strong { font-size: 16px; }
.dash .week-chart .bar { fill: var(--blue); }
.dash .week-chart .is-now .bar { fill: var(--yellow); }
.dash .week-chart .axis { stroke: var(--line-strong); }
.dash .week-chart .bar-g:hover .hit, .dash .week-chart .bar-g:focus .hit { fill: var(--blue-soft); }
.dash .bl-track { height: 8px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.dash .bl-bar { background: linear-gradient(90deg, var(--blue), #3D86C6); }
:root[data-theme='dark'] .dash .bl-bar { background: linear-gradient(90deg, #3D86C6, var(--blue)); }

/* ---------- tables ---------- */

.dash .table-scroll { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.dash table.data th {
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.dash table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dash table.data tbody tr:last-child td { border-bottom: 0; }
.dash table.data tbody tr:hover td { background: var(--row-hover); }

/* ---------- controls ---------- */

.dash .btn { border-radius: 10px; border-width: 1.5px; }
.dash .btn-secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.dash .btn-secondary:hover:not([disabled]) { background: var(--surface-2); border-color: var(--ink-2); }
.dash .btn-primary { border-color: var(--yellow-press); color: #10283B; }
.dash .btn-danger { background: var(--surface); }
.dash input[type='text'], .dash input[type='email'], .dash input[type='tel'], .dash input[type='number'], .dash input[type='password'],
.dash input[type='search'], .dash input[type='date'], .dash input[type='datetime-local'], .dash input[type='time'], .dash select, .dash textarea {
  border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.dash .seg { border-radius: 10px; border-width: 1.5px; }
.dash .seg button { background: var(--surface); color: var(--ink); }
.dash .seg button[aria-pressed='true'] { background: var(--ink); color: var(--surface); }
.dash .pill { border-width: 1px; }
.dash dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 18px; }

/* ---------- cards inside sections ---------- */

.dash .app-card, .dash .job-card, .dash .booking-item, .dash .pick-item, .dash .side-card {
  background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); border-radius: 14px;
}
.dash .job-requested { border-left-color: var(--blue); }
.dash .job-accepted { border-left-color: var(--green); }
.dash .pick-item:hover, .dash .side-card:hover { border-color: var(--blue); }
.dash .view-banner { background: linear-gradient(120deg, #10283B, #1D5A8C); border-radius: 14px; }
.dash .view-banner .btn-secondary { background: #fff; color: #10283B; border-color: #fff; }
.dash .locked-box, .dash .bk-side { background: var(--surface-2); }

/* ---------- dark mode: parts of styles.css that use fixed light colours ---------- */

:root[data-theme='dark'] .dash .pill-new { background: var(--blue-soft); }
:root[data-theme='dark'] .dash .pill-done { background: rgba(155, 173, 189, 0.12); }
:root[data-theme='dark'] .dash .pill-off { background: rgba(242, 132, 124, 0.12); }
:root[data-theme='dark'] .dash .acct-menu { background: var(--surface); border-color: var(--line); }
:root[data-theme='dark'] .dash .acct-portal { color: var(--ink); }
:root[data-theme='dark'] .dash .acct-portal:hover, :root[data-theme='dark'] .dash .acct-portal.is-current { background: var(--surface-2); }
:root[data-theme='dark'] .dash .acct-admin { background: #2A4A66; }
:root[data-theme='dark'] .dash .acct-signout:hover { background: rgba(242, 132, 124, 0.12); }
:root[data-theme='dark'] .dash .nav-avatar { color: #10283B; }
:root[data-theme='dark'] .dash .detail-photo, :root[data-theme='dark'] .dash .app-photos img,
:root[data-theme='dark'] .dash .part-thumb { background: var(--surface-2); }
:root[data-theme='dark'] .dash .part-btn, :root[data-theme='dark'] .dash .make-tile, :root[data-theme='dark'] .dash .kind-card,
:root[data-theme='dark'] .dash .report-reason, :root[data-theme='dark'] .dash .garage-option,
:root[data-theme='dark'] .dash .star-pick button { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
:root[data-theme='dark'] .dash .part-btn[aria-pressed='true'] { background: var(--blue); color: #0D1520; }
:root[data-theme='dark'] .dash .fact { background: var(--surface-2); }
:root[data-theme='dark'] .dash .side-icon { background: var(--yellow); color: #10283B; }
:root[data-theme='dark'] .dash .rs-bar { background: var(--surface-2); }
:root[data-theme='dark'] .dash .btn-quiet { background: transparent; }
:root[data-theme='dark'] .dash .tag-MEDIUM { border-color: var(--blue); color: var(--blue); }
:root[data-theme='dark'] .dash .demo-banner { background: #3A3110; color: #F7E7A6; border-bottom-color: #8A6D00; }
:root[data-theme='dark'] .dash dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
:root[data-theme='dark'] .dash .make-tile:has(.make-radio:checked), :root[data-theme='dark'] .dash .kind-card:has(input:checked),
:root[data-theme='dark'] .dash .report-reason:has(input:checked), :root[data-theme='dark'] .dash .garage-option:has(input:checked) { background: var(--surface-2); border-color: var(--blue); }

/* ---------- tablets and phones: the sidebar becomes a drawer ---------- */

@media (max-width: 960px) {
  .dash-side { transform: translateX(-100%); transition: transform 0.22s ease; box-shadow: none; width: min(300px, 86vw); }
  .dash-drawer-open .dash-side { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.35); }
  .dash-drawer-open .dash-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(6, 14, 22, 0.5); }
  .dash-drawer-open { overflow: hidden; }
  .dash-ready .dash-main { margin-left: 0; }
  .dash-close, .dash-ready .dash-burger { display: inline-grid; }
  .dash-top { padding: 10px 16px; min-height: 64px; gap: 10px; }
  .dash-heading h1 { font-size: 24px; }
  .dash-crumb { font-size: 12px; }
  .dash-content { padding: 16px 16px 56px; }
  .dash .acct-btn-text, .dash .acct-chev { display: none; }
  .dash-top-right:has(.acct) .dash-customer-link { display: none; }
}
@media (max-width: 600px) {
  .dash .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .dash .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 0; }
  .dash .stat-icon { width: 40px; height: 40px; border-radius: 12px; }
  .dash .stat-icon svg { width: 20px; height: 20px; }
  .dash .stat b { font-size: 28px; }
  .dash-hero { padding: 18px; gap: 14px; }
  .dash-hero-icon { width: 46px; height: 46px; border-radius: 14px; }
  .dash h2 { font-size: 23px; }
  .dash-top-brand .biz-brand-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-side, .dash-nav-item { transition: none; }
}
.dash #downloads { scroll-margin-top: 92px; }
.dash .view-banner { margin: 0 0 14px; }
.dash .table-scroll + .btn, .dash .table-scroll + p > .btn { margin-top: 12px; }

/* Shown while the page checks whether someone is signed in, instead of the sign-in form. */
.dash-checking { display: grid; justify-items: center; gap: 12px; padding: 64px 16px; text-align: center; }
.dash-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--yellow); animation: dash-spin 0.8s linear infinite; }
@keyframes dash-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dash-spinner { animation-duration: 2.4s; } }
