/* ============================================================
   AVANT DRIVE — OPERATIONS PLATFORM
   Shared Stylesheet — Dark by default, light toggle
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap');

/* ── DARK THEME (default) ───────────────────────────────── */
:root {
  --bg:           #1a1a1a;
  --card:         #252525;
  --card2:        #2e2e2e;
  --border:       #3a3a3a;
  --border-focus: #888888;
  --text:         #f0f0f0;
  --text-mid:     #aaaaaa;
  --text-light:   #666666;
  --accent:       #f0f0f0;
  --accent-hover: #cccccc;

  --sidebar-bg:   #111111;
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-text: rgba(255,255,255,0.55);
  --sidebar-active-bg: rgba(255,255,255,0.09);
  --sidebar-active-text: #ffffff;

  --status-confirmed:    #60a5fa;
  --status-confirmed-bg: rgba(96,165,250,0.12);
  --status-active:       #4ade80;
  --status-active-bg:    rgba(74,222,128,0.12);
  --status-returned:     #fb923c;
  --status-returned-bg:  rgba(251,146,60,0.12);
  --status-completed:    #94a3b8;
  --status-completed-bg: rgba(148,163,184,0.12);
  --status-cancelled:    #f87171;
  --status-cancelled-bg: rgba(248,113,113,0.12);
  --status-enquiry:      #c084fc;
  --status-enquiry-bg:   rgba(192,132,252,0.12);

  --shadow:    0 1px 3px rgba(0,0,0,0.3), 0 4px 14px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.45);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --nav-width:    230px;
  --radius:       6px;
  --radius-lg:    10px;
  --transition:   0.18s ease;
}

/* ── LIGHT THEME ────────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #fafafa;
  --card:         #ffffff;
  --card2:        #f5f5f5;
  --border:       #e8e8e8;
  --border-focus: #1a1a1a;
  --text:         #1a1a1a;
  --text-mid:     #777777;
  --text-light:   #aaaaaa;
  --accent:       #1a1a1a;
  --accent-hover: #333333;

  --sidebar-bg:   #1a1a1a;
  --sidebar-border: rgba(255,255,255,0.07);
  --sidebar-text: rgba(255,255,255,0.55);
  --sidebar-active-bg: rgba(255,255,255,0.09);
  --sidebar-active-text: #ffffff;

  --status-confirmed:    #1565c0;
  --status-confirmed-bg: #e3f2fd;
  --status-active:       #2e7d32;
  --status-active-bg:    #e8f5e9;
  --status-returned:     #e65100;
  --status-returned-bg:  #fff3e0;
  --status-completed:    #4a4a4a;
  --status-completed-bg: #f0f0f0;
  --status-cancelled:    #b71c1c;
  --status-cancelled-bg: #ffebee;
  --status-enquiry:      #6a1b9a;
  --status-enquiry-bg:   #f3e5f5;

  --shadow:    0 1px 3px rgba(0,0,0,0.07), 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; }
input, select, textarea { font-family: var(--font-body); }
ul { list-style: none; }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo {
  width: 34px; height: 34px;
  background: var(--text);
  color: var(--sidebar-bg);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.brand-name {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #ffffff;
  line-height: 1.2;
  text-transform: uppercase;
}
.brand-sub {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 2px;
  font-weight: 400;
  text-transform: uppercase;
}

.nav-section {
  padding: 16px 14px 5px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
}

.nav-menu { padding: 8px 0; flex: 1; overflow-y: auto; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  margin: 1px 7px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 400;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.8);
}
.nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 500;
}
.nav-link svg { flex-shrink: 0; opacity: 0.7; }
.nav-link.active svg { opacity: 1; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pos-btn {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all var(--transition);
}
.pos-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }

.theme-toggle-btn {
  width: 100%;
  padding: 7px 14px;
  background: transparent;
  color: rgba(255,255,255,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.theme-toggle-btn:hover { color: rgba(255,255,255,0.6); border-color: rgba(255,255,255,0.15); }

/* ── MAIN LAYOUT ────────────────────────────────────────── */
.main {
  margin-left: var(--nav-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}

.page-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
}
.page-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

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

.content { padding: 24px 28px; flex: 1; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover { opacity: 0.85; }

.btn-accent {
  background: var(--accent);
  color: var(--bg);
}
.btn-accent:hover { opacity: 0.85; }

.btn-outline {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-mid); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text); background: var(--card2); }

