/* ═══════════════════════════════════════════════════════════════════════════
   Garage Logic — Shared Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:    #2563eb;
  --primary-dk: #1d4ed8;
  --secondary:  #64748b;
  --success:    #16a34a;
  --warning:    #d97706;
  --danger:     #dc2626;
  --info:       #0891b2;
  --bg:         #f1f5f9;
  --surface:    #ffffff;
  --border:     #e2e8f0;
  --text:       #1e293b;
  --text-muted: #64748b;
  --sidebar-w:  240px;
  --header-h:   56px;
  --radius:     8px;
  --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

html, body { height: 100%; font-family: 'Inter', system-ui, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; font-size: 14px; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ─── Typography ─────────────────────────────────────────────────────────── */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8rem; }
.text-lg { font-size: 1rem; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

/* ─── Layout Shell ───────────────────────────────────────────────────────── */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #1e293b;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 18px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  border-bottom: 1px solid #334155;
  white-space: nowrap;
}
.sidebar-logo span { color: var(--primary); }
.sidebar-vrm { padding: 12px 16px; border-bottom: 1px solid #334155; }
.sidebar-vrm .sidebar-section-label { padding: 0; margin-bottom: 8px; }
.sidebar-vrm-row { display: flex; gap: 6px; align-items: center; }
.sidebar-vrm-row .form-control {
  flex: 1; min-width: 0;
  text-transform: uppercase; font-family: monospace;
  background: #0f172a; color: #e2e8f0; border-color: #334155;
}
.sidebar-vrm-row .form-control::placeholder { color: #64748b; }
.sidebar-vrm-row .btn { flex-shrink: 0; }
.sidebar-section { padding: 12px 0; border-bottom: 1px solid #334155; }
.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #475569;
  padding: 0 16px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: #94a3b8;
  cursor: pointer;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
  user-select: none;
}
.nav-item:hover { background: #334155; color: #e2e8f0; }
.nav-item.active { background: #1d3461; color: #fff; border-left-color: var(--primary); }
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-user {
  margin-top: auto;
  padding: 12px 16px;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { color: #e2e8f0; font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: #64748b; font-size: 0.75rem; }

/* ─── Main Area ──────────────────────────────────────────────────────────── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* In-app notifications inbox bell + panel */
.inbox-bell { position: relative; }
.inbox-bell-btn {
  position: relative; background: transparent; border: 0; cursor: pointer;
  font-size: 1.3rem; line-height: 1; padding: 6px 8px; color: var(--text-muted);
  border-radius: 6px;
}
.inbox-bell-btn:hover { background: var(--bg); color: var(--text); }
.inbox-bell-badge {
  position: absolute; top: 0; right: 0;
  background: var(--danger,#dc2626); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 1;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.inbox-panel {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 380px; max-height: 480px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,.15); z-index: 200;
}
.inbox-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: .82rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.inbox-panel-header button { font-size: .78rem; }
.inbox-row {
  display: flex; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.inbox-row:hover { background: var(--bg); }
.inbox-row.unseen { background: rgba(37,99,235,.04); }
.inbox-row .inbox-icon { font-size: 1.1rem; flex-shrink: 0; }
.inbox-row .inbox-body { flex: 1; min-width: 0; }
.inbox-row .inbox-title { font-weight: 600; font-size: .9rem; margin-bottom: 2px; }
.inbox-row .inbox-snippet { font-size: .82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-row .inbox-time { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }
.inbox-row .inbox-delete {
  align-self: flex-start; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .85rem; line-height: 1;
  padding: 2px 4px; border-radius: 4px; opacity: .55;
}
.inbox-row:hover .inbox-delete { opacity: 1; }
.inbox-row .inbox-delete:hover { color: #dc2626; background: rgba(220,38,38,.08); }
.inbox-empty { padding: 30px 14px; text-align: center; color: var(--text-muted); font-size: .9rem; }

.topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}
.topbar-title { font-size: 1.05rem; font-weight: 600; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Mobile nav drawer trigger + scrim — hidden on desktop, shown in the
   max-width:768px block for the garage SPA. */
.nav-hamburger {
  display: none;
  background: none; border: none;
  font-size: 1.4rem; line-height: 1;
  padding: 4px 8px; margin-left: -4px;
  cursor: pointer; color: var(--text);
  border-radius: 6px;
}
.nav-hamburger:hover { background: var(--bg); }
.nav-scrim { display: none; }

.page-content { flex: 1; overflow-y: auto; padding: 24px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 1.3rem; font-weight: 700; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ─── Settings tabs ─────────────────────────────────────────────────────── */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.settings-tab {
  padding: 10px 18px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.settings-panel { display: none; }
.settings-panel.active { display: block; }

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-title { font-size: .95rem; font-weight: 600; }
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: #f8fafc; border-radius: 0 0 var(--radius) var(--radius); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.stat-card[onclick]:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.stat-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.stat-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
/* Colour-coded variants — tinted background + accent left border so the
   tile is recognisable at a glance, not just by the value text. */
.stat-card.danger  { background: #fef2f2; border-left-color: var(--danger);  }
.stat-card.danger  .stat-value { color: var(--danger); }
.stat-card.warning { background: #fffbeb; border-left-color: var(--warning); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.success { background: #f0fdf4; border-left-color: var(--success); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.primary { background: #eff6ff; border-left-color: var(--primary); }
.stat-card.primary .stat-value { color: var(--primary); }
.stat-card.purple  { background: #faf5ff; border-left-color: #7c3aed; }
.stat-card.purple  .stat-value { color: #7c3aed; }
.stat-card.info    { background: #ecfeff; border-left-color: #0e7490; }
.stat-card.info    .stat-value { color: #0e7490; }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 500;
  line-height: 1.4;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--primary);   color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dk); border-color: var(--primary-dk); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger    { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-warning   { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-info      { background: var(--info);    color: #fff; border-color: var(--info); }
.btn-ghost     { background: transparent; color: var(--primary); border-color: transparent; }
.btn-ghost:hover { background: #eff6ff; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-lg { padding: 10px 20px; font-size: 1rem; }
.btn-icon { padding: 6px; border-radius: 6px; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-weight: 500; margin-bottom: 5px; font-size: 0.85rem; }
.form-label .required { color: var(--danger); }
.form-control {
  width: 100%;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.form-control.is-invalid { border-color: var(--danger); }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; text-align: left; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: #f8fafc; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
.table-empty { text-align: center; padding: 40px; color: var(--text-muted); }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.badge-primary  { background: #dbeafe; color: #1d4ed8; }
.badge-success  { background: #dcfce7; color: #15803d; }
.badge-warning  { background: #fef9c3; color: #854d0e; }
.badge-danger   { background: #fee2e2; color: #b91c1c; }
.badge-info     { background: #cffafe; color: #0e7490; }
.badge-secondary{ background: #f1f5f9; color: #475569; }
.badge-purple   { background: #f3e8ff; color: #7c3aed; }

/* Severity badges */
.sev-critical { background: #fee2e2; color: #991b1b; }
.sev-high     { background: #ffedd5; color: #9a3412; }
.sev-medium   { background: #fef9c3; color: #713f12; }
.sev-low      { background: #f0fdf4; color: #166534; }

/* ─── Modals ─────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn .15s ease-out;
}
.modal-lg   { max-width: 780px; }
.modal-xl   { max-width: 1000px; }
.modal-evhc { max-width: 860px; height: min(95vh, 1100px); max-height: 95vh; }
@media (max-width: 860px) {
  .modal-evhc { max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .modal-backdrop { padding: 0; }
}
@keyframes modalIn { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.3rem; color: var(--text-muted); padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 9px 18px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; font-size: 0.87rem; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info     { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

/* ─── Line Item Tables (Estimates / Jobs / Invoices) ─────────────────────── */
.line-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.line-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.line-table th { padding: 6px 8px; background: #f8fafc; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.line-table td { padding: 2px 3px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.line-table tfoot td { padding: 8px 10px; font-weight: 600; border-top: 2px solid var(--border); }
.line-table .line-input { width: 100%; padding: 5px 7px; border: 1px solid transparent; border-radius: 4px; background: transparent; font-size: .875rem; box-sizing: border-box; min-width: 0; font-family: inherit; }
.line-table .line-input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 2px rgba(37,99,235,.1); }
.line-table tr:hover .line-input { background: #f8fafc; border-color: var(--border); }
.line-table tr:hover .line-input:focus { background: var(--surface); }
.line-table .col-type  { width: 105px; }
.line-table .col-code  { width: 100px; overflow: hidden; text-overflow: ellipsis; }
.line-table .col-qty   { width: 62px; }
.line-table .col-price { width: 90px; }
.line-table .col-vat   { width: 60px; }
.line-table .col-disc  { width: 60px; }
.line-table .col-warr  { width: 68px; }
.line-table .col-total { width: 82px; }
.line-table .col-incvat { width: 84px; }
.line-table .col-fit   { width: 92px; }
.line-table .col-del   { width: 34px; }
.line-table th.col-qty, .line-table th.col-price, .line-table th.col-vat,
.line-table th.col-disc, .line-table th.col-total, .line-table th.col-incvat { text-align: right; }
.line-table td.col-incvat { text-align: right; padding-right: 8px; color: var(--text-muted); }
.line-table th.col-warr, .line-table th.col-fit { text-align: center; }
.line-table td.line-total-cell { text-align: right; padding-right: 8px; }
.line-table td.col-del  { text-align: center; }
.line-table tr[style*="cursor:pointer"]:hover { background: var(--primary-light, #eff6ff); }
.line-code-badge { font-family: monospace; font-size: .72rem; background: var(--surface-alt,#f1f5f9); border: 1px solid var(--border); padding: 1px 5px; border-radius: 3px; white-space: nowrap; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.line-input-sm { padding: 3px 5px !important; font-size: .82rem !important; }
.totals-box { text-align: right; margin-top: 12px; }
.totals-row { display: flex; justify-content: flex-end; gap: 40px; padding: 4px 0; font-size: 0.9rem; }
.totals-row.total-final { font-size: 1.1rem; font-weight: 700; border-top: 2px solid var(--border); padding-top: 8px; margin-top: 4px; }


/* ─── Kanban Board ───────────────────────────────────────────────────────── */
.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col {
  min-width: 200px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}
.kanban-col-header {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #f8fafc; border-radius: var(--radius) var(--radius) 0 0;
}
.kanban-col-header .col-count { background: var(--border); color: var(--text-muted); font-size: 0.72rem; border-radius: 999px; padding: 1px 7px; }
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; }
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
  transition: box-shadow .15s;
  box-shadow: var(--shadow);
}
.kanban-card:hover { box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.kanban-card-num { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.kanban-card-title { font-weight: 600; font-size: 0.88rem; margin: 3px 0; }
.kanban-card-sub { font-size: 0.78rem; color: var(--text-muted); }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ─── Diary / Day Grid ───────────────────────────────────────────────────── */
.diary-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.diary-nav h2 { flex: 1; text-align: center; }
.diary-day-grid {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  min-width: 500px;
}
.diary-day-corner {
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
}
.diary-day-time-header {
  background: #f8fafc;
  padding: 4px 3px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  min-width: 32px;
}
.diary-day-row-label {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.diary-day-cell {
  border-right: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  min-height: 48px;
}
.diary-day-cell.diary-day-cell-hour { border-left: 1px solid #cbd5e1; }
.diary-day-cell:hover { background: #f0f9ff; }
.diary-day-cell.dragover { background: #bfdbfe; outline: 2px dashed #2563eb; outline-offset: -2px; }
.diary-booking:active { cursor: grabbing; }
.diary-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 8px;
  cursor: ew-resize;
  background: rgba(0,0,0,0.12);
  border-radius: 0 4px 4px 0;
  z-index: 2;
}
.diary-resize-handle:hover { background: rgba(0,0,0,0.28); }
.diary-day-grid.dragging .diary-booking { pointer-events: none; }
.diary-booking-locked { opacity: 0.7; cursor: not-allowed !important; }
.diary-booking-locked:hover { opacity: 0.85; }
.diary-cal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 220px;
  flex-shrink: 0;
}
.diary-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 4px; }
.diary-cal-nav strong { flex: 1; text-align: center; font-size: 0.85rem; }
.diary-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.diary-cal-dow { font-weight: 600; color: var(--text-muted); font-size: 0.65rem; padding: 4px 0; }
.diary-cal-day { padding: 5px 0; cursor: pointer; border-radius: 4px; font-size: 0.78rem; }
.diary-cal-day:hover { background: #f0f9ff; }
.diary-cal-day.today { color: #dc2626; font-weight: 700; }
.diary-cal-day.selected { background: var(--primary); color: #fff; }
.diary-cal-day.today.selected { background: #dc2626; color: #fff; }
.diary-cal-day.cap-ok   { background: #dcfce7; }
.diary-cal-day.cap-low  { background: #fef3c7; }
.diary-cal-day.cap-over { background: #fee2e2; }
.diary-cal-day.cap-ok.today, .diary-cal-day.cap-low.today, .diary-cal-day.cap-over.today { color: #dc2626; }
.diary-hours-badge {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.diary-hours-badge.ok   { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.diary-hours-badge.low  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.diary-hours-badge.over { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.diary-booking {
  margin: 2px;
  border-radius: 4px;
  padding: 3px 5px;
  font-size: 0.7rem;
  font-weight: 600;
  overflow: hidden;
  cursor: pointer;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  word-break: break-all;
}
.diary-booking-blue   { background: #dbeafe; color: #1e40af; border-left: 3px solid #2563eb; }
.diary-booking-green  { background: #dcfce7; color: #166534; border-left: 3px solid #16a34a; }
.diary-booking-orange { background: #ffedd5; color: #9a3412; border-left: 3px solid #f97316; }
.diary-booking-purple { background: #f3e8ff; color: #7e22ce; border-left: 3px solid #9333ea; }
/* No-show: overrides the rotating colour variant so a missed booking
   reads instantly regardless of its base colour. Red dashed border +
   faint diagonal hatch = "customer didn't arrive". Still clickable so
   the SA can open it to reinstate / reschedule. */
.diary-booking-noshow {
  background:
    repeating-linear-gradient(135deg, rgba(220,38,38,.10) 0 6px, rgba(220,38,38,.02) 6px 12px),
    #fef2f2 !important;
  color: #991b1b !important;
  border-left: 3px dashed #dc2626 !important;
}
/* Provisional: an online widget booking still awaiting the staff Approve
   decision (source=online, approved_at NULL). Amber + dashed = "holds the
   slot but isn't confirmed yet" — approve/decline from Booking Requests. */
.diary-booking-pending {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px dashed #f59e0b !important;
  border-left: 3px dashed #f59e0b !important;
}
/* Block: a non-job "don't book here" note. Neutral grey with a diagonal
   hatch so it reads as unavailable/struck-out at a glance, distinct from
   the coloured job chips. Still clickable/draggable to edit or remove. */
.diary-booking-block {
  background:
    repeating-linear-gradient(135deg, rgba(71,85,105,.16) 0 6px, rgba(71,85,105,.04) 6px 12px),
    #f1f5f9 !important;
  color: #334155 !important;
  border-left: 3px solid #64748b !important;
}
.diary-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dc2626;
  pointer-events: none;
  z-index: 5;
}
.diary-now-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dc2626;
}
.diary-now-label {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: #dc2626;
  padding: 1px 5px;
  border-radius: 3px;
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
}

/* ─── Photo Gallery ──────────────────────────────────────────────────────── */
.photo-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-thumb {
  width: 80px; height: 80px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
}
.photo-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.photo-upload-area:hover { border-color: var(--primary); background: #eff6ff; }
.photo-upload-area input[type=file] { display: none; }

/* ─── Login Page ─────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0,0,0,.4);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}
.login-header {
  background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
  padding: 28px;
  text-align: center;
  color: #fff;
}
.login-header h1 { font-size: 1.6rem; margin-bottom: 4px; }
.login-header p { opacity: .8; font-size: 0.88rem; }
.login-tabs { display: flex; border-bottom: 1px solid var(--border); }
.login-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
  font-size: 0.9rem;
}
.login-tab:hover { color: var(--text); }
.login-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.login-body { padding: 24px; }
.login-tab-panel { display: none; }
.login-tab-panel.active { display: block; }

/* ─── Fleet Owner / Driver Portal ────────────────────────────────────────── */
.portal-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  padding: 0 24px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}
.portal-header-logo { font-size: 1.1rem; font-weight: 700; flex: 1; }
.portal-header-logo span { color: #60a5fa; }
.portal-nav { display: flex; gap: 4px; }
.portal-nav-item {
  padding: 7px 14px;
  border-radius: 6px;
  color: #94a3b8;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.88rem;
  transition: background .15s, color .15s;
}
.portal-nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.portal-nav-item.active { background: var(--primary); color: #fff; }

.portal-content { padding: 24px; max-width: 1100px; margin: 0 auto; }

/* ─── Vehicle Card ───────────────────────────────────────────────────────── */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.vehicle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s;
}
.vehicle-card:hover { box-shadow: var(--shadow-md); }
.vehicle-card-header {
  background: #1e293b;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vehicle-card-reg { font-size: 1.2rem; font-weight: 800; letter-spacing: .05em; }
.vehicle-card-body { padding: 14px 16px; }
.vehicle-info-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.85rem; }
.vehicle-info-label { color: var(--text-muted); }

/* ─── Driver Card ────────────────────────────────────────────────────────── */
.driver-vehicle-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.driver-vehicle-reg { font-size: 2rem; font-weight: 900; letter-spacing: .06em; margin-bottom: 4px; }
.driver-vehicle-desc { color: #94a3b8; font-size: 0.9rem; margin-bottom: 16px; }
.driver-vehicle-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.driver-stat { text-align: center; }
.driver-stat-val { font-size: 1.1rem; font-weight: 700; }
.driver-stat-label { font-size: 0.72rem; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }

/* ─── Overdue Banner ─────────────────────────────────────────────────────── */
.overdue-banner {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
}
.overdue-banner-icon { font-size: 1.3rem; }
.overdue-cta {
  border: 2px solid #dc2626 !important;
  animation: overdue-pulse 2s ease-in-out infinite;
}
@keyframes overdue-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
  50%       { box-shadow: 0 0 0 6px rgba(220,38,38,0.18); }
}

/* ─── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  z-index: 10;
}

/* ─── Search Bar ─────────────────────────────────────────────────────────── */
.search-bar { position: relative; }
.search-bar .form-control { padding-left: 34px; }
.search-bar::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 0.85rem; pointer-events: none; }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; }
.page-btn { padding: 5px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.85rem; }
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Toast Notifications ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 240px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn .2s ease-out;
  font-size: 0.87rem;
}
.toast.success { background: #166534; }
.toast.error   { background: #991b1b; }
.toast.warning { background: #92400e; }
@keyframes slideIn { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Garage SPA: the sidebar becomes an off-canvas drawer (toggled by the
     topbar hamburger / body.nav-open) instead of vanishing entirely — that
     left phones with no navigation at all. */
  .nav-hamburger { display: inline-flex; align-items: center; }
  .app-shell { height: 100dvh; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 264px; max-width: 82vw;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 2px 0 18px rgba(0,0,0,.35);
  }
  body.nav-open .sidebar { transform: none; }
  .nav-scrim {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 290;
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }

  /* Topbar: compact; action buttons wrap to a second row rather than overflow. */
  .topbar {
    padding: 6px 12px; gap: 8px;
    height: auto; min-height: var(--header-h);
    flex-wrap: wrap;
  }
  .topbar-title { font-size: 1rem; }
  .topbar-actions { flex-wrap: wrap; }

  .page-content { padding: 14px; }
  .page-title { font-size: 1.1rem; }

  /* iOS zooms the viewport when a focused input's font is < 16px. Bump form
     controls to 16px on phones so tapping a field doesn't jolt the layout. */
  .form-control, input, select, textarea { font-size: 16px; }

  /* Modals go near-full-screen so forms and detail views aren't cramped. */
  .modal-backdrop { padding: 8px; }
  .modal, .modal-lg, .modal-xl { max-width: 100%; max-height: 94dvh; }
  .modal-body { padding: 16px; }
  .modal-footer { flex-wrap: wrap; }

  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kanban { flex-direction: column; }
  .kanban-col { min-width: unset; max-height: none; }
  .diary-grid { font-size: 0.7rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }

  /* Portal header: stack nav below logo+actions row */
  .portal-header {
    flex-wrap: wrap;
    height: auto;
    padding: 8px 16px;
    gap: 6px;
  }
  .portal-header-logo { flex: 1; }
  .portal-nav {
    display: flex;
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 4px;
  }
  .portal-nav::-webkit-scrollbar { display: none; }
  .portal-nav-item { white-space: nowrap; flex-shrink: 0; }
  .portal-content { padding: 16px; }
}

/* ─── Incoming Call Popups (stacked cards) ────────────────────────────────── */
#caller-popup-stack {
  position: fixed; bottom: 24px; left: 24px; z-index: 1100;
  display: flex; flex-direction: column; gap: 10px;
}
#caller-popup,            /* legacy single popup (cached garage.html) */
.caller-popup-card {
  width: 300px;
  background: var(--surface);
  border: 2px solid var(--success);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  overflow: hidden;
  animation: callerIn .25s ease-out;
}
#caller-popup { position: fixed; bottom: 24px; left: 24px; z-index: 1100; }
.caller-popup-answered {
  margin: 6px 14px 0; padding: 6px 10px; border-radius: 6px;
  background: #dcfce7; color: #166534; font-weight: 600; font-size: .9rem;
}
@keyframes callerIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.caller-popup-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--success); color: #fff;
  font-weight: 600; font-size: .85rem;
}
.caller-popup-ring   { font-size: 1.1rem; display: inline-block; animation: ring .5s infinite alternate; }
@keyframes ring { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.caller-popup-label  { flex: 1; }
.caller-popup-close  {
  background: none; border: none; color: rgba(255,255,255,.75);
  font-size: 1.1rem; cursor: pointer; padding: 0 4px; border-radius: 4px;
}
.caller-popup-close:hover { color: #fff; background: rgba(255,255,255,.2); }
.caller-popup-body    { padding: 12px 14px 6px; }
.caller-popup-name    { font-size: 1rem; font-weight: 700; color: var(--text); }
.caller-popup-phone   { font-size: .88rem; color: var(--text-muted); margin-top: 3px; }
.caller-popup-unknown { font-size: .8rem; color: var(--text-muted); margin-top: 6px; font-style: italic; }
.caller-popup-footer  { padding: 8px 14px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.caller-popup-timer   { font-size: .75rem; color: var(--text-muted); flex-shrink: 0; }

/* ─── Customer Authorisation Popup ───────────────────────────────────────── */
#auth-popup {
  position: fixed; bottom: 24px; left: 340px; z-index: 1100;
  width: 300px;
  background: var(--surface);
  border: 2px solid var(--success);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  overflow: hidden;
  animation: callerIn .25s ease-out;
}
.auth-popup-header {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--success); color: #fff;
  font-weight: 600; font-size: .85rem;
}
.auth-popup-icon  { font-size: 1.1rem; }
.auth-popup-label { flex: 1; }
.auth-popup-close {
  background: none; border: none; color: rgba(255,255,255,.75);
  font-size: 1.1rem; cursor: pointer; padding: 0 4px; border-radius: 4px;
}
.auth-popup-close:hover { color: #fff; background: rgba(255,255,255,.2); }
.auth-popup-body    { padding: 12px 14px 6px; }
.auth-popup-vehicle { font-size: 1rem; font-weight: 700; color: var(--text); }
.auth-popup-summary { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.auth-popup-total   { font-size: .9rem; font-weight: 600; color: var(--success); margin-top: 4px; }
.auth-popup-footer  { padding: 8px 14px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.auth-popup-timer   { font-size: .75rem; color: var(--text-muted); flex-shrink: 0; }

/* ─── Line Group Cards (Estimates & Jobs) ────────────────────────────────── */
.line-group-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
/* Drag a line between groups */
.line-drag-grip {
  cursor: grab;
  color: var(--text-muted);
  margin-right: 6px;
  font-size: .95rem;
  line-height: 1;
  user-select: none;
}
.line-drag-grip:active { cursor: grabbing; }
tr.line-row-dragging { opacity: .45; }
.line-group-card.line-group-drop-hot,
.line-group-ungrouped.line-group-drop-hot {
  outline: 2px dashed var(--primary, #3b82f6);
  outline-offset: -2px;
  background: rgba(59, 130, 246, .06);
}
.line-ungroup-hint {
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
  font-style: italic;
}
.line-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-alt, #f5f6f8);
  border-bottom: 1px solid var(--border);
}
.grp-reorder { display: inline-flex; flex-direction: column; gap: 1px; flex: 0 0 auto; }
.grp-reorder .grp-move {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  cursor: pointer; font-size: .58rem; line-height: 1; padding: 2px 5px; border-radius: 3px;
}
.grp-reorder .grp-move:hover:not(:disabled) { background: var(--primary-light, #eff6ff); color: var(--primary); border-color: var(--primary); }
.grp-reorder .grp-move:disabled { opacity: .3; cursor: default; }
.line-group-name-input {
  flex: 1;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 2px 6px;
  outline: none;
  cursor: text;
  min-width: 0;
}
.line-group-name-input:hover,
.line-group-name-input:focus {
  border-color: var(--border);
  background: var(--surface);
}
.line-group-total {
  font-weight: 700;
  font-size: .88rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}
.line-group-category {
  font-size: .78rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  padding: 3px 6px;
  cursor: pointer;
  max-width: 175px;
  flex-shrink: 0;
}
.line-group-category:focus {
  outline: none;
  border-color: var(--primary);
}
.line-group-category:disabled {
  cursor: default;
  opacity: .7;
}
.line-group-ungrouped {
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

/* ─── UK number plate (registration display) ──────────────────────────────
   Renders a vehicle reg as a UK rear (yellow) number plate. Used on the
   Job, Estimate and Tech detail views. The authentic plate font is
   "UKNumberPlate" (Charles Wright lineage) — shipped at
   public/fonts/UKNumberPlate.ttf — listed first in the .uk-plate stack so
   it's used when available, falling back to a heavy condensed sans. */
@font-face {
  font-family: 'UKNumberPlate';
  src: url('/fonts/UKNumberPlate.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
.uk-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'UKNumberPlate', 'Charles Wright', 'Arial Narrow', 'Arial Black', Arial, sans-serif;
  /* UKNumberPlate ships a single (regular) weight. Requesting 800 made the
     browser synthesise bold — smearing the glyphs (blurry). font-synthesis:none
     keeps the real plate font crisp; sans-serif fallbacks still bold via 800. */
  font-weight: 800;
  font-synthesis: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #111;
  background: #fdf22b;            /* rear yellow */
  border: 2px solid #111;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 1.15rem;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  vertical-align: middle;
}
.uk-plate--front { background: #fcfcfc; }     /* white front variant */
.uk-plate--lg {
  font-size: 1.5rem;
  padding: 4px 14px;
  letter-spacing: 3px;
}
.uk-plate--sm {
  font-size: .95rem;
  padding: 2px 7px;
  letter-spacing: 1.5px;
  border-width: 1.5px;
}
.uk-plate--empty {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: normal;
}

/* Indeterminate progress bar (queued tyre import, etc.) */
@keyframes pulse {
  0%   { opacity: .45; }
  50%  { opacity: 1; }
  100% { opacity: .45; }
}
