/* ============================================================
   RHM Stock Manager - admin UI
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --ink: #1f2937;
  --ink-soft: #374151;
  --ink-mute: #6b7280;
  --ink-faint: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #f1f3f5;

  /* App-wide default = core DealerOS blue. Per-tenant colours (e.g. an
     rhm brown) are applied at runtime by dealeros.js when that tenant is
     active; the pre-login / sign-in screens stay neutral DealerOS blue. */
  --brand: #3a93f0;
  --brand-dark: #1f63d6;
  --brand-light: #5fb8ff;
  --brand-soft: #eaf3fe;
  --gold: #d4a24c;

  --blue: #3b82f6;
  --blue-soft: #dbeafe;
  --green: #10b981;
  --green-soft: #d1fae5;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --red: #ef4444;
  --red-soft: #fee2e2;

  --shadow-sm: 0 1px 2px rgba(20, 24, 39, 0.06);
  --shadow: 0 1px 3px rgba(20, 24, 39, 0.06), 0 4px 14px rgba(20, 24, 39, 0.06);
  --shadow-lg: 0 8px 24px rgba(20, 24, 39, 0.12);

  --radius: 8px;
  --radius-lg: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; padding: 0; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------- Top bar (brand colour) ---------- */
.topbar {
  background: var(--brand);
  color: #fff;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-search {
  width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 12px;
}
.topbar-search input {
  background: transparent;
  border: 0;
  outline: none;
  color: #fff;
  flex: 1;
  font-size: 0.9rem;
}
.topbar-search input::placeholder { color: rgba(255, 255, 255, 0.7); }
.topbar-search svg { width: 16px; height: 16px; color: rgba(255, 255, 255, 0.85); }

.topbar-add {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  transition: background 0.15s var(--ease);
}
.topbar-add:hover { background: rgba(255, 255, 255, 0.25); }
.topbar-add svg { width: 18px; height: 18px; }

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.topbar-logo-mark {
  background: var(--gold);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.topbar-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.topbar-logo-text strong { font-size: 0.94rem; font-weight: 700; letter-spacing: 0.04em; }
.topbar-logo-text small { font-size: 0.62rem; opacity: 0.85; letter-spacing: 0.12em; font-weight: 500; margin-top: 3px; }
/* Image-logo tenants (DealerOS demo): real brand logo in the topbar / login */
.topbar-logo-img { height: 40px; width: auto; display: block; }
.login-card-logo-img { height: 40px; width: auto; display: block; margin: 0 auto; background: var(--brand); padding: 12px 20px; border-radius: 14px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.topbar-bell {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 0.15s var(--ease);
}
.topbar-bell:hover { background: rgba(255, 255, 255, 0.15); }
.topbar-bell svg { width: 18px; height: 18px; }
.topbar-bell .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--red);
  color: #fff;
  border-radius: 9px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.15s var(--ease);
}
.topbar-user:hover { background: rgba(255, 255, 255, 0.18); }
.topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.78rem;
}
.topbar-user-name { font-size: 0.88rem; font-weight: 500; }
.topbar-user svg { width: 12px; height: 12px; opacity: 0.7; }

/* ---------- Tab nav (white sub-bar) ---------- */
.tabnav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: 56px;
  z-index: 49;
}
.tabnav::-webkit-scrollbar { display: none; }

.tabnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-mute);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
  margin-bottom: -1px;
}
.tabnav a:hover { color: var(--ink); }
.tabnav a.is-active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.tabnav a svg { width: 16px; height: 16px; opacity: 0.75; }
.tabnav a.is-active svg { opacity: 1; color: var(--brand); }

.tabnav-badge {
  background: var(--red);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
}

.tabnav-more {
  width: 38px;
  height: 38px;
  display: none;
  place-items: center;
  color: var(--ink-mute);
  margin-left: 2px;
  border-radius: 8px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tabnav-more:hover { background: var(--surface-soft); color: var(--ink); }
.tabnav-more.open { background: var(--surface-soft); color: var(--brand); }
.tabnav-more svg { width: 20px; height: 20px; }

/* Overflow dropdown holding tabs that don't fit on the bar */
.tabnav-overflow {
  position: fixed;
  display: none;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 210px;
  max-height: 72vh;
  overflow-y: auto;
  z-index: 60;
}
.tabnav-overflow.open { display: flex; }
.tabnav-overflow a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-mute);
  white-space: nowrap;
  border-bottom: 0;
}
.tabnav-overflow a:hover { background: var(--surface-soft); color: var(--ink); }
.tabnav-overflow a.is-active { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }
.tabnav-overflow a svg { width: 16px; height: 16px; opacity: 0.8; }
.tabnav-overflow a.is-active svg { opacity: 1; color: var(--brand); }

/* Grouped parent tab (opens a dropdown of related pages) */
.tab-group { cursor: pointer; }
.tab-group .tab-caret { width: 13px !important; height: 13px !important; opacity: 0.5; margin-left: -3px; }
.tab-group.is-active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.tab-group.is-active svg:first-of-type { opacity: 1; color: var(--brand); }
.tab-group.is-active .tab-caret { opacity: 0.85; color: var(--ink-mute); }

/* ---------- Page shell ---------- */
.page {
  padding: 24px 28px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 20px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.page-head .count {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-soft); border-color: var(--ink-faint); }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #0e9974; color: #fff; border-color: #0e9974; }

.btn-blue { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-blue:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-mute); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg { padding: 12px 20px; font-size: 0.95rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ---------- Vehicle row list ---------- */
.list-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.vehicle-row {
  display: grid;
  grid-template-columns: 200px 1fr auto auto auto;
  gap: 24px;
  padding: 18px 22px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s var(--ease);
  cursor: pointer;
}
.vehicle-row:last-child { border-bottom: 0; }
.vehicle-row:hover { background: var(--surface-soft); }

.vehicle-thumb {
  width: 100%;
  height: 110px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
}
.vehicle-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vehicle-thumb-watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(166, 85, 43, 0.04);
  color: var(--brand);
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  opacity: 0.4;
}
.vehicle-info-title {
  color: var(--blue);
  font-weight: 600;
  font-size: 1.02rem;
  margin: 0 0 6px;
  line-height: 1.3;
}
.vehicle-info-title:hover { text-decoration: underline; }
.vehicle-info-meta {
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.vehicle-info-tags {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.reg-plate {
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #d97706;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-mute);
  font-size: 0.84rem;
  font-weight: 500;
}
.key-chip svg { width: 14px; height: 14px; }

.status-pills {
  display: flex;
  gap: 8px;
}
.status-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  position: relative;
}
.status-pill.is-done { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.status-pill svg { width: 14px; height: 14px; }
.status-pill-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
  margin-top: 2px;
}

.vehicle-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-mute);
  font-size: 0.92rem;
}
.vehicle-location svg { width: 14px; height: 14px; }

.vehicle-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  min-width: 100px;
}
.vehicle-price.tbc { color: var(--ink-faint); font-weight: 500; }

.vehicle-row-menu {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-mute);
  transition: background 0.15s var(--ease);
}
.vehicle-row-menu:hover { background: var(--bg); color: var(--ink); }

@media (max-width: 1000px) {
  .vehicle-row { grid-template-columns: 140px 1fr auto; gap: 16px; padding: 14px 16px; }
  .vehicle-thumb { height: 90px; }
  .status-pills, .vehicle-location { display: none; }
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-mute);
}
.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
}
.empty-state-icon svg { width: 36px; height: 36px; }
.empty-state h2 { font-size: 1.2rem; margin: 0 0 8px; color: var(--ink); font-weight: 600; }
.empty-state p { margin: 0 0 24px; max-width: 380px; margin-left: auto; margin-right: auto; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.5);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.modal-backdrop.is-open { display: flex; opacity: 1; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.97);
  transition: transform 0.2s var(--ease);
}
.modal-backdrop.is-open .modal { transform: scale(1); }
.modal.small { max-width: 480px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--ink-mute);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-footer-actions { display: flex; gap: 10px; }

.modal-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--green-soft);
  color: #065f46;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  position: relative;
}
.modal-alert svg { width: 20px; height: 20px; color: var(--green); flex-shrink: 0; margin-top: 1px; }
.modal-alert p { margin: 0; font-size: 0.9rem; line-height: 1.5; }
.modal-alert-close {
  margin-left: auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #065f46;
  opacity: 0.6;
}
.modal-alert-close:hover { opacity: 1; }

/* ---------- Step indicator ---------- */
.modal-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.modal-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-faint);
  position: relative;
}
.modal-step:not(:last-child)::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
  margin-left: 8px;
}
.modal-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--line);
  color: var(--ink-faint);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.modal-step.is-active { color: var(--brand); }
.modal-step.is-active .modal-step-num { background: var(--brand); color: #fff; border-color: var(--brand); }
.modal-step.is-done { color: var(--green); }
.modal-step.is-done .modal-step-num { background: var(--green); color: #fff; border-color: var(--green); }
.modal-step.is-done::after { background: var(--green); }

/* ---------- Forms ---------- */
.form-section { margin-bottom: 28px; }
.form-section:last-child { margin-bottom: 0; }
.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.form-section-help {
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin: 0 0 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row.single { grid-template-columns: 1fr; }
.form-row > .field.full { grid-column: 1 / -1; }
@media (max-width: 540px) {
  .form-row { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-mute);
}
.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--ink);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
  width: 100%;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(166, 85, 43, 0.12);
}
.field input.reg-input {
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  border-color: #d97706;
}
.field input.reg-input::placeholder { color: rgba(31, 41, 55, 0.4); letter-spacing: 0.04em; }
.field-help { font-size: 0.74rem; color: var(--ink-faint); margin-top: 2px; }

.field-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--line);
  border-radius: 999px;
  transition: background 0.2s var(--ease);
  cursor: pointer;
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle.is-on { background: var(--brand); }
.toggle.is-on::after { transform: translateX(16px); }
.field-toggle label { color: var(--ink-soft); font-weight: 500; font-size: 0.92rem; cursor: pointer; }

.field-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  cursor: pointer;
}
.field-checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.field-checkbox label { color: var(--ink-soft); font-size: 0.92rem; cursor: pointer; }

/* ---------- Success state in modal ---------- */
.success-state {
  text-align: center;
  padding: 32px 20px;
}
.success-state-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid var(--green);
  color: var(--green);
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
}
.success-state-icon svg { width: 44px; height: 44px; }
.success-state h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
}
.success-state .reg-plate { display: inline-block; margin-bottom: 16px; font-size: 0.95rem; padding: 6px 14px; }
.success-state-vehicle {
  font-size: 0.94rem;
  color: var(--ink-soft);
  margin-bottom: 26px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}
.success-state-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ---------- Vehicle detail page ---------- */
.detail-shell {
  padding: 0;
}
.detail-actions-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.detail-actions-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.9rem;
}
.detail-actions-back svg { width: 16px; height: 16px; }
.detail-actions-back:hover { color: var(--brand); }