.btn-danger {
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled);
  border: 1px solid transparent;
}
.btn-danger:hover { opacity: 0.8; }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.w-full { width: 100%; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 15px 20px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}
.card-body { padding: 18px 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--card2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── STAT CARDS ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-sub { font-size: 12px; color: var(--text-light); }
.stat-card.accent {
  background: var(--text);
  border-color: var(--text);
}
.stat-card.accent .stat-label { color: rgba(0,0,0,0.4); }
.stat-card.accent .stat-value { color: var(--bg); }
.stat-card.accent .stat-sub   { color: rgba(0,0,0,0.35); }
[data-theme="light"] .stat-card.accent .stat-label { color: rgba(255,255,255,0.5); }
[data-theme="light"] .stat-card.accent .stat-value { color: #ffffff; }
[data-theme="light"] .stat-card.accent .stat-sub   { color: rgba(255,255,255,0.4); }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge::before {
  content: '';
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-enquiry    { background: var(--status-enquiry-bg);    color: var(--status-enquiry); }
.badge-confirmed  { background: var(--status-confirmed-bg);  color: var(--status-confirmed); }
.badge-active     { background: var(--status-active-bg);     color: var(--status-active); }
.badge-returned   { background: var(--status-returned-bg);   color: var(--status-returned); }
.badge-completed  { background: var(--status-completed-bg);  color: var(--status-completed); }
.badge-cancelled  { background: var(--status-cancelled-bg);  color: var(--status-cancelled); }

/* ── TABLES ──────────────────────────────────────────────── */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--card2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--card2); }
.data-table tbody tr { cursor: pointer; transition: background var(--transition); }
tr.selected-row td { background: var(--status-confirmed-bg) !important; }

.cell-primary { font-weight: 500; color: var(--text); }
.cell-sub { font-size: 12px; color: var(--text-light); margin-top: 1px; }
.cell-mono { font-family: 'Courier New', monospace; font-size: 11px; letter-spacing: 0.5px; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-light);
}
.form-input, .form-select, .form-textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  background: var(--card2);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  font-family: var(--font-body);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(128,128,128,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-light); opacity: 0.6; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-light); }
.form-section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  margin-top: 6px;
}

.input-prefix-wrap { position: relative; }
.input-prefix {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-light); font-size: 13px;
}
.input-prefix-wrap .form-input { padding-left: 24px; }

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(10px);
  transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-lg { max-width: 800px; }
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}
.modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-mid);
  font-size: 17px; line-height: 1;
  transition: background var(--transition);
  font-family: var(--font-body);
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  flex-shrink: 0;
}

/* ── FILTER TABS ─────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
}
.filter-tab {
  padding: 5px 13px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
  cursor: pointer;
  border: none; background: transparent;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font-body);
}
.filter-tab.active {
  background: var(--card);
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.filter-tab:hover:not(.active) { color: var(--text-mid); }

/* ── JOURNEY TRACKER ────────────────────────────────────── */
.journey-stages { display: flex; flex-direction: column; gap: 0; }
.journey-stage {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 10px;
}
.stage-header {
  padding: 11px 16px;
  background: var(--card2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.stage-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stage-name {
  font-size: 11px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-mid);
}
.stage-done .stage-num { background: var(--status-active); color: #000; }
.stage-done .stage-name { color: var(--status-active); }

.journey-steps { padding: 4px 0; }
.journey-step {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.journey-step:last-child { border-bottom: none; }
.journey-step.completed { background: rgba(74,222,128,0.04); }
[data-theme="light"] .journey-step.completed { background: #f0fff4; }

.step-check {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--card2);
}
.step-check:hover { border-color: var(--text-mid); }
.journey-step.completed .step-check {
  background: var(--status-active);
  border-color: var(--status-active);
  color: #000;
}

.step-content { flex: 1; min-width: 0; }
.step-label { font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 7px; }
.step-optional { font-size: 10px; font-weight: 400; color: var(--text-light); background: var(--card2); padding: 1px 6px; border-radius: 10px; border: 1px solid var(--border); }
.step-meta { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.step-inputs { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.step-input-small {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--card2);
  outline: none;
  width: 120px;
}
.step-input-small:focus { border-color: var(--border-focus); }
.step-save-btn {
  padding: 5px 10px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: 11.5px;
  cursor: pointer;
  font-family: var(--font-body);
}
.step-save-btn:hover { opacity: 0.8; }

.journey-dots { display: flex; gap: 3px; align-items: center; }
.journey-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--border);
}
.journey-dot.done    { background: var(--status-active); border-color: var(--status-active); }
.journey-dot.current { background: var(--status-returned); border-color: var(--status-returned); }

/* ── VEHICLE CARDS ──────────────────────────────────────── */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}
.vehicle-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.vehicle-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--text-light);
}
.vehicle-card-header {
  background: var(--card2);
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 90px;
}
.vehicle-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.vehicle-reg {
  display: inline-block;
  background: var(--border);
  color: var(--text-mid);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-family: 'Courier New', monospace;
}
.vehicle-card-body { padding: 14px 18px; }
.vehicle-class { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-light); margin-bottom: 12px; }
.vehicle-rate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rate-cell { text-align: center; }
.rate-period { font-size: 9px; font-weight: 600; letter-spacing: 0.5px; color: var(--text-light); display: block; }
.rate-price { font-size: 13px; font-weight: 500; color: var(--text); }
.vehicle-card-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: var(--card2);
  display: flex; align-items: center; justify-content: space-between;
}
.vehicle-status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--status-active);
  display: inline-block; margin-right: 5px;
}
.vehicle-status-dot.inactive { background: var(--text-light); }

