/* Randy's Auto shop app. Phase 5 look ("clean workshop"): white cards with thin lines on a light ground, one action
   blue, the RA orange for the brand mark only, Windows' own Segoe UI. Every color and size comes from these settings;
   dark and sunlight modes (near the end) only change them. */

:root {
  --topbar: #0f172a;
  --topbar-search: #1e293b;
  --brand: #ea580c;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff4ff;
  --bg: #f4f6f8;
  --card: #ffffff;
  --card-2: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --border: #cbd5e1;
  --line: #e2e8f0;
  --row-border: #eef1f5;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #b45309;
  --warn-text: #9a3412;
  --warn-soft: #fff7ed;
  --neutral-soft: #f1f5f9;
  --well: #e3e8ef;          /* grey areas that sit on the page ground: board columns, choosers */
  --well-line: #d3dbe5;
  --text-2: #334155;
  --placeholder: #94a3b8;
  --radius: 12px;
  --radius-sm: 8px;
  --ctl-h: 40px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-pop: 0 8px 24px rgba(15, 23, 42, 0.14);
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.25);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-size: 15px; line-height: 1.45; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
svg { flex-shrink: 0; }
.num, td.num, .money, .stat-value, .totals-bar, .bar-num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- Line icons (fragments/icons.html) ---------- */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.fill { fill: currentColor; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 56px; padding: 0 12px 0 16px;
  background: var(--topbar); color: #fff;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: #fff; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.icon-btn .i { width: 20px; height: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--brand); font-size: 13px; font-weight: 700;
}
.search {
  flex: 0 1 440px; display: flex; align-items: center; gap: 10px; margin-left: 12px;
  height: 38px; padding: 0 12px; border-radius: 10px; background: var(--topbar-search); color: #94a3b8;
}
.search:focus-within { box-shadow: 0 0 0 2px rgba(96, 165, 250, .5); }
.topbar .search input { flex: 1; min-width: 0; height: auto; padding: 0; border: 0; background: transparent; color: #fff; font: inherit; font-size: 14px; outline: none; box-shadow: none; }
.topbar .search input:focus { box-shadow: none; }
.topbar .search input::placeholder { color: #94a3b8; }
.search .search-key { border-color: #3b4a5e; background: transparent; color: #94a3b8; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.bell { position: relative; }
.badge-count {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #ef4444; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.user-menu { position: relative; margin-left: 6px; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; background: #475569; color: #fff; font-size: 13px; font-weight: 600;
}
/* Pop-up menus: user menu, quick add, bell, the RO's Print and Message menus */
.user-menu-panel, .quick-add-panel, .bell-panel, .menu-pop-panel, .merge-panel {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.user-menu-panel { position: absolute; right: 0; top: 44px; width: 248px; padding: 6px; z-index: 60; }
.user-menu-panel .who { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.user-menu-panel a, .user-menu-panel button, .quick-add-panel a, .quick-add-panel button, .menu-pop-panel a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.user-menu-panel a:hover, .user-menu-panel button:hover, .quick-add-panel a:hover, .quick-add-panel button:hover, .menu-pop-panel a:hover {
  background: var(--neutral-soft); text-decoration: none; }
.quick-add-panel .i, .menu-pop-panel .i { color: var(--faint); }

/* ---------- Sidebar: the 7 hubs ---------- */
.sidemenu {
  position: fixed; top: 56px; bottom: 0; left: 0; z-index: 25; width: 260px;
  padding: 10px 8px 24px; overflow-y: auto; background: var(--card);
  box-shadow: var(--shadow-pop);
  transform: translateX(-105%); transition: transform .18s ease;
}
body.menu-open .sidemenu { transform: none; }
.scrim { position: fixed; inset: 56px 0 0 0; z-index: 20; background: rgba(15, 23, 42, .35); }
.menu-group-label { padding: 8px 12px 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.menu-link { display: flex; align-items: center; gap: 14px; margin-bottom: 2px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.menu-link svg { flex: none; }
.menu-link:hover { background: var(--neutral-soft); color: var(--text); text-decoration: none; }
.menu-link.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

/* Wide screens: the hubs stay on the left as a narrow rail (icon over label); the menu button is only for small screens. */
@media (min-width: 900px) {
  .sidemenu { width: 80px; padding: 10px 8px; transform: none; box-shadow: none; border-right: 1px solid var(--line); z-index: 15; }
  .sidemenu .menu-link { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 12px; text-align: center; }
  body { padding-left: 80px; }
  body > .topbar { margin-left: -80px; }
  #menu-toggle, .scrim { display: none !important; }
}

/* Hub header: the hub's name and its tabs. Inside a hub, a page's own sub-tabs become a segmented chooser. */
.hub-tabs { display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; background: var(--card); padding: 0 28px; border-bottom: 1px solid var(--line); }
.hub-tabs .hub-name { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; padding: 14px 18px 12px 4px; white-space: nowrap; }
.hub-tabs .tab { padding: 14px 12px 12px; }
body.in-hub .page-head { background: transparent; border: 0; padding: 18px 32px 0; }
body.in-hub .page-head > h1 { font-size: 17px; padding-bottom: 10px; }
body.in-hub .page-head .tabs { display: inline-flex; max-width: 100%; gap: 2px; padding: 3px; background: var(--well); border-radius: 10px; }
body.in-hub .page-head .tabs .tab { padding: 6px 14px; border: 0; border-radius: var(--radius-sm); font-size: 14px; }
body.in-hub .page-head .tabs .tab.active { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
body.in-hub .page-head + .page-body { padding-top: 16px; }
@media (max-width: 700px) {
  .hub-tabs { padding: 0 8px; }
  .hub-tabs .hub-name { display: none; }
  body.in-hub .page-head { padding: 12px 16px 0; }
}
@media print { .hub-tabs { display: none !important; } }

/* ---------- Page ---------- */
.page-head { background: var(--card); padding: 20px 32px 0; border-bottom: 1px solid var(--line); }
.page-head h1 { padding-bottom: 14px; }
.page-head.no-tabs { padding-bottom: 8px; }
.tabs { display: flex; overflow-x: auto; }
.tabs { gap: 4px; }
.tab { padding: 12px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }
.page-body { padding: 24px 32px 48px; max-width: 1400px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* Messages: errors stay at the top of the page; "Saved" notes float in the corner and fade (app.js) */
.flash { display: flex; align-items: center; gap: 10px; margin: 16px 32px 0; padding: 12px 16px; border-radius: var(--radius-sm); }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); font-weight: 500; }
.flash.toast { position: fixed; left: 24px; bottom: 24px; z-index: 90; margin: 0; max-width: min(460px, calc(100vw - 48px));
  background: #0f172a; color: #fff; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(15, 23, 42, .3); font-size: 14px;
  animation: toast-in .2s ease-out; transition: opacity .25s, transform .25s; }
.flash.toast.gone { opacity: 0; transform: translateY(8px); }
.flash.toast .ok-icon { color: #4ade80; stroke-width: 2.6; }
.flash.toast > span { flex: 1; }
.toast-action { border: 0; background: none; color: #93c5fd; font: inherit; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.toast-close { display: inline-flex; border: 0; background: none; color: #94a3b8; cursor: pointer; padding: 4px; border-radius: 6px; }
.toast-close:hover { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 900px) { .flash.toast { left: 104px; } }
.totals-bar ~ .flash.toast, body:has(.totals-bar) .flash.toast { bottom: 96px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ---------- Buttons and forms ---------- */
/* Buttons: primary (filled), plain (outlined), quiet (text only), danger (soft red); .icon = square icon button */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--ctl-h); padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--neutral-soft); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--primary); }
.btn.quiet:hover { background: var(--primary-soft); }
.btn.soft { border-color: transparent; background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.btn.danger { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: #fde2e2; }
.btn.small { height: 32px; padding: 0 12px; font-size: 14px; gap: 6px; }
.btn.icon { width: var(--ctl-h); padding: 0; }
.btn.small.icon { width: 32px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg, .icon-svg { width: 18px; height: 18px; }
.btn.small svg { width: 16px; height: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label, .field .label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=search], input[type=url],
input[type=date], input[type=datetime-local], input[type=time], input[type=month], select, textarea {
  width: 100%; height: var(--ctl-h); padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); font: inherit;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
input[type=date], input[type=datetime-local], input[type=time], input[type=month] { width: auto; min-width: 0; }
input::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
/* Dropdowns: one look everywhere (our own arrow); Chrome and Edge also get a styled open list */
select { appearance: none; -webkit-appearance: none; padding-right: 36px; text-overflow: ellipsis; white-space: nowrap; background-image: var(--chevron);
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; cursor: pointer; }
select[multiple], select[size] { background-image: none; padding-right: 12px; height: auto; }
@supports (appearance: base-select) {
  select:not([multiple]):not([size]), ::picker(select) { appearance: base-select; }
  select:not([multiple]):not([size]) { display: inline-flex; align-items: center; white-space: nowrap; overflow: hidden; }
  select:not([multiple]):not([size])::picker-icon { display: none; }
  ::picker(select) { border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop); padding: 4px;
    background: var(--card); color: var(--text); }
  select option { padding: 8px 10px; border-radius: 6px; }
  select option:hover, select option:focus-visible { background: var(--neutral-soft); }
  select option:checked { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
  select option::checkmark { display: none; }
}
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 18px; height: 18px; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); }
/* File pickers: the browser's "Choose file" becomes a plain button */
input[type=file] { font: inherit; font-size: 14px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { height: 36px; margin-right: 10px; padding: 0 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--neutral-soft); }
/* On/off settings (label.check) show as switches */
.check { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; cursor: pointer; }
.check input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 40px; height: 24px; margin: 0;
  border-radius: 12px; background: var(--border); cursor: pointer; transition: background-color .15s; }
.check input[type=checkbox]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .25); transition: transform .15s; }
.check input[type=checkbox]:checked { background: var(--primary); }
.check input[type=checkbox]:checked::after { transform: translateX(16px); }
.check input[type=checkbox]:focus-visible { box-shadow: var(--focus); }
.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Tables ---------- */
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 13px; font-weight: 600; color: var(--faint); background: var(--card-2); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid var(--row-border); vertical-align: top; }
table.data tbody tr:hover td { background: var(--card-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.inactive td { color: var(--muted); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty::before { content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 20px no-repeat; }
.empty p { margin: 4px 0; }

/* List editors in Settings: one form per row */
.row-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.row-form { display: grid; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--row-border); }
.row-form:last-child { border-bottom: 0; }
.row-form.head { color: var(--faint); font-size: 13px; font-weight: 600; background: var(--card-2); border-radius: var(--radius) var(--radius) 0 0; }
.row-form.add { background: var(--card-2); }
.cols-zone { grid-template-columns: 1.2fr 2fr .8fr .6fr .6fr auto; }
.cols-label { grid-template-columns: 2fr auto 1.2fr .6fr .6fr auto; }
.cols-appt { grid-template-columns: 2fr auto .8fr .6fr .6fr auto; }
.cols-cat { grid-template-columns: .8fr 2fr .6fr .6fr auto; }
.row-form .active-box { display: flex; align-items: center; gap: 6px; font-size: 14px; }

/* ---------- Chips ---------- */
/* Badges: soft tinted pills. A chip given a color (RO labels: style="--c: #hex") shows a colored dot on a tint of it. */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--neutral-soft);
  color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.soft { background: var(--neutral-soft); color: var(--text-2); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.info { background: var(--primary-soft); color: var(--primary-dark); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.off { background: var(--neutral-soft); color: var(--faint); }
.chip.ph { background: var(--card-2); color: var(--muted); border: 1px dashed var(--placeholder); }
.chip[style*="--c"] { background: color-mix(in srgb, var(--c) 14%, var(--card)); color: color-mix(in srgb, var(--c) 72%, var(--text)); }
.chip[style*="--c"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.initials { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #64748b; color: #fff; font-size: 13px; font-weight: 500; }

/* ---------- Activity feed (RO Summary style) ---------- */
.feed-search { display: flex; gap: 10px; margin-bottom: 8px; }
.feed-search input { max-width: 420px; }
.feed-item { padding: 14px 0; border-bottom: 1px solid var(--row-border); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .when { color: var(--muted); font-size: 14px; margin-top: 2px; }
.show-more { display: block; text-align: center; padding: 16px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--text); }

/* ---------- Coming soon ---------- */

/* ---------- Settings layout ---------- */
.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 8px 0; }
.settings-nav a { display: block; margin: 0 6px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text); }
.settings-nav a:hover { background: var(--neutral-soft); text-decoration: none; }
.settings-nav a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }

/* ---------- Placeholder control (paid features) ---------- */
.placeholder-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: 1px dashed var(--placeholder); border-radius: var(--radius-sm); background: var(--card-2);
  color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.placeholder-btn:hover { background: var(--neutral-soft); }
.placeholder-dialog { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: var(--radius); padding: 24px; box-shadow: 0 16px 48px rgba(0,0,0,.25); }
.placeholder-dialog::backdrop { background: rgba(15, 23, 42, .4); }
.placeholder-dialog h2 { font-size: 18px; margin-top: 8px; }
.placeholder-dialog .dialog-close { position: absolute; right: 12px; top: 10px; margin: 0; }
.placeholder-dialog .dialog-close button { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.ph-manual { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--row-border); }
.ph-manual form { display: grid; gap: 10px; }

/* ---------- Integrations ---------- */
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 20px; }
.feature-card { display: flex; flex-direction: column; gap: 10px; }
.feature-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.feature-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.feature-card dt { color: var(--muted); }
.feature-card dd { margin: 0; }
.feature-card .actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Sign-in and setup ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--topbar); }
.auth-card { width: min(420px, 100%); background: var(--card); border-radius: 16px; padding: 32px; box-shadow: 0 16px 48px rgba(0, 0, 0, .4); }
.auth-card .brand-mark { margin-bottom: 14px; color: #fff; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .field { margin-top: 14px; }
.auth-card .btn { width: 100%; margin-top: 20px; height: 44px; }
.auth-card .flash { margin: 16px 0 0; }

/* ---------- Milestone 2: lists, profiles, customers and vehicles ---------- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.filter-bar input[type=search] { flex: 1 1 280px; min-width: 0; }
.filter-bar .spacer { flex: 1; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
td.num, th.num { text-align: right; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.02em; }
.inline { display: flex; gap: 8px; }
.inline > input { flex: 1; min-width: 0; }
.inline > select { flex: 0 0 auto; width: auto; }
.full-width { width: 100%; }
.section-title { font-size: 17px; margin: 24px 0 10px; }
.count { display: inline-block; min-width: 20px; padding: 0 7px; margin-left: 6px; border-radius: 999px; background: var(--neutral-soft); color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.h1-sub { font-size: 16px; font-weight: 400; margin-left: 8px; }
.page-head h1 .chip { vertical-align: middle; margin-left: 6px; }

/* Segmented chooser: a grey track with the chosen option raised */
.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--well); border-radius: 10px; margin-bottom: 16px; }
.segmented label, .segmented a { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.segmented label:has(input:checked), .segmented a.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.customer-form:has(input[name=customerType][value=PERSON]:checked) .business-only { display: none; }
.customer-form .card + .card, .vehicle-form .card + .card { margin-top: 16px; }
.customer-form > .form-actions, .vehicle-form > .form-actions { margin-top: 16px; }
.warn-card { box-shadow: inset 3px 0 0 var(--warn); margin-bottom: 16px; }
.dupe-list { margin: 8px 0 12px; padding-left: 20px; }
.dupe-list li { margin: 4px 0; }
.dupe-list .muted { margin-left: 8px; }

.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card h2 { margin: 0 0 4px; font-size: 18px; }
.profile-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 500; margin-bottom: 10px; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 14px 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--row-border); }
.profile-actions form { margin: 0; }
.profile-tabs { background: var(--card); border-radius: var(--radius); padding: 0 8px; margin-bottom: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow-x: auto; flex-wrap: nowrap; }
.profile-tabs .tab { white-space: nowrap; }
.inline-flash { margin: 0 0 16px; }