.detail-actions-title {
  flex: 1;
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin: 0 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-actions-buttons { display: flex; gap: 6px; }

.detail-hero {
  background: linear-gradient(135deg, var(--ink) 0%, #374151 100%);
  color: #fff;
  padding: 36px 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}
.detail-hero-reg { font-size: 1.1rem; padding: 8px 16px; }
.detail-hero-info h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.detail-hero-meta {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.8);
}
.detail-hero-price-block {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.detail-hero-price {
  font-size: 2rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.detail-hero-price-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--amber);
}
.detail-hero-tags { display: flex; gap: 6px; font-size: 0.78rem; }
.detail-hero-tag {
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-weight: 500;
}

.detail-body {
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 1000px) {
  .detail-body { grid-template-columns: 1fr; padding: 18px; }
  .detail-hero { grid-template-columns: 1fr; padding: 24px 18px; gap: 18px; }
  .detail-hero-price-block { align-items: flex-start; text-align: left; }
  .detail-actions-bar { padding: 10px 18px; gap: 8px; flex-wrap: wrap; }
  .detail-actions-title { font-size: 0.86rem; margin: 0 8px; }
  .detail-actions-buttons { gap: 4px; flex-wrap: wrap; }
  .detail-actions-buttons .btn { padding: 6px 10px; font-size: 0.82rem; }
  .detail-actions-buttons .btn svg { width: 14px; height: 14px; }
}
@media (max-width: 560px) {
  .detail-hero-info h1 { font-size: 1.2rem; }
  .detail-hero-price { font-size: 1.5rem; }
  .detail-hero-meta { font-size: 0.84rem; }
  .detail-actions-back svg { width: 14px; height: 14px; }
  .detail-actions-title { display: none; }
  /* Hide secondary buttons on tiny screens - Edit and Delete are reachable
     from the row menu in vehicles.html. Keep Publish as the primary. */
  .detail-actions-buttons #btn-edit,
  .detail-actions-buttons #btn-delete,
  /* Keep AI Description visible on mobile - it's a primary action. */
  .detail-actions-buttons .btn:not(#btn-publish):not(#btn-edit):not(#btn-delete):not(#btn-ai-desc):nth-child(n+3) { display: none; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-head h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}
.card-body { padding: 18px; }
.card-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--ink-mute);
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  gap: 22px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
}
.tabs button {
  padding: 12px 0;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  margin-bottom: -1px;
}
.tabs button.is-active { color: var(--blue); border-bottom-color: var(--blue); }

.detail-rows { padding: 4px 18px 18px; }
.detail-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.92rem;
}
.detail-row:last-child { border-bottom: 0; }
.detail-row .key { color: var(--ink-mute); }
.detail-row .val { color: var(--ink); font-weight: 500; }
.detail-row .val small { color: var(--ink-faint); font-weight: 400; margin-left: 6px; }

.dvla-block {
  margin: 12px 18px 18px;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  background: var(--green-soft);
  overflow: hidden;
}
.dvla-block-head {
  padding: 8px 14px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  font-size: 0.86rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dvla-block-head button {
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.9;
}
.dvla-block-head button svg { width: 14px; height: 14px; }
.dvla-rows { padding: 8px 14px; background: var(--surface); }
.dvla-rows .detail-row { font-size: 0.88rem; padding: 8px 0; grid-template-columns: 130px 1fr auto; }
.dvla-rows .detail-row .val.ok { color: var(--green); font-weight: 600; }
.dvla-rows .detail-row .val.warn { color: var(--red); font-weight: 600; }
.dvla-meta {
  padding: 6px 14px 10px;
  background: var(--surface);
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.inspections-list { padding: 6px 18px 18px; }
.inspection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.inspection-item:last-child { border-bottom: 0; }
.inspection-item-name {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inspection-item-name svg { width: 18px; height: 18px; }
.inspection-item-name.warn svg { color: var(--amber); }
.inspection-item-name.ok svg { color: var(--green); }
.inspection-item-name strong { font-size: 0.9rem; color: var(--ink); display: block; }
.inspection-item-name small { font-size: 0.78rem; color: var(--ink-mute); }

.history-list { padding: 0 18px 18px; }
.history-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 10px 0;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.88rem;
}
.history-item:last-child { border-bottom: 0; }
.history-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}
.history-row {
  display: grid;
  grid-template-columns: 90px 110px 1fr;
  gap: 14px;
  align-items: center;
  color: var(--ink-soft);
}
.history-row .badge {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-mute);
  width: max-content;
}

.comment-box {
  margin: 12px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.comment-box textarea {
  width: 100%;
  border: 0;
  outline: none;
  padding: 12px;
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
}
.comment-box-foot {
  padding: 8px 12px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  justify-content: flex-end;
}

.linked-empty {
  padding: 32px 18px;
  text-align: center;
}
.linked-empty p { color: var(--ink-mute); margin: 0 0 12px; font-size: 0.92rem; }
.linked-empty .add-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.86rem;
  background: var(--blue-soft);
  padding: 6px 12px;
  border-radius: 999px;
}
.linked-empty .add-link svg { width: 14px; height: 14px; }

/* ---------- Login page ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background:
    radial-gradient(circle at 20% 30%, rgb(from var(--brand) r g b / 0.07), transparent 50%),
    radial-gradient(circle at 80% 70%, rgb(from var(--brand-light) r g b / 0.08), transparent 50%),
    var(--bg);
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.login-card-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.login-card-logo-mark {
  background: var(--brand);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.94rem;
  letter-spacing: 0.04em;
}
.login-card-logo-text strong { display: block; font-size: 1rem; font-weight: 700; color: var(--ink); }
.login-card-logo-text small { font-size: 0.74rem; color: var(--ink-mute); letter-spacing: 0.08em; }

.login-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}
.login-card p {
  color: var(--ink-mute);
  margin: 0 0 28px;
  font-size: 0.92rem;
}
.login-card form .field { margin-bottom: 14px; }
.login-card form .btn { width: 100%; }
.login-demo-note {
  margin-top: 22px;
  padding: 12px 14px;
  background: var(--blue-soft);
  border-radius: 6px;
  font-size: 0.82rem;
  color: #1e40af;
}
.login-demo-note strong { display: block; margin-bottom: 4px; font-weight: 600; }
.login-demo-note code {
  background: rgba(59, 130, 246, 0.15);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 0.78rem;
}

/* ---------- Filter row ---------- */
.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.filter-chip:hover { background: var(--surface-soft); }
.filter-chip.is-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.filter-chip-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 0 6px;
  border-radius: 4px;
  margin-left: 6px;
  font-size: 0.76rem;
}
.filter-chip.is-active .filter-chip-count { background: rgba(255, 255, 255, 0.2); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--ink);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  transform: translateY(120%);
  transition: transform 0.3s var(--ease);
  max-width: 360px;
}
.toast.is-visible { transform: translateY(0); }
.toast svg { width: 20px; height: 20px; color: var(--green); flex-shrink: 0; }
.toast strong { display: block; font-size: 0.92rem; margin-bottom: 2px; }
.toast small { font-size: 0.82rem; opacity: 0.8; }

/* ---------- Small helpers ---------- */
.muted { color: var(--ink-mute); }
.text-right { text-align: right; }
.flex { display: flex; align-items: center; gap: 8px; }
.gap-md { gap: 12px; }

/* ---------- More-options menu in modal footer ---------- */
.menu-wrap { position: relative; display: flex; gap: 8px; align-items: center; }

.menu-trigger {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  display: grid;
  place-items: center;
  color: var(--ink-mute);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.menu-trigger:hover { background: var(--line); color: var(--ink); }
.menu-trigger svg { width: 18px; height: 18px; }

.menu-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 20;
  display: none;
}
.menu-dropdown.is-open { display: block; }
.menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 0.92rem;
  color: var(--ink);
  transition: background 0.15s var(--ease);
}
.menu-dropdown button:hover { background: var(--bg); }
.menu-dropdown button .badge-beta {
  background: var(--blue-soft);
  color: #1e40af;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
}

/* ---------- ANPR scanner overlay ---------- */
.anpr-scanner {
  display: none;
  text-align: center;
  padding: 12px 0;
}
.anpr-scanner.is-on { display: block; }

.anpr-frame {
  margin: 0 auto 20px;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 16/8;
  background: #0a0a0a;
  border: 2px dashed var(--brand);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.anpr-frame::before,
.anpr-frame::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid var(--gold);
}
.anpr-frame::before {
  top: 10px;
  left: 10px;
  border-right: 0;
  border-bottom: 0;
}
.anpr-frame::after {
  bottom: 10px;
  right: 10px;
  border-left: 0;
  border-top: 0;
}
.anpr-scan-line {
  position: absolute;
  top: 0;
  left: 4%;
  right: 4%;
  height: 2px;
  background: var(--brand);
  box-shadow: 0 0 12px var(--brand), 0 0 30px rgba(166, 85, 43, 0.5);
  animation: anpr-scan 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes anpr-scan {
  0%, 100% { top: 6%; }
  50% { top: calc(94% - 2px); }
}

.anpr-text strong { display: block; font-size: 1.02rem; color: var(--ink); margin-bottom: 4px; }
.anpr-text small { color: var(--ink-mute); font-size: 0.88rem; }

.anpr-found {
  display: none;
  background: var(--green-soft);
  color: #065f46;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  align-items: center;
  gap: 14px;
  text-align: left;
}
.anpr-found.is-on { display: flex; }
.anpr-found-info { flex: 1; }
.anpr-found-info strong { display: block; font-size: 0.88rem; color: #065f46; margin-bottom: 4px; }
.anpr-found-plate {
  display: inline-block;
  background: var(--amber);
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #d97706;
}
.anpr-actions { display: flex; gap: 8px; }

/* ---------- Row three-dot menu + floating menu ---------- */
.vehicle-row { position: relative; cursor: pointer; }
.vehicle-row-menu-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-mute);
  display: grid;
  place-items: center;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  z-index: 5;
}
.vehicle-row-menu-btn:hover { background: var(--bg); color: var(--ink); }
.vehicle-row-menu-btn svg { width: 18px; height: 18px; }

.row-menu {
  position: absolute;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
  display: none;
}
.row-menu.is-open { display: block; }
.row-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--ink);
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}
.row-menu button:hover { background: var(--bg); }
.row-menu button svg { width: 16px; height: 16px; color: var(--ink-mute); }
.row-menu .row-menu-divider { height: 1px; background: var(--line-soft); margin: 4px 0; }
.row-menu button.danger { color: var(--red); }
.row-menu button.danger:hover { background: var(--red-soft); }
.row-menu button.danger svg { color: var(--red); }

/* ---------- Danger button ---------- */
.btn-danger { background: var(--surface); color: var(--red); border-color: var(--line); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.btn-danger svg { color: var(--red); }

/* ---------- Typeahead / autocomplete ---------- */
.typeahead-wrap { position: relative; }
.typeahead-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 0 6px 6px;
  box-shadow: var(--shadow);
  z-index: 40;
  display: none;
  margin-top: 2px;
}
.typeahead-suggestions.is-open { display: block; }