/* ── RATES GRID ─────────────────────────────────────────── */
.rates-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text-light); }
.empty-icon-wrap {
  width: 44px; height: 44px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  color: var(--text-light);
}
.empty-title { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--text-mid); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

/* ── ALERTS ─────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
.alert-info    { background: var(--status-confirmed-bg); color: var(--status-confirmed); }
.alert-success { background: var(--status-active-bg);    color: var(--status-active); }
.alert-warning { background: var(--status-returned-bg);  color: var(--status-returned); }
.alert-error   { background: var(--status-cancelled-bg); color: var(--status-cancelled); }

/* ── LOADING ────────────────────────────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; padding: 56px; color: var(--text-light); gap: 12px; font-size: 13px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ──────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 16px; background: var(--text); color: var(--bg); border-radius: var(--radius); font-size: 13px; box-shadow: var(--shadow-lg); animation: slideUp 0.2s ease; max-width: 300px; }
.toast.success { background: var(--status-active); color: #000; }
.toast.error   { background: var(--status-cancelled); color: #fff; }
@keyframes slideUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── LOGIN OVERLAY ──────────────────────────────────────── */
.login-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 999;
  display: flex; align-items: center; justify-content: center;
}
.login-overlay.hidden { display: none; }
.login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 340px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--text);
  margin-bottom: 4px;
}
.login-sub {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 30px;
  display: block;
}
.login-box .form-input { text-align: center; font-size: 14px; letter-spacing: 2px; margin-bottom: 12px; }
.login-error { color: var(--status-cancelled); font-size: 12px; margin-top: 10px; display: none; }

