/* Weymouth Tyres CRM – UI styles */
:root {
  --primary: #1d4ed8; --sidebar: #0f172a; --on-primary: #fff; --sb-text: #cbd5e1; --sb-strong: #fff;
  --bg: #f1f5f9; --card: #fff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0; --soft: #f8fafc;
  --danger: #dc2626; --success: #16a34a; --warning: #f59e0b;
  --radius: 10px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --pad: 16px; --row: 10px;
  font-size: 14px;
}
[data-density="compact"] { --pad: 12px; --row: 6px; font-size: 13px; }
[data-theme="dark"] { --bg: #0b1220; --card: #111a2e; --text: #e2e8f0; --muted: #94a3b8; --line: #1e293b; --soft: #0f172a; }
@media (prefers-color-scheme: dark) { [data-theme="auto"] { --bg: #0b1220; --card: #111a2e; --text: #e2e8f0; --muted: #94a3b8; --line: #1e293b; --soft: #0f172a; } }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.55rem; margin: 0; } h2 { font-size: 1.08rem; margin: 0; } h3 { font-size: 1rem; margin: 0 0 10px; } h4 { margin: 10px 0 6px; font-size: .9rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
pre.code { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; white-space: pre-wrap; }
.ic { flex-shrink: 0; vertical-align: -3px; }
.muted { color: var(--muted); } .small { font-size: .86em; } .right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.text-danger { color: var(--danger); font-weight: 600; } .pre { white-space: normal; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp { position: absolute; left: -9999px; }

/* ---------- Layout */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; background: var(--sidebar); color: var(--sb-text); display: flex; flex-direction: column; z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; color: var(--sb-strong); font-weight: 700; font-size: 1.05rem; }
.brand img { max-height: 34px; max-width: 120px; }
.brand-mark { display: inline-flex; width: 34px; height: 34px; border-radius: 9px; background: var(--primary); color: #fff; align-items: center; justify-content: center; }
.brand-mark.big { width: 56px; height: 56px; border-radius: 14px; }
.sidebar nav { padding: 6px 10px 20px; flex: 1; }
.sidebar nav a, .sidebar summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--sb-text); cursor: pointer; list-style: none; font-weight: 500; }
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::after { content: "›"; margin-left: auto; transition: transform .15s; opacity: .6; }
.sidebar details[open] summary::after { transform: rotate(90deg); }
.sidebar nav a:hover, .sidebar summary:hover { background: color-mix(in srgb, var(--sb-strong) 6%, transparent); color: var(--sb-strong); }
.sidebar nav a.active, .sidebar summary.active { background: color-mix(in srgb, var(--sb-strong) 10%, transparent); color: var(--sb-strong); }
.sidebar nav a.sub { padding-left: 38px; font-weight: 400; font-size: .95em; }
.sidebar nav a.sub.active { background: var(--primary); color: var(--on-primary); }
.sidebar-foot { padding: 10px 18px; font-size: .75rem; opacity: .5; }
.main { margin-left: 236px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: var(--card); border-bottom: 1px solid var(--line); }
.global-search { display: flex; align-items: center; gap: 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; width: 320px; max-width: 40vw; }
.global-search input { border: 0 !important; background: transparent !important; padding: 8px 0 !important; box-shadow: none !important; }
.shortcuts { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-chip span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.1; font-weight: 600; }
.user-chip small { font-weight: 400; color: var(--muted); }
.content { padding: 22px; max-width: 1600px; width: 100%; }
.only-mobile, .btn-icon.only-mobile { display: none; }
.nav-overlay { display: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- Components */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--pad); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.empty { color: var(--muted); text-align: center; padding: 28px 10px !important; }
.card.empty { padding: 40px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { border-color: #94a3b8; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--primary); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #111; }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--soft); border-color: var(--line); }
.btn-sm { padding: 5px 10px; font-size: .88em; }
.btn-lg { padding: 12px 20px; font-size: 1.05em; }
.btn-block { width: 100%; justify-content: center; }
.btn.disabled { opacity: .45; pointer-events: none; }
.btn-icon { display: inline-flex; padding: 7px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.btn-icon:hover { background: var(--soft); }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .8em; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); margin: 2px; }
.reg { display: inline-block; font-family: "Charles Wright", "Arial Narrow", Arial, sans-serif; font-weight: 800; letter-spacing: .04em; background: #facc15; color: #111; border: 1px solid #a16207; border-radius: 4px; padding: 1px 7px; font-size: .95em; white-space: nowrap; }
.reg.sm { font-size: .82em; padding: 0 5px; }
.link { color: var(--primary); font-weight: 600; }
.link:hover { text-decoration: underline; }
.tick { color: var(--success); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); vertical-align: middle; }
.dot { display: inline-flex; align-items: center; justify-content: center; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.note { background: color-mix(in srgb, var(--warning) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
[data-theme="dark"] .flash-success { background: #052e16; color: #bbf7d0; border-color: #166534; }
[data-theme="dark"] .flash-error { background: #450a0a; color: #fecaca; border-color: #991b1b; }

/* ---------- Tables, toolbars, tabs */
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; }
.search-form { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--soft); flex: 1; max-width: 460px; min-width: 200px; }
.search-form input { border: 0 !important; background: transparent !important; padding: 8px 0 !important; box-shadow: none !important; width: 100%; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; overflow-x: auto; }
.tabs-top { margin-bottom: 14px; }
.tab { padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .count { background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; font-size: .8em; margin-left: 4px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78em; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th a:hover { color: var(--text); }
.table td { padding: var(--row) 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: var(--soft); }
.table.compact td, .table.compact th { padding: 5px 8px; }
.table tr.prio-urgent td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
.table tr.prio-high td:first-child { box-shadow: inset 4px 0 0 var(--warning); }
.table tr.declined td { opacity: .5; text-decoration: line-through; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; color: var(--muted); flex-wrap: wrap; }
.pager div { display: flex; gap: 6px; }
.type-pill { font-size: .75em; font-weight: 700; padding: 2px 7px; border-radius: 5px; background: var(--soft); border: 1px solid var(--line); text-transform: uppercase; }
.t-labour { color: #2563eb; } .t-part { color: #7c3aed; } .t-tyre { color: #0f172a; } .t-misc { color: #64748b; }
[data-theme="dark"] .t-tyre { color: #e2e8f0; }

/* ---------- Forms */
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
input[type=color] { padding: 2px; height: 38px; width: 70px; }
textarea { resize: vertical; }
.form .grid, .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 600; font-size: .9em; }
.span-all { grid-column: 1 / -1; } .span-2 { grid-column: span 2; }
.section-title { grid-column: 1 / -1; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: .95rem; }
.grid > .section-title:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.req { color: var(--danger); } .help { color: var(--muted); font-size: .85em; }
.check { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; margin: 4px 14px 4px 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; }
.form-foot { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.inline { display: inline; } .inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mini-select { width: auto; padding: 5px 8px; font-size: .9em; }
.copy-field { display: flex; gap: 6px; } .copy-field input { font-size: .85em; }
.sticky-save { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; z-index: 5; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.settings-grid .card { margin: 0; }
.settings-form > .card, .settings-form > .settings-grid { margin-bottom: 16px; }
.jt-block { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.jt-block summary { display: flex; align-items: center; gap: 12px; cursor: pointer; flex-wrap: wrap; }
.jt-block summary .inline-form { margin-left: auto; }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }

/* ---------- Dashboard */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.kpis.cards { margin-bottom: 16px; } .kpis.cards .card { margin: 0; }
.kpi span { display: block; color: var(--muted); font-size: .82em; font-weight: 600; }
.kpi strong { font-size: 1.35rem; } .kpi small { font-size: .7em; color: var(--muted); }
.kpi.danger strong { color: var(--danger); }
.meter { height: 8px; background: var(--soft); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.meter span { display: block; height: 100%; background: var(--primary); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg a { padding: 6px 11px; font-weight: 600; font-size: .88em; color: var(--muted); display: inline-flex; gap: 5px; align-items: center; border-right: 1px solid var(--line); }
.seg a:last-child { border-right: 0; }
.seg a.active { background: var(--primary); color: #fff; }
.attention, .checklist, .link-list, .report-list { list-style: none; margin: 0; padding: 0; }
.attention a { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.attention a:hover { background: var(--soft); }
.attention .ic { margin-left: auto; color: var(--muted); }
.attention .dot { width: 26px; height: 22px; border-radius: 6px; color: #fff; font-size: .8em; font-weight: 700; margin: 0; }
.checklist a { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.checklist .tickbox { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.checklist li.ok a { color: var(--muted); text-decoration: line-through; }
.checklist li.ok .tickbox { background: var(--success); border-color: var(--success); color: #fff; }
.stat-row { display: flex; gap: 12px; margin: 10px 0 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px; }
.stat span { display: block; font-size: .8em; color: var(--muted); } .stat strong { font-size: 1.15rem; }

/* ---------- Views */
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 16px; }
.lbl { display: block; font-size: .76em; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.desc { margin-top: 14px; }
.side-col .card h3 { display: flex; align-items: center; gap: 6px; }
.totals-box { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding: 12px 6px 4px; }
.totals-box > div { display: flex; gap: 20px; min-width: 240px; justify-content: space-between; }
.totals-box .grand { font-size: 1.15rem; border-top: 1px solid var(--line); padding-top: 4px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.split-forms { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.settings-hub, .report-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.settings-hub .card, .report-cats .card { margin: 0; }
.link-list a { display: flex; align-items: center; justify-content: space-between; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.link-list a:hover { color: var(--primary); }
.report-list a { display: flex; flex-direction: column; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.report-list a:hover strong { color: var(--primary); }
.guide li { margin-bottom: 8px; }
.all-good { text-align: center; padding: 40px 10px; color: var(--success); }
.all-good p { color: var(--text); font-weight: 600; }

/* ---------- Document editor */
.item-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.catalogue-search { position: relative; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--soft); min-width: 340px; }
.catalogue-search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 7px 0 !important; }
.cat-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.15); max-height: 360px; overflow: auto; z-index: 20; margin-top: 4px; }
.cat-results button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--text); font: inherit; }
.cat-results button:hover, .cat-results button.hl { background: var(--soft); }
.cat-results small { display: block; color: var(--muted); }
.items-table td { padding: 5px 4px; vertical-align: top; }
.items-table input, .items-table select, .items-table textarea { padding: 6px 7px; }
.items-table textarea { min-height: 34px; height: 34px; overflow: hidden; }
.items-table .line-total { padding-top: 12px; text-align: right; font-weight: 600; white-space: nowrap; }
.items-table .stock-badge { font-size: .75em; color: var(--muted); display: block; padding: 2px 2px 0; }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-box { width: 100%; max-width: 520px; }

/* ---------- Kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kcol { flex: 0 0 260px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); }
.kcol-head { padding: 10px 12px; font-weight: 700; border-top: 4px solid var(--c); border-radius: var(--radius) var(--radius) 0 0; display: flex; justify-content: space-between; }
.kcol-head .count { color: var(--muted); }
.kcol-body { padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.kcol.drag-over { outline: 2px dashed var(--primary); }
.kcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; box-shadow: var(--shadow); cursor: grab; }
.kcard.prio-urgent, .cal-job.prio-urgent { box-shadow: inset 4px 0 0 var(--danger), var(--shadow); }
.kcard.prio-high, .cal-job.prio-high { box-shadow: inset 4px 0 0 var(--warning), var(--shadow); }
.kcard-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kcard-foot { display: flex; justify-content: space-between; margin-top: 4px; }

/* ---------- Calendar */
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-nav, .cal-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-nav h2 { margin: 0 8px; min-width: 180px; }
.cal-nav input[type=date], .cal-right select { width: auto; padding: 5px 8px; }
.cal-month { padding: 0; overflow: hidden; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid.head div { padding: 8px; font-weight: 700; font-size: .8em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 128px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 5px; position: relative; display: flex; flex-direction: column; gap: 3px; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--soft); opacity: .65; }
.cal-day.today { background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.cal-day.is-closed { background: repeating-linear-gradient(135deg, var(--soft), var(--soft) 6px, transparent 6px, transparent 12px); }
.cal-day.drag-over, .week-col.drag-over, .dv-col.drag-over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.cal-day.today .cal-day-head a { background: var(--primary); color: #fff; border-radius: 99px; padding: 0 7px; }
.cap { font-size: .72em; font-weight: 700; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; }
.cap.over { color: #fff; background: var(--danger); border-color: var(--danger); }
.cap.closed { color: var(--danger); }
.lims { display: flex; flex-wrap: wrap; gap: 3px; }
.lim { font-size: .68em; font-weight: 700; border-radius: 4px; padding: 0 4px; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.lim.full { background: var(--c); color: #fff; }
.cal-job { display: block; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 10%, var(--card)); border-radius: 5px; padding: 3px 6px; font-size: .8em; line-height: 1.3; cursor: grab; overflow: hidden; }
.cal-job:hover { background: color-mix(in srgb, var(--c) 20%, var(--card)); }
.cj-top { display: flex; gap: 6px; align-items: center; } .cj-top b { font-weight: 800; }
.cj-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onsite { width: 8px; height: 8px; border-radius: 50%; background: var(--success); margin-left: auto; display: inline-block; }
.cal-event { display: block; font-size: .75em; background: var(--c); color: #fff; border-radius: 4px; padding: 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day .more { font-size: .75em; color: var(--primary); font-weight: 700; }
.cal-day .add { position: absolute; right: 5px; bottom: 3px; opacity: 0; font-weight: 700; color: var(--primary); font-size: 1.1em; }
.cal-day:hover .add { opacity: 1; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 0; padding: 0; overflow-x: auto; }
.week-col { border-right: 1px solid var(--line); padding: 8px; min-height: 420px; display: flex; flex-direction: column; gap: 5px; }
.week-col:last-child { border-right: 0; }
.week-col.today { background: color-mix(in srgb, var(--primary) 5%, var(--card)); }
.week-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.add-row { font-size: .85em; color: var(--primary); font-weight: 600; margin-top: auto; padding-top: 6px; }
.day-summary { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.day-summary .cal-event { display: inline-block; }
.dayview { display: flex; overflow-x: auto; --h: 56px; }
.dv-times { flex: 0 0 56px; }
.dv-head { height: 38px; padding: 8px; font-weight: 700; border-bottom: 3px solid var(--c, var(--line)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-hour { height: var(--h); font-size: .75em; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.dv-col { flex: 1 0 170px; border-left: 1px solid var(--line); }
.dv-body { position: relative; height: calc(var(--h) * var(--hours)); }
.dv-slot { display: block; height: var(--h); border-bottom: 1px dashed var(--line); }
.dv-slot:hover { background: var(--soft); }
.dv-job { position: absolute; left: 3px; right: 3px; overflow: hidden; }
.dv-job .cal-job { height: 100%; }
.tl-wrap { overflow-x: auto; }
.tl-row { display: flex; border-bottom: 1px solid var(--line); min-width: 900px; }
.tl-name { flex: 0 0 150px; padding: 10px 8px; font-weight: 700; border-left: 4px solid var(--c, transparent); }
.tl-track { position: relative; flex: 1; height: 48px; }
.tl-head .tl-track { height: 26px; }
.tl-head .tl-track span { position: absolute; top: 6px; font-size: .75em; color: var(--muted); transform: translateX(-50%); }
.tl-track i { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--line); }
.tl-job { position: absolute; top: 6px; bottom: 6px; overflow: hidden; }
.tl-job .cal-job { height: 100%; white-space: nowrap; }
.colour-key { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 16px; align-items: center; }
.colour-key span { display: inline-flex; align-items: center; }
.edge { display: inline-block; width: 4px; height: 14px; margin-right: 6px; border-radius: 2px; }
.edge.urgent { background: var(--danger); } .edge.high { background: var(--warning); }

/* ---------- Courtesy, messaging */
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fleet-card { margin: 0; display: flex; flex-direction: column; gap: 6px; border-top: 4px solid var(--success); }
.fleet-card.is-out { border-top-color: var(--warning); }
.fleet-top { display: flex; justify-content: space-between; align-items: center; }
.fleet-card .btn { align-self: flex-start; }
.msg-layout { display: grid; grid-template-columns: 320px 1fr; padding: 0; min-height: 70vh; overflow: hidden; }
.msg-list { border-right: 1px solid var(--line); padding: 12px; overflow-y: auto; max-height: 80vh; }
.msg-list .search-form { max-width: none; margin-bottom: 10px; }
.msg-conv { display: block; padding: 10px; border-radius: 8px; margin-bottom: 2px; }
.msg-conv:hover { background: var(--soft); }
.msg-conv.active { background: color-mix(in srgb, var(--primary) 10%, var(--card)); }
.msg-conv strong { display: block; }
.msg-thread { display: flex; flex-direction: column; padding: 14px 18px; gap: 12px; }
.msg-head { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.msg-head h3 { margin: 0; }
.msg-bubbles { display: flex; flex-direction: column; gap: 10px; max-height: 50vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 75%; padding: 10px 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.bubble.out { align-self: flex-end; background: color-mix(in srgb, var(--primary) 10%, var(--card)); }
.bubble .meta { font-size: .75em; color: var(--muted); margin-bottom: 3px; }
.msg-compose { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------- Inspections */
.vhc-summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vhc-summary label { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.rag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-weight: 700; color: #fff; font-size: .9em; }
.rag.sm { padding: 0 8px; font-size: .78em; }
.rag.red { background: var(--danger); } .rag.amber { background: var(--warning); color: #111; } .rag.green { background: var(--success); }
.vhc-item { display: grid; grid-template-columns: minmax(160px, 1fr) auto; gap: 8px 14px; padding: 10px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.vhc-item.s-red { border-left-color: var(--danger); } .vhc-item.s-amber { border-left-color: var(--warning); } .vhc-item.s-green { border-left-color: var(--success); }
.vhc-label { font-weight: 600; align-self: center; }
.rag-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.rag-btn input { display: none; }
.rag-btn span { display: inline-block; padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); font-weight: 700; cursor: pointer; min-width: 64px; text-align: center; user-select: none; }
.rag-btn.green input:checked + span { background: var(--success); color: #fff; border-color: var(--success); }
.rag-btn.amber input:checked + span { background: var(--warning); color: #111; border-color: var(--warning); }
.rag-btn.red input:checked + span { background: var(--danger); color: #fff; border-color: var(--danger); }
.rag-btn.na input:checked + span { background: #64748b; color: #fff; }
.vhc-extra { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vhc-extra input { flex: 1; min-width: 120px; }
.photo-btn { cursor: pointer; }
.photo-btn.has-files { background: var(--success); color: #fff; }
.vhc-photos { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.vhc-photos img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.vhc-photos label { font-size: .75em; }
.vhc-report { border-top: 5px solid var(--line); }
.vhc-report.red { border-top-color: var(--danger); } .vhc-report.amber { border-top-color: var(--warning); } .vhc-report.green { border-top-color: var(--success); }
.vhc-report h2 { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.vhc-r { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ---------- Printable documents */
.doc-paper { background: #fff; color: #0f172a; max-width: 860px; margin: 0 auto 20px; padding: 36px; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.doc-top { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--accent); padding-bottom: 16px; }
.doc-logo { max-height: 70px; max-width: 240px; margin-bottom: 6px; }
.doc-company h2 { color: var(--accent); font-size: 1.4rem; }
.doc-title { text-align: right; }
.doc-title h1 { color: var(--accent); text-transform: uppercase; letter-spacing: .05em; font-size: 1.6rem; }
.doc-meta th { text-align: left; color: #64748b; font-weight: 600; padding: 2px 10px 2px 0; } .doc-meta td { text-align: right; font-weight: 600; }
.doc-parties { display: flex; gap: 40px; padding: 16px 0; flex-wrap: wrap; }
.doc-parties h4, .doc-desc h4 { margin: 0 0 4px; color: #64748b; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.doc-desc { padding: 0 0 12px; }
.doc-lines { width: 100%; border-collapse: collapse; margin: 10px 0; }
.doc-lines th { background: var(--accent); color: #fff; padding: 7px 8px; font-size: .8rem; text-align: left; }
.doc-lines th.right { text-align: right; }
.doc-lines td { padding: 7px 8px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.doc-lines tr.declined td { color: #94a3b8; text-decoration: line-through; }
.doc-bottom { display: flex; justify-content: space-between; gap: 24px; margin-top: 10px; }
.doc-notes { flex: 1; }
.doc-totals { min-width: 260px; border-collapse: collapse; }
.doc-totals th { text-align: left; padding: 5px 8px; color: #475569; font-weight: 600; } .doc-totals td { text-align: right; padding: 5px 8px; }
.doc-totals tr.grand th, .doc-totals tr.grand td { border-top: 2px solid var(--accent); font-size: 1.1rem; font-weight: 800; color: #0f172a; }
.doc-footer { margin-top: 24px; padding-top: 10px; border-top: 1px solid #e2e8f0; text-align: center; color: #64748b; font-size: .85rem; }
.print-bar { max-width: 860px; margin: 16px auto; display: flex; gap: 8px; }

/* ---------- Bare pages: login, install, portal */
body.bare { background: var(--bg); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-brand { text-align: center; } .login-brand img { max-height: 70px; } .login-brand h1 { margin-top: 10px; }
.install { max-width: 860px; margin: 30px auto; padding: 0 16px; }
.install .card { padding: 28px; }
.checks li.ok { color: var(--success); } .checks li.bad { color: var(--danger); }
ul.checks { list-style: none; padding: 0; display: block; }
body.portal { background: var(--bg); }
.portal-wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }
.portal-head { background: var(--primary); color: #fff; margin-bottom: 20px; }
.portal-head .portal-wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.portal-head img { max-height: 46px; background: #fff; border-radius: 6px; padding: 3px; }
.portal-head strong { font-size: 1.2rem; }
.portal-foot { color: var(--muted); font-size: .85rem; text-align: center; padding: 20px 16px 40px; }
.booking h3 { margin-top: 22px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.svc input { display: none; }
.svc span { display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; height: 100%; }
.svc input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--card)); }
.slots { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.slots button { padding: 8px 12px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; cursor: pointer; font: inherit; font-weight: 600; color: var(--text); }
.slots button.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.booking .btn-lg { margin-top: 18px; }
.booking-done { padding: 40px; color: var(--success); } .booking-done p { color: var(--text); }
.auth-box { max-width: 860px; margin: 0 auto 20px; }

/* ---------- Responsive */
@media (max-width: 1100px) {
  .view-grid { grid-template-columns: 1fr; }
  .shortcuts { display: none; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .main { margin-left: 0; }
  .only-mobile, .btn-icon.only-mobile { display: inline-flex; }
  .content { padding: 14px; }
  .topbar { padding: 8px 12px; }
  .global-search { width: auto; flex: 1; max-width: none; }
  .user-chip span:not(.avatar) { display: none; }
  .form .grid, .grid { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .two-col, .msg-layout { grid-template-columns: 1fr; }
  .msg-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .cal-day { min-height: 90px; }
  .cal-job .cj-sub { display: none; }
  .catalogue-search { min-width: 100%; }
  .doc-paper { padding: 18px; }
  .doc-top, .doc-bottom { flex-direction: column; }
  .doc-title { text-align: left; }
  .vhc-item { grid-template-columns: 1fr; }
  .rag-btn span { min-width: 0; padding: 9px 11px; }
}
@media (max-width: 520px) {
  .form .grid, .grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .page-head h1 { font-size: 1.3rem; }
  .topbar-right .btn span { display: none; }
}

/* ---------- Print */
@media print {
  .sidebar, .topbar, .no-print, .print-bar, .page-head .actions, .sticky-save, .report-range { display: none !important; }
  .main { margin: 0; } .content { padding: 0; }
  body, body.bare, body.portal { background: #fff; }
  .card { box-shadow: none; border: 0; }
  .doc-paper { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .portal-head, .portal-foot { display: none; }
  a { text-decoration: none; }
}

/* ---------- Integration setup steps */
.setup-steps .step { border-left: 4px solid var(--line); }
.step-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.step-head h3 { margin: 0 0 2px; } .step-head p { margin: 0; }
.step-tick { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.step-tick.ok { background: var(--success); border-color: var(--success); color: #fff; }
.lkq-hit { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* ---------- Booking portal tyre picker */
.tyre-box { margin-top: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--soft); }
.tyre-box h3 { margin-top: 0 !important; }
.tyre-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 10px 0; }
.tyre-opt { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.tyre-opt b { font-size: 1.1rem; margin-top: 4px; } .tyre-opt b small { font-weight: 400; color: var(--muted); font-size: .7em; }
.tyre-opt.sel { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--card)); }

body.portal.embed { background: transparent; }
body.portal.embed main { padding-top: 10px; }

/* ---------- Appearance & Branding */
.appearance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.app-right { position: sticky; top: 70px; }
.card-head h3 { display: flex; align-items: center; gap: 6px; margin: 0; }
.widget-row { padding: 10px 0; border-top: 1px solid var(--line); }
.widget-row .copy-field { margin-top: 6px; }
.preview-stage { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; justify-content: center; height: 72vh; overflow: hidden; }
.preview-stage iframe { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; transform-origin: top center; }
.seg a { cursor: pointer; }
@media (max-width: 1100px) { .appearance { grid-template-columns: 1fr; } .app-right { position: static; } }

/* ---------- Shop checkout */
.tyre-opt .eta-stock { color: var(--success); font-weight: 600; }
.tyre-opt .eta-order { color: #b45309; font-weight: 600; }
.order-box { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.order-box h3 { margin-top: 0 !important; }
.order-lines td { padding: 6px 4px; } .order-lines .grand td { border-top: 2px solid var(--line); font-size: 1.05rem; }
.pay-box { max-width: 620px; margin: 0 auto; } .booking-done-card { max-width: 720px; margin: 0 auto; }

.time-msg { color: var(--danger); font-weight: 700; margin: 4px 0 0; }

.veh-lookup { display: flex; gap: 8px; }
.veh-lookup input { flex: 1; text-transform: uppercase; font-weight: 700; letter-spacing: .06em; background: #facc15; border: 2px solid #111; color: #111; font-size: 1.1rem; }
.veh-result { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line); font-size: .92rem; }
.veh-result.ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.veh-result.err { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

/* ---------- Customer account */
.acct-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.acct-tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.acct-tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.acct-tabs .acct-book { margin-left: auto; color: var(--primary); }
.acct-login { margin: 30px auto; }
.code-input { font-size: 1.8rem; letter-spacing: .4em; text-align: center; font-weight: 800; }
.acct-hello { margin: 4px 0 14px; }
.acct-booking { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.acct-booking:last-child { border-bottom: 0; }
.acct-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.acct-alerts { border-left: 4px solid var(--warning); } .acct-alerts p { margin: 4px 0; }
.acct-vehicles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.acct-veh { padding: 12px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }
.acct-veh .reg { align-self: flex-start; }

.tyre-opt .tyre-feat { font-style: normal; font-size: .72rem; font-weight: 700; color: #b45309; }

/* Bond integration page */
.bond-logo { display: inline-block; background: #0b3d91; color: #fff; font-weight: 800; letter-spacing: .08em; font-size: .75rem; padding: 3px 7px; border-radius: 4px; margin-right: 6px; }
.loc-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.bond-search { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.bond-search > input { max-width: 260px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips > span { width: 60px; font-weight: 700; letter-spacing: .05em; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: .85rem; cursor: pointer; background: var(--card); }
.chip input { margin: 0; }
.chip:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip:has(input:checked) input { accent-color: #fff; }

[hidden] { display: none !important; }

/* User panel (top-right) */
button.user-chip { border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; padding: 4px 8px; border-radius: 10px; text-align: left; }
button.user-chip:hover { background: var(--soft); }
.avatar { border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.avatar-ini { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 700; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 90; }
.user-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); background: var(--card); color: var(--text); z-index: 91; box-shadow: -10px 0 40px rgba(0,0,0,.18);
  transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; }
.user-drawer.open { transform: none; }
.ud-head { display: flex; align-items: flex-start; gap: 6px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.ud-head > div { flex: 1; min-width: 0; }
.ud-name { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ud-role { font-size: .75rem; font-weight: 600; color: #1e40af; background: #eff6ff; border-radius: 999px; padding: 2px 10px; }
[data-theme="dark"] .ud-role { background: #1e293b; color: #93c5fd; }
.ud-email { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.ud-head [data-ud-gear][aria-expanded="true"] { outline: 2px solid var(--primary); border-radius: 10px; }
.ud-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; }
.ud-photo { background: var(--soft); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ud-avatar { width: 110px; height: 110px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; overflow: hidden; }
.ud-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ud-avatar:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.link-btn { border: 0; background: none; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }
.ud-org { background: var(--soft); border-radius: 12px; padding: 14px; margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.ud-org label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: .88rem; margin-top: 4px; }
.ud-org select { width: 100%; }
.ud-menu { display: flex; flex-direction: column; margin-top: 16px; }
.ud-menu a, .ud-menu button { display: flex; align-items: center; gap: 14px; padding: 13px 6px; border: 0; background: none; font: inherit; font-size: 1rem; color: var(--text); text-decoration: none; cursor: pointer; border-radius: 8px; text-align: left; }
.ud-menu a:hover, .ud-menu button:hover { background: var(--soft); }
.ud-menu .ic { color: var(--muted); flex: 0 0 auto; }
.ud-menu span { flex: 1; }
.ud-back { display: flex; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-weight: 700; font-size: 1.05rem; color: var(--text); cursor: pointer; padding: 4px 0 10px; }
.ud-check { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ud-check .ic { color: var(--muted); }
.ud-actions { display: flex; gap: 8px; margin-top: 14px; }
.ud-radio { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.ud-radio span { display: flex; flex-direction: column; } .ud-radio small { color: var(--muted); }
.ud-radio:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.ud-preview { position: fixed; inset: 0; z-index: 95; background: rgba(15,23,42,.6); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.ud-preview-head { display: flex; align-items: center; gap: 12px; color: #fff; }
.ud-preview-head .btn-icon { color: #fff; }
.ud-phone { width: 390px; max-width: 100%; height: min(800px, calc(100vh - 90px)); border: 12px solid #111; border-radius: 36px; overflow: hidden; background: #fff; box-shadow: 0 30px 60px rgba(0,0,0,.4); }
.ud-phone iframe { width: 100%; height: 100%; border: 0; display: block; }
body.drawer-open { overflow: hidden; }

/* Settings shell (LaunchControl-style left menu) */
.set-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.set-nav { position: sticky; top: 70px; max-height: calc(100vh - 86px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.set-nav-toggle { display: none; }
.set-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; margin-bottom: 8px; color: var(--muted); background: var(--bg); }
.set-search input { border: 0; background: transparent; padding: 8px 0; width: 100%; font: inherit; color: var(--text); outline: none; }
.set-home, .set-group summary { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; text-decoration: none; }
.set-group summary::-webkit-details-marker { display: none; }
.set-group summary::after { content: "›"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.set-group[open] summary::after { transform: rotate(90deg); }
.set-home:hover, .set-group summary:hover { background: var(--soft); }
.set-home.active { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.set-group .ic, .set-home .ic { color: var(--muted); }
.set-group a { display: block; padding: 6px 10px 6px 35px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.set-group a:hover { background: var(--soft); color: var(--text); }
.set-group a.active { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font-weight: 600; }
.set-main { min-width: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--primary); }
.crumbs span { margin: 0 4px; } .crumbs strong { color: var(--text); font-weight: 600; }
.set-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.set-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.set-card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.set-card-head h3 { margin: 0 0 2px; font-size: 1.05rem; }
.set-card-head p { margin: 0; }
.set-ic { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); flex: 0 0 auto; }
.set-card ul { list-style: none; margin: 0; padding: 0; }
.set-card li a { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.set-card li a .ic { color: var(--muted); }
.set-card li a:hover { color: var(--primary); } .set-card li a:hover .ic { color: var(--primary); }
.set-main > .page-head h1 { font-size: 1.5rem; }
@media (max-width: 960px) {
  .set-shell { grid-template-columns: 1fr; gap: 12px; }
  .set-nav { position: static; max-height: none; padding: 6px 10px; }
  .set-nav-toggle { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; font: inherit; color: var(--text); font-weight: 700; padding: 8px 4px; cursor: pointer; }
  .set-nav-box:not(.open) > :not(.set-nav-toggle) { display: none; }
}

.quick-pay { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.qp-methods { display: flex; flex-wrap: wrap; gap: 8px; }

.svc-group { margin: 16px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.svc-group:first-of-type { margin-top: 4px; }
.bk-status { padding: 8px 12px; border-radius: 8px; font-size: .9rem; margin: 0; }
.bk-status.ok { background: #ecfdf5; color: #065f46; }
.bk-status.warn { background: #fef2f2; color: #991b1b; }
[data-theme="dark"] .bk-status.ok { background: #052e16; color: #bbf7d0; } [data-theme="dark"] .bk-status.warn { background: #450a0a; color: #fecaca; }
option.opt-busy { color: #b91c1c; }

/* Website widget setup (LaunchControl-style editor) */
.ws-page { margin: -6px 0 0; }
.ws-top { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.ws-top h1 { margin: 0; font-size: 1.45rem; }
.ws-x { color: var(--muted); display: inline-flex; }
.ws-x:hover { color: var(--text); }
.ws-top-r { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.ws-link { border: 0; background: none; font: inherit; color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; padding: 0; }
.ws-link.muted { color: var(--muted); font-weight: 500; }
.ws-saved { font-size: .85rem; color: var(--muted); }
.ws-saved.ok { color: #16a34a; } .ws-saved.err { color: #dc2626; }
.ws-grid { display: grid; grid-template-columns: minmax(340px, 470px) minmax(0, 1fr); gap: 24px; align-items: start; }
.ws-left { display: flex; flex-direction: column; gap: 18px; }
.ws-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.ws-card h2 { font-size: 1.15rem; margin: 0 0 4px; }
.ws-card > .muted, .ws-card-head .muted { margin: 0 0 16px; font-size: .92rem; }
.ws-card hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.ws-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ws-reset { border: 0; background: none; color: #dc2626; font: inherit; font-weight: 600; cursor: pointer; padding: 2px 0; white-space: nowrap; }
.ws-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-top: 10px; cursor: pointer; }
.ws-toggle-row span { display: flex; flex-direction: column; gap: 2px; } .ws-toggle-row small { color: var(--muted); }
.ws-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.ws-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ws-2col .ws-field { margin-bottom: 0; }
.ws-2col + .ws-2col, .ws-2col + .ws-field { margin-top: 14px; }
.ws-field label { font-weight: 600; font-size: .9rem; }
.ws-field input:not([type=color]) { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; background: var(--card); color: var(--text); }
.ws-color { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.ws-color input[type=color] { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0; margin: 0 4px 0 10px; background: none; cursor: pointer; flex: 0 0 auto; }
.ws-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; } .ws-color input[type=color]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.ws-color input[data-w-hex] { border: 0 !important; border-radius: 0 !important; flex: 1; min-width: 0; font-family: ui-monospace, Menlo, monospace !important; text-transform: uppercase; padding: 11px 6px !important; }
.ws-copy { border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); padding: 0 12px; align-self: stretch; cursor: pointer; }
.ws-copy:hover { color: var(--text); } .ws-copy.done { color: #16a34a; }
.ws-add { display: flex; gap: 10px; margin-bottom: 10px; }
.ws-add input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 500 .95rem ui-monospace, Menlo, monospace; background: var(--card); color: var(--text); }
.ws-sites { display: flex; flex-direction: column; gap: 8px; }
.ws-site { display: flex; align-items: center; justify-content: space-between; background: var(--soft); border-radius: 10px; padding: 12px 14px; }
.ws-site code { font-size: .95rem; background: none; }
.ws-del { border: 0; background: none; color: var(--muted); cursor: pointer; display: inline-flex; }
.ws-del:hover { color: #dc2626; }
.ws-note { margin-top: 12px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 10px; padding: 12px 14px; font-size: .92rem; }
[data-theme="dark"] .ws-note { background: #172554; border-color: #1e3a8a; color: #bfdbfe; }
.ws-lbl { font-weight: 700; display: block; margin: 4px 0 8px; }
.ws-group-lbl { color: var(--muted); font-weight: 600; margin: 12px 0 8px; }
.ws-segs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; }
.ws-segs button { border: 0; background: none; padding: 10px 6px; border-radius: 9px; font: inherit; color: var(--muted); cursor: pointer; font-weight: 500; }
.ws-segs button.on { background: var(--primary); color: #fff; font-weight: 600; }
.ws-snippet { border: 1px solid var(--line); border-radius: 12px; margin-top: 16px; overflow: hidden; }
.ws-snippet-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--soft); border-bottom: 1px solid var(--line); }
.ws-snippet pre { margin: 0; padding: 14px 16px; font-size: .82rem; overflow-x: auto; white-space: pre; background: var(--card); }
.ws-right { position: sticky; top: 70px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 100px); min-height: 520px; }
.ws-prev-head { display: flex; justify-content: flex-end; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ws-prev-head select { border: 2px solid var(--primary); border-radius: 10px; padding: 7px 10px; font: inherit; background: var(--card); color: var(--text); }
.ws-devices { display: flex; justify-content: center; gap: 10px; padding: 14px; background: var(--soft); }
.ws-devices button { border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 7px 16px; font: inherit; cursor: pointer; color: var(--text); }
.ws-devices button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.ws-stage { flex: 1; background: #161616; margin: 0 14px 14px; border-radius: 10px; overflow: hidden; display: flex; justify-content: center; }
.ws-stage iframe { border: 0; width: 100%; height: 100%; transform-origin: top center; background: transparent; flex: 0 0 auto; }
@media (max-width: 1000px) { .ws-grid { grid-template-columns: 1fr; } .ws-right { position: static; height: 620px; } }
@media (max-width: 520px) { .ws-2col { grid-template-columns: 1fr; } .ws-top { flex-wrap: wrap; } }
.ws-prev-head select { width: auto !important; min-width: 200px; }

/* Dashboard quick quote */
.qq { margin-bottom: 18px; }
.qq-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qq-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.qq-bar input[type=search] { flex: 1; min-width: 220px; font-size: 1.05rem; padding: 10px 12px; }
.qq-qty { display: flex; align-items: center; gap: 6px; font-weight: 600; } .qq-qty select { width: auto; }
.qq table { width: 100%; }
.qq td { vertical-align: middle; }
.qq .src { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.qq .src.stock { background: #dcfce7; color: #166534; } .qq .src.bond { background: #dbeafe; color: #1e40af; } .qq .src.none { background: #f1f5f9; color: #64748b; }
[data-theme="dark"] .qq .src.stock { background: #052e16; color: #bbf7d0; } [data-theme="dark"] .qq .src.bond { background: #172554; color: #bfdbfe; }
.qq .price { font-weight: 700; white-space: nowrap; } .qq .cost-col { color: var(--muted); white-space: nowrap; }
.qq.hide-cost .cost-col { display: none; }
.qq .acts { white-space: nowrap; text-align: right; } .qq .acts .btn { margin-left: 4px; }
.qq tr.oos td { opacity: .55; }
.qq .tyre-name strong { display: block; } .qq .tyre-name small { color: var(--muted); }
.qq tr.group-row td { background: var(--soft); font-size: .85rem; }

/* Purchase invoice lines */
.pi-lines td { vertical-align: top; }
.pi-prod { position: relative; min-width: 280px; }
.pi-results { position: absolute; z-index: 20; left: 0; right: 0; top: 42px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); max-height: 320px; overflow-y: auto; }
.pi-results button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 9px 12px; font: inherit; cursor: pointer; color: var(--text); }
.pi-results button:hover { background: var(--soft); }
.pi-results small { display: block; color: var(--muted); }
.pi-results .pi-addnew { color: var(--primary); font-weight: 600; }
.pi-ok { color: #16a34a; } .pi-new { color: #b45309; font-weight: 600; }
.pi-kind { width: auto !important; padding: 2px 6px !important; font-size: .8rem; margin-left: 6px; }
[data-status] { margin-top: 4px; }

/* Website header on the booking page and customer account */
body.has-site-head .s-head a, body.has-site-head .s-topbar a { text-decoration: none; }
body.has-site-head .s-head button.s-burger { width: 44px; height: 44px; min-width: 44px; padding: 0; background: none; }
body.has-site-head main.portal-wrap { margin-top: 28px; }
.acct-user { margin-left: auto; font-size: .9rem; color: var(--muted); align-self: center; white-space: nowrap; }

/* Dashboard customisation */
.dash-grid > .dash-full { grid-column: 1 / -1; }
.dash-grid > .card { margin-bottom: 0; }
.dash-grid { margin-bottom: 16px; }
.dash-list { list-style: none; margin: 0 0 14px; padding: 0; max-width: 560px; }
.dash-list li { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--card); }
.dash-move { display: inline-flex; gap: 2px; }

/* Side menu styles (user panel → Menu Settings) – desktop only; phones keep the slide-out menu */
.nav-fly { display: none; }
.sb-toggle { display: none; }
.sb-quick { display: inline; } .sb-quick button { border: 0; background: color-mix(in srgb, var(--sb-strong) 8%, transparent); color: var(--sb-text); border-radius: 6px; padding: 2px 9px; cursor: pointer; font-size: 1rem; margin-right: 8px; }
.sb-quick button:hover { background: color-mix(in srgb, var(--sb-strong) 18%, transparent); color: var(--sb-strong); }
.sidebar-foot { display: flex; align-items: center; opacity: .75; }
@media (min-width: 861px) {
  /* icons only + expand on hover */
  body.sb-icons .sidebar, body.sb-expand .sidebar { width: 68px; overflow: visible; }
  body.sb-icons .main, body.sb-expand .main { margin-left: 68px; }
  body.sb-icons .sidebar nav, body.sb-expand .sidebar nav { padding: 6px 10px; }
  body.sb-icons .sidebar .brand, body.sb-expand:not(:has(.sidebar:hover)) .sidebar .brand { padding: 16px 0; justify-content: center; }
  body.sb-icons .brand span:not(.brand-mark), body.sb-icons .sidebar nav a > span, body.sb-icons .sidebar summary > span, body.sb-icons .sidebar summary::after, body.sb-icons .sidebar nav a.sub, body.sb-icons .sidebar-foot > span { display: none; }
  body.sb-icons .brand img { max-width: 44px; }
  body.sb-icons .sidebar nav a, body.sb-icons .sidebar summary { justify-content: center; padding: 10px 0; }
  body.sb-icons .nav-wrap { position: relative; }
  body.sb-icons .nav-wrap:hover > .nav-fly { display: flex; }
  body.sb-icons .nav-fly { position: absolute; left: 100%; top: 0; margin-left: 8px; flex-direction: column; min-width: 200px; background: var(--sidebar); border-radius: 10px; padding: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.3); z-index: 60; }
  body.sb-icons .nav-fly::before { content: ""; position: absolute; left: -10px; top: 0; bottom: 0; width: 10px; }
  body.sb-icons .nav-fly strong { color: #fff; padding: 6px 10px; font-size: .85rem; }
  body.sb-icons .nav-fly a { padding: 7px 10px !important; justify-content: flex-start !important; color: var(--sb-text); border-radius: 6px; }
  body.sb-icons .nav-fly a:hover, body.sb-icons .nav-fly a.active { background: color-mix(in srgb, var(--sb-strong) 10%, transparent); color: var(--sb-strong); }
  body.sb-icons .nav-tip { white-space: nowrap; min-width: 0 !important; color: #fff; padding: 7px 12px; top: 4px; font-size: .9rem; }
  body.sb-icons .sidebar-foot { justify-content: center; padding: 10px 0; }
  body.sb-icons .sb-quick button { margin: 0; }
  body.sb-expand .sidebar { transition: width .18s ease; overflow-x: hidden; }
  body.sb-expand .sidebar:not(:hover) .brand span:not(.brand-mark), body.sb-expand .sidebar:not(:hover) nav a > span, body.sb-expand .sidebar:not(:hover) summary > span,
  body.sb-expand .sidebar:not(:hover) summary::after, body.sb-expand .sidebar:not(:hover) nav a.sub, body.sb-expand .sidebar:not(:hover) .sidebar-foot > span { display: none; }
  body.sb-expand .sidebar:not(:hover) nav a, body.sb-expand .sidebar:not(:hover) summary { justify-content: center; padding: 10px 0; }
  body.sb-expand .sidebar:not(:hover) .brand img { max-width: 44px; }
  body.sb-expand .sidebar:hover { width: 236px; box-shadow: 8px 0 30px rgba(0,0,0,.25); overflow-y: auto; }
  /* fully hidden: ☰ in the top bar, or bring it in from the left edge */
  body.sb-hidden .sidebar, body.sb-autohide .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  body.sb-hidden .main, body.sb-autohide .main { margin-left: 0; }
  body.sb-hidden .sb-toggle, body.sb-autohide .sb-toggle { display: inline-flex; }
  body.sb-hidden.nav-open .sidebar, body.sb-autohide.nav-open .sidebar, body.sb-autohide .sidebar:hover, body.sb-autohide .sb-hotzone:hover + .sidebar { transform: none; }
  body.sb-hidden.nav-open .nav-overlay, body.sb-autohide.nav-open .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 35; }
  .sb-hotzone { position: fixed; left: 0; top: 0; bottom: 0; width: 12px; z-index: 41; }
}
@media (max-width: 860px) { .sb-toggle { display: inline-flex; } .sb-quick { display: none; } }

/* Menu switcher at the bottom of the side menu (keep open / icons / hover / top) */
.sidebar-foot { flex-direction: column; align-items: stretch; gap: 6px; opacity: 1; padding: 12px 10px 10px; border-top: 1px solid color-mix(in srgb, var(--sb-strong) 8%, transparent); }
.sb-switch { display: flex; align-items: center; gap: 8px; }
.sb-seg { display: inline-flex; background: rgba(0,0,0,.25); border-radius: 10px; padding: 3px; gap: 2px; flex: 1; }
.sb-seg button, .sb-top-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--sb-text); padding: 6px 0; border-radius: 8px; cursor: pointer; }
.sb-seg button:hover, .sb-top-btn:hover { color: var(--sb-strong); background: color-mix(in srgb, var(--sb-strong) 10%, transparent); }
.sb-seg button.on { background: #fff; color: var(--sidebar); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.sb-top-btn { flex: 0 0 auto; padding: 6px 9px; }
.sb-top-btn.on { background: #fff; color: var(--sidebar); }
.sb-ver { font-size: .7rem; opacity: .45; text-align: center; }
@media (min-width: 861px) {
  body.sb-icons .sb-switch, body.sb-expand .sidebar:not(:hover) .sb-switch { flex-direction: column; }
  body.sb-icons .sb-seg, body.sb-expand .sidebar:not(:hover) .sb-seg { flex-direction: column; width: 100%; }
  body.sb-icons .sb-top-btn, body.sb-expand .sidebar:not(:hover) .sb-top-btn { width: 100%; }
  body.sb-icons .sidebar-foot, body.sb-expand .sidebar:not(:hover) .sidebar-foot { padding: 10px 8px; }

  /* Menu at the top */
  body.sb-top .sidebar { position: sticky; top: 0; inset: auto; width: auto; height: auto; flex-direction: row; align-items: center; overflow: visible; z-index: 45; padding: 0 10px; gap: 6px; }
  body.sb-top .brand { padding: 10px 8px; flex: 0 0 auto; }
  body.sb-top .brand img { max-height: 30px; }
  body.sb-top .sidebar nav { display: flex; flex-wrap: wrap; align-items: center; flex: 1; padding: 6px 4px; gap: 2px; }
  body.sb-top .sidebar nav a, body.sb-top .sidebar summary { padding: 7px 9px; font-size: .86rem; gap: 6px; white-space: nowrap; }
  body.sb-top .sidebar nav .ic { width: 16px; height: 16px; }
  body.sb-top .sidebar nav a.sub, body.sb-top .nav-tip { display: none !important; }
  body.sb-top .sidebar summary::after { content: "▾"; transform: none !important; margin-left: 2px; }
  body.sb-top .nav-wrap { position: relative; }
  body.sb-top .nav-group { pointer-events: auto; }
  body.sb-top .nav-group summary { pointer-events: none; }
  body.sb-top .nav-wrap:hover > .nav-fly { display: flex; }
  body.sb-top .nav-fly { position: absolute; top: 100%; left: 0; flex-direction: column; min-width: 210px; background: var(--sidebar); border-radius: 10px; padding: 8px; box-shadow: 0 14px 30px rgba(0,0,0,.3); z-index: 60; }
  body.sb-top .nav-fly::before { content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
  body.sb-top .nav-fly strong { color: #fff; padding: 6px 10px; font-size: .82rem; }
  body.sb-top .nav-fly a { padding: 7px 10px !important; color: var(--sb-text); border-radius: 6px; }
  body.sb-top .nav-fly a:hover, body.sb-top .nav-fly a.active { background: color-mix(in srgb, var(--sb-strong) 10%, transparent); color: var(--sb-strong); }
  body.sb-top .sidebar-foot { flex-direction: row; border: 0; padding: 6px; }
  body.sb-top .sb-seg { flex: 0 0 auto; } body.sb-top .sb-seg button { padding: 6px 8px; }
  body.sb-top .sb-ver { display: none; }
  body.sb-top .main { margin-left: 0; }
  body.sb-top .topbar { position: static; }
}
/* keep the switcher pinned to the bottom; only the menu list scrolls */
body.sb-full .sidebar, body.sb-hidden .sidebar, body.sb-autohide .sidebar, body.sb-expand .sidebar:hover { overflow: hidden; }
body.sb-full .sidebar nav, body.sb-hidden .sidebar nav, body.sb-autohide .sidebar nav, body.sb-expand .sidebar:hover nav { overflow-y: auto; min-height: 0; scrollbar-width: thin; }
.sidebar-foot { flex: 0 0 auto; }
@media (max-width: 860px) { .sidebar { overflow: hidden; } .sidebar nav { overflow-y: auto; min-height: 0; } }
@media (min-width: 861px) {
  body.sb-icons .sidebar { overflow: hidden; }
  body.sb-icons .sidebar nav { overflow-y: auto; min-height: 0; scrollbar-width: none; }
  body.sb-icons .sidebar nav::-webkit-scrollbar { display: none; }
  body.sb-icons .nav-fly { position: fixed; left: 76px; margin-left: 0; }
  body.sb-icons .sb-seg { display: grid; grid-template-columns: 1fr 1fr; flex-direction: initial; }
  body.sb-icons .sb-switch { gap: 4px; }
}

/* Menu at the top: brand in the header + one coloured menu bar underneath (overflow goes into “More”) */
.topnav, .tb-brand { display: none; }
@media (min-width: 861px) {
  body.sb-top .sidebar { display: none !important; }
  body.sb-top .main { margin-left: 0 !important; }
  body.sb-top .sb-toggle { display: none !important; }
  body.sb-top .topbar { position: sticky; top: 0; }
  .tb-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); margin-right: 8px; white-space: nowrap; }
  .tb-brand img { max-height: 34px; max-width: 140px; }
  body.sb-top .topnav { display: flex; align-items: center; gap: 4px; background: var(--sidebar); padding: 6px 8px; position: sticky; top: 59px; z-index: 29; }
  .tn-items { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow: hidden; }
  .tn-items.measured { overflow: visible; }
  .tn-item { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 8px; color: var(--sb-text); font-weight: 600; font-size: .95rem; white-space: nowrap; border: 0; background: none; cursor: pointer; font-family: inherit; text-decoration: none; }
  .tn-item:hover { background: color-mix(in srgb, var(--sb-strong) 12%, transparent); color: var(--sb-strong); }
  .tn-item.active { background: var(--sb-strong); color: var(--sidebar); }
  .tn-item .ic:last-child:not(:first-child) { opacity: .8; }
  .tn-dd { position: relative; }
  .tn-menu { display: none; position: absolute; top: 100%; left: 0; margin-top: 6px; min-width: 220px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 36px rgba(15,23,42,.18); padding: 6px; z-index: 70; }
  .tn-menu::before { content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
  .tn-menu-right { left: auto; right: 0; }
  .tn-dd:hover > .tn-menu, .tn-dd.open > .tn-menu { display: block; }
  .tn-menu a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; color: var(--text); white-space: nowrap; }
  .tn-menu a:hover { background: var(--soft); }
  .tn-menu a.active { color: var(--primary); font-weight: 600; }
  .tn-menu .tn-group { padding: 8px 12px 2px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .tn-side { margin-left: 4px; padding-left: 8px; border-left: 1px solid color-mix(in srgb, var(--sb-strong) 18%, transparent); }
  .tn-side button { border: 0; background: none; color: var(--sb-text); padding: 8px; border-radius: 8px; cursor: pointer; display: inline-flex; }
  .tn-side button:hover { background: color-mix(in srgb, var(--sb-strong) 12%, transparent); color: var(--sb-strong); }
}
@media (min-width: 861px) { .tn-menu-right { max-height: calc(100vh - 140px); overflow-y: auto; } .tn-menu a .ic { color: var(--muted); } }

/* Full-width header with the logo above the side menu (all menu styles, desktop) */
:root { --tbh: 60px; }
@media (min-width: 861px) {
  .tb-brand { display: inline-flex; }
  .topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; min-height: var(--tbh); }
  .main { padding-top: var(--tbh); }
  .sidebar { top: var(--tbh) !important; height: auto; }
  .sidebar > .brand { display: none; }
  .sb-hotzone { top: var(--tbh); }
  body.sb-top .topbar { position: fixed; }
  body.sb-top .topnav { top: var(--tbh) !important; }
  body.nav-open .nav-overlay { top: var(--tbh); }
  .set-nav { top: calc(var(--tbh) + 12px); max-height: calc(100vh - var(--tbh) - 24px); }
  .ws-right { top: calc(var(--tbh) + 12px); height: calc(100vh - var(--tbh) - 40px); }
}

/* Dashboards: tabs, new-dashboard window, bar rows */
.dash-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dash-tab { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.dash-tab:hover { background: var(--soft); color: var(--text); }
.dash-tab.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.dash-star { color: #f59e0b; }
.dash-add { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.dash-add:hover { background: var(--line); color: var(--text); }
.dash-modal { border: 0; border-radius: 18px; padding: 0; width: min(680px, calc(100vw - 32px)); background: var(--card); color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.dash-modal::backdrop { background: rgba(15,23,42,.45); }
.dm-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dm-head h2 { margin: 0; font-size: 1.3rem; }
.dm-body { padding: 18px 22px; max-height: 70vh; overflow-y: auto; }
.dm-label { display: block; font-weight: 600; margin: 4px 0 8px; }
.dm-body > input { width: 100%; margin-bottom: 14px; }
.dm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dm-opt { display: block; cursor: pointer; }
.dm-opt input { position: absolute; opacity: 0; }
.dm-opt span { display: flex; flex-direction: column; justify-content: center; gap: 4px; height: 100%; min-height: 104px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.dm-opt small { color: var(--muted); line-height: 1.4; }
.dm-opt input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card)); box-shadow: 0 0 0 1px var(--primary); }
.dm-opt input:focus-visible + span { outline: 2px solid var(--primary); }
.dm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
.dash-cust-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
.dash-manage { display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--line); padding-left: 20px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; font-size: .92rem; }
.bar-row span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
@media (max-width: 700px) { .dm-grid { grid-template-columns: 1fr; } .dash-cust-grid { grid-template-columns: 1fr; } .dash-manage { border: 0; padding: 0; } }

/* ---- List settings (views / columns / filters) + ⋮ actions ---- */
.lk-btns { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.lk-ib { position: relative; width: 40px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); cursor: pointer; }
.lk-ib:hover, .lk-ib[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--card)); }
.lk-ib.on { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.lk-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.lk-menu { position: relative; }
.lk-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.14); padding: 8px; z-index: 40; }
.lk-pop-h { font-size: .72em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
.lk-pop a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: var(--text); font-weight: 500; }
.lk-pop a:hover { background: var(--soft); }
.lk-views { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.lk-view { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--text); font-size: .9em; font-weight: 600; }
.lk-view .ic { color: #f59e0b; fill: #f59e0b; }
.lk-view.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.lk-view.on .ic { color: #fff; fill: #fff; }
.lk-active { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.lk-active > span { display: inline-flex; align-items: center; gap: 4px; }
.lk-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--primary) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line)); color: var(--text); font-size: .86em; cursor: pointer; }
.lk-chip:hover { border-color: var(--primary); }
.lk-clear-link { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; font-weight: 600; cursor: pointer; font: inherit; }
.lk-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(410px, 100vw); background: var(--card); color: var(--text); z-index: 91; box-shadow: -10px 0 40px rgba(0,0,0,.18);
  transform: translateX(105%); transition: transform .22s ease; display: flex; flex-direction: column; }
.lk-drawer.open { transform: none; }
.lk-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.lk-head h3 { margin: 0; font-size: 1.3em; }
.lk-x { background: none; border: 0; color: var(--text); cursor: pointer; padding: 4px; }
.lk-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 16px 6px; padding: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.lk-tabs button { border: 0; background: transparent; padding: 8px; border-radius: 7px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.lk-tabs button.on { background: var(--primary); color: #fff; }
.lk-body { flex: 1; overflow-y: auto; padding: 6px 16px 16px; }
.lk-sub { display: flex; justify-content: space-between; color: var(--muted); font-size: .88em; margin: 8px 0 10px; }
.lk-caps { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; font-size: .9em; }
.lk-vlist, .lk-clist { list-style: none; margin: 0; padding: 0; }
.lk-vrow { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-radius: 8px; }
.lk-vrow.on { background: color-mix(in srgb, var(--primary) 7%, var(--card)); }
.lk-vrow a { flex: 1; color: var(--text); font-weight: 500; }
.lk-grip { color: var(--muted); opacity: .6; cursor: grab; display: inline-flex; }
.lk-vrow[data-id="all"] .lk-grip { visibility: hidden; }
.lk-star, .lk-del, .lk-eye { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); display: inline-flex; }
.lk-star .ic { opacity: .35; }
.lk-star.on .ic, .lk-star:hover .ic { opacity: 1; color: #f59e0b; fill: #f59e0b; }
.lk-del:disabled { opacity: .3; cursor: default; }
.lk-del:not(:disabled):hover { color: #dc2626; }
.lk-save { display: flex; gap: 8px; margin: 14px 0 6px; }
.lk-save input { flex: 1; min-width: 0; }
.lk-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; background: var(--card); }
.lk-card .lk-cl { flex: 1; font-weight: 500; }
.lk-card.off .lk-cl { color: var(--muted); }
.lk-eye.on { color: var(--primary); }
.lk-eye.dis { opacity: .35; color: var(--muted); padding: 4px; }
.lk-clist .dragging, .lk-vlist .dragging { opacity: .45; }
.lk-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; margin: 8px 0 12px; color: var(--muted); }
.lk-search input { border: 0 !important; box-shadow: none !important; padding: 11px 0 !important; background: transparent !important; flex: 1; }
.lk-f { display: block; padding: 0; }
.lk-f summary { display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; list-style: none; }
.lk-f summary::-webkit-details-marker { display: none; }
.lk-f summary .ic { color: var(--muted); transition: transform .15s; }
.lk-f[open] summary .ic { transform: rotate(90deg); }
.lk-fsum { color: var(--primary); font-size: .88em; font-weight: 600; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-fbody { padding: 0 14px 14px; }
.lk-opts { display: grid; gap: 6px; max-height: 240px; overflow-y: auto; }
.lk-check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.lk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lk-two label { font-size: .85em; color: var(--muted); display: grid; gap: 4px; }
.lk-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lk-seg input { display: none; }
.lk-seg span { display: block; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: .9em; }
.lk-seg input:checked + span { background: var(--primary); color: #fff; }
.lk-foot { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.lk-drawer.busy .lk-body { opacity: .6; pointer-events: none; }

/* ---- Settings → Theme ---- */
.th-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1180px) { .th-grid { grid-template-columns: 1fr; } }
.th-col { display: grid; gap: 22px; min-width: 0; }
.th-card { padding: 24px 26px; margin: 0; }
.th-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.th-head h3 { margin: 0; font-size: 1.2em; }
.th-pill { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: .85em; color: var(--muted); white-space: nowrap; }
.th-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.th-preset { border: 2px solid transparent; background: none; border-radius: 10px; padding: 4px 4px 6px; cursor: pointer; display: grid; gap: 5px; color: var(--text); font: inherit; font-size: .92em; }
.th-preset:hover { border-color: var(--line); }
.th-preset.on { border-color: var(--text); }
.th-sw { position: relative; display: grid; grid-template-columns: 1.6fr 1fr; height: 34px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--card); }
.th-sw i { display: block; }
.th-sw b { display: none; position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #111; align-items: center; justify-content: center; }
.th-preset.on .th-sw b { display: inline-flex; }
.th-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0 6px; }
.th-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
@media (max-width: 640px) { .th-fields, .th-fields-2 { grid-template-columns: 1fr; } }
.th-field > label { display: block; font-weight: 700; margin-bottom: 8px; }
.th-field small { display: block; color: var(--muted); margin-top: 7px; }
.th-colour { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.th-colour input[type=color] { width: 28px; height: 28px; padding: 0; border: 0; margin: 0 4px 0 10px; border-radius: 6px; background: none; cursor: pointer; flex: 0 0 auto; }
.th-colour input[type=color]::-webkit-color-swatch-wrapper { padding: 0; } .th-colour input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.12); border-radius: 6px; }
.th-colour input[type=text] { border: 0 !important; box-shadow: none !important; min-width: 0; flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 1em; padding: 11px 6px !important; text-transform: uppercase; }
.th-colour input.bad { color: #dc2626; }
.th-copy { border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); padding: 0 12px; align-self: stretch; cursor: pointer; }
.th-copy:hover { color: var(--primary); }
.th-note { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 14px 0 0; font-size: .95em; }
.th-foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.th-foot > span:first-child { margin-right: auto; }
.th-foot .dirty { color: #b45309; font-weight: 600; }
.th-icon-btn { border: 0; background: none; color: var(--text); padding: 8px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.th-icon-btn:hover { background: var(--soft); }
.th-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 12px; margin-bottom: 12px; }
@media (max-width: 640px) { .th-row { grid-template-columns: 1fr; } }
.th-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.th-opt input { position: absolute; opacity: 0; pointer-events: none; }
.th-opt span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 10px; text-align: center; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; background: var(--card); }
.th-opt span:hover { border-color: #94a3b8; }
.th-opt input:checked + span { border: 2px solid var(--text); background: var(--soft); font-weight: 700; }
.th-opt input:disabled + span { opacity: .4; cursor: not-allowed; }
.th-opt input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.th-help { color: var(--muted); margin: 12px 0 0; }
.th-preview { padding: 0; margin: 0; overflow: hidden; position: sticky; top: calc(var(--tbh, 60px) + 14px); }
.th-pv-top { display: flex; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.th-pv { --pv-menu: #0f172a; --pv-ink: #fff; --pv-primary: #1d4ed8; --pv-on: #fff; --pv-bg: #f1f5f9; background: #fff; color: #0f172a; font-size: 13px; }
.th-pv-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; color: #64748b; border-bottom: 1px solid #e2e8f0; }
.th-pv-bar span { flex: 1; } .th-pv-bar i { font-style: normal; font-size: 11px; width: 28px; height: 28px; border-radius: 50%; background: #f1f5f9; display: inline-flex; align-items: center; justify-content: center; }
.th-pv-body { display: flex; min-height: 470px; }
.th-pv-menu { width: 168px; flex: 0 0 auto; background: var(--pv-menu); color: var(--pv-ink); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; transition: width .2s; }
.th-pv-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 4px 6px 14px; }
.th-pv-logo { width: 28px; height: 28px; border-radius: 7px; background: #fff; color: var(--pv-menu); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; overflow: hidden; flex: 0 0 auto; }
.th-pv-logo img { max-width: 26px; max-height: 26px; }
.th-pv-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; font-weight: 600; opacity: .9; white-space: nowrap; }
.th-pv-item.on { background: color-mix(in srgb, var(--pv-ink) 92%, transparent); color: var(--pv-menu); opacity: 1; }
.th-pv-set { margin-top: auto; }
.th-pv-main { flex: 1; min-width: 0; background: var(--pv-bg); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.th-pv-head { display: flex; justify-content: space-between; align-items: flex-start; }
.th-pv-head small { color: #64748b; } .th-pv-head h4 { margin: 2px 0 0; font-size: 20px; }
.th-pv-btn { background: var(--pv-primary); color: var(--pv-on); border-radius: 8px; padding: 8px 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.th-pv-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.th-pv-stats div { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; }
.th-pv-stats small { color: #64748b; display: block; } .th-pv-stats b { font-size: 22px; }
.th-pv-list { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; }
.th-pv-lh { font-weight: 700; padding: 10px 14px; border-bottom: 1px solid #e2e8f0; }
.th-pv-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #f1f5f9; }
.th-pv-row:last-child { border-bottom: 0; }
.th-pv-row > div { flex: 1; } .th-pv-row small { display: block; color: #64748b; }
.th-pv-ic { width: 30px; height: 30px; border-radius: 8px; background: #f1f5f9; display: inline-flex; align-items: center; justify-content: center; color: #475569; }
.th-pv-foot { color: #64748b; font-size: 12px; margin: auto 0 0; }
.th-preview > .th-note { padding: 14px 22px; border-top: 1px solid var(--line); margin: 0; }
.th-pv[data-beh="collapsed"] .th-pv-menu, .th-pv[data-beh="hover"] .th-pv-menu { width: 56px; }
.th-pv[data-beh="collapsed"] .th-pv-l, .th-pv[data-beh="hover"] .th-pv-l { display: none; }
.th-pv[data-beh="hover"] .th-pv-menu:hover { width: 168px; } .th-pv[data-beh="hover"] .th-pv-menu:hover .th-pv-l { display: inline; }
.th-pv[data-beh="autohide"] .th-pv-menu, .th-pv[data-beh="hidden"] .th-pv-menu { width: 0; padding: 0; overflow: hidden; }
.th-pv[data-pos="top"] .th-pv-body { flex-direction: column; }
.th-pv[data-pos="top"] .th-pv-menu { width: auto !important; padding: 6px 10px !important; flex-direction: row; overflow: visible !important; }
.th-pv[data-pos="top"] .th-pv-brand { padding: 0 10px 0 4px; } .th-pv[data-pos="top"] .th-pv-l { display: inline !important; }
.th-pv[data-pos="top"] .th-pv-set { margin: 0 0 0 auto; }

/* ---- Settings → Email Design ---- */
.ed-grid { display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .ed-grid { grid-template-columns: 1fr; } }
.ed-card { padding: 20px; }
.ed-card h3 { margin: 0 0 12px; }
.ed-lbl { font-weight: 600; font-size: .92em; margin: 16px 0 8px; }
.ed-card h3 + .ed-lbl { margin-top: 0; }
.ed-stack { display: grid; gap: 10px; }
.ed-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ed-opt { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: var(--card); font-weight: 400; }
.ed-opt:has(input:checked) { border: 2px solid var(--primary); padding: 11px 13px; }
.ed-opt > input { margin-top: 3px; flex: 0 0 auto; width: 18px; height: 18px; }
.ed-opt > span { display: grid; gap: 3px; min-width: 0; }
.ed-opt small { color: var(--muted); }
.ed-logo { position: relative; display: inline-flex; justify-self: start; margin-top: 8px; padding: 10px 16px; border-radius: 8px; background: #0f172a; max-width: 220px; }
.ed-logo img { max-height: 48px; max-width: 190px; }
.ed-x { position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--text); cursor: pointer; }
.ed-x input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.ed-x:has(input:checked) { background: #dc2626; color: #fff; border-color: #dc2626; }
.ed-logo:has(input:checked) img { opacity: .3; }
.ed-change { justify-self: start; margin-top: 8px; position: relative; overflow: hidden; }
.ed-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ed-dot { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-left: 6px; }
.ed-test { margin-top: 10px; }
.ed-preview { padding: 0; overflow: hidden; position: sticky; top: calc(var(--tbh, 60px) + 14px); }
.ed-pv-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ed-pv-head h3 { margin: 0; } .ed-pv-head p { margin: 2px 0 0; }
.ed-pv-body { background: #f1f5f9; }
.ed-pv-body iframe { display: block; width: 100%; height: 760px; border: 0; }
.lk-pop form { margin: 0; }
.lk-pop-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-align: left; white-space: nowrap; }
.lk-pop-btn:hover { background: var(--soft); }
.page-head .lk-menu .lk-pop { z-index: 60; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: default; pointer-events: none; }

/* ---- Settings → Document design ---- */
.dd-tabs { margin-bottom: 16px; }
.dd-grid { display: grid; grid-template-columns: minmax(340px, 520px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .dd-grid { grid-template-columns: 1fr; } }
.dd-intro { margin: 0 0 14px; font-size: 1.02em; }
.dd-card { padding: 18px 20px; margin-bottom: 16px; }
.dd-card h3 { margin: 0 0 6px; }
.dd-card select { width: 100%; }
.dd-lockinfo { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); margin: -2px -20px 0; padding: 0 20px 14px; border-bottom: 1px solid var(--line); }
.dd-head > summary, .dd-pfrow > summary { display: flex; align-items: center; gap: 10px; padding: 14px 0; cursor: pointer; list-style: none; font-weight: 600; font-size: 1.05em; }
.dd-head > summary::-webkit-details-marker, .dd-pfrow > summary::-webkit-details-marker { display: none; }
.dd-head > summary small, .dd-pfrow > summary small { margin-left: auto; color: var(--muted); font-weight: 400; font-size: .85em; }
.dd-head:not([open]) > summary .ic { transform: rotate(-90deg); }
.dd-pfrow[open] > summary .ic { transform: rotate(90deg); }
.dd-head { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.dd-caps { text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); font-size: .82em; margin: 12px 0 2px; }
.dd-sub { margin: 0 0 6px; }
.dd-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--soft); }
.dd-chk { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; cursor: pointer; }
.dd-chk input, .dd-bhead input { width: 18px; height: 18px; flex: 0 0 auto; }
.dd-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-lock { color: var(--muted); display: inline-flex; }
.dd-label { padding: 7px 10px !important; }
.dd-mv { display: inline-flex; gap: 2px; }
.dd-mv button { border: 0; background: none; color: var(--muted); padding: 4px; border-radius: 6px; cursor: pointer; display: inline-flex; }
.dd-mv button:hover { background: var(--soft); color: var(--text); }
.dd-row:first-child [data-mv="-1"], .dd-row:last-child [data-mv="1"], .dd-block:first-child [data-mv="-1"], .dd-block:last-child [data-mv="1"] { opacity: .25; pointer-events: none; }
.dd-block { border-bottom: 1px solid var(--line); }
.dd-bhead { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.dd-exp { flex: 1; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; font-size: 1.02em; color: var(--text); cursor: pointer; text-align: left; min-width: 0; }
.dd-exp .ic:first-child { color: var(--muted); transition: transform .15s; flex: 0 0 auto; }
.dd-exp.open .ic:first-child { transform: rotate(90deg); }
.dd-bhead:has(.dd-on:not(:checked)) .dd-name { color: var(--muted); }
.dd-bbody { padding: 0 0 14px 28px; display: grid; gap: 10px; }
.dd-f { display: grid; gap: 4px; font-size: .9em; color: var(--muted); }
.dd-rt { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dd-rt-bar { display: flex; gap: 4px; padding: 6px 8px; background: var(--soft); border-bottom: 1px solid var(--line); }
.dd-rt-bar button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 1em; color: var(--text); }
.dd-rt-bar button:hover { background: var(--card); }
.dd-rt textarea { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; width: 100%; resize: vertical; }
.dd-add { display: flex; gap: 10px; padding-top: 14px; flex-wrap: wrap; }
.dd-imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.dd-img { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.dd-img img { max-height: 54px; max-width: 120px; display: block; }
.dd-img button { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--text); }
.dd-up { position: relative; overflow: hidden; justify-self: start; }
.dd-up input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dd-rm { justify-self: start; color: #dc2626; }
.dd-sw { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--soft); cursor: pointer; }
.dd-sw:last-child { border-bottom: 0; }
.dd-sw span { display: grid; gap: 2px; } .dd-sw small { color: var(--muted); }
.dd-banner { display: grid; gap: 8px; margin-top: 12px; }
.dd-banner-img img { max-width: 100%; max-height: 90px; border: 1px solid var(--line); border-radius: 6px; }
.dd-cc { margin-top: 10px; max-width: 260px; }
.dd-sets { display: grid; gap: 0; padding-top: 6px; padding-bottom: 6px; }
.dd-sets label { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--soft); font-weight: 600; }
.dd-sets label:last-child { border-bottom: 0; }
.dd-preview { padding: 0; overflow: hidden; position: sticky; top: calc(var(--tbh, 60px) + 14px); margin: 0; }
.dd-pv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--soft); flex-wrap: wrap; }
.dd-pv-head label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dd-pv-head select { min-width: 170px; }
.dd-pv-body { background: #e2e8f0; padding: 14px; }
.dd-pv-body iframe { display: block; width: 100%; height: calc(100vh - 220px); min-height: 600px; border: 0; background: #fff; box-shadow: 0 4px 18px rgba(15,23,42,.12); }

/* ---- Integrations ---- */
.int-search { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--card); color: var(--muted); min-width: min(380px, 70vw); }
.int-search input { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 10px 0 !important; flex: 1; }
.int-tabs { margin-bottom: 18px; }
.int-tabs .tab { cursor: pointer; }
.int-tabs .count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--primary) 12%, var(--card)); color: var(--primary); font-size: .8em; text-align: center; margin-left: 4px; }
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.int-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 26px 18px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.int-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.int-card strong { font-size: 1.12em; margin-top: 8px; }
.int-desc { color: var(--muted); font-size: .92em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.int-logo { display: inline-flex; align-items: center; justify-content: center; font-weight: 800; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px rgba(15,23,42,.08); font-family: -apple-system, "Segoe UI", Arial, sans-serif; flex: 0 0 auto; }
.int-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: .8em; font-weight: 600; }
.int-badge.on { background: #dcfce7; color: #15803d; }
.int-card .int-badge { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1; }
.int-detail { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .int-detail { grid-template-columns: 1fr; } }
.int-side { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; margin: 0; }
.int-side h3 { margin: 6px 0 0; }
.int-main .card { margin-bottom: 16px; }
.int-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 12px 0; }
.int-stats div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.int-stats b { display: block; font-size: 1.4em; } .int-stats small { color: var(--muted); }
.int-dev { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.int-dev summary { cursor: pointer; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row form { margin: 0; }
.dojo-wait { max-width: 520px; text-align: center; padding: 30px; }
.dojo-amt { font-size: 2.4em; font-weight: 800; }
.spinner { width: 34px; height: 34px; margin: 14px auto; border: 4px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Booking page: step-by-step (Book a Vehicle Appointment) ---- */
.vx-booking { max-width: 1060px; margin: 10px auto 40px; }
.vx-bhead { text-align: center; padding-top: 10px; }
.vx-bhead .vx-title { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.vx-card { background: var(--card); border-radius: 16px; padding: 36px 44px 40px; box-shadow: 0 1px 3px rgba(15,23,42,.06); border: 1px solid var(--line); }
.vx-card h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 6px; letter-spacing: -.02em; }
.vx-card .vx-sub { margin-bottom: 28px; }
.vx-card .vx-next { margin-top: 26px; }
.vx-card .svc-grid { margin-bottom: 8px; }
.vx-card .svc-group { margin: 18px 0 8px; }
.vx-card input[type=date] { padding: 12px 14px; font-size: 1rem; border-radius: 10px; }
.vx-card .slots button { padding: 10px 16px; border-radius: 10px; }
.vx-card .vx-h3 { margin-top: 22px; }
.vx-manual { margin-top: 18px; display: grid; gap: 4px; }
.vx-manual input { padding: 13px 16px; border-radius: 10px; font-size: 1rem; }
.vx-center { text-align: center; margin: 16px 0 0; }
.vx-card .order-box { margin-top: 18px; }
.vx-card .note { margin-top: 16px; }
@media (max-width: 640px) { .vx-card { padding: 24px 18px 28px; border-radius: 12px; } }
.apple-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.apple-ways h4 { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.apple-ways ol { padding-left: 18px; margin: 6px 0; }
@media (max-width: 720px) { .apple-ways { grid-template-columns: 1fr; } }
.wa-es { border: 2px solid #25d366; }
.wa-ok { display: flex; align-items: center; gap: 8px; color: #15803d; font-weight: 500; }
.wa-es-btn { background: #25d366; border-color: #25d366; color: #fff; }

/* ⋮ menu options (toggles), print list, stock import */
.lk-pop a.lk-opt { justify-content: space-between; gap: 24px; }
.lk-tg { width: 42px; height: 24px; border-radius: 99px; background: #d1d5db; position: relative; flex: 0 0 auto; transition: background .15s; }
.lk-tg::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
.lk-tg.on { background: var(--primary); } .lk-tg.on::after { left: 21px; }
.lk-pop-sep { border-top: 1px solid var(--line); margin: 6px -8px; }
.print-list { max-width: 1100px; margin: 0 auto; padding: 10px 16px 30px; background: #fff; color: #111; }
.print-list h2 { margin: 6px 0 2px; }
.print-list .table td, .print-list .table th { padding: 5px 6px; font-size: .86rem; }
@media print { .print-list { padding: 0; } }
.imp-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; }
.imp-map label { display: grid; gap: 4px; font-size: .9em; } .imp-map span { color: var(--muted); }

/* Settings → Tyre Pricing / Stock Control */
.tp-note { display: flex; gap: 10px; align-items: flex-start; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; }
.tp-card { padding: 16px 20px; }
.tp-table th { text-transform: uppercase; font-size: .78rem; letter-spacing: .05em; color: var(--muted); }
.tp-table td { vertical-align: middle; }
.tp-off td { opacity: .55; }
.tp-mv { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; display: inline-flex; vertical-align: middle; }
.tp-mv:disabled { opacity: .25; cursor: default; }
.tp-pr { display: inline-block; width: 18px; text-align: center; color: var(--muted); }
.tp-mk { display: inline-block; border: 1px solid #86efac; background: #f0fdf4; color: #15803d; border-radius: 99px; padding: 3px 12px; font-weight: 700; }
.tp-status { border: 0; border-radius: 99px; padding: 4px 12px; font: inherit; font-weight: 600; cursor: pointer; background: var(--soft); color: var(--muted); }
.tp-status.on { background: #dcfce7; color: #15803d; }
.tp-ic { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px 6px; display: inline-flex; }
.tp-ic:hover { color: var(--text); } .tp-del { color: #dc2626; } .tp-del:hover { color: #b91c1c; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .grid2 { grid-template-columns: 1fr; } }
.tp-bottom { margin-top: 18px; }
.tp-how { background: color-mix(in srgb, var(--primary) 6%, var(--card)); border-color: color-mix(in srgb, var(--primary) 25%, var(--line)); }
.tp-how h3 { color: var(--primary); } .tp-how ul { margin: 8px 0 0; padding-left: 18px; color: color-mix(in srgb, var(--primary) 70%, var(--text)); line-height: 1.7; }
.tp-check { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; } .tp-check label { display: grid; gap: 4px; font-size: .85em; color: var(--muted); } .tp-check input, .tp-check select { width: 110px; }
.tp-result { background: var(--soft); border-radius: 10px; padding: 10px 14px; margin: 12px 0 0; }
.tp-other { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 6px; }
.tp-dialog { border: 0; border-radius: 16px; padding: 22px 24px; width: min(640px, 94vw); box-shadow: 0 30px 80px rgba(0,0,0,.3); background: var(--card); color: var(--text); }
.tp-dialog::backdrop { background: rgba(15,23,42,.45); }
.tp-dh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; } .tp-dh h3 { margin: 0; }
.sc-card { padding: 22px 26px; margin-bottom: 18px; }
.sc-card h3 { margin: 0 0 4px; }
.sc-help { margin: 10px 0 0; padding-left: 18px; line-height: 1.7; }
.sc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.sc-table td { vertical-align: middle; } .sc-grip { color: var(--muted); cursor: grab; }
.sc-table tr.dragging { opacity: .4; }
.sc-name { margin: 0; } .sc-name span { font-weight: 500; }

/* On/off switches (all of the CRM). Selector is specific enough to beat the general input / checkbox styles. */
input[type=checkbox].ws-switch { -webkit-appearance: none; appearance: none; display: inline-block; vertical-align: middle; box-sizing: border-box;
  width: 46px; min-width: 46px; max-width: 46px; height: 26px; padding: 0; margin: 0; border: 0; border-radius: 999px; background: #cbd5e1;
  position: relative; cursor: pointer; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(15,23,42,.06); transition: background .18s; accent-color: auto; }
input[type=checkbox].ws-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.3); transition: transform .18s; }
input[type=checkbox].ws-switch:checked { background: var(--primary); }
input[type=checkbox].ws-switch:checked::after { transform: translateX(20px); }
input[type=checkbox].ws-switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
input[type=checkbox].ws-switch:disabled { opacity: .5; cursor: default; }
[data-theme="dark"] input[type=checkbox].ws-switch:not(:checked) { background: #475569; }

/* Row ⋮ menu */
.rm-col { width: 44px; text-align: right; padding-left: 0 !important; }
.rm-btn { border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; cursor: pointer; display: inline-flex; }
.rm-btn:hover, .rm.open .rm-btn { background: var(--soft); color: var(--text); }
.rm-pop { position: fixed; z-index: 80; min-width: 230px; max-height: calc(100vh - 16px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(15,23,42,.18); padding: 6px; text-align: left; }
.rm-form { margin: 0; }
.rm-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; color: var(--text); font: inherit; font-size: .95rem;
  cursor: pointer; text-align: left; white-space: nowrap; text-decoration: none; }
.rm-item:hover, .rm-item.on { background: var(--soft); }
.rm-item > span { flex: 1; }
.rm-item > .ic { color: var(--muted); flex: 0 0 auto; }
.rm-item > .ic:last-child:not(:first-child) { color: var(--primary); }
.rm-has > .rm-item > .ic:last-child { transition: transform .15s; color: var(--muted); }
.rm-has > .rm-item.on > .ic:last-child { transform: rotate(90deg); }
.rm-danger, .rm-danger > .ic { color: #dc2626 !important; }
.rm-warn, .rm-warn > .ic { color: #d97706 !important; }
.rm-cur { font-weight: 600; }
.rm-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; margin: 0 2px; }
.rm-sep { border-top: 1px solid var(--line); margin: 6px -6px; }
.rm-subpop { margin: 2px 0 4px 18px; padding-left: 8px; border-left: 2px solid var(--line); max-height: 260px; overflow-y: auto; }
.rm-preview { position: fixed; inset: 0; z-index: 120; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; padding: 20px; }
.rm-pv-box { background: var(--card); border-radius: 14px; width: min(1100px, 100%); height: min(88vh, 1000px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.rm-pv-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.rm-pv-box iframe { flex: 1; width: 100%; border: 0; background: #fff; }
body.bare.preview .print-bar { display: none; }
body.bare.preview { padding: 12px; }

/* Sidebar footer: when the menu is collapsed only a » button shows (like LaunchControl) */
.sb-open-btn, .sb-close-btn { display: none; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--sb-text); border-radius: 10px; cursor: pointer; }
.sb-open-btn:hover, .sb-close-btn:hover { color: var(--sb-strong); background: color-mix(in srgb, var(--sb-strong) 12%, transparent); }
.sb-close-btn { flex: 0 0 auto; padding: 6px 7px; }
.sb-close-btn .ic { transform: rotate(180deg); }
@media (min-width: 861px) {
  body.sb-full .sb-close-btn { display: inline-flex; }
  body.sb-icons .sb-switch > :not(.sb-open-btn), body.sb-expand .sidebar:not(:hover) .sb-switch > :not(.sb-open-btn),
  body.sb-icons .sb-ver, body.sb-expand .sidebar:not(:hover) .sb-ver { display: none !important; }
  body.sb-icons .sb-open-btn, body.sb-expand .sidebar:not(:hover) .sb-open-btn { display: inline-flex; width: 44px; height: 44px; margin: 0 auto; }
  body.sb-icons .sidebar-foot, body.sb-expand .sidebar:not(:hover) .sidebar-foot { padding: 10px 0 12px; align-items: center; }
  body.sb-icons .sb-switch, body.sb-expand .sidebar:not(:hover) .sb-switch { flex-direction: row; justify-content: center; width: 100%; }
}

/* Reports */
.rep-sec { margin: 22px 0 10px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.rep-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rep-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.rep-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); box-shadow: 0 4px 14px rgba(0,0,0,.06); transform: translateY(-1px); }
.rep-card strong { display: block; margin-bottom: 3px; }
.rep-card .small { display: block; line-height: 1.4; }
.rep-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); }
.rep-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.rep-kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.rep-kpi span { display: block; color: var(--muted); font-size: .8rem; font-weight: 600; }
.rep-kpi strong { display: block; font-size: 1.35rem; margin-top: 2px; }
.rep-delta { display: inline-block; margin-top: 4px; font-style: normal; font-size: .76rem; font-weight: 700; color: var(--muted); padding: 1px 7px; border-radius: 99px; background: var(--soft); }
.rep-delta.up { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.rep-delta.down { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.rep-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.rep-charts .card { margin: 0; }
.rep-chart.wide { grid-column: 1 / -1; }
.rep-bars { display: flex; flex-direction: column; gap: 8px; }
.rep-brow { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.rep-blab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-btrack { height: 10px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.rep-btrack i { display: block; height: 100%; border-radius: 99px; background: var(--primary); min-width: 2px; }
.rep-bval { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 64px; text-align: right; }
.rep-cols { overflow-x: auto; }
.rep-cols svg { width: 100%; height: auto; max-height: 260px; display: block; }
.rep-bar { fill: var(--primary); } .rep-bar:hover { opacity: .75; }
.rep-grid-l { stroke: var(--line); stroke-width: 1; }
.rep-lab { fill: var(--muted); font-size: 10px; }
.rep-cols-max { text-align: right; margin-top: 2px; }
.rep-hd { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.report-range .btn.active { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.rep-prev { margin-left: auto; }
@media (max-width: 1100px) { .rep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .rep-grid, .rep-charts { grid-template-columns: 1fr; } }
@media print { .rep-shell { display: block; } .rep-shell .set-nav, .crumbs { display: none !important; } .rep-charts { grid-template-columns: 1fr 1fr; } }

/* AI tyre suggestion */
.ai-go { margin-top: 8px; }
.ai-card { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.ai-card h3 { display: flex; align-items: center; gap: 6px; }
.ai-fits { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.ai-fit { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.ai-fit:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, transparent); }
.ai-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-fields label { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.ai-src { margin: 2px 0 8px; padding-left: 18px; font-size: .85rem; }
.seg-radio { display: flex; gap: 18px; flex-wrap: wrap; }
.ai-prov { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 6px; margin: 12px 0 0; }
.ai-prov legend { font-weight: 700; padding: 0 6px; }

/* Support manual */
.mn-lang { display: flex; margin-bottom: 8px; }
.mn-lang a { flex: 1; text-align: center; }
.mn-ch { scroll-margin-top: 80px; margin-bottom: 26px; }
.mn-ch-title { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; margin: 6px 0 12px; }
.mn-sec { scroll-margin-top: 80px; line-height: 1.6; }
.mn-sec h3 { margin-top: 0; }
.mn-sec ol, .mn-sec ul { padding-left: 22px; margin: 6px 0 10px; }
.mn-sec li { margin: 4px 0; }
.mn-sec li > ul { margin: 4px 0; }
.mn-sec code { background: var(--soft); padding: 1px 5px; border-radius: 5px; font-size: .88em; overflow-wrap: anywhere; }
.mn-btn { display: inline-block; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); font-weight: 600; font-size: .9em; white-space: nowrap; }
.mn-tip, .mn-warn { border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: .93rem; }
.mn-tip { background: color-mix(in srgb, var(--primary) 8%, transparent); border-left: 4px solid var(--primary); }
.mn-warn { background: color-mix(in srgb, var(--warning) 12%, transparent); border-left: 4px solid var(--warning); }
.mn-faq dt { font-weight: 700; margin-top: 10px; }
.mn-faq dd { margin: 2px 0 0; }
@media print { .mn-shell { display: block; } .mn-shell .set-nav { display: none !important; } .mn-sec { break-inside: avoid; box-shadow: none; } }
.tyre-opt .tyre-promo, .promo-ok { color: #15803d; font-style: normal; font-weight: 700; }
.tyre-opt .tyre-promo { background: #dcfce7; border-radius: 6px; padding: 2px 8px; align-self: flex-start; font-size: .85rem; }
.promo-box { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.promo-err { color: var(--danger); }

/* Discount codes */
.dc-card { padding: 0; overflow: hidden; }
.dc-card > summary { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; cursor: pointer; list-style: none; border-bottom: 1px solid var(--line); }
.dc-card > summary::-webkit-details-marker { display: none; }
.dc-card > summary .ic { margin-top: 3px; color: var(--muted); transition: transform .15s; }
.dc-card:not([open]) > summary .ic { transform: rotate(-90deg); }
.dc-card > summary h3 { margin: 0 0 2px; }
.dc-card > summary p { margin: 0; }
.dc-body { padding: 16px 18px; background: var(--soft); }
.dc-info { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); background: color-mix(in srgb, var(--primary) 8%, var(--card)); color: color-mix(in srgb, var(--primary) 80%, var(--text)); border-radius: 10px; margin-bottom: 14px; font-size: .92rem; }
.dc-info .ic { flex: none; margin-top: 1px; }
.dc-top { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.dc-form { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.dc-form h4 { margin: 0 0 10px; }
.dc-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.dc-table { background: var(--card); }
.dc-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.dc-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.02rem; letter-spacing: .02em; }
.dc-hidden { color: #d97706; } .dc-banner { color: #16a34a; }
.dc-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--card); border-top: 1px solid var(--line); padding: 12px 14px; margin-top: 14px; border-radius: 8px; }
.dc-pager .btn.disabled { opacity: .5; pointer-events: none; }
.order-lines .promo-line td { color: #15803d; font-weight: 600; }
.doc-promo { margin: 10px 0 0; gap: 8px; align-items: center; } .doc-promo .ic { color: var(--primary); }
.dc-page .dc-body { border-radius: 12px; }
.jt-inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.jt-price { display: inline-flex; align-items: center; gap: 4px; }
.jt-price input { width: 82px; padding: 4px 6px; }
.jt-price select { width: auto; padding: 4px 6px; }
.jt-shown { white-space: nowrap; }
.jt-colour { width: 34px; height: 28px; padding: 2px; border-radius: 6px; cursor: pointer; }
.btn-warn-soft { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.pref-days { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.pref-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.pref-chip:has(input:checked) { border-color: var(--vx, var(--primary)); background: color-mix(in srgb, var(--vx, var(--primary)) 10%, transparent); }
[data-quote-panel] textarea { width: 100%; margin-bottom: 12px; }
.qbook h2 { display: flex; align-items: center; gap: 8px; }
.qdep { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0; display: flex; flex-direction: column; gap: 4px; max-width: 420px; }
.qdep > div:not(.small) { display: flex; justify-content: space-between; gap: 12px; }
.qcallback summary { cursor: pointer; font-weight: 600; }
.qcallback textarea { width: 100%; margin: 6px 0; }
.portal-legal { font-size: .78rem; opacity: .8; margin-top: 4px; }
.qs-form { margin: 0; }
.seo-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.seo-check li { display: flex; gap: 10px; align-items: flex-start; }
.seo-check li > span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #fef3c7; color: #92400e; font-weight: 800; }
.seo-check li.ok > span { background: #dcfce7; color: #15803d; }
.seo-check strong { display: block; } .seo-check small { display: block; }