.typeahead-group {
  padding: 6px 12px 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
}
.typeahead-suggestion {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.1s var(--ease);
}
.typeahead-suggestion:hover,
.typeahead-suggestion.is-active { background: var(--brand-soft); }
.typeahead-suggestion .meta {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--ink-mute);
  padding: 2px 8px;
  background: var(--bg);
  border-radius: 4px;
  flex-shrink: 0;
}
.typeahead-suggestion.create { color: var(--brand); font-weight: 500; }
.typeahead-suggestion.create svg { width: 14px; height: 14px; flex-shrink: 0; }
.typeahead-empty {
  padding: 14px 12px;
  text-align: center;
  color: var(--ink-mute);
  font-size: 0.86rem;
}

/* ---------- Edit Vehicle area-picker ---------- */
.edit-picker-heading {
  text-align: center;
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 500;
  margin: 6px 0 28px;
}
.edit-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 18px;
  padding: 4px 8px 12px;
}
.edit-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.12s var(--ease), background 0.12s var(--ease);
  font: inherit;
  text-align: center;
}
.edit-tile:hover {
  background: var(--surface-soft);
  transform: translateY(-2px);
}
.edit-tile:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.edit-tile:disabled:hover { background: transparent; transform: none; }
.edit-tile-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1e3a5f;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.edit-tile-icon svg { width: 26px; height: 26px; stroke-width: 2; }
.edit-tile-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.edit-tile-soon {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  padding: 1px 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-mute);
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .edit-tile-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Sub-panel (single section's edit form) */
.edit-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.edit-panel-back {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
  flex-shrink: 0;
}
.edit-panel-back:hover { background: var(--surface-soft); }
.edit-panel-back svg { width: 16px; height: 16px; }
.edit-panel-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Pricing panel (AutoTrader integration) ---------- */
.pricing-panel {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 820px) {
  .pricing-panel { grid-template-columns: 1fr; gap: 24px; }
  .pricing-side { border-left: 0 !important; padding-left: 0 !important; border-top: 1px solid var(--line); padding-top: 22px; }
}
.pricing-main { text-align: center; }
.pricing-main .reg-plate { display: inline-block; margin-bottom: 14px; }
.pricing-main .pricing-vehicle-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 18px;
  text-align: center;
}
.pricing-big-price {
  font-size: 3.6rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
  margin: 6px 0 16px;
}
.pricing-divider {
  height: 1px;
  background: var(--line);
  width: 88%;
  margin: 8px auto;
}
.pricing-margin {
  font-size: 1rem;
  color: #e8a13a;
  font-weight: 500;
  margin: 12px 0 8px;
}
.pricing-margin.is-loss { color: #d93636; }

.pricing-section-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  font-weight: 600;
  text-transform: uppercase;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin: 28px 0 18px;
  text-align: left;
}
.pricing-slider-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin: 10px 0 14px;
}
.pricing-position-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2a5b3b;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.94rem;
  white-space: nowrap;
}
.pricing-position-badge .at-logo {
  background: #fff;
  color: #2a5b3b;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.pricing-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  outline: none;
}
.pricing-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.18);
}
.pricing-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 0;
}
.pricing-percent {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.pricing-percent strong { font-weight: 600; font-size: 1.1rem; }
.pricing-position-chips {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 0;
  flex-wrap: wrap;
}
.pricing-chip {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 0.86rem;
  font-weight: 500;
  color: rgba(0,0,0,0.5);
  background: #e9ecef;
}
.pricing-chip.low      { background: #d6d8db; }
.pricing-chip.great    { background: #b5d4b9; color: #1f4126; }
.pricing-chip.good     { background: #2a5b3b; color: #fff; }
.pricing-chip.fair     { background: #e8c259; color: #4a3f10; }
.pricing-chip.higher   { background: #e89a85; color: #5a2018; }
.pricing-chip.is-active { box-shadow: inset 0 0 0 2px rgba(0,0,0,0.18); text-decoration: underline; }

.pricing-additional-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.pricing-additional-row .field { margin: 0; }
.pricing-additional-row .field-checkbox {
  display: flex; align-items: center; gap: 8px; margin-top: 22px;
}

.pricing-side {
  border-left: 1px solid var(--line);
  padding-left: 26px;
}
.pricing-side-block { margin-bottom: 24px; }
.pricing-side-block-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.95rem; font-weight: 600; color: var(--ink); margin-bottom: 10px;
}
.pricing-side-block-head .ico {
  display: inline-flex; gap: 6px; color: var(--ink-mute);
}
.pricing-side-block-head .ico button { background: none; border: 0; cursor: pointer; color: inherit; padding: 2px; }
.pricing-side-valuation {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 4px;
}
.pricing-side-valuation .v-amount {
  font-size: 1.05rem; font-weight: 600; color: var(--ink); line-height: 1.2;
}
.pricing-side-valuation .v-amount small {
  display: block; font-size: 0.7rem; letter-spacing: 0.1em;
  color: var(--ink-mute); font-weight: 600; margin-top: 3px;
}
.pricing-side-valuation .at-pill {
  background: #2a5b3b; color: #fff; font-weight: 700;
  padding: 6px 10px; border-radius: 5px; font-size: 0.86rem; letter-spacing: 0.02em;
}
.pricing-phase-badge {
  display: block; width: 100%; padding: 10px 0;
  background: var(--green); color: #fff;
  border-radius: 6px; text-align: center;
  font-weight: 600; letter-spacing: 0.04em; font-size: 0.95rem;
}
.pricing-phase-badge.watch { background: #e8a13a; }
.pricing-phase-badge.stale { background: #d93636; }
.pricing-phase-meta { color: var(--ink-mute); font-size: 0.86rem; margin-top: 8px; }
.pricing-leads-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pricing-lead-tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
}
.pricing-lead-tile .num { font-size: 1.4rem; font-weight: 700; color: var(--green); line-height: 1; }
.pricing-lead-tile .lbl { color: var(--ink-mute); font-size: 0.85rem; margin-top: 6px; }
.pricing-history-empty { color: var(--ink-mute); font-size: 0.88rem; }
.pricing-history-item {
  display: flex; justify-content: space-between; padding: 6px 0;
  border-bottom: 1px solid var(--line); font-size: 0.86rem;
}
.pricing-history-item:last-child { border-bottom: 0; }

.pricing-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 18px; margin-top: 22px; border-top: 1px solid var(--line);
}
.pricing-footer-left a {
  color: #3b82f6; font-weight: 500; font-size: 0.92rem;
  display: inline-flex; align-items: center; gap: 4px;
}
.pricing-footer-right { display: flex; gap: 10px; }

/* Section-style edit panel forms */
.edit-form-grid {
  display: grid;
  gap: 14px;
}
.edit-note {
  background: #fff8eb;
  border: 1px solid #f1d692;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.86rem;
  color: #6f5712;
  margin-bottom: 18px;
  display: flex; gap: 10px; align-items: flex-start;
}
.edit-note svg { width: 16px; height: 16px; flex-shrink: 0; color: #b7891a; margin-top: 1px; }

/* ---------- Publish modal ---------- */
.publish-summary {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 18px;
}
.publish-summary .reg-plate { flex-shrink: 0; }
.publish-summary-info { flex: 1; min-width: 0; }
.publish-summary-info h3 { margin: 0 0 2px; font-size: 0.98rem; font-weight: 600; color: var(--ink); }
.publish-summary-info p  { margin: 0; font-size: 0.84rem; color: var(--ink-mute); }
.publish-summary-price { font-size: 1.1rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.publish-summary-price.tbc { color: var(--red, #d93636); }

.publish-warning {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: #ffefef;
  border: 1px solid #f5c0c0;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #832018;
  margin-bottom: 18px;
}
.publish-warning svg { width: 16px; height: 16px; color: #d93636; flex-shrink: 0; margin-top: 1px; }
.publish-warning strong { color: #5a1410; }

.publish-channel-list { display: flex; flex-direction: column; gap: 10px; }
.publish-channel {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.publish-channel.is-disabled { opacity: 0.45; }
.publish-channel.is-live { border-color: #a5d6a7; background: #f4faf4; }
.publish-channel.is-error { border-color: #f5b7b7; background: #fff7f7; }

.publish-channel-mark {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.publish-channel-meta { min-width: 0; }
.publish-channel-meta h4 { margin: 0; font-size: 0.96rem; font-weight: 600; color: var(--ink); }
.publish-channel-meta small { display: block; color: var(--ink-mute); font-size: 0.78rem; margin-top: 2px; }

.publish-channel-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-soft);
  color: var(--ink-mute);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.publish-channel-status.live  { background: #e6f4ea; color: #1f6b35; border-color: #c0e0ca; }
.publish-channel-status.err   { background: #fdecec; color: #832018; border-color: #f0c0c0; }
.publish-channel-status.pub   { background: #e6efff; color: #1d4ed8; border-color: #c2d4f8; }
.publish-channel-status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.publish-channel-status.pub .dot { animation: rhmPulse 1.1s ease-in-out infinite; }
@keyframes rhmPulse { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

.publish-toggle {
  position: relative;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: var(--line);
  border: 0; cursor: pointer; padding: 0; flex-shrink: 0;
  transition: background 0.15s var(--ease);
}
.publish-toggle::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  transition: transform 0.18s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.publish-toggle.is-on { background: var(--green); }
.publish-toggle.is-on::after { transform: translateX(16px); }

.publish-master {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0 4px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 14px;
}
.publish-master-label { font-size: 0.88rem; color: var(--ink-mute); }
.publish-master-count { font-weight: 600; color: var(--ink); }

.publish-success {
  text-align: center;
  padding: 20px 10px;
}
.publish-success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center; margin: 0 auto 16px;
}
.publish-success-icon svg { width: 32px; height: 32px; }
.publish-success h2 { margin: 0 0 6px; font-size: 1.2rem; color: var(--ink); }
.publish-success p  { margin: 0 0 22px; color: var(--ink-mute); }
.publish-success-list {
  display: flex; flex-direction: column; gap: 8px;
  text-align: left; max-width: 480px; margin: 0 auto 20px;
}
.publish-success-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
}
.publish-success-row a {
  color: #1d4ed8; font-size: 0.86rem; text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.publish-success-row a:hover { text-decoration: underline; }
.publish-success-row a svg { width: 12px; height: 12px; }

/* Vehicle row Live badge */
.live-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 999px;
  background: #e6f4ea; color: #1f6b35;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid #c0e0ca;
}
.live-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* Channels card on detail page */
.channels-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.channels-row:last-child { border-bottom: 0; }
.channels-row-mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: #fff; font-weight: 700;
  font-size: 0.72rem; flex-shrink: 0;
}
.channels-row-name { flex: 1; min-width: 0; }
.channels-row-name strong { display: block; font-size: 0.92rem; color: var(--ink); font-weight: 600; }
.channels-row-name small  { display: block; font-size: 0.76rem; color: var(--ink-mute); margin-top: 2px; }
.channels-row-actions { display: flex; gap: 6px; }
.channels-row-actions a {
  font-size: 0.78rem; color: #1d4ed8; text-decoration: none;
}
.channels-row-actions a:hover { text-decoration: underline; }

/* ============================================================
   Detail Drawer - slide-out side panel for leads / deals /
   valuations / reservations / inbox messages. Left column =
   record info + actions; right column = activity timeline
   + composer.
   ============================================================ */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(31, 41, 55, 0.5);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.drawer-backdrop.is-open { display: block; opacity: 1; }

.drawer {
  position: fixed;
  top: 0; bottom: 0; left: 60px; right: 0;
  background: var(--surface);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
  z-index: 201;
  display: grid;
  grid-template-columns: 360px 1fr;
  transform: translateX(20px);
  opacity: 0;
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}
.drawer-backdrop.is-open .drawer { transform: translateX(0); opacity: 1; }

.drawer-close {
  position: absolute; top: 12px; left: -42px;
  width: 32px; height: 32px;
  background: var(--ink);
  color: #fff; border: 0; border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer;
}
.drawer-close svg { width: 18px; height: 18px; }

.drawer-left {
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer-left-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px 24px 16px;
}
.drawer-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: #d9d9e6; color: var(--ink-mute);
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.6rem;
  margin: 0 auto 14px;
}
.drawer-name {
  text-align: center;
  font-size: 1.25rem; font-weight: 600; color: var(--ink);
  margin: 0 0 6px;
}
.drawer-sub {
  text-align: center; color: var(--ink-mute);
  font-size: 0.86rem; margin: 0; line-height: 1.5;
}
.drawer-sub a { color: var(--ink); text-decoration: none; display: block; }
.drawer-sub a:hover { color: var(--blue, #5468ff); text-decoration: underline; }

.drawer-stages {
  display: flex; gap: 6px; margin: 22px 0 18px;
}
.drawer-stages span {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--line);
}
.drawer-stages span.fill { background: #69c065; }
.drawer-stage-label {
  text-align: center; font-size: 0.86rem; color: var(--ink);
  margin-bottom: 22px;
}
.drawer-stage-label strong { color: var(--ink); font-weight: 600; }

.drawer-section { margin-bottom: 22px; }
.drawer-section-head {
  display: flex; justify-content: space-between;
  font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px; margin-bottom: 10px;
}
.drawer-section-head a {
  color: #1d4ed8; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.04em; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.drawer-section-empty {
  color: var(--ink-mute); font-size: 0.86rem; padding: 6px 0;
}

.drawer-vehicle-card {
  display: grid; grid-template-columns: 60px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 0;
}
.drawer-vehicle-card .thumb {
  width: 60px; height: 44px; border-radius: 4px;
  background: var(--surface-soft); display: grid; place-items: center;
  font-size: 0.7rem; color: var(--ink-mute);
}
.drawer-vehicle-card strong {
  display: block; font-size: 0.86rem; color: var(--ink);
  font-weight: 500;
}
.drawer-vehicle-card .reg-plate { font-size: 0.74rem; padding: 2px 6px; margin-top: 4px; }
.drawer-vehicle-card .status { font-size: 0.74rem; color: var(--ink-mute); margin-top: 4px; }

.drawer-detail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; font-size: 0.88rem; color: var(--ink);
}
.drawer-detail-item svg { width: 16px; height: 16px; color: var(--ink-mute); flex-shrink: 0; }
.drawer-detail-item .green-badge {
  background: #e6f4ea; color: #1f6b35;
  font-size: 0.74rem; font-weight: 700; padding: 2px 8px; border-radius: 4px;
  letter-spacing: 0.04em;
}

.drawer-source-card {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px;
}
.drawer-source-card .src-badges {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 8px;
}
.drawer-source-card .src-badge {
  background: var(--surface-soft); color: var(--ink);
  font-size: 0.74rem; font-weight: 600;
  padding: 4px 10px; border-radius: 4px;
}
.drawer-source-row {
  display: flex; justify-content: space-between;
  font-size: 0.84rem; padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
.drawer-source-row:last-of-type { border-bottom: 0; }
.drawer-source-row span:first-child { color: var(--ink-mute); }
.drawer-source-row span:last-child { color: var(--ink); font-weight: 500; }

.drawer-footer {
  display: grid; grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.drawer-footer .btn { padding: 12px; font-weight: 700; font-size: 0.86rem; }
.drawer-footer .btn-won { background: #1f6b35; color: #fff; }
.drawer-footer .btn-lost { background: #d93636; color: #fff; }
.drawer-footer .btn-icon {
  background: var(--surface-soft); color: var(--ink-mute);
  padding: 12px;
}
.drawer-footer .btn-icon svg { width: 18px; height: 18px; }

/* RIGHT - activity timeline */
.drawer-right {
  display: flex; flex-direction: column;
  overflow: hidden;
  background: #fbfbfd;
}
.drawer-tabs {
  display: flex; gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.drawer-tab {
  flex: 1; padding: 14px; background: none; border: 0;
  cursor: pointer; font: inherit; font-weight: 500;
  color: var(--ink-mute);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-bottom: 3px solid transparent;
}
.drawer-tab.is-active { color: #1d4ed8; border-bottom-color: #1d4ed8; }
.drawer-tab svg { width: 16px; height: 16px; }

.drawer-composer {
  background: #fff8d6; padding: 14px 18px;
  display: grid; grid-template-columns: 1fr auto;
  gap: 10px; align-items: center;
  border-bottom: 1px solid var(--line);
}
.drawer-composer-input {
  padding: 10px 12px; border: 0; background: transparent;
  font: inherit; outline: none;
  width: 100%; resize: vertical; min-height: 40px;
}
.drawer-composer-input::placeholder { color: var(--ink-mute); font-style: italic; }
.drawer-composer-actions {
  display: flex; gap: 6px;
}
.drawer-composer-actions .btn { padding: 8px 18px; font-size: 0.84rem; font-weight: 700; letter-spacing: 0.06em; }
.drawer-composer-actions .btn-save { background: #1d4ed8; color: #fff; }
.drawer-composer-actions .btn-clear { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

.drawer-timeline {
  flex: 1; overflow-y: auto;
  padding: 18px 24px;
}
.drawer-timeline-section {
  text-align: center; margin: 20px 0 14px;
}
.drawer-timeline-section span {
  display: inline-block;
  background: var(--surface-soft);
  color: var(--ink); padding: 4px 14px;
  border-radius: 14px; font-size: 0.78rem; font-weight: 500;
}
.drawer-timeline-empty {
  text-align: center; color: var(--ink-mute);
  padding: 12px;
}
.drawer-timeline-empty a {
  display: block; color: #1d4ed8; text-decoration: none;
  margin-top: 6px;
}

.drawer-activity {
  display: grid; grid-template-columns: 36px 1fr;
  gap: 14px; margin-bottom: 14px;
}
.drawer-activity-icon {
  width: 36px; height: 36px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-mute);
}
.drawer-activity-icon svg { width: 18px; height: 18px; }
.drawer-activity-body {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px;
}
.drawer-activity-body strong {
  display: block; color: var(--ink); margin-bottom: 4px;
}
.drawer-activity-body p {
  color: var(--ink); font-size: 0.92rem; margin: 0 0 6px;
}
.drawer-activity-body small { color: var(--ink-mute); font-size: 0.8rem; }

@media (max-width: 900px) {
  /* Stack left + right columns vertically so the composer + activity
     timeline are still reachable on mobile. Hiding .drawer-right
     entirely orphaned every note/diary/email/sms entry point. */
  .drawer { grid-template-columns: 1fr; grid-template-rows: auto auto; left: 0; overflow-y: auto; padding-bottom: 76px; }
  .drawer-left { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .drawer-left-scroll { padding-bottom: 12px; }
  /* On mobile the .drawer-left has no scroll context, so position: sticky
     would anchor to the bottom of the left column (i.e. somewhere mid-
     scroll). Use position: fixed pinned to the viewport bottom so WON /
     LOST / Delete are always one tap away regardless of scroll depth.
     .drawer padding-bottom above reserves space so timeline content
     doesn't hide behind the fixed footer. */
  .drawer-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    z-index: 220;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    border-top: 1px solid var(--line);
  }
  .drawer-right { min-height: 60vh; }
  .drawer-close { left: auto; right: 12px; top: 12px; }
}

/* Print styles for vehicle.html job-card print */
@media print {
  body { background: #fff !important; }
  .topbar, .tabnav, .detail-actions-bar, .detail-hero, .row-menu,
  .modal-backdrop, .toast, .drawer-backdrop { display: none !important; }
  .detail-body { display: block !important; padding: 0 !important; }
  /* Hide all cards by default; show only the one with .print-this */
  .detail-body .card { display: none !important; }
  .detail-body .card.print-this { display: block !important; box-shadow: none !important; border: 1px solid #000 !important; }
  @page { size: A4; margin: 14mm; }
}

/* ============================================================
   VISUAL POLISH v2 - non-functional uplift
   Goals: richer brand presence, refined typography, more depth
   without breaking ANY existing layout or interaction.
   ============================================================ */

:root {
  /* Refined token palette layered on top of the originals.
     Default = core DealerOS blue; dealeros.js swaps in a tenant colour
     at runtime when a specific dealer is active. */
  --brand: #3a93f0;
  --brand-dark: #1f63d6;
  --brand-light: #5fb8ff;
  --brand-soft: #eaf3fe;
  --brand-grad: linear-gradient(135deg, #1f63d6 0%, #3a93f0 60%, #5fb8ff 100%);
  --gold: #e2b75c;
  --gold-soft: #fcf2d8;

  --ink: #14161c;
  --ink-soft: #1f2937;
  --ink-mute: #5b6677;
  --ink-faint: #8a96a8;
  --line: #ebeef3;
  --line-soft: #f4f6fa;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #fafbfd;

  --blue: #2563eb;
  --blue-soft: #e5edff;
  --green: #14a36c;
  --green-soft: #d8f5e8;
  --amber: #f59e0b;
  --amber-soft: #fff4dd;
  --red: #dc2626;
  --red-soft: #ffe1e1;

  --shadow-sm: 0 1px 2px rgba(20, 24, 39, 0.05);
  --shadow:    0 2px 8px rgba(20, 24, 39, 0.06), 0 1px 2px rgba(20, 24, 39, 0.04);
  --shadow-lg: 0 16px 40px -8px rgba(15, 23, 42, 0.18), 0 8px 16px -6px rgba(15, 23, 42, 0.10);

  --radius: 10px;
  --radius-lg: 14px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle global texture + sharper body font */
html, body {
  font-size: 14.5px;
  letter-spacing: -0.005em;
  background:
    radial-gradient(900px 600px at 10% -10%, rgba(58,147,240,0.06), transparent 60%),
    radial-gradient(800px 700px at 110% 0%, rgba(37,99,235,0.04), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* TOPBAR - rich brand gradient + subtle inner highlight */
.topbar {
  background: var(--brand-grad);
  box-shadow:
    inset 0 -1px 0 rgba(255,255,255,0.06),
    0 2px 8px rgba(20, 24, 39, 0.08);
  backdrop-filter: blur(8px);
}
.topbar-search { background: rgba(255,255,255,0.16); border-radius: 8px; padding: 7px 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); transition: background 0.16s var(--ease); }
.topbar-search:focus-within { background: rgba(255,255,255,0.24); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 0 2px rgba(255,255,255,0.18); }
.topbar-add { border-radius: 8px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); transition: transform 0.16s var(--ease), background 0.16s var(--ease); }
.topbar-add:hover { transform: translateY(-1px); background: rgba(255,255,255,0.28); }
.topbar-logo-mark {
  background: linear-gradient(135deg, var(--gold) 0%, #b08230 100%);
  color: #2a1607;
  box-shadow: 0 2px 4px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.45);
  border-radius: 8px;
}
.topbar-bell { border-radius: 8px; transition: background 0.16s var(--ease); }
.topbar-bell:hover { background: rgba(255,255,255,0.18); }
.topbar-bell .badge {
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.topbar-user { border-radius: 8px; transition: background 0.16s var(--ease); }
.topbar-user:hover { background: rgba(255,255,255,0.22); }
.topbar-user-avatar {
  background: var(--gold);
  color: var(--ink);
  border: 1.5px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  font-weight: 800;
}

/* TABNAV - clean sticky underline + active hover slide */
.tabnav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
  padding: 0 28px;
}
.tabnav a { position: relative; padding: 14px 18px; font-weight: 500; letter-spacing: -0.005em; }
.tabnav a::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 3px;
  background: var(--brand);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s var(--ease);
}
.tabnav a.is-active::after { transform: scaleX(1); }
.tabnav a.is-active { color: var(--brand-dark); font-weight: 600; border-bottom-color: transparent; }
.tabnav a:hover:not(.is-active) { color: var(--ink); background: var(--surface-soft); }

/* PAGE HEAD - bolder title hierarchy */
.page-head { padding: 28px 28px 18px; }
.page-head h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.page-head .count { color: var(--ink-mute); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

/* BUTTONS - subtle elevation + lift on hover */
.btn {
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: 8px;
  transition: transform 0.12s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
  box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-primary,
.btn-success,
.btn-blue { background-image: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(0,0,0,0.04) 100%); color: #fff; }
.btn-success { background-color: var(--green); }
.btn-success:hover { background-color: #0e8a5b; }
/* Primary keeps the brand identity - topbar, plates and tabnav
   underline are all brand orange. Save buttons should match. */
.btn-primary { background-color: var(--brand); }
.btn-primary:hover { background-color: var(--brand-dark); }
.btn-blue { background-color: var(--blue); }
.btn-danger { background-color: var(--red); color: #fff; }
.btn-danger:hover { background-color: #b91c1c; }

/* CARDS / LIST CARDS - soft shadows + rounded corners */
.card, .list-card, .dash-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.card:hover { /* no-op - cards don't lift, only rows do */ }
.card-head h3 { font-size: 0.98rem; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }

/* LIST ROWS - soft hover + crisp focus ring */
.vehicle-row, .lead-row, .deal-row, .res-row, .val-row, .inbox-row, .contact-row, .job-row {
  transition: background 0.12s var(--ease), box-shadow 0.16s var(--ease);
}
.vehicle-row:hover, .lead-row:hover, .deal-row:hover,
.res-row:hover, .val-row:hover, .inbox-row:hover,
.contact-row:hover, .job-row:hover {
  background: linear-gradient(90deg, var(--surface-soft) 0%, transparent 100%);
  box-shadow: inset 3px 0 0 var(--brand);
}

/* FILTER CHIPS - pill, softer borders, refined active */
.filter-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 16px;
  font-weight: 500;
  color: var(--ink-mute);
  transition: all 0.14s var(--ease);
}
.filter-chip:hover { color: var(--ink); border-color: var(--ink-faint); background: var(--surface-soft); }
.filter-chip.is-active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(138,66,32,0.25);
}
.filter-chip-count {
  background: rgba(0,0,0,0.06);
  color: var(--ink);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.74rem;
  margin-left: 6px;
}
.filter-chip.is-active .filter-chip-count { background: rgba(255,255,255,0.25); color: #fff; }

/* INPUT / SELECT / TEXTAREA - focus glow */
input[type="text"]:not(.topbar-search input),
input[type="email"], input[type="tel"], input[type="number"], input[type="date"],
select, textarea {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 0.14s var(--ease), box-shadow 0.16s var(--ease);
}
/* Focus glow applies to in-page form inputs ONLY - topbar searches are
   their own component with a frosted treatment. */
.topbar-search input:focus { box-shadow: none; }
input[type="text"]:not(.topbar-search input):focus,
input[type="email"]:focus, input[type="tel"]:focus,
input[type="number"]:focus, input[type="date"]:focus, select:focus, textarea:focus {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(196,121,77,0.18);
  outline: none;
}

/* REG PLATE - refined badge with subtle inner shadow */
.reg-plate {
  background: linear-gradient(180deg, #f4cd3e 0%, #e3b51b 100%);
  color: #1a1409;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 1px 2px rgba(0,0,0,0.1);
  border: 1px solid #c79e16;
}

/* MODALS - frosted backdrop + lift */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}
.modal {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,0.5);
}
.modal-header h2 { font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }

/* TOASTS - softer, with a left accent bar */
.toast {
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--brand);
}

/* DRAWER - frosted, smoother slide-in */
.drawer-backdrop { background: rgba(15, 23, 42, 0.48); backdrop-filter: blur(3px); }
.drawer { box-shadow: -20px 0 60px -8px rgba(15,23,42,0.25); }
.drawer-avatar {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(138,66,32,0.25), inset 0 1px 0 rgba(255,255,255,0.18);
}
.drawer-stages span.fill {
  background: linear-gradient(90deg, var(--green) 0%, #0eaa70 100%);
  box-shadow: 0 1px 2px rgba(20,163,108,0.3);
}
.drawer-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 16px 20px; }
.drawer-footer .btn-won { background: linear-gradient(180deg, #14a36c 0%, #0e8a5b 100%); border: 0; }
.drawer-footer .btn-lost { background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%); border: 0; }
.drawer-section-head { color: var(--ink-mute); }
.drawer-composer {
  background: linear-gradient(180deg, #fffaeb 0%, #fff6dc 100%);
  border-bottom: 1px solid #f0e2b3;
}
.drawer-composer-actions .btn-save {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border: 0;
  box-shadow: 0 2px 6px rgba(37,99,235,0.32);
}
.drawer-tab.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.drawer-activity-body { transition: box-shadow 0.16s var(--ease); }
.drawer-activity-body:hover { box-shadow: var(--shadow); border-color: var(--ink-faint); }

/* DASHBOARD - bigger headline, lifted KPI card */
.greeting { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.weather { color: var(--ink-mute); }
.kpi-big { font-weight: 700; letter-spacing: -0.04em; font-size: 4.2rem; line-height: 1; color: var(--brand-dark); }
.dash-card { transition: box-shadow 0.18s var(--ease); }
.dash-card:hover { box-shadow: var(--shadow-lg); }

/* HANDOVER BAR - striking gradient */
.handover-bar {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-radius: 10px;
  box-shadow: 0 6px 16px -4px rgba(220,38,38,0.4);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.handover-bar:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -4px rgba(220,38,38,0.5); }

/* LEADERBOARD - refined ring around 'me' avatar */
.leaderboard-me-avatar {
  background: linear-gradient(135deg, var(--green) 0%, #0eaa70 100%) !important;
  box-shadow: 0 8px 20px -4px rgba(20,163,108,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}

/* VEHICLE HERO + DETAIL ACTION BAR */
.detail-hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.detail-actions-bar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* STATUS PILLS + DOTS (generic) - slight gradient */
.status-pill {
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 999px;
}
.deal-status-dot.ok { background: radial-gradient(circle at 30% 30%, #1ed091, #0e8a5b); box-shadow: 0 0 0 3px var(--green-soft); }
.deal-status-dot.warn { background: radial-gradient(circle at 30% 30%, #fbbf24, #d97706); box-shadow: 0 0 0 3px var(--amber-soft); }
.deal-status-dot.idle { background: var(--ink-faint); box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }

/* SECTION TITLES - small caps polish */
.detail-section-title, .insight-title {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.74rem;
  color: var(--ink-mute);
}

/* SCROLLBAR - slim, brand-tinted on hover */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.18) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.14); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(138,66,32,0.4); }

/* Live Listings + Publish modal - brand SVG logos fill the mark cleanly */
.channels-row-logo, .publish-channel-logo {
  background: transparent !important;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  border-radius: 8px;
}
.channels-row-logo svg, .publish-channel-logo svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}

/* ============================================================
   VISUAL POLISH v3 - Ultra layer
   Micro-animations, refined empty states, depth + delight
   without touching any selector behaviour.
   ============================================================ */

/* Universal soft motion */
@keyframes rhm-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rhm-slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes rhm-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes rhm-soft-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20,163,108,0.35); }
  50%      { box-shadow: 0 0 0 8px rgba(20,163,108,0); }
}
@keyframes rhm-bounce-in {
  0%   { opacity: 0; transform: scale(0.92); }
  60%  { opacity: 1; transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Cards + page content fade up on first paint */
.dash-card, .card, .list-card, .modal, .drawer,
.empty-state, .kpi-card-deals, .leaderboard {
  animation: rhm-fade-in 0.32s var(--ease) both;
}

/* List rows reveal in a soft cascade */
.vehicle-row, .lead-row, .deal-row, .res-row, .val-row,
.inbox-row, .contact-row, .job-row {
  animation: rhm-slide-in 0.28s var(--ease) both;
}
.vehicle-row:nth-child(1), .lead-row:nth-child(1), .deal-row:nth-child(1),
.res-row:nth-child(1), .val-row:nth-child(1), .inbox-row:nth-child(1),
.contact-row:nth-child(1), .job-row:nth-child(1) { animation-delay: 0.02s; }
.vehicle-row:nth-child(2), .lead-row:nth-child(2), .deal-row:nth-child(2),
.res-row:nth-child(2), .val-row:nth-child(2), .inbox-row:nth-child(2),
.contact-row:nth-child(2), .job-row:nth-child(2) { animation-delay: 0.06s; }
.vehicle-row:nth-child(3), .lead-row:nth-child(3), .deal-row:nth-child(3),
.res-row:nth-child(3), .val-row:nth-child(3), .inbox-row:nth-child(3),
.contact-row:nth-child(3), .job-row:nth-child(3) { animation-delay: 0.10s; }
.vehicle-row:nth-child(4), .lead-row:nth-child(4), .deal-row:nth-child(4),
.res-row:nth-child(4), .val-row:nth-child(4), .inbox-row:nth-child(4),
.contact-row:nth-child(4), .job-row:nth-child(4) { animation-delay: 0.14s; }
.vehicle-row:nth-child(5), .lead-row:nth-child(5), .deal-row:nth-child(5),
.res-row:nth-child(5), .val-row:nth-child(5), .inbox-row:nth-child(5),
.contact-row:nth-child(5), .job-row:nth-child(5) { animation-delay: 0.18s; }

/* TOPBAR refinements */
.topbar { padding: 0 28px; backdrop-filter: blur(12px); }
.topbar-search { width: 360px; transition: width 0.2s var(--ease), background 0.2s var(--ease); }
.topbar-search:focus-within { width: 420px; }

/* SIGN-IN button on hover gets a brand sheen */
.btn-primary, .btn-success, .btn-blue, .btn-danger {
  position: relative;
  overflow: hidden;
}
.btn-primary::before, .btn-success::before, .btn-blue::before, .btn-danger::before {
  content: '';
  position: absolute;
  top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  transition: left 0.5s var(--ease);
  pointer-events: none;
}
.btn-primary:hover::before, .btn-success:hover::before, .btn-blue:hover::before, .btn-danger:hover::before {
  left: 120%;
}

/* FILTER CHIPS - softer active glow + scale lift */
.filter-chip { transform-origin: center; }
.filter-chip:hover { transform: translateY(-1px); }
.filter-chip.is-active {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -2px rgba(138,66,32,0.32);
}

/* Reg plates - slightly more dimensional */
.reg-plate {
  background: linear-gradient(180deg, #f4cd3e 0%, #e6b21e 55%, #d4a01a 100%);
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  border-color: #b08315;
}

/* KPI hero card - animated entrance + counter glow on update */
.kpi-card-deals { position: relative; overflow: hidden; }
.kpi-card-deals::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(196,121,77,0.10) 0%, transparent 70%);
  pointer-events: none;
}
.kpi-big {
  display: inline-block;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Leaderboard avatars - soft pulse on the 'me' chip */
.leaderboard-me-avatar { animation: rhm-bounce-in 0.5s var(--ease) both, rhm-soft-pulse 3.5s ease-out 1s infinite; }

/* Handover bar gets a subtle inner highlight + glow accent */
.handover-bar {
  position: relative;
  overflow: hidden;
}
.handover-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}

/* DRAWER - smoother slide + stage fill animation */
.drawer { transition: transform 0.28s var(--ease), opacity 0.24s var(--ease); }
.drawer-backdrop.is-open .drawer { animation: rhm-slide-in 0.34s var(--ease) both; }
.drawer-stages span.fill {
  animation: rhm-fade-in 0.4s var(--ease) both;
}
.drawer-composer {
  position: relative;
  overflow: hidden;
}
.drawer-composer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, #f5c84a 0%, #e6a92a 50%, #f5c84a 100%);
  background-size: 200% 100%;
  animation: rhm-shimmer 4s linear infinite;
}

/* Drawer activity timeline - staggered slide-in */
.drawer-activity { animation: rhm-slide-in 0.3s var(--ease) both; }
.drawer-activity:nth-child(1) { animation-delay: 0.05s; }
.drawer-activity:nth-child(2) { animation-delay: 0.10s; }
.drawer-activity:nth-child(3) { animation-delay: 0.15s; }

/* TAB UNDERLINE - slide between tabs more smoothly */
.tabnav a::after, .tabs button {
  transition: transform 0.26s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}

/* EMPTY STATES - softer, with subtle floating animation */
.empty-state { padding: 60px 24px; text-align: center; }
.empty-state-icon {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--gold-soft) 100%);
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--brand);
  box-shadow: 0 8px 24px -8px rgba(138,66,32,0.25);
  animation: rhm-bounce-in 0.5s var(--ease) both;
}
.empty-state-icon svg { width: 32px; height: 32px; }
.empty-state h2 { font-size: 1.2rem; color: var(--ink); font-weight: 600; margin: 0 0 8px; letter-spacing: -0.01em; }
.empty-state p { color: var(--ink-mute); margin-bottom: 18px; }

/* SOURCE BADGES + STATUS BADGES - soft gradients */
.src-badge {
  background: linear-gradient(135deg, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.02) 100%);
  font-weight: 600;
}

/* TOAST - slide-in from top right */
.toast {
  animation: rhm-bounce-in 0.32s var(--ease) both;
  border-radius: 14px;
  padding: 14px 18px;
}

/* MODAL - softer + larger lift */
.modal {
  animation: rhm-bounce-in 0.32s var(--ease) both;
  border: 1px solid rgba(255,255,255,0.8);
}
.modal-header { padding: 22px 24px 16px; }
.modal-body   { padding: 18px 24px; }
.modal-footer { padding: 16px 24px 20px; gap: 12px; }

/* JOBS PILL - animated count */
.jobs-pill {
  background: linear-gradient(135deg, var(--green) 0%, #0eaa70 100%);
  box-shadow: 0 4px 10px -2px rgba(20,163,108,0.4);
}

/* DEAL/RES/LEAD ROW - make linked vehicle visible */
.deal-thumb, .lead-detail-thumb, .res-vehicle .thumb {
  background: linear-gradient(135deg, var(--brand-soft) 0%, #f4d6b3 100%);
  color: var(--brand-dark);
  font-weight: 700;
}

/* CARD HEADS - softer with refined typography */
.card-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { font-size: 1.02rem; letter-spacing: -0.01em; }
.card-empty { color: var(--ink-mute); padding: 32px 20px; text-align: center; font-style: italic; font-size: 0.92rem; }

/* SLIDER-TYPE inputs (Pricing) - branded thumb */
.pricing-slider input[type="range"]::-webkit-slider-thumb {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  box-shadow: 0 4px 10px -2px rgba(138,66,32,0.4);
}

/* HOVER LIFT on key cards (dashboard widgets) */
.dash-card, .kpi-card-deals, .leaderboard {
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.dash-card:hover { transform: translateY(-2px); }

/* FOCUS RINGS - accessible + on-brand */
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
  border-radius: 6px;
}

/* RESPECT REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* ============================================================
   DASHBOARD COMMAND CENTRE
   Hero KPI tiles, quick actions, sparkline, focus list,
   activity feed, pipeline funnel, forecourt spotlight.
   ============================================================ */

/* HERO KPI STRIP */
.hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 28px 18px;
}
@media (max-width: 1100px) { .hero-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .hero-kpis { grid-template-columns: 1fr; } }
.hero-kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: rhm-fade-in 0.42s var(--ease) both;
}
.hero-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hero-kpi::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand);
  border-radius: 14px 0 0 14px;
}
.hero-kpi[data-tone="brand"]::before { background: linear-gradient(180deg, var(--brand-dark), var(--brand-light)); }
.hero-kpi[data-tone="blue"]::before  { background: linear-gradient(180deg, #2563eb, #3b82f6); }
.hero-kpi[data-tone="green"]::before { background: linear-gradient(180deg, #14a36c, #0e8a5b); }
.hero-kpi[data-tone="amber"]::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.hero-kpi-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 6px 14px -2px rgba(0,0,0,0.18);
}
.hero-kpi-icon svg { width: 22px; height: 22px; }
.hero-kpi[data-tone="brand"] .hero-kpi-icon { background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-light) 100%); }
.hero-kpi[data-tone="blue"]  .hero-kpi-icon { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.hero-kpi[data-tone="green"] .hero-kpi-icon { background: linear-gradient(135deg, #14a36c 0%, #0eaa70 100%); }
.hero-kpi[data-tone="amber"] .hero-kpi-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.hero-kpi-body { min-width: 0; }
.hero-kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.hero-kpi-num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.hero-kpi-suffix { font-size: 1rem; color: var(--ink-mute); font-weight: 600; }
.hero-kpi-sub {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 6px;
}
.hot-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: #dc2626;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(220,38,38,0.55);
  animation: rhm-soft-pulse-red 2s ease-out infinite;
}
@keyframes rhm-soft-pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}

/* QUICK ACTIONS strip */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 0 28px 22px;
}
@media (max-width: 1100px) { .quick-actions { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .quick-actions { grid-template-columns: repeat(2, 1fr); } }
.quick-action {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-light);
}
.quick-action .qa-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 4px 12px -2px rgba(0,0,0,0.18);
}
.quick-action .qa-icon svg { width: 20px; height: 20px; }
.quick-action strong { display: block; font-size: 0.92rem; font-weight: 600; }
.quick-action small  { display: block; font-size: 0.74rem; color: var(--ink-mute); margin-top: 2px; }

/* KPI SPARKLINE (Deals Completed card) */
.kpi-spark {
  margin-left: auto;
  width: 280px;
  position: relative;
}
.kpi-spark svg path { transition: d 0.4s var(--ease); }
.kpi-spark-label {
  position: absolute;
  bottom: -4px; left: 4px;
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}
@media (max-width: 900px) { .kpi-spark { display: none; } }

/* 3-COL ROW (focus / activity / pipeline). Higher-specificity selector
   so the page-inline `.dash-row { 1fr 1fr }` rule can't override the
   three-column layout. */
.dash-row.dash-row-3 {
  grid-template-columns: 1.1fr 1fr 1fr !important;
  gap: 20px;
}
@media (max-width: 1100px) { .dash-row.dash-row-3 { grid-template-columns: 1fr !important; } }

/* TODAY'S FOCUS */
.focus-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.focus-item {
  display: grid;
  grid-template-columns: 36px 1fr 18px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.16s var(--ease);
  border: 1px solid transparent;
}
.focus-item:hover {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}
.focus-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: #fff;
}
.focus-icon svg { width: 16px; height: 16px; }
.focus-item[data-tone="red"]    .focus-icon { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }
.focus-item[data-tone="amber"]  .focus-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.focus-item[data-tone="blue"]   .focus-icon { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.focus-item[data-tone="green"]  .focus-icon { background: linear-gradient(135deg, #14a36c 0%, #0e8a5b 100%); }
.focus-text strong { display: block; font-size: 0.9rem; }
.focus-text small  { display: block; color: var(--ink-mute); font-size: 0.78rem; margin-top: 2px; }
.focus-chevron     { color: var(--ink-faint); }
.focus-empty {
  text-align: center;
  padding: 32px 22px;
  color: var(--ink-mute);
}
.focus-empty-icon {
  width: 48px; height: 48px;
  margin: 0 auto 10px;
  background: var(--green-soft);
  color: var(--green);
  border-radius: 50%;
  display: grid; place-items: center;
}
.focus-empty-icon svg { width: 24px; height: 24px; }
.focus-empty h4 { margin: 0 0 4px; font-weight: 600; color: var(--ink); }
.focus-empty p  { margin: 0; font-size: 0.88rem; }

/* RECENT ACTIVITY feed */
.activity-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.activity-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.12s var(--ease);
}
.activity-item:hover { background: var(--surface-soft); }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  color: #fff;
}
.activity-icon svg { width: 14px; height: 14px; }
.activity-item[data-tone="brand"] .activity-icon { background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-light) 100%); }
.activity-item[data-tone="blue"]  .activity-icon { background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%); }
.activity-item[data-tone="green"] .activity-icon { background: linear-gradient(135deg, #14a36c 0%, #0e8a5b 100%); }
.activity-item[data-tone="amber"] .activity-icon { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.activity-text strong { display: block; font-size: 0.88rem; }
.activity-text small  { display: block; color: var(--ink-mute); font-size: 0.76rem; margin-top: 2px; }
.activity-ago { color: var(--ink-faint); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.04em; }

/* PIPELINE FUNNEL */
.pipeline-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.pipeline-row {
  display: grid;
  grid-template-columns: 80px 1fr 44px;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.16s var(--ease);
}
.pipeline-row:hover { transform: translateX(2px); }
.pipeline-label { font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.pipeline-bar {
  position: relative;
  height: 24px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}
.pipeline-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  animation: pipeline-grow 0.6s var(--ease) both;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
.pipeline-row[data-stage="new"]       .pipeline-fill { background: linear-gradient(90deg, #93c5fd, #2563eb); }
.pipeline-row[data-stage="contacted"] .pipeline-fill { background: linear-gradient(90deg, #fbbf24, #d97706); }
.pipeline-row[data-stage="hot"]       .pipeline-fill { background: linear-gradient(90deg, #f87171, #dc2626); }
.pipeline-row[data-stage="won"]       .pipeline-fill { background: linear-gradient(90deg, #34d399, #14a36c); }
@keyframes pipeline-grow { from { width: 0; } }
.pipeline-count { text-align: right; font-weight: 700; color: var(--ink); }

/* FORECOURT SPOTLIGHT */
.spotlight-card { margin: 22px 28px 28px; }
.spotlight-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 14px 18px 22px;
}
@media (max-width: 1100px) { .spotlight-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .spotlight-row { grid-template-columns: 1fr; } }
.spotlight-card-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
}
.spotlight-card-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-light);
}
.spotlight-thumb {
  position: relative;
  height: 110px;
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--gold-soft) 100%);
  display: grid;
  place-items: center;
}
.spotlight-watermark {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: 0.08em;
  color: rgba(138,66,32,0.18);
}
.spotlight-phase {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.92);
}
.spotlight-phase.phase-fresh  { color: #14a36c; }
.spotlight-phase.phase-profit { color: #d97706; }
.spotlight-phase.phase-watch  { color: #d97706; }
.spotlight-phase.phase-stale  { color: #dc2626; }
.spotlight-body { padding: 12px 14px 14px; }
.spotlight-title {
  font-size: 0.94rem;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spotlight-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-bottom: 6px;
}
.spotlight-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: -0.02em;
}

/* DEALS HERO KPI card upgraded layout */
.kpi-card-deals .dash-kpi-row-inner {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 900px) {
  .kpi-card-deals .dash-kpi-row-inner { grid-template-columns: auto auto; }
}

/* ============================================================
   CHANNEL ROI + SMART REPRICING widgets
   ============================================================ */
.dash-row.dash-row-2-balanced {
  grid-template-columns: 1.15fr 0.85fr !important;
  gap: 22px;
}
@media (max-width: 1100px) { .dash-row.dash-row-2-balanced { grid-template-columns: 1fr !important; } }

.roi-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.roi-row {
  display: grid;
  grid-template-columns: 42px 1fr 90px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.16s var(--ease);
}
.roi-row:hover { background: var(--surface); border-color: var(--line); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.roi-logo { width: 42px; height: 42px; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.roi-logo svg { width: 100%; height: 100%; display: block; }
.roi-text strong { display: block; font-weight: 600; font-size: 0.92rem; }
.roi-text small { display: block; color: var(--ink-mute); font-size: 0.76rem; margin-top: 2px; }
.roi-bar { height: 4px; background: rgba(0,0,0,0.04); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.roi-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-light)); border-radius: 999px; animation: rhm-fade-in 0.4s var(--ease) both; }
.roi-cost { text-align: right; }
.roi-cost strong { display: block; font-weight: 800; color: var(--ink); font-size: 1rem; letter-spacing: -0.02em; }
.roi-cost small { display: block; color: var(--ink-mute); font-size: 0.74rem; }

.reprice-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.reprice-row {
  display: grid;
  grid-template-columns: 70px 1fr 90px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(245,158,11,0.08) 0%, transparent 70%);
  border: 1px solid rgba(245,158,11,0.18);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.16s var(--ease);
}
.reprice-row:hover { background: linear-gradient(90deg, rgba(245,158,11,0.14) 0%, transparent 70%); transform: translateX(2px); border-color: rgba(245,158,11,0.32); }
.reprice-text strong { display: block; font-size: 0.92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reprice-text small { display: block; color: var(--ink-mute); font-size: 0.76rem; margin-top: 2px; }
.reprice-drop { text-align: right; }
.reprice-drop small { display: block; color: var(--ink-mute); font-size: 0.76rem; text-decoration: line-through; }
.reprice-drop strong { display: block; color: #b45309; font-weight: 800; font-size: 0.96rem; letter-spacing: -0.02em; }

/* ============================================================
   UI BEAST PASS - glass morphism, refined motion, premium states
   Final layer over v2 / v3 / dashboard / widgets.
   ============================================================ */

/* Voice note button on Drawer composer */
.btn-voice {
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
  color: #fff;
  border: 0;
  padding: 8px 12px;
  transition: all 0.2s var(--ease);
}
.btn-voice:hover { box-shadow: 0 6px 16px -2px rgba(109,40,217,0.4); transform: translateY(-1px); }
.btn-voice.is-recording {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  animation: rhm-soft-pulse-red 1.2s ease-out infinite;
}

/* Glass-morphism layer for drawer-backdrop */
.drawer-backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

/* Subtle gradient overlay on cards in dark surfaces */
.card { position: relative; }

/* TopBar add button gets a soft glow on hover */
.topbar-add:hover { box-shadow: 0 0 0 3px rgba(255,255,255,0.18); }

/* Daily briefing button on dashboard pulses subtly */
.dash-briefing-btn {
  position: relative;
  animation: rhm-pulse-gold 3s ease-out infinite;
}
@keyframes rhm-pulse-gold {
  0%, 100% { box-shadow: 0 4px 12px -2px rgba(138,66,32,0.35), 0 0 0 0 rgba(226,183,92,0); }
  50%      { box-shadow: 0 6px 18px -2px rgba(138,66,32,0.5), 0 0 0 6px rgba(226,183,92,0.18); }
}

/* Notification bell badge: micro-bounce on new messages */
.topbar-bell .badge { transition: transform 0.18s var(--ease); }
.topbar-bell:hover .badge { transform: scale(1.18) rotate(10deg); }

/* Modal entrance - more pronounced lift */
.modal-backdrop.is-open .modal {
  animation: rhm-modal-in 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes rhm-modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Card-head emoji prefix slot (allows premium look without an icon) */
.card-head h3 { display: flex; align-items: center; gap: 8px; }

/* Buttons with .btn-icon look like tab actions on the drawer */
.drawer-footer .btn-icon {
  background: var(--surface-soft);
  color: var(--ink-mute);
  border: 1px solid var(--line);
}

/* Refined kbd-style chip for keyboard shortcuts in tooltips */
kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-family: 'SF Mono', Monaco, monospace;
  color: var(--ink);
}

/* Status pill animation for in-progress / pending */
@keyframes rhm-stripe {
  0% { background-position: 0 0; }
  100% { background-position: 40px 0; }
}
.status-pill.is-progress {
  background-image: linear-gradient(45deg, rgba(255,255,255,0.18) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.18) 75%, transparent 75%);
  background-size: 40px 40px;
  animation: rhm-stripe 1.6s linear infinite;
}

/* Refined .info-i */
.info-i {
  display: inline-grid; place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink-mute);
  font-size: 0.74rem;
  font-weight: 800;
  font-style: italic;
  margin-left: 6px;
  cursor: help;
  transition: all 0.16s var(--ease);
}
.info-i:hover { background: var(--brand); color: #fff; }

/* Page hero kicker style - used across new pages */
.acc-kicker, .auc-kicker, .rem-kicker, .fc-kicker {
  display: inline-block;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* Tabnav glass effect when scrolled */
.tabnav {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

/* Drawer left avatar bigger ring on hover */
.drawer-avatar { transition: transform 0.2s var(--ease); }
.drawer-left-scroll:hover .drawer-avatar { transform: scale(1.04); }

/* Better focus styles globally */
*:focus-visible {
  outline: 2px solid var(--brand-light);
  outline-offset: 2px;
  border-radius: 4px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 0;
}

/* Loading shimmer placeholder helper */
.is-loading {
  background: linear-gradient(90deg, var(--surface-soft) 0%, var(--surface) 50%, var(--surface-soft) 100%);
  background-size: 200% 100%;
  animation: rhm-shimmer 1.4s linear infinite;
}

/* Footer credit at the bottom of each page */
.rhm-credit {
  text-align: center;
  padding: 24px;
  color: var(--ink-faint);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* REVIEWS card */
.reviews-body { padding: 4px 18px 18px; }
.reviews-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.reviews-cell { text-align: center; padding: 16px; background: linear-gradient(135deg, var(--surface-soft) 0%, transparent 100%); border-radius: 12px; border: 1px solid var(--line); }
.reviews-platform svg { width: 36px; height: 36px; margin-bottom: 4px; }
.reviews-score { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0; }
.reviews-score strong { color: var(--brand-dark); font-size: 1.7rem; }
.reviews-platform-name { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ink); }
.reviews-count { color: var(--ink-mute); font-size: 0.74rem; margin-top: 2px; }
.review-item { padding: 12px; background: var(--surface-soft); border-radius: 10px; margin-bottom: 8px; transition: background 0.14s; }
.review-item:hover { background: var(--surface); border: 1px solid var(--line); }
.review-stars { color: #f59e0b; font-size: 0.92rem; letter-spacing: 1px; margin-bottom: 4px; }
.review-text { font-size: 0.88rem; color: var(--ink); line-height: 1.5; font-style: italic; }
.review-meta { color: var(--ink-mute); font-size: 0.76rem; margin-top: 6px; }

/* TEST DRIVE planner */
.testdrive-body { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.td-row { display: grid; grid-template-columns: 56px 64px 1fr 28px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--surface-soft); border: 1px solid transparent; transition: all 0.14s; text-decoration: none; color: var(--ink); }
.td-row:hover { border-color: var(--line); background: var(--surface); transform: translateX(2px); }
.td-day { text-align: center; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%); color: #fff; border-radius: 8px; padding: 6px; }
.td-day strong { display: block; font-size: 0.72rem; letter-spacing: 0.04em; font-weight: 700; }
.td-day span { display: block; font-size: 1.1rem; font-weight: 800; line-height: 1; margin-top: 2px; }
.td-time { font-weight: 700; color: var(--ink); }
.td-customer strong { display: block; font-size: 0.9rem; }
.td-customer small { display: block; color: var(--ink-mute); font-size: 0.76rem; margin-top: 2px; }

/* Daily Briefing responsive grid */
.briefing-ov-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 600px) {
  .briefing-ov-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   UI BEAST LAYER II - Final premium pass
   ============================================================ */

/* Smoother brand-aware page background - barely-visible mesh */
body {
  background:
    radial-gradient(900px 600px at 10% -10%, rgba(196,121,77,0.05), transparent 60%),
    radial-gradient(800px 700px at 110% 0%, rgba(37,99,235,0.04), transparent 60%),
    radial-gradient(600px 500px at 50% 100%, rgba(20,163,108,0.03), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

/* TABNAV - premium scroll handling + chip-style tabs */
.tabnav {
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}
.tabnav a {
  scroll-snap-align: start;
  padding: 14px 12px;
  font-size: 0.92rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 10px 10px 0 0;
  white-space: nowrap;
}
.tabnav a:hover:not(.is-active) {
  background: linear-gradient(180deg, rgba(196,121,77,0.06) 0%, rgba(196,121,77,0.0) 100%);
  color: var(--brand-dark);
}
.tabnav a.is-active {
  background: linear-gradient(180deg, rgba(196,121,77,0.12) 0%, rgba(196,121,77,0.02) 100%);
}
.tabnav a.is-active::after {
  height: 3px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand), var(--brand-light));
  border-radius: 2px 2px 0 0;
}

/* Page main content fades up softly */
.page > *:first-child { animation: rhm-fade-in 0.4s var(--ease) both; }

/* Drawer composer auto-focus glow */
.drawer-composer-input:focus { outline: 0; }

/* Subtle slide-in for any drawer activity entry being added live */
.drawer-activity { animation: rhm-slide-in 0.4s var(--ease) both; }

/* Make every card-head h3 weightier + emoji-aware */
.card-head h3, .dash-card-head h3 {
  font-weight: 700;
  letter-spacing: -0.005em;
}

/* Premium ribbon utility - used on dashboard cards with announcements */
.ribbon {
  position: absolute;
  top: 12px; right: -32px;
  transform: rotate(35deg);
  background: linear-gradient(135deg, var(--gold), #b08230);
  color: #2a1607;
  padding: 4px 36px;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  box-shadow: 0 4px 10px -2px rgba(0,0,0,0.18);
}

/* Skeleton helper for any list while data loads */
.skeleton-row {
  height: 56px;
  background: linear-gradient(90deg, var(--surface-soft) 0%, var(--surface) 50%, var(--surface-soft) 100%);
  background-size: 200% 100%;
  border-radius: 10px;
  animation: rhm-shimmer 1.4s linear infinite;
  margin-bottom: 8px;
}

/* Vehicle.html action bar lift on hover, tighter spacing */
.detail-actions-buttons .btn {
  font-weight: 600;
  letter-spacing: -0.005em;
}
.detail-actions-buttons .btn[id="btn-ai-desc"] { box-shadow: 0 4px 14px -4px rgba(109,40,217,0.4); }
.detail-actions-buttons .btn[id="btn-book-td"] { box-shadow: 0 4px 14px -4px rgba(20,163,108,0.4); }
.detail-actions-buttons .btn[id="btn-ai-desc"]:hover { box-shadow: 0 8px 22px -4px rgba(109,40,217,0.55); }
.detail-actions-buttons .btn[id="btn-book-td"]:hover { box-shadow: 0 8px 22px -4px rgba(20,163,108,0.55); }

/* Reg plate - extra physical depth */
.reg-plate {
  position: relative;
}
.reg-plate::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,0.45) 0%, transparent 40%);
  pointer-events: none;
}

/* Better focus chrome on links */
a:focus-visible { outline: 2px solid var(--brand-light); outline-offset: 3px; border-radius: 4px; }

/* Drawer-stages spans get a soft connector line */
.drawer-stages { position: relative; }
.drawer-stages::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.04) 50%, transparent 100%);
  z-index: -1;
}

/* Hover-state for any list-row inside a card - universal lift */
.card .list-card .row:hover,
.list-card > div:hover:not(.list-card-head) { background-color: var(--surface-soft); }

/* Daily Briefing modal - more comfortable padding */
#briefing-modal .modal-body { padding: 24px 28px; line-height: 1.6; }

/* Final touch - soft pulse on the bell badge so dealers can't miss a hot lead */
.topbar-bell .badge {
  animation: rhm-soft-pulse-red 2.5s ease-out infinite;
}

/* Toast positioning + premium */
.toast {
  border-radius: 14px;
  font-weight: 500;
  border-left: 4px solid var(--brand);
  background: linear-gradient(135deg, #ffffff 0%, #fafbfd 100%);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  backdrop-filter: blur(8px);
}
.toast strong { color: var(--ink); }
.toast small { color: var(--ink-mute); opacity: 1; }

/* Premium scrollbar on the entire app */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(0,0,0,0.10), rgba(0,0,0,0.16)); border-radius: 999px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--brand), var(--brand-dark)); }

/* ============================================================
   LOGIN SCREEN - premium hero treatment
   ============================================================ */
.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 600px at 0% 0%, rgb(from var(--brand) r g b / 0.16), transparent 60%),
    radial-gradient(800px 700px at 100% 100%, rgb(from var(--brand-light) r g b / 0.14), transparent 60%),
    radial-gradient(700px 500px at 50% 50%, rgb(from var(--brand) r g b / 0.06), transparent 70%),
    linear-gradient(135deg, #f6f8fb 0%, #eef2f7 100%);
  overflow: hidden;
}
.login-shell::before {
  /* Subtle car-silhouette texture */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0, transparent 40px, rgb(from var(--brand) r g b / 0.025) 40px, rgb(from var(--brand) r g b / 0.025) 42px);
  pointer-events: none;
}
.login-card {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: 20px;
  padding: 48px 44px;
  box-shadow:
    0 24px 60px -12px rgba(15, 23, 42, 0.18),
    0 4px 16px -2px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  max-width: 460px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: rhm-bounce-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.login-card-logo { margin-bottom: 32px; gap: 14px; }
.login-card-logo-mark {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand-dark) 100%);
  color: #fff;
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-weight: 900;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 20px -4px rgba(176, 130, 48, 0.4), inset 0 1px 0 rgba(255,255,255,0.45);
  font-size: 1.05rem;
}
.login-card-logo-text strong { font-size: 1.18rem; letter-spacing: -0.005em; }
.login-card-logo-text small { font-size: 0.72rem; font-weight: 600; }
.login-card h1 {
  font-size: 1.65rem;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.login-card p { color: var(--ink-mute); font-size: 0.94rem; margin-bottom: 24px; }
.login-card form .field label { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 6px; }
.login-card form .field input {
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: all 0.16s var(--ease);
}
.login-card form .field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(196, 121, 77, 0.16);
  outline: none;
}
.login-card form .btn-lg {
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%) !important;
  border: 0;
  box-shadow: 0 8px 20px -4px rgba(138, 66, 32, 0.4);
  position: relative;
  overflow: hidden;
}
.login-card form .btn-lg:hover {
  box-shadow: 0 12px 28px -4px rgba(138, 66, 32, 0.55);
  transform: translateY(-1px);
}
.login-demo-note {
  margin-top: 28px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(37,99,235,0.05) 0%, rgba(20,163,108,0.04) 100%);
  border: 1px solid rgba(37,99,235,0.12);
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-mute);
}
.login-demo-note strong {
  display: block;
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.login-demo-note code {
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  border: 1px solid var(--line);
}

/* Dashboard sparkline follows the tenant brand */
#spark-line { stroke: var(--brand-dark); }
#sparkFill stop { stop-color: var(--brand-light); }

/* DVLA reg-lookup status pill (New Valuation modal) */
.dvla-status { font-size: 0.8rem; font-weight: 600; margin: 2px 0 10px; padding: 9px 13px; border-radius: 9px; display: flex; align-items: center; gap: 8px; }
.dvla-status.loading { background: #eaf1ff; color: #2563eb; }
.dvla-status.ok { background: #e7f7ef; color: #0d8a52; }
.dvla-status.demo { background: #eaf4ff; color: #1d6fd8; }
.dvla-status.err { background: #fdecec; color: #b3261e; }
.field input[readonly] { background: var(--surface-soft); color: var(--ink-mute); cursor: default; }

/* Topbar user dropdown (My KPIs / My Commission / Reports / Sign out) */
.user-dropdown { position: fixed; z-index: 1200; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s; }
.user-dropdown.open { opacity: 1; visibility: visible; transform: none; }
.user-dropdown a, .user-dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border-radius: 8px; font: inherit; font-size: 0.95rem; font-weight: 500; color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left; text-decoration: none; }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--surface-soft); }
.user-dropdown svg { width: 18px; height: 18px; opacity: .7; flex: none; }
.user-dropdown .ud-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.user-dropdown [data-signout] { color: #c0392b; }

/* =====================================================================
   MOBILE RESPONSIVENESS — additive, does not touch the desktop layout.
   Fixes: topbar overflow, horizontal tabnav, full-width modals, 16px
   inputs (no iOS zoom), 44px tap targets, no sideways scroll 320px+.
   ===================================================================== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  /* Topbar: drop the centre logo + user name so it fits a phone */
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar-logo { display: none; }
  .topbar-user-name { display: none; }
  .topbar-search { flex: 1 1 auto; min-width: 0; }
  .topbar-search input { font-size: 16px; }
  /* Tab nav becomes a horizontal scroller instead of pushing the page wide */
  .tabnav { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabnav::-webkit-scrollbar { height: 0; }
  .tabnav a { white-space: nowrap; flex: 0 0 auto; }
  /* Page chrome */
  .page { padding-left: 14px; padding-right: 14px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-actions { flex-wrap: wrap; gap: 8px; }
  .page-actions .btn { flex: 1 1 auto; justify-content: center; }
  /* 16px inputs prevent iOS zoom + are legible; 44px tap targets */
  input, select, textarea, .field input, .field select, .field textarea, .modal input, .modal select, .modal textarea { font-size: 16px !important; }
  .btn { min-height: 44px; }
  .btn.btn-sm { min-height: 34px; }
  /* Wide list grids scroll inside their card rather than the whole page */
  .list-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Full-width, scrollable modals with a reachable close button */
  .modal-backdrop { padding: 10px; align-items: flex-start; }
  .modal { width: calc(100vw - 20px) !important; max-width: calc(100vw - 20px) !important; max-height: 92vh; overflow-y: auto; margin: 8px auto; }
  .modal .form-row { display: flex; flex-direction: column; gap: 12px; }
  .modal .field, .modal .field.full { width: 100%; }
  .modal-footer { flex-wrap: wrap; gap: 10px; }
  .modal-footer-actions { width: 100%; display: flex; gap: 10px; }
  .modal-footer-actions .btn { flex: 1; }
  /* Stat / tile rows stack 1-up on small phones via existing grids;
     keep the new-module tile rows comfortable */
  .tile-row { grid-template-columns: 1fr 1fr !important; }
  .user-dropdown { right: 10px !important; left: 10px; min-width: 0; }
}
@media (max-width: 420px) {
  .tile-row { grid-template-columns: 1fr !important; }
  .page h1 { font-size: 1.35rem; }
}

/* ====================================================================
   Realistic UK rear number plate. Overrides the earlier gold-box
   .reg-plate styling: classic yellow plate, black plate-style text,
   and a blue GB/UK side band. em-based so it scales wherever the
   class is used (deal/lead lists, drawers, pricing hero).
   ==================================================================== */
.reg-plate {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: #ffd400;
  background-image: none;
  color: #111418;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-shadow: none;
  line-height: 1;
  padding: 0.36em 0.62em 0.36em 2.25em;
  border: 1px solid #15171c;
  border-radius: 0.4em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.4);
  white-space: nowrap;
}
.reg-plate::before {
  content: 'UK';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: auto;
  width: 1.85em;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #063298;
  color: #fff;
  font-size: 0.74em;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 0.4em 0 0 0.4em;
  pointer-events: none;
}