/* ── STRIPE ACTIVITY PANEL ──────────────────────────────── */
.stripe-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
.stripe-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card2);
}
.stripe-panel-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-light); }
.stripe-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.stripe-item:last-child { border-bottom: none; }
.stripe-item-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.stripe-item-icon.succeeded  { background: var(--status-active-bg);    color: var(--status-active); }
.stripe-item-icon.pending    { background: var(--status-returned-bg);  color: var(--status-returned); }
.stripe-item-icon.refunded   { background: var(--status-confirmed-bg); color: var(--status-confirmed); }
.stripe-item-icon.preauth    { background: var(--status-enquiry-bg);   color: var(--status-enquiry); }
.stripe-item-body { flex: 1; min-width: 0; }
.stripe-item-label { font-weight: 500; color: var(--text); }
.stripe-item-meta  { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.stripe-item-amount { font-weight: 600; color: var(--text); white-space: nowrap; margin-left: auto; text-align: right; }
.stripe-suggestion {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 5px; padding: 3px 8px;
  background: var(--status-active-bg); color: var(--status-active);
  border: 1px solid var(--status-active); border-radius: 20px;
  font-size: 11px; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.stripe-suggestion:hover { background: var(--status-active); color: #000; }
.stripe-suggestion.already-done { background: var(--card2); color: var(--text-light); border-color: var(--border); cursor: default; }
.stripe-empty { padding: 18px 16px; font-size: 12px; color: var(--text-light); text-align: center; }
.stripe-loading { padding: 14px 16px; font-size: 12px; color: var(--text-light); display: flex; align-items: center; gap: 8px; }

/* ── DEPOSIT HOLDS PANEL ────────────────────────────────── */
.holds-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.holds-panel-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--card2); }
.holds-panel-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-light); }
.hold-item { display: flex; align-items: center; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.hold-item:last-child { border-bottom: none; }
.hold-amount-badge { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.hold-expiry-badge { display: inline-block; padding: 2px 7px; border-radius: 20px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.hold-expiry-badge.ok      { background: var(--status-active-bg);    color: var(--status-active); }
.hold-expiry-badge.warning { background: var(--status-returned-bg);  color: var(--status-returned); }
.hold-expiry-badge.expired { background: var(--status-cancelled-bg); color: var(--status-cancelled); }

/* ── VEHICLE TRACKING PANEL ─────────────────────────────── */
.tracking-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.tracking-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--card2); }
.tracking-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-light); }
.tracking-body { padding: 16px; }
.tracking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 12px; }
.tracking-field label { font-size: 10px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-light); display: block; margin-bottom: 4px; }
.excess-display { padding: 9px 12px; border-radius: var(--radius); background: var(--card2); border: 1px solid var(--border); font-size: 13px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.excess-display.over  { background: var(--status-cancelled-bg); border-color: var(--status-cancelled); color: var(--status-cancelled); }
.excess-display.under { background: var(--status-active-bg);    border-color: var(--status-active);    color: var(--status-active); }
.fuel-selector { display: flex; gap: 3px; }
.fuel-btn { flex: 1; padding: 6px 4px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); font-size: 11px; font-weight: 600; cursor: pointer; background: var(--card2); color: var(--text-mid); transition: all var(--transition); font-family: var(--font-body); }
.fuel-btn:hover { border-color: var(--text-mid); }
.fuel-btn.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.star-rating { display: flex; gap: 3px; align-items: center; }
.star { width: 26px; height: 26px; cursor: pointer; color: var(--border); transition: color var(--transition); font-size: 22px; line-height: 1; user-select: none; }
.star.active, .star:hover, .star.hover { color: #f59e0b; }
.star-label { font-size: 12px; color: var(--text-light); margin-left: 5px; }

/* ── DOCUMENTS PANEL ────────────────────────────────────── */
.documents-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; margin-top: 18px; }
.documents-header { padding: 14px 20px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.documents-title { font-family: var(--font-display); font-size: 17px; font-weight: 500; color: var(--text); }
.documents-body { padding: 18px 20px; }
.forms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 20px; }
.form-open-btn { display: flex; flex-direction: column; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card2); cursor: pointer; transition: all var(--transition); text-decoration: none; color: var(--text); font-family: var(--font-body); }
.form-open-btn:hover { border-color: var(--text-mid); background: var(--card); }
.form-open-btn.mandatory { border-left: 2px solid var(--text-mid); }
.form-btn-label { font-size: 11.5px; font-weight: 500; color: var(--text); text-align: left; line-height: 1.3; }
.form-btn-tag { font-size: 9px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-light); margin-top: 3px; }
.form-btn-tag.required { color: var(--text-mid); }
.upload-area { border: 1.5px dashed var(--border); border-radius: var(--radius-lg); padding: 24px; text-align: center; cursor: pointer; transition: all var(--transition); background: var(--card2); margin-bottom: 14px; }
.upload-area:hover, .upload-area.drag-over { border-color: var(--text-mid); background: var(--card); }
.upload-area-icon { color: var(--text-light); margin-bottom: 7px; }
.upload-area-title { font-size: 13px; font-weight: 500; color: var(--text-mid); margin-bottom: 3px; }
.upload-area-sub { font-size: 11px; color: var(--text-light); }
.doc-list { display: flex; flex-direction: column; gap: 7px; }
.doc-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card2); transition: background var(--transition); }
.doc-item:hover { background: var(--card); }
.doc-icon { width: 30px; height: 30px; border-radius: var(--radius); background: var(--status-cancelled-bg); color: var(--status-cancelled); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: 11px; color: var(--text-light); margin-top: 1px; }
.doc-actions { display: flex; gap: 5px; flex-shrink: 0; }
.upload-progress { padding: 10px 14px; background: var(--status-confirmed-bg); border: 1px solid var(--status-confirmed); border-radius: var(--radius); font-size: 13px; color: var(--status-confirmed); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }

/* ── NOTIFICATION CARDS ─────────────────────────────────── */
.notif-list { display: flex; flex-direction: column; gap: 7px; }
.notif-card { display: flex; align-items: center; gap: 11px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card2); cursor: pointer; transition: background var(--transition); text-decoration: none; color: inherit; }
.notif-card:hover { background: var(--card); }
.notif-card.urgent  { border-left: 3px solid var(--status-cancelled); }
.notif-card.high    { border-left: 3px solid var(--status-returned); }
.notif-card.medium  { border-left: 3px solid var(--status-confirmed); }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.notif-dot.urgent  { background: var(--status-cancelled); }
.notif-dot.high    { background: var(--status-returned); }
.notif-dot.medium  { background: var(--status-confirmed); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 500; color: var(--text); }
.notif-sub   { font-size: 11px; color: var(--text-light); margin-top: 1px; }
.notif-time  { font-size: 12px; font-weight: 600; color: var(--text-mid); white-space: nowrap; }
.notif-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 7px; border-radius: 20px; white-space: nowrap; text-transform: uppercase; }
.notif-badge.urgent  { background: var(--status-cancelled); color: #fff; }
.notif-badge.high    { background: var(--status-returned); color: #fff; }
.notif-badge.medium  { background: var(--status-confirmed); color: #fff; }

/* ── CUSTOMER PROFILE ───────────────────────────────────── */
.customer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.customer-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px; cursor: pointer; transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition); }
.customer-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--text-light); }
.customer-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--text); color: var(--bg); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 17px; font-weight: 500; margin-bottom: 10px; flex-shrink: 0; }
.customer-name-text { font-family: var(--font-display); font-size: 19px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.customer-contact { font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.customer-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; padding-top: 11px; border-top: 1px solid var(--border); }
.cstat-val   { font-size: 17px; font-weight: 600; color: var(--text); line-height: 1; }
.cstat-label { font-size: 10px; color: var(--text-light); margin-top: 2px; letter-spacing: 0.5px; }

/* ── COPY BUTTON ────────────────────────────────────────── */
.copy-btn { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; background: var(--card2); border: 1px solid var(--border); border-radius: 4px; font-size: 11px; font-weight: 500; color: var(--text-mid); cursor: pointer; transition: all var(--transition); font-family: var(--font-body); }
.copy-btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.copy-btn.copied { background: var(--status-active); color: #000; border-color: var(--status-active); }

/* ── MISC UTILITIES ─────────────────────────────────────── */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap { display: flex; gap: 10px; align-items: center; }
.mt-4  { margin-top: 4px; }  .mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }
.text-light { color: var(--text-light); }
.text-small { font-size: 12px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.fw-medium { font-weight: 500; }

.financial-table { width: 100%; font-size: 13px; }
.financial-table td { padding: 5px 0; color: var(--text); }
.financial-table td:last-child { text-align: right; font-weight: 500; }
.financial-table .total-row td { border-top: 1px solid var(--border); padding-top: 9px; font-weight: 600; font-size: 14px; }
.financial-table .total-row td:first-child { font-family: var(--font-display); font-size: 15px; }

.booking-ref { font-family: 'Courier New', monospace; font-size: 11px; letter-spacing: 0.5px; background: var(--card2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 4px; color: var(--text-mid); }

/* ── PRINT ──────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar-actions, .modal-overlay,
  .stripe-panel, .holds-panel, .documents-panel,
  .tracking-panel .tracking-header button,
  .btn, .copy-btn, .journey-stages .step-check,
  #healthBanner, #timeoutWarning { display: none !important; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  body { background: white !important; color: #1a1a1a !important; font-size: 11pt; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .topbar { position: static !important; background: white !important; border-bottom: 1px solid #ccc !important; }
  a { color: inherit !important; text-decoration: none !important; }
  @page { margin: 15mm; size: A4; }
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  :root { --nav-width: 56px; }
  .sidebar-brand .brand-name, .sidebar-brand .brand-sub, .nav-link span { display: none; }
  .sidebar-brand { justify-content: center; padding: 16px; }
  .nav-link { justify-content: center; padding: 12px; margin: 1px 4px; }
  .sidebar-footer .pos-btn, .sidebar-footer .theme-toggle-btn span { display: none; }
  .content { padding: 14px; }
  .topbar { padding: 12px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  /* Title + action buttons share the topbar without overflowing */
  .page-title { font-size: 19px; }
  .topbar-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  /* Tables injected straight into a card body become horizontally swipeable
     (the .table-wrap list views already scroll on their own) */
  .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Modals use almost the full screen width on a phone */
  .modal-overlay { padding: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) {
  .stats-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ── STRIPE CUSTOMER PROFILE ────────────────────────────────── */
.stripe-customer-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.stripe-customer-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.stripe-customer-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-light);
  display: flex; align-items: center; gap: 6px;
}
.stripe-found-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--status-active); display: inline-block;
}
.stripe-not-found-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-light); display: inline-block;
}
.stripe-customer-link {
  font-size: 11px; color: var(--status-confirmed);
  text-decoration: none; font-weight: 500;
}
.stripe-customer-link:hover { text-decoration: underline; }
.stripe-cards-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.stripe-card-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 10px;
  font-size: 12px; font-weight: 500;
}
.stripe-card-brand { font-weight: 700; text-transform: capitalize; color: var(--text); }
.stripe-card-last4 { font-family: 'Courier New', monospace; letter-spacing: 1px; color: var(--text-mid); }
.stripe-card-exp   { font-size: 11px; color: var(--text-light); }
.stripe-holds-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.stripe-hold-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; background: var(--status-enquiry-bg);
  border: 1px solid var(--status-enquiry); border-radius: var(--radius);
  font-size: 12px;
}
.stripe-hold-row .hold-ref { color: var(--text-mid); font-size: 11px; }
.stripe-hold-row .hold-amt { font-weight: 600; color: var(--text); }
.stripe-hold-row .hold-exp { font-size: 11px; color: var(--status-returned); font-weight: 500; }
.stripe-open-pos-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  background: var(--text); color: var(--bg);
  border: none; border-radius: var(--radius);
  font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: var(--font-body);
  text-decoration: none; transition: opacity var(--transition);
}
.stripe-open-pos-btn:hover { opacity: 0.8; }