.vehicle-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.vehicle-card { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.card.vehicle-card + .card.vehicle-card { margin-top: 0; }
.vehicle-card:hover { border-color: var(--primary); }
.vehicle-card.add { border: 1px dashed var(--border); box-shadow: none; background: transparent; justify-content: center; color: var(--primary); }

.location .location-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.location .chip { margin-left: 6px; height: 22px; font-size: 12px; }
.location-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.location-actions form { margin: 0; }
.location.inactive { opacity: 0.6; }
.edit-location { margin-top: 12px; }
.edit-location summary { cursor: pointer; color: var(--primary); font-size: 14px; }
.edit-location form { margin-top: 12px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.stat-grid .card + .card { margin-top: 0; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--faint); }
.stat-value { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.stat-value.small-value { font-size: 20px; }

.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vin-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.vin-row .field { flex: 1 1 260px; }
.vin-row input { font-size: 17px; text-transform: uppercase; }
.plate-lookup-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ph-block { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form input[type=text] { width: auto; flex: 1 1 140px; }
.merge-menu { position: relative; }
.merge-menu summary { list-style: none; }
.merge-menu summary::-webkit-details-marker { display: none; }
.merge-panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 290px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.merge-panel p { margin: 0 0 6px; }
.recall { box-shadow: inset 3px 0 0 var(--warn); }
.recall.park-it { border-left-color: var(--danger); }
.recall-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.recall p { margin: 6px 0; }
.recall + .recall { margin-top: 12px; }
.card.head-row { margin-bottom: 8px; }

/* ---------- Milestone 3: repair order page ---------- */
.ro-head { background: var(--card); padding: 16px 28px 0; border-bottom: 1px solid var(--line); }
.ro-head-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ro-head-row h1 { margin: 0; font-size: 22px; }
.ro-head-row.second { justify-content: space-between; margin: 8px 0 4px; font-size: 14px; }
.ro-head-row .spacer, .totals-bar .spacer, .job-money .spacer { flex: 1; }
.ro-head .tabs { margin-top: 8px; }
/* The RO label: a pill in the label's own color that opens the list of labels */
.label-select { --c: #64748b; width: auto; height: 30px; padding: 0 30px 0 12px; border: 1px solid color-mix(in srgb, var(--c) 35%, var(--card)); border-radius: 999px;
  background-color: color-mix(in srgb, var(--c) 14%, var(--card)); color: color-mix(in srgb, var(--c) 72%, var(--text)); font-size: 13px; font-weight: 600;
  background-position: right 8px center; background-size: 14px; }
.label-select option { color: var(--text); background: #fff; }
.label-form { margin: 0; }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); border: 1px solid var(--warn); }
/* Odometer: one pill in the header; clicking it opens a small box for miles in and out */
.odo-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card-2); color: var(--text-2); font-size: 13px; cursor: pointer; list-style: none; }
.odo-pill strong { font-weight: 600; color: var(--text); }
.odo-pill.warn { border-color: #fed7aa; background: var(--warn-soft); color: var(--warn-text); }
.odo-pill .i { width: 15px; height: 15px; }
.odo-pop .odo-panel { width: 300px; gap: 14px; }
.odo-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 10px; margin: 0; }
.odo-form .field { grid-column: 1 / -1; }
.odo-form .nw { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.odo-form + .odo-form { padding-top: 14px; border-top: 1px solid var(--line); }
.pin-btn { color: var(--faint); }
.pin-btn.on { color: #f59e0b; }
.pin-btn.on .i { fill: currentColor; }
.menu-pop { position: relative; }
.menu-pop summary { list-style: none; }
.menu-pop summary::-webkit-details-marker { display: none; }
.menu-pop-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; display: flex; flex-direction: column; padding: 6px; }
.ro-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 20px 24px 90px; align-items: start; }
body.side-hidden .ro-layout { grid-template-columns: minmax(0, 1fr); }
body.side-hidden .ro-side { display: none; }
.ro-main .card + .card { margin-top: 16px; }
.ro-side { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 0 16px; position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; }
.side-sec { border-bottom: 1px solid var(--line); padding: 0 0 14px; }
.side-sec:not([open]) { padding-bottom: 0; }
.side-sec:last-child { border-bottom: 0; }
.side-sec > summary { display: flex; align-items: center; gap: 8px; padding: 14px 0; cursor: pointer; font-weight: 600; }
.side-sec > summary::after { content: ""; margin-left: auto; width: 16px; height: 16px; flex: none; background: var(--chevron) center / 16px no-repeat; transition: transform .15s; }
.side-sec[open] > summary::after { transform: rotate(180deg); }
.sec-hint { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 400; color: var(--faint); }
.side-sec[open] .sec-hint { display: none; }