/* ── CALENDAR GRID ──────────────────────────────────────────── */
.cal-wrap {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
.cal-table {
  border-collapse: collapse;
  min-width: 900px;
  width: 100%;
  table-layout: fixed;
}
.cal-table tbody tr { overflow: visible; }
.cal-table tbody { overflow: visible; }
/* Sticky vehicle column */
.cal-veh-th, .cal-veh-td {
  position: sticky;
  left: 0;
  z-index: 10;
  width: 165px;
  min-width: 165px;
  background: var(--card2);
  border-right: 2px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cal-veh-th {
  padding: 8px 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-light);
  text-align: left;
  z-index: 20;
}
.cal-veh-td {
  background: var(--card);
  padding: 0 10px;
  height: 48px;
  display: table-cell;
  vertical-align: middle;
}
/* Inner flex layout for vehicle cell */
.cal-veh-td {
  display: table-cell;
}
.cal-veh-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cal-veh-info { line-height: 1.3; min-width: 0; }
/* Day header cells */
.cal-day-th {
  width: 34px;
  min-width: 28px;
  padding: 5px 3px;
  text-align: center;
  background: var(--card2);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 9;
}
.cal-day-th.today-col { background: var(--status-active-bg); }
.cal-day-th.weekend   { background: color-mix(in srgb, var(--card2) 80%, transparent); }
.cal-th-top { font-size: 9px; color: var(--text-light); font-weight: 500; }
.cal-th-num { font-size: 12px; font-weight: 700; color: var(--text-mid); }
.cal-day-th.today-col .cal-th-num { color: var(--status-active); }
/* Day body cells */
.cal-day-td {
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 48px;
  min-width: 28px;
  position: relative;
}
.cal-day-td.today-col { background: rgba(74,222,128,0.04); }
.cal-day-td.weekend   { background: var(--card2); }
/* Booking bars */
.cal-booking-bar {
  display: flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: opacity 0.15s, box-shadow 0.15s;
}
.cal-booking-bar:hover { opacity: 0.88; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.bar-ref { font-size: 9.5px; opacity: 0.6; margin-left: 4px; }
/* Status colours */
.cal-bar-confirmed { background: var(--status-confirmed-bg); color: var(--status-confirmed); border: 1px solid var(--status-confirmed); }
.cal-bar-active    { background: var(--status-active-bg);    color: var(--status-active);    border: 1px solid var(--status-active); }
.cal-bar-returned  { background: var(--status-returned-bg);  color: var(--status-returned);  border: 1px solid var(--status-returned); }
.cal-bar-completed { background: var(--card2);               color: var(--text-light);       border: 1px solid var(--border); }
.cal-bar-enquiry   { background: var(--card2);               color: var(--text-mid);         border: 1px solid var(--border); }
.cal-bar-cancelled { background: rgba(239,68,68,0.08);       color: var(--status-cancelled); border: 1px solid var(--status-cancelled); opacity: 0.5; }
/* Vehicle card in cal */
.cal-vehicle-thumb {
  width: 34px; height: 26px;
  border-radius: 3px;
  background-size: cover;
  background-position: center;
  background-color: var(--card2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cal-vehicle-name { font-size: 12px; font-weight: 600; color: var(--text); }
.cal-vehicle-reg  { font-size: 10px; color: var(--text-light); font-family: monospace; }
.cal-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}
/* ============================================================
   STEP 6 — PAYMENTS & RECONCILIATION
   ============================================================ */

/* Payment list items — clickable for edit */
.payment-item {
  transition: background var(--transition);
}
.payment-item:hover {
  background: var(--card2);
}

/* Reconciliation summary block (sits inside Financials card body) */
.reconciliation-block {
  margin-top: 4px;
  padding: 12px 14px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.recon-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}
.recon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
}
.recon-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recon-label {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 500;
}
.recon-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.2;
}
.recon-breakdown {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-light);
}

/* Light theme tweak for the cancelled-bg fallback used in refund hint */
:root {
  --status-cancelled-bg-soft: rgba(248,113,113,0.08);
}
[data-theme="light"] {
  --status-cancelled-bg-soft: #fff5f5;
}
/* ============================================================
   FIX — Missing class names introduced in Step 4–6
   Paste at the very bottom of style.css
   ============================================================ */

/* Two-column booking-detail layout */
.booking-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) {
  .booking-grid { grid-template-columns: 1fr; }
}

/* Booking reference pill in topbar */
.booking-ref-pill {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-mid);
}

/* Journey progress bar */
.journey-progress-bar {
  height: 3px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.journey-progress-fill {
  height: 100%;
  background: var(--status-active);
  transition: width 0.3s ease;
}

/* Journey stage with header band */
.journey-stage {
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  overflow: visible;
  margin-bottom: 0;
}
.journey-stage:last-child { border-bottom: none; }
.journey-stage-header {
  padding: 10px 16px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--card2);
  border-bottom: 1px solid var(--border);
}
.journey-steps {
  display: flex;
  flex-direction: column;
}

/* Journey step (new checkbox-wrap + content structure) */
.journey-step {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.journey-step:last-child { border-bottom: none; }
.journey-step.done {
  background: rgba(74,222,128,0.04);
}
[data-theme="light"] .journey-step.done {
  background: #f0fff4;
}
.journey-step.not-applicable { opacity: 0.55; }

.journey-step-checkbox-wrap {
  flex-shrink: 0;
  margin-top: 1px;
}
.journey-step-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--status-active);
}

.journey-step-content { flex: 1; min-width: 0; }
.journey-step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.journey-step-time {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-light);
  font-style: italic;
}
.journey-step-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 3px;
}
.step-required {
  color: var(--status-cancelled);
  font-weight: 700;
}

/* Operational Forms launcher links */
.form-launch-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card2);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  transition: all var(--transition);
}
.form-launch-link:last-child { margin-bottom: 0; }
.form-launch-link:hover {
  background: var(--card);
  border-color: var(--text-mid);
  transform: translateX(2px);
}
.form-launch-link svg {
  flex-shrink: 0;
  color: var(--text-light);
}

/* Phase pills (Pre-Booking / Handover / Active / Return) */
.form-phase-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
.phase-pre-booking { background: var(--status-enquiry-bg);   color: var(--status-enquiry); }
.phase-handover    { background: var(--status-confirmed-bg); color: var(--status-confirmed); }
.phase-active      { background: var(--status-active-bg);    color: var(--status-active); }
.phase-return      { background: var(--status-returned-bg);  color: var(--status-returned); }

.form-mandatory {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled);
  margin-left: 6px;
}

/* Key/value rows in Booking Details / Customer cards */
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.kv-row:last-child { border-bottom: none; padding-bottom: 0; }
.kv-key {
  color: var(--text-light);
  font-size: 11.5px;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
.kv-val {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

/* Extra-large modal (for document preview iframe) */
.modal-xl { max-width: 1100px; }

/* Upload area CTA text (used in new doc upload modal) */
.upload-cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  margin-top: 8px;
}

/* dashboard notification card (used in index.html) */
.notification-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card2);
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  color: inherit;
  margin-bottom: 6px;
}
.notification-item:last-child { margin-bottom: 0; }
.notification-item:hover { background: var(--card); }
.notification-item.urgent { border-left: 3px solid var(--status-cancelled); }
.notification-item.high   { border-left: 3px solid var(--status-returned); }
.notification-item.medium { border-left: 3px solid var(--status-confirmed); }

/* Stripe payment row when matched by email but not booking ref */
.hold-item.untagged {
  background: rgba(255,255,255,0.02);
}
[data-theme="light"] .hold-item.untagged {
  background: rgba(0,0,0,0.02);
}

/* Drag-over state alias (HTML uses 'dragover', not 'drag-over') */
.upload-area.dragover {
  border-color: var(--text-mid);
  background: var(--card);
}
/* ============================================================
   STEP 7 — RECONCILIATION PAGE
   ============================================================ */

/* Filter bar at top of page */
.recon-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 24px;
  align-items: flex-end;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.recon-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recon-filter-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-light);
}

/* Summary stat cards */
.recon-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 1200px) {
  .recon-summary-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .recon-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
.recon-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.recon-stat.accent {
  background: var(--text);
  border-color: var(--text);
}
.recon-stat.accent .recon-stat-label { color: rgba(0,0,0,0.45); }
.recon-stat.accent .recon-stat-value { color: var(--bg); }
.recon-stat.accent .recon-stat-sub   { color: rgba(0,0,0,0.4); }
[data-theme="light"] .recon-stat.accent .recon-stat-label { color: rgba(255,255,255,0.5); }
[data-theme="light"] .recon-stat.accent .recon-stat-value { color: #ffffff; }
[data-theme="light"] .recon-stat.accent .recon-stat-sub   { color: rgba(255,255,255,0.4); }

.recon-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-light);
}
.recon-stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.1;
  margin-top: 2px;
}
.recon-stat-sub {
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

/* Source pills (Stripe / Cash etc.) */
.recon-source-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  line-height: 1.4;
}
.recon-source-pill.source-stripe {
  background: rgba(168,85,247,0.12);
  color: #a855f7;
  border: 1px solid rgba(168,85,247,0.3);
}
.recon-source-pill.source-cash {
  background: var(--card2);
  color: var(--text-mid);
  border: 1px solid var(--border);
}
[data-theme="light"] .recon-source-pill.source-stripe {
  background: #f5edff;
  color: #7c3aed;
  border-color: #d4b8ff;
}

/* Inside .accent stat cards, override pill colours so they remain visible */
.recon-stat.accent .recon-source-pill.source-stripe {
  background: rgba(168,85,247,0.25);
  color: #e4ccff;
  border-color: rgba(168,85,247,0.5);
}
.recon-stat.accent .recon-source-pill.source-cash {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.2);
}