/* Fold-outs: no browser triangles anywhere. Small "Edit job", "+ Part", "Tire details" links become quiet buttons with a chevron. */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.job-edit > summary, .add-part > summary, .tire-edit > summary, .edit-location > summary, .add-spec > summary, .core-edit > summary:not(.btn),
details.small > summary, .warranty-edit > summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; margin-left: -10px; border-radius: var(--radius-sm);
  color: var(--primary); font-size: 14px; font-weight: 500; cursor: pointer; }
.job-edit > summary:hover, .add-part > summary:hover, .tire-edit > summary:hover, .edit-location > summary:hover, .add-spec > summary:hover,
details.small > summary:hover, .warranty-edit > summary:hover { background: var(--primary-soft); }
.job-edit > summary::after, .tire-edit > summary::after, .edit-location > summary::after, details.small > summary::after, .warranty-edit > summary::after {
  content: ""; width: 14px; height: 14px; background: var(--chevron) center / 14px no-repeat; transition: transform .15s; }
.job-edit[open] > summary::after, .tire-edit[open] > summary::after, .edit-location[open] > summary::after, details.small[open] > summary::after,
.warranty-edit[open] > summary::after { transform: rotate(180deg); }
.warranty-edit > summary { color: var(--muted); font-weight: 400; }
.side-sec .field { margin-top: 8px; }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
.summary-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: start; }
.summary-nav { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 72px; }
.sig { max-width: 280px; border: 1px solid var(--border); border-radius: 4px; margin-top: 6px; background: #fff; }
.concern { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--row-border); }
.concern-text .chip { margin-right: 6px; height: 22px; font-size: 12px; }
.concern-edit { position: relative; }
.concern-edit summary { list-style: none; }
.concern-edit[open] form { position: absolute; right: 0; z-index: 25; width: 360px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.concern-edit .field { display: block; margin-bottom: 8px; }
.estimate-tools { display: flex; flex-wrap: wrap; gap: 16px; }
.estimate-tools form { flex: 1 1 300px; }
.muted-card { background: var(--card-2); box-shadow: none; border: 1px dashed var(--border); }
.job-card { padding: 0; overflow: visible; }
.job-card > * { padding-left: 20px; padding-right: 20px; }
.job-card > :first-child { padding-top: 14px; }
.job-card > :last-child { padding-bottom: 14px; }
.job-card.declined { opacity: 0.7; }
.job-card.declined .job-title { text-decoration: line-through; text-decoration-color: var(--placeholder); }
.job-card.done .job-head { box-shadow: inset 3px 0 0 var(--ok); }
.job-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.job-head .chip { margin-left: 6px; height: 22px; font-size: 12px; }
.job-title { font-size: 17px; font-weight: 600; }
.job-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.job-actions form { margin: 0; }
.job-edit { margin: 8px 0; }
.job-edit summary { cursor: pointer; color: var(--primary); font-size: 14px; }
.job-edit form { margin-top: 10px; }
.lines { margin-top: 12px; }
.line-head, .line-row { display: grid; gap: 6px; align-items: center; }
.line-head { font-size: 12px; color: var(--faint); font-weight: 600; padding: 8px 0 6px; border-bottom: 1px solid var(--line); }
.line-row { padding: 6px 0; border-bottom: 1px solid var(--row-border); margin: 0; }
.line-row input, .line-row select { height: 34px; padding: 4px 8px; min-width: 0; }
.line-row select { padding-right: 28px; background-position: right 6px center; }
.line-row.add input { background: var(--card-2); }
.row-btns { display: flex; gap: 4px; justify-content: flex-end; }
.labor-grid { grid-template-columns: minmax(160px, 3fr) 70px 90px 90px 70px 110px; }
.part-grid { grid-template-columns: minmax(140px, 3fr) minmax(80px, 1.2fr) 60px 80px 80px 100px 110px; }
.sublet-grid { grid-template-columns: minmax(140px, 3fr) minmax(100px, 1.5fr) 80px 80px 110px; }
.fee-grid { grid-template-columns: 80px minmax(140px, 3fr) 90px 70px 60px 90px 110px; }
.canned-grid { grid-template-columns: 70px minmax(160px, 3fr) 100px 90px 90px 140px 110px; }
.cols-markup { grid-template-columns: 1fr 1fr 1fr 2fr 110px; }
.part-status { height: 26px; font-size: 12px; font-weight: 600; justify-self: start; padding: 0 28px 0 10px; border-radius: 999px; border-color: transparent;
  background-color: var(--neutral-soft); color: var(--text-2); background-position: right 6px center; background-size: 14px; }
.part-status.st-ordered { background-color: var(--warn-soft); color: var(--warn-text); }
.part-status.st-received { background-color: var(--ok-soft); color: var(--ok); }
.part-status.st-backordered, .part-status.st-needed { background-color: var(--danger-soft); color: var(--danger); }
.add-part { margin-top: 6px; }
.add-part summary { cursor: pointer; color: var(--primary); }
.add-part form { margin-top: 8px; }
.job-money { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Estimate totals: a light bar that stays at the bottom of the screen */
.totals-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); color: var(--muted); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, .06); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 12px 28px; font-size: 14px; }
.totals-bar strong { color: var(--text); font-weight: 600; }
.totals-bar .grand { font-size: 19px; color: var(--text); }
@media (min-width: 900px) { .totals-bar { left: 80px; } }
.auth-dialog { width: min(680px, 96vw); }
.auth-form table { margin-bottom: 12px; }
.sig-wrap { margin-top: 12px; }
.sig-pad { display: block; width: 100%; max-width: 560px; height: 160px; border: 1px dashed var(--border); border-radius: var(--radius); background: #fff; touch-action: none; margin: 6px 0; }
.steps { margin-top: 10px; }
.step { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--row-border); margin: 0; }
.tick { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); color: transparent; cursor: pointer; font-weight: 700; }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.struck { text-decoration: line-through; color: var(--muted); }
.wip-parts { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.wip-part { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.wip-part form { margin: 0; }
.wip-part select { width: auto; height: 30px; }
.comments { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--row-border); }
.comment { margin-bottom: 8px; }

/* ---------- Milestone 4 ---------- */
.danger-text { color: var(--danger); }
.menu-pop-panel.pad { padding: 10px; gap: 8px; min-width: 240px; }
.date-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.date-range input[type=date] { width: auto; }

/* ---------- Milestone 5: boards and calendar ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; }
.board.techs { grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); grid-template-columns: none; }
.board-col { background: var(--well); border: 1px solid var(--well-line); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.board-col header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.board-col header .hrs { font-size: 12px; color: var(--muted); width: 100%; }
.board-col.unassigned header { color: var(--danger); }
.board-cards { display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.board-cards.drop-hover { outline: 2px dashed var(--primary); outline-offset: 4px; border-radius: var(--radius); }
.ro-card { display: block; background: var(--card); border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px; color: var(--text); text-decoration: none; cursor: grab; }
.ro-card:hover { border-color: var(--border); box-shadow: 0 4px 12px rgba(15, 23, 42, .08); text-decoration: none; }
.ro-card.dragging { opacity: .5; }
.ro-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ro-card-top .chip { height: 22px; font-size: 11px; }
.ro-card-top .spacer { flex: 1; }
.initials.tech { background: #0d4a80; }
.pin { color: var(--warn); }
.ro-card-cust { font-weight: 500; }
.ro-card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.ro-card-bottom .chip { height: 20px; font-size: 11px; }
.progress { height: 4px; background: var(--bg); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); }
.cal-head { display: flex; flex-direction: column; gap: 8px; }
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.cal-nav .spacer { flex: 1; }
.cal-title { font-size: 16px; margin-left: 8px; }
.cal-grid { display: grid; grid-template-columns: 60px repeat(var(--days, 1), minmax(0, 1fr)); background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.cal-grid.cols-1 { --days: 1; } .cal-grid.cols-7 { --days: 7; }
.cal-corner { border-bottom: 1px solid var(--row-border); }
.cal-dayhead { border-bottom: 1px solid var(--row-border); border-left: 1px solid var(--row-border); padding: 6px; font-size: 13px; font-weight: 500; }
.cal-dayhead.is-today a { color: var(--danger); }
.cal-allday { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.cal-hours { grid-row: 2; }
.cal-hour { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; border-top: 1px solid var(--row-border); }
.cal-day { grid-row: 2; position: relative; border-left: 1px solid var(--row-border); }
.cal-day.is-today { background: var(--primary-soft); }
.cal-slot { height: 48px; border-top: 1px solid var(--row-border); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 3; }
.appt { position: absolute; left: 4px; right: 4px; background: var(--primary-soft); border-left: 3px solid var(--primary); border-radius: 6px; padding: 3px 6px; font-size: 12px; overflow: hidden; color: var(--text); text-decoration: none; display: flex; flex-direction: column; z-index: 2; }
.appt.allday { position: static; }
.appt.canceled, .appt-line.canceled { opacity: .5; text-decoration: line-through; }
.appt-pad { position: absolute; left: 0; right: 0; bottom: 100%; background: repeating-linear-gradient(45deg, #eef1f4, #eef1f4 4px, #e1e6ea 4px, #e1e6ea 8px); }
.small-chip { height: 18px; font-size: 10px; background: var(--ok-soft); color: var(--ok); align-self: flex-start; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.cal-dow { padding: 6px; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--row-border); }
.cal-cell { min-height: 110px; border-top: 1px solid var(--row-border); border-left: 1px solid var(--row-border); padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.cal-cell.other { background: var(--card-2); }
.cal-cell.is-today .cal-date { color: #fff; background: var(--danger); border-radius: 50%; width: 24px; text-align: center; }
.cal-date { font-size: 12px; font-weight: 500; color: var(--text); text-decoration: none; }
.appt-line { display: block; font-size: 12px; padding: 3px 8px; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 6px; color: var(--text); text-decoration: none; margin: 2px 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stops { list-style: none; padding: 0; margin: 0 0 16px; }
.stop { display: flex; align-items: center; gap: 12px; cursor: grab; }
.card.stop + .card.stop { margin-top: 10px; }
.grip { color: var(--muted); letter-spacing: -4px; }
.booking-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; border-top: 1px solid var(--row-border); padding-top: 10px; }

/* ---------- Inspections ---------- */
.card.insp { padding: 0; overflow: hidden; }
.insp-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.insp-bar h2 { margin: 0; }
.insp-progress { width: 120px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.insp-progress span { display: block; height: 100%; background: var(--primary); }
.insp-actions { padding: 12px 20px 4px; }
.insp-section { padding: 0 20px 8px; }
.insp-section h3 { margin: 14px 0 2px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.task { border-bottom: 1px solid var(--row-border); padding: 10px 0; margin: 0; }
.task:last-child { border-bottom: 0; }
.task:has(.rate-urgent input:checked) { box-shadow: inset 3px 0 0 var(--danger); padding-left: 12px; margin-left: -12px; }
.task:has(.rate-attention input:checked) { box-shadow: inset 3px 0 0 var(--warn); padding-left: 12px; margin-left: -12px; }
.task-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-name { flex: 1 1 200px; }
/* Ratings: a segmented chooser; the chosen rating fills with its color */
.ratings { display: inline-flex; gap: 2px; padding: 3px; background: var(--well); border-radius: 10px; }
.rate { position: relative; display: inline-flex; align-items: center; padding: 5px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-2); cursor: pointer; }
.rate:hover { background: var(--card); }
.rate input { position: absolute; opacity: 0; pointer-events: none; }
.rate:has(input:focus-visible) { box-shadow: var(--focus); }
.rate:has(input:checked) { color: #fff; font-weight: 600; }
.rate:has(input:checked).rate-good { background: var(--ok); }
.rate:has(input:checked).rate-attention { background: var(--warn); }
.rate:has(input:checked).rate-urgent { background: var(--danger); }
.rate:has(input:checked).rate-na { background: #64748b; }
.task-more { margin-top: 4px; }
.task-add { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; margin-left: -8px; border-radius: var(--radius-sm);
  color: var(--faint); font-size: 13px; font-weight: 500; cursor: pointer; }
.task-add .i { width: 15px; height: 15px; }
.task-add .i + span + .i { margin-left: 8px; }
.task-add:hover { background: var(--neutral-soft); color: var(--text); }
.task-more[open] > .task-add { color: var(--primary-dark); }
.task-body { display: grid; gap: 10px; margin-top: 8px; }
.task-body textarea { min-height: 64px; }
.task-files { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.task-files > input[type=text] { flex: 1 1 200px; width: auto; align-self: center; }
.task-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* Photo and file picker: a dashed tile; the real file box sits invisibly on top of it */
.file-tile { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 16px;
  border: 1.5px dashed var(--placeholder); border-radius: var(--radius-sm); background: var(--card); color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.file-tile:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-tile:focus-within { box-shadow: var(--focus); }
.file-tile input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-tile .i { width: 20px; height: 20px; color: var(--faint); }
.file-tile.small-tile { min-height: 40px; padding: 6px 12px; }
.file-tile.picked { border-style: solid; border-color: var(--ok); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { display: flex; flex-direction: column; gap: 2px; }
.thumb img { width: 110px; height: 82px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.file-chip { display: inline-block; padding: 6px 10px; background: var(--neutral-soft); border-radius: var(--radius-sm); font-size: 12px; }
.attention-chip { background: var(--warn-soft); color: var(--warn-text); height: 22px; font-size: 12px; }
.urgent-chip { background: var(--danger-soft); color: var(--danger); height: 22px; font-size: 12px; }
.markup-canvas { display: block; max-width: 100%; margin: 12px 0; border: 1px solid var(--border); border-radius: 4px; touch-action: none; cursor: crosshair; }
.cols-tasks { grid-template-columns: 1fr 2fr 80px 110px; }

/* ---------- Milestone 7: parts ---------- */
.part-extra { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 2px 0 6px; border-bottom: 1px solid var(--row-border); }
.part-extra .chip { height: 20px; font-size: 11px; }
.tire-edit summary { cursor: pointer; color: var(--primary); }
.tire-edit form { margin-top: 6px; }
.from-stock { margin-top: 6px; }
.order-grid { grid-template-columns: minmax(220px, 3fr) 150px 140px 90px 140px 120px; }

/* ---------- Milestone 8 ---------- */
.job-clock { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.job-clock .chip { height: 22px; font-size: 11px; }

/* ---------- Milestone 9: spec library ---------- */
.spec-confirm { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.confirm-box { border-radius: var(--radius); padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.confirm-box.needed { background: var(--warn-soft); border: 1px solid var(--warn); }
.confirm-box.ok { background: var(--ok-soft); }
.confirm-box form.inline { display: inline; margin: 0; }
.spec-group { border-top: 1px solid var(--row-border); padding: 10px 0; }
.spec-group-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.spec-group-head .placeholder-btn { font-size: 12px; padding: 2px 8px; }
.held { background: var(--card-2); padding: 6px 8px; border-radius: 4px; }
.spec-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed var(--row-border); }
.spec-row.similar { opacity: .6; }
.spec-row form.inline { display: inline; margin: 0; }
.spec-name { min-width: 140px; color: var(--muted); font-size: 13px; }
.spec-value .chip { height: 20px; font-size: 11px; }
.conflict-values { width: 100%; color: var(--warn-text); }
.add-spec summary { cursor: pointer; color: var(--primary); }
.add-spec form { margin-top: 8px; }
.ro-side .form-grid.four { grid-template-columns: 1fr 1fr; }

/* ---------- Milestone 10: reports and overview ---------- */
.report-nav .menu-group-label { padding: 10px 12px 4px; }
.saved-row { display: flex; align-items: center; justify-content: space-between; }
.saved-row form.inline { margin: 0; }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.report-table tfoot td { font-weight: 700; border-top: 2px solid var(--text); }
.report-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-3 .card + .card { margin-top: 0; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.bar { height: 10px; background: var(--neutral-soft); border-radius: 5px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--primary); }
.bar-num { text-align: right; }
@media print {
  .topbar, .sidemenu, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .reports-layout { display: block; }
  .card, .table-card { box-shadow: none; }
}

/* ---------- Phones and small tablets ---------- */
@media (max-width: 900px) {
  .page-head { padding: 16px 16px 0; }
  .page-body { padding: 16px 16px 40px; }
  .flash { margin: 12px 16px 0; }
  .grid-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { display: flex; overflow-x: auto; padding: 0; }
  .settings-nav a { white-space: nowrap; }
  .row-form, .cols-zone, .cols-label, .cols-appt, .cols-cat { grid-template-columns: 1fr 1fr; }
  .row-form.head { display: none; }
  .row-form .wide { grid-column: 1 / -1; }
  .brand-name { display: none; }
  .search { flex: 1; }
  .topbar { gap: 8px; padding: 0 8px; }
  .profile-layout { grid-template-columns: minmax(0, 1fr); }
  .ro-layout { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 120px; }
  .ro-side { position: static; max-height: none; }
  .ro-head { padding: 12px 16px 0; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .labor-grid, .part-grid, .sublet-grid, .fee-grid, .canned-grid, .cols-markup, .order-grid { grid-template-columns: 1fr 1fr; }
  .line-head { display: none; }
  .line-row > input:first-of-type:not([type=hidden]) { grid-column: 1 / -1; }
  .totals-bar { padding: 8px 12px; gap: 10px; font-size: 13px; }
  .board { grid-template-columns: repeat(3, 85vw); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .cal-grid.cols-7 { overflow-x: auto; grid-template-columns: 50px repeat(7, 120px); }
  .form-grid.four { grid-template-columns: 1fr 1fr; }
  table.data .small { min-width: 140px; }
}
@media (max-width: 520px) {
  .search { display: none; }
  .feature-list { grid-template-columns: minmax(0, 1fr); }
}

/* Phase 2: quantity-from-spec rule on canned part lines */
.qty-rule { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; color: var(--muted, #607080); padding: 2px 0 6px 70px; }
.qty-rule label { display: flex; align-items: center; gap: 6px; }
.qty-rule input[type=text] { width: 70px; }
.quick-jobs { margin-top: 14px; border-top: 1px solid var(--border, #dde3e8); padding-top: 12px; }
.quick-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.quick-head input[type=search] { margin-left: auto; max-width: 240px; }
.quick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; margin-bottom: 8px; }

/* Phase 2: Parts Lookup, Paste from RockAuto, RockAuto order list */
.lookup-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lookup-vehicle form.inline { display: inline; margin-left: 8px; }
.engine-list form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 0 10px 8px 0; }
.node-list, .fav-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.lookup-results { display: grid; gap: 0; }
.lookup-row { display: grid; grid-template-columns: 84px 150px 120px minmax(160px, 1fr) 110px 330px; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--row-border); }
.lookup-row.lookup-head { font-size: 12px; color: var(--muted); font-weight: 600; }
.lookup-row.oe { background: var(--ok-soft); }
.lookup-row.oe-supplier { background: var(--ok-soft); }
.lookup-add { display: flex; gap: 6px; align-items: center; }
.lookup-add select { max-width: 170px; }
.lookup-add .qty { width: 52px; }
.paste-row { display: grid; grid-template-columns: 50px 140px 140px minmax(160px, 1fr) 70px 100px; gap: 8px; align-items: center; margin-bottom: 6px; }
.order-row { display: grid; grid-template-columns: 50px 80px minmax(200px, 1fr) 50px 100px 140px 140px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--row-border); }
.order-row.changed { background: var(--warn-soft); }
.warn-text { color: #a15c00; }
.size-list { display: flex; flex-wrap: wrap; gap: 6px; }
.size-list form.inline { display: inline; }
button.linkish { background: none; border: 0; padding: 0 0 0 4px; cursor: pointer; color: var(--muted); }
@media (max-width: 900px) {
  .lookup-row, .paste-row, .order-row { grid-template-columns: 1fr 1fr; }
  .lookup-row.lookup-head, .order-row.line-head, .paste-row.line-head { display: none; }
}
/* Phase 2: vehicle info sidebar and Add specs form */
.vehicle-info { margin-bottom: 14px; }
.vi-section { margin-top: 8px; }
.vi-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.vi-row { display: grid; grid-template-columns: minmax(120px, 45%) 1fr; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--row-border); font-size: 13px; }
.vi-row.unverified .vi-value strong { color: var(--muted); font-weight: 500; }
.vi-value form.inline { display: inline; }
.vi-placard { margin-top: 10px; }
.placard-thumb { max-width: 220px; max-height: 140px; border: 1px solid var(--border); border-radius: 4px; display: block; margin-bottom: 6px; }
.fill-section h2 { margin-top: 16px; }
.fill-row { display: grid; grid-template-columns: 260px minmax(160px, 1fr) 90px; gap: 8px; align-items: center; margin-bottom: 6px; }
@media (max-width: 700px) { .fill-row { grid-template-columns: 1fr 1fr; } .fill-row label { grid-column: 1 / -1; } }

/* ---- Phase 3 ---- */
.card .flash { margin: 12px 0; }
.form-grid .field.wide { grid-column: 1 / -1; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; background: var(--bg); padding: 1px 4px; border-radius: 4px; word-break: break-all; }

/* Clock status dot: green clocked in, yellow on break, red clocked out */
.avatar { position: relative; }
.clock-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: #ef4444; }
.avatar .clock-dot { position: absolute; right: -2px; bottom: -2px; }
.clock-dot.inline { border-color: transparent; vertical-align: middle; margin-right: 6px; width: 10px; height: 10px; }
.clock-dot.clock-IN { background: #22c55e; }
.clock-dot.clock-BREAK { background: var(--warn); }
.clock-dot.clock-OUT { background: #ef4444; }
.clock-line { margin-top: 6px; }
/* Quick + menu */
.quick-add { position: relative; }
.quick-add summary { list-style: none; cursor: pointer; }
.quick-add summary::-webkit-details-marker { display: none; }
.quick-add-panel { position: absolute; right: 0; top: 44px; min-width: 220px; padding: 6px; z-index: 60; }
/* Remembered filters, undo, shortcuts */
.filters-note { display: flex; align-items: center; gap: 8px; margin: 14px 32px -4px; font-size: 13px; color: var(--faint); }
.filters-note a { font-weight: 500; }
.flash .undo-form { margin-left: 12px; display: inline; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--row-border); border-bottom-width: 2px;
  border-radius: 4px; font-family: inherit; font-size: 12px; text-align: center; background: var(--bg); }
.shortcuts-dialog { position: relative; border: 0; border-radius: var(--radius); padding: 20px 24px; max-width: 360px; box-shadow: var(--shadow-pop); background: var(--card); color: var(--text); }
.shortcuts-dialog .dialog-close { position: absolute; right: 10px; top: 10px; margin: 0; }
.shortcuts-dialog .dialog-close button, .placeholder-dialog .dialog-close button { display: inline-flex; padding: 6px; border-radius: var(--radius-sm); }
.shortcuts-dialog::backdrop { background: rgba(15, 23, 42, .4); }
@media (max-width: 720px) { .filters-note { margin: 8px 16px 0; } }
/* Search dropdown */
form.search { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); max-height: 70vh; overflow-y: auto; z-index: 70; padding: 6px; min-width: 320px; }
.suggest-group { padding: 8px 14px 4px; font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.suggest-item { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.suggest-item .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item .s { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-item:hover, .suggest-item.active { background: var(--neutral-soft); text-decoration: none; }
.suggest-item.all { border-top: 1px solid var(--row-border); margin-top: 4px; color: var(--primary, #1565c0); }
.suggest-empty { padding: 10px 14px; color: var(--muted); font-size: 14px; }

/* ---------- Phase 3, step 4: display modes (My profile > Display) ---------- */
@media screen {
  /* Dark */
  :root[data-display="dark"] {
    --topbar: #0f172a; --topbar-search: #1e293b;
    --primary: #60a5fa; --primary-dark: #93c5fd; --primary-soft: #172554;
    --bg: #0b1220; --card: #111a2b; --card-2: #0f172a; --text: #e2e8f0; --muted: #94a3b8; --faint: #94a3b8;
    --border: #334155; --line: #1f2a3d; --row-border: #1a2436; --neutral-soft: #1e293b; --text-2: #cbd5e1; --well: #1e293b; --well-line: #2c3a50;
    --danger: #fca5a5; --danger-soft: #3f1d1d; --ok: #86efac; --ok-soft: #14301f; --warn: #fbbf24; --warn-text: #fcd34d; --warn-soft: #3b2a0b;
    --placeholder: #64748b; --shadow: none; --shadow-pop: 0 8px 24px rgba(0, 0, 0, .5);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
  [data-display="dark"] .btn.primary { color: #0b1220; }
  [data-display="dark"] input, [data-display="dark"] select, [data-display="dark"] textarea,
  [data-display="dark"] input[type=color], [data-display="dark"] .tick { background-color: #0f172a; color: var(--text); }
  [data-display="dark"] .rate:has(input:checked), [data-display="dark"] .btn.primary { color: #0b1220; }
  [data-display="dark"] .rate:has(input:checked).rate-good, [data-display="dark"] .tick.on { background: #22c55e; }
  [data-display="dark"] .muted-card, [data-display="dark"] .held, [data-display="dark"] .cal-cell.other,
  [data-display="dark"] .line-row.add input { background: #0f172a; }
  [data-display="dark"] .board-col { background: #182027; }
  [data-display="dark"] .appt, [data-display="dark"] .appt-line { background: #1d3247; }
  [data-display="dark"] .cal-day.is-today { background: #1a232b; }
  [data-display="dark"] .chip.off, [data-display="dark"] .part-status { background: #2b353f; color: var(--text); }
  [data-display="dark"] .chip.ph, [data-display="dark"] .placeholder-btn { background: #232c35; color: var(--muted); }
  [data-display="dark"] .chip.warn, [data-display="dark"] .confirm-box.needed, [data-display="dark"] .order-row.changed { background: #3a2f17; color: #ffd27a; }
  [data-display="dark"] .lookup-row.oe, [data-display="dark"] .lookup-row.oe-supplier { background: #1c3322; }
  [data-display="dark"] .label-select option { background: #1c242c; color: var(--text); }
  [data-display="dark"] .sig, [data-display="dark"] .sig-pad { background: #fff; }

  /* Sunlight: black on white, bigger and bolder, for a screen used outdoors */
  :root[data-display="sunlight"] {
    --bg: #ffffff; --card: #ffffff; --card-2: #f3f4f6; --text: #000000; --muted: #1f2937; --faint: #1f2937;
    --border: #111827; --line: #111827; --row-border: #9ca3af; --neutral-soft: #e5e7eb; --text-2: #000000; --well: #e5e7eb; --well-line: #6b7280;
    --primary: #0b3fb3; --primary-dark: #082f86; --primary-soft: #dbe7ff;
    --danger: #8b0000; --ok: #14532d; --warn: #7c2d12; --warn-text: #7c2d12;
    --shadow: none; --ctl-h: 48px;
  }
  [data-display="sunlight"] .card, [data-display="sunlight"] .table-card, [data-display="sunlight"] .row-list { border-width: 2px; }
  [data-display="sunlight"] body { font-size: 18px; font-weight: 500; }
  [data-display="sunlight"] .small, [data-display="sunlight"] .hint { font-size: 15px; }
  [data-display="sunlight"] h1 { font-size: 30px; }
  [data-display="sunlight"] .btn { font-size: 17px; border-width: 2px; }
  [data-display="sunlight"] .btn.small { height: 42px; font-size: 16px; }
  [data-display="sunlight"] input:not([type=checkbox]):not([type=radio]):not([type=file]), [data-display="sunlight"] select, [data-display="sunlight"] textarea { border-width: 2px; min-height: 46px; font-size: 17px; }
  [data-display="sunlight"] .check input[type=checkbox] { border: 2px solid #111827; }
  [data-display="sunlight"] table.data th { color: #000; }
  [data-display="sunlight"] .chip { font-size: 15px; height: 30px; border: 1px solid #111827; }
  [data-display="sunlight"] a { text-decoration: underline; }
  [data-display="sunlight"] .btn, [data-display="sunlight"] .tab, [data-display="sunlight"] .menu-link,
  [data-display="sunlight"] .suggest-item, [data-display="sunlight"] .brand { text-decoration: none; }
}

/* ---------- Tablet pass: bigger tap targets on any touch screen (Surface Go, phone) ---------- */
@media (any-pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; padding: 0 14px; }
  input, select { min-height: 44px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; }
  .check input[type=checkbox] { width: 44px; height: 26px; }
  .check input[type=checkbox]::after { width: 22px; height: 22px; }
  .check input[type=checkbox]:checked::after { transform: translateX(18px); }
  .check { padding: 10px 0; }
  .tick { width: 44px; height: 44px; font-size: 18px; }
  .rate { padding: 10px 16px; font-size: 15px; }
  .job-clock .btn, .job-clock button { min-height: 44px; }
  .user-menu-panel a, .user-menu-panel button, .quick-add-panel a, .quick-add-panel button { padding: 14px 18px; }
  .stops li { padding-top: 12px; padding-bottom: 12px; }
  .menu-link { padding-top: 14px; padding-bottom: 14px; }
  .suggest-item { padding: 12px 14px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .part-status { height: 36px; font-size: 14px; }
  .placeholder-btn { min-height: 44px; }
}
.display-switch { display: flex; gap: 2px; margin: 4px 0; padding: 3px; background: var(--neutral-soft); border-radius: 10px; }
.user-menu-panel .display-switch button { flex: 1; justify-content: center; width: auto; padding: 6px 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.user-menu-panel .display-switch button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
/* Filter dropdowns sit side by side instead of one per row */
.filter-bar select { width: auto; flex: 0 1 auto; max-width: 100%; }
@media (max-width: 520px) { .filter-bar select { flex: 1 1 100%; } }
/* Notifications bell */
.bell-menu { position: relative; }
.bell-menu summary { list-style: none; cursor: pointer; }
.bell-menu summary::-webkit-details-marker { display: none; }
.bell-menu .badge-count { color: #fff; }
.bell-panel { position: absolute; right: 0; top: 44px; width: 350px; max-height: 70vh; overflow-y: auto; z-index: 60; padding: 6px; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bell-item { display: block; padding: 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.bell-item .t { display: block; }
.bell-item .s { display: block; font-size: 12px; color: var(--muted); }
.bell-item.unread .t { font-weight: 700; }
.bell-item.unread { background: var(--primary-soft); }
.bell-item.unread:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--neutral-soft)); }
.bell-item:hover { background: var(--neutral-soft); text-decoration: none; }
.bell-item.all { color: var(--primary); border-bottom: 0; }
tr.unread td a { font-weight: 700; }
@media (max-width: 520px) { .bell-panel { position: fixed; left: 8px; right: 8px; width: auto; top: 52px; } }
/* Customer alert banner */
.customer-alert { margin: 10px 0; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 15px; }
.customer-alert.info { background: var(--primary-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--primary); }
.customer-alert.warn { background: var(--warn-soft); color: #6b3d00; box-shadow: inset 3px 0 0 var(--warn); }
[data-display="dark"] .customer-alert.warn { background: #3a2f17; color: #ffd27a; }
.page-head .customer-alert { margin: 8px 0 0; }

/* ---- Phase 3, step 6: follow-ups, messages, warranty ---- */
input.narrow { width: 90px; flex: 0 0 auto; }
.warranty-edit { display: inline-block; margin-left: 6px; }
.warranty-edit summary { cursor: pointer; list-style: none; display: inline; }
.warranty-edit summary::-webkit-details-marker { display: none; }
.warranty-edit[open] { display: block; margin-top: 6px; }
.follow-list { display: grid; gap: 10px; }
.follow-card { padding: 12px 14px; }
.follow-card.overdue { box-shadow: inset 3px 0 0 var(--warn); }
.follow-head { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: flex-start; }
.follow-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.follow-forms { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 8px; }
.follow-forms .inline-form input[type=text] { flex: 1 1 160px; }
.contact-log { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.contact-log li { padding: 3px 0; border-top: 1px solid var(--row-border); }
.message-text { width: 100%; font: inherit; font-size: 16px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.narrow-page { max-width: 760px; }
.tab-tools { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.comeback-pick { margin: 14px 0; padding: 10px 14px; background: var(--primary-soft); border-radius: var(--radius); }
.comeback-pick select { max-width: 100%; }
.template-form { margin-bottom: 14px; }
.template-form label { display: block; font-weight: 500; margin-bottom: 4px; }
.template-form textarea { width: 100%; font: inherit; }
tr.overdue td:first-child { border-left: 3px solid var(--warn); }

/* ---- Phase 3, step 7: weather, cores, expenses ---- */
.wx { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; min-height: 0; margin-top: 2px; }
.wx:empty { display: none; }
.wx.compact { font-size: 12px; }
.wx-icon { font-size: 15px; line-height: 1; }
.wx-temp { font-weight: 500; }
.wx-pop { color: var(--primary); }
.wx-dot { background: var(--warn); color: #000; border-radius: 50%; width: 15px; height: 15px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.wx-flag { font-size: 11px; padding: 1px 6px; }
.wx-strip:empty { display: none; }
.wx-strip { margin: 0 0 12px; }
.wx-dayline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.wx-hours { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.wx-hour { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 6px 4px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); }
.wx-hour.flagged { border-color: var(--warn); }
.wx-stop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.wx-stop:empty { display: none; }
.wx-week { display: flex; flex-wrap: wrap; gap: 8px; }
.wx-daycard { display: flex; flex-direction: column; gap: 2px; padding: 8px; min-width: 110px; border: 1px solid var(--border); border-radius: var(--radius); }
.core-edit { margin-top: 8px; }
.core-edit summary { list-style: none; display: inline-block; }
.core-edit summary::-webkit-details-marker { display: none; }
.core-edit[open] form { margin-top: 8px; }

/* ---- Phase 4: settings sections ---- */
.settings-cards { min-width: 0; }
.card-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.card-jump a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 500; }
.card-jump a:hover { border-color: var(--primary); text-decoration: none; }
.settings-group { scroll-margin-top: 72px; margin-bottom: 18px; }
.settings-group > .card + .card, .settings-group > .card + div { margin-top: 12px; }
.side-panel { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(620px, 100%); max-width: 100%; padding: 0; border: 0;
  border-left: 1px solid var(--line); background: var(--bg); color: var(--text); box-shadow: -12px 0 32px rgba(15, 23, 42, .16); }
.side-panel[open] { animation: panel-in .2s ease-out; }
@keyframes panel-in { from { transform: translateX(24px); opacity: .6; } }
.side-panel::backdrop { background: rgba(15, 23, 42, .3); }
.side-panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); }
.side-panel-title { font-size: 17px; }
.side-panel-head .spacer { flex: 1; }
.side-panel-body { padding: 16px; }
.side-panel-body > .page-body { padding: 0; }
.side-panel-close { width: 36px; padding: 0; }
.side-panel-body .page-body > p:first-child:has(> a:only-child) { display: none; }

/* ---------- Today ---------- */
.today-date { font-size: 18px; margin: 0 0 12px; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 28px; align-items: start; }
.today-grid > .card { margin: 0; }
.today-grid .card h2 { margin: 0; font-size: 16px; }
.today-grid .head-row { margin-bottom: 8px; }
.today-stops { grid-row: span 2; }
.today-list { list-style: none; margin: 0; padding: 0; }
.today-list li { padding: 8px 0; border-top: 1px solid var(--row-border); }
.today-list li:first-child { border-top: 0; }
@media print { body { padding-left: 0 !important; } }

/* ---------- Customer workspace: vehicle chips and the Vehicle tab ---------- */
.vehicle-chips { padding: 0 0 12px; }
.vehicle-chips .chip { background: var(--bg); color: var(--text); border: 1px solid var(--border); text-decoration: none; }
.vehicle-chips .chip:hover { border-color: var(--primary); }
.vehicle-chips .chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.vehicle-head h2 { margin: 0 0 4px; font-size: 18px; }
.vehicle-head .facts { grid-template-columns: repeat(auto-fill, minmax(80px, 110px) minmax(160px, 1fr)); }
.vehicle-tabs { margin: 16px 0 12px; border-bottom: 1px solid var(--border); }
.profile-layout.vehicle-mode { grid-template-columns: 240px minmax(0, 1fr); }
@media (max-width: 900px) { .profile-layout.vehicle-mode { grid-template-columns: minmax(0, 1fr); } }
/* Phones: wide tables inside cards scroll sideways instead of widening the page. */
@media (max-width: 700px) { .card table { display: block; overflow-x: auto; } }
/* Phones: on the Vehicle tab the customer card shrinks to the name and buttons so the vehicle shows first. */
@media (max-width: 900px) { .vehicle-mode > .profile-card .facts, .vehicle-mode > .profile-card .profile-avatar, .vehicle-mode > .profile-card .chips { display: none; } }

/* ---------- Small spacing and width helpers (instead of one-off inline styles) ---------- */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 20px; }
.m-0 { margin: 0; } .mb-2 { margin-bottom: 12px; } .flat { box-shadow: none; }
input.w-xs, select.w-xs, .w-xs { max-width: 76px; } input.w-sm, select.w-sm, .w-sm { max-width: 96px; } input.w-md, select.w-md, .w-md { max-width: 124px; }
/* Phones: the totals bar shows the total, what's approved and the buttons; the breakdown is on the job cards */
@media (max-width: 700px) {
  .totals-bar { gap: 6px 12px; padding: 10px 16px; }
  .totals-bar > span:not(.grand):not(.muted):not(.spacer) { display: none; }
  .totals-bar .placeholder-btn { height: 32px; padding: 0 10px; font-size: 13px; }
}
.page-body > .flash { margin: 0 0 16px; }
.lookup-search .inline-form .btn { min-width: 190px; }
/* Parts Lookup pictures: a thumbnail per result that opens the part's pictures and details in the side panel */
.lookup-pic a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; }
.lookup-pic img { width: 76px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.lookup-pic a:hover img { border-color: var(--primary); }
.pic-none { display: flex; align-items: center; justify-content: center; width: 76px; height: 64px; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); color: var(--faint); font-size: 11px; text-align: center; }
.pic-more { font-size: 12px; font-weight: 600; color: var(--primary); }
.pic-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pic-gallery img { width: 100%; height: 150px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pic-gallery a:first-child { grid-column: 1 / -1; }
.pic-gallery a:first-child img { height: 300px; }
.spec-facts { grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); }
.lookup-pic { display: flex; flex-direction: column; align-items: center; }

/* ---- Website & booking plan, step 1 ---- */

/* New booking requests: a count on Schedule in the side menu and on its Requests tab */
.menu-link { position: relative; }
.menu-badge { top: 4px; right: 10px; color: #fff; }
@media (min-width: 900px) { .menu-badge { right: 12px; } }
.tab .tab-badge { position: static; display: inline-block; margin-left: 6px; color: #fff; vertical-align: 1px; }

/* Parts Lookup cart */
.cart-tick { gap: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.lookup-row:has([data-cart-tick]:checked) { box-shadow: inset 3px 0 0 var(--primary); }
.cart-bar { position: sticky; bottom: 12px; z-index: 30; margin-top: 16px; background: var(--card); border: 1px solid var(--primary);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 10px 14px; }
.cart-bar[hidden] { display: none; }
.cart-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.cart-list { flex: 1 1 320px; min-width: 0; }
.cart-list summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; padding: 4px 0; }
.cart-list summary::-webkit-details-marker { display: none; }
.cart-list summary .i { color: var(--primary); }
.cart-list[open] .cart-hint { visibility: hidden; }
.cart-total { font-weight: 600; font-variant-numeric: tabular-nums; }
.cart-rows { display: grid; gap: 4px; margin: 8px 0 4px; max-height: 40vh; overflow-y: auto; }
.cart-row { display: grid; grid-template-columns: minmax(0, 1fr) 60px 90px 32px; gap: 8px; align-items: center; padding: 4px 0; border-top: 1px solid var(--row-border); }
.cart-row .qty { width: 60px; }
.cart-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cart-actions select { max-width: 220px; }

/* Estimate: one Save for every changed row */
.estimate-tab.batch-on .row-save { display: none; }
.estimate-tab .changed { border-color: var(--primary); background: var(--primary-soft); }
.estimate-tab .changed-total { color: var(--primary-dark); }
.save-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: var(--card); border-top: 2px solid var(--primary); box-shadow: 0 -6px 18px rgba(15, 23, 42, .12); }
.save-bar[hidden] { display: none; }
.save-count { font-weight: 600; }
.save-bar .spacer { flex: 1; }
@media (min-width: 900px) { .save-bar { left: 80px; } }
@media (max-width: 640px) { .save-bar { padding: 10px 12px; gap: 8px; } .save-delta { display: none; } }
.set-all { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.canned-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.canned-quick .btn .i { width: 14px; height: 14px; color: var(--warn); }
.job-actions form { display: inline; }
body.save-pending .totals-bar { display: none; }
@media (max-width: 760px) {
  .lookup-add { grid-column: 1 / -1; flex-wrap: wrap; }
  .lookup-add select { flex: 1 1 160px; max-width: none; }
  .cart-row { grid-template-columns: minmax(0, 1fr) 56px 76px 32px; }
}

/* ---- Website & booking plan, step 2: booking requests ---- */
.d-block { display: block; }
.pre { white-space: pre-wrap; }
.clip-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer; }
.pick-row:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pick-row > input { margin-top: 3px; flex: none; }
.pick-body { min-width: 0; flex: 1; }
.pick-body .chip { margin-left: 4px; }
.pick-body .customer-alert { margin-top: 8px; }
.request-page .facts { font-size: 15px; }
.approve-form .card + .card, .request-page > .card + .card, .request-page > form + .card, .request-page > form.card { margin-top: 16px; }
.slot-preview { display: grid; gap: 6px; }
.slot-day { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.slot-day strong { width: 80px; }