/* Group header (when grouping by day/month/etc) */
.recon-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: var(--card2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}
.recon-group-header strong {
  color: var(--text);
  font-weight: 700;
}

/* Table rows in the recon table — keep payments tightly packed */
#paymentsTable .data-table tbody td {
  padding: 10px 14px;
}
#paymentsTable .data-table tbody tr:not([onclick]) {
  cursor: default;
}
#paymentsTable .data-table tbody tr:not([onclick]):hover td {
  background: transparent;
}
/* ============================================================
   JOURNEY ↔ PAYMENT LINK INDICATORS
   ============================================================ */

.journey-payment-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  border: 1px solid transparent;
  max-width: 100%;
}

.journey-payment-link.linked {
  background: var(--status-active-bg);
  border-color: var(--status-active);
  color: var(--status-active);
  cursor: pointer;
  transition: background var(--transition);
}
.journey-payment-link.linked:hover {
  background: var(--status-active);
  color: #000;
}
.journey-payment-link.linked:hover .recon-source-pill,
.journey-payment-link.linked:hover .journey-payment-link-ref,
.journey-payment-link.linked:hover .journey-payment-link-amt {
  color: #000;
}

.journey-payment-link.missing {
  background: var(--status-cancelled-bg);
  border-color: var(--status-cancelled);
  color: var(--status-cancelled);
  font-weight: 500;
}

.journey-payment-link-ref {
  font-family: monospace;
  font-size: 10.5px;
  color: var(--text-mid);
  letter-spacing: 0.2px;
}
.journey-payment-link-amt {
  font-weight: 700;
  color: var(--text);
  margin-left: auto;
  padding-left: 6px;
}

.journey-payment-link-btn {
  background: var(--card);
  border: 1px solid var(--status-cancelled);
  color: var(--status-cancelled);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 6px;
  font-family: var(--font-body);
  transition: background var(--transition);
}
.journey-payment-link-btn:hover {
  background: var(--status-cancelled);
  color: white;
}

/* ============================================================
   STEP 8 — AUDIT LOG PAGE
   ============================================================ */

.audit-table { font-size: 12.5px; }
.audit-table tbody td { padding: 10px 12px; vertical-align: middle; }
.audit-row { cursor: pointer; transition: background var(--transition); }
.audit-row:hover td { background: var(--card2); }

/* Actor initial avatar */
.audit-actor-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}

/* Category pills */
.audit-category-pill {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 10px;
  white-space: nowrap;
}
.audit-cat-booking  { background: var(--status-confirmed-bg);  color: var(--status-confirmed); }
.audit-cat-journey  { background: rgba(168,85,247,0.12);       color: #a855f7; border: 1px solid rgba(168,85,247,0.3); }
[data-theme="light"] .audit-cat-journey { background: #f5edff; color: #7c3aed; border-color: #d4b8ff; }
.audit-cat-payment  { background: var(--status-active-bg);     color: var(--status-active); }
.audit-cat-customer { background: var(--status-returned-bg);   color: var(--status-returned); }
.audit-cat-vehicle  { background: var(--status-enquiry-bg);    color: var(--status-enquiry); }
.audit-cat-document { background: var(--card2);                color: var(--text-mid); border: 1px solid var(--border); }
.audit-cat-charge   { background: var(--status-cancelled-bg);  color: var(--status-cancelled); }
.audit-cat-session  { background: var(--card2);                color: var(--text-light); border: 1px solid var(--border); }
.audit-cat-other    { background: var(--card2);                color: var(--text-light); border: 1px solid var(--border); }
.audit-cat-staff    { background: rgba(20,184,166,0.12);       color: #14b8a6; border: 1px solid rgba(20,184,166,0.3); }
[data-theme="light"] .audit-cat-staff { background: #e6fbf7; color: #0d9488; border-color: #99e6da; }

/* Detail expansion row */
.audit-detail-row td {
  background: var(--card2) !important;
  padding: 0 !important;
}
.audit-detail-block {
  padding: 12px 16px 16px;
  border-left: 3px solid var(--accent);
}
.audit-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
}
.audit-detail-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  max-height: 360px;
  overflow: auto;
}
.audit-detail-body pre {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-mid);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Detail badges */
.audit-detail-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.6px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 10px;
}
.audit-badge-truncated {
  background: var(--status-returned-bg);
  color: var(--status-returned);
  border: 1px solid var(--status-returned);
}
.audit-badge-error {
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled);
  border: 1px solid var(--status-cancelled);
}

/* Expand chevron button */
.audit-expand-btn {
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--transition), background var(--transition);
}
.audit-expand-btn:hover { color: var(--text); background: var(--border); }

/* Inline Activity Log card (Step 8) */
.activity-log-entry {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.activity-log-entry:last-child { border-bottom: none; }
