/* ============================================
   FLEET MANAGEMENT SYSTEM
   Saffron & Ink — Day / Night Theme
   Font: Bebas Neue + Plus Jakarta Sans + JetBrains Mono
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── NIGHT THEME (default) ───────────────── */
:root {
  --bg:          #0A0A0F;
  --bg2:         #0F0F18;
  --surface:     #111118;
  --surface2:    #18181F;
  --surface3:    #1E1E28;
  --border:      #2A2A38;
  --border2:     #333345;

  --saffron:     #FF6B00;
  --saffron-dim: #FF6B0018;
  --saffron-mid: #FF6B0035;
  --saffron-glow:0 0 20px #FF6B0040;

  --green:       #22C55E;
  --green-dim:   #22C55E18;
  --red:         #EF4444;
  --red-dim:     #EF444418;
  --yellow:      #EAB308;
  --yellow-dim:  #EAB30818;
  --blue:        #3B82F6;
  --blue-dim:    #3B82F618;

  --text:        #F0EDE8;
  --text-muted:  #8B8B9E;
  --text-dim:    #4A4A5E;

  --font-head:   'Bebas Neue', sans-serif;
  --font-body:   'Plus Jakarta Sans', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.6);

  --transition:  all 0.2s ease;
}

/* ── DAY THEME ───────────────────────────── */
:root[data-theme="light"] {
  --bg:          #FDF8F3;
  --bg2:         #F5EFE6;
  --surface:     #FFFFFF;
  --surface2:    #FDF8F3;
  --surface3:    #F5EFE6;
  --border:      #E8DDD0;
  --border2:     #D4C4B0;

  --saffron:     #E55A00;
  --saffron-dim: #E55A0012;
  --saffron-mid: #E55A0025;
  --saffron-glow:0 0 20px #E55A0030;

  --green:       #16A34A;
  --green-dim:   #16A34A15;
  --red:         #DC2626;
  --red-dim:     #DC262615;
  --yellow:      #CA8A04;
  --yellow-dim:  #CA8A0415;
  --blue:        #2563EB;
  --blue-dim:    #2563EB15;

  --text:        #1A1A2E;
  --text-muted:  #6B6875;
  --text-dim:    #A89F96;

  --shadow-sm:   0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.12);
}

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

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ── SCROLLBAR ───────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--saffron); }

/* ── NAV ─────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 62px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; gap: 0.25rem;
  transition: background 0.3s ease;
}

:root[data-theme="light"] .nav {
  background: rgba(253,248,243,0.95);
  backdrop-filter: blur(12px);
}
:root:not([data-theme="light"]) .nav {
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(12px);
}

.nav__brand {
  font-family: var(--font-head);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: var(--saffron);
  text-decoration: none;
  margin-right: auto;
  display: flex; align-items: center; gap: 0.4rem;
}
.nav__brand-dot {
  width: 7px; height: 7px;
  background: var(--saffron);
  border-radius: 50%;
  display: inline-block;
  box-shadow: var(--saffron-glow);
}
.nav__brand span { color: var(--text-muted); font-size: 1rem; }

.nav__link {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}
.nav__link:hover { color: var(--text); background: var(--surface2); }
.nav__link--active {
  color: var(--saffron);
  border-color: var(--saffron-mid);
  background: var(--saffron-dim);
}

/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
  margin-left: 0.5rem;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--saffron); color: var(--saffron); }

/* ── PAGE ────────────────────────────────── */
.page {
  padding-top: 82px;
  padding-bottom: 4rem;
  max-width: 1300px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ── PAGE HEADER ─────────────────────────── */
.page-header {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap; gap: 1rem;
}
.page-title {
  font-family: var(--font-head);
  font-size: 2.8rem;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--text);
}
.page-title span { color: var(--saffron); }
.page-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ── BUTTONS ─────────────────────────────── */
.btn {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex; align-items: center; gap: 0.5rem;
  white-space: nowrap;
}
.btn--primary {
  background: var(--saffron);
  color: #fff;
  box-shadow: 0 2px 12px var(--saffron-mid);
}
.btn--primary:hover {
  background: #FF8533;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--saffron-mid);
}
:root[data-theme="light"] .btn--primary { color: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn--ghost:hover { border-color: var(--saffron); color: var(--saffron); background: var(--saffron-dim); }

.btn--danger { background: var(--red-dim); color: var(--red); border: 1px solid transparent; }
.btn--danger:hover { border-color: var(--red); }

.btn--success { background: var(--green-dim); color: var(--green); border: 1px solid transparent; }
.btn--success:hover { border-color: var(--green); }

.btn--sm { padding: 0.3rem 0.7rem; font-size: 0.72rem; border-radius: var(--radius-sm); }
.btn--full { width: 100%; justify-content: center; }

/* ── CARDS ───────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--border2); }
.card--accent { border-left: 3px solid var(--saffron); }
.card--green  { border-left: 3px solid var(--green); }
.card--red    { border-left: 3px solid var(--red); }
.card--yellow { border-left: 3px solid var(--yellow); }

/* ── STAT CARDS ──────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  position: relative; overflow: hidden;
  transition: var(--transition);
}
.stat-card::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent-color, var(--saffron));
}
.stat-card:hover { border-color: var(--accent-color, var(--saffron)); box-shadow: var(--shadow-sm); }
.stat-card--green  { --accent-color: var(--green); }
.stat-card--red    { --accent-color: var(--red); }
.stat-card--yellow { --accent-color: var(--yellow); }
.stat-card--blue   { --accent-color: var(--blue); }

.stat-card__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.stat-card__value {
  font-family: var(--font-head);
  font-size: 2.2rem;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text);
}
.stat-card__sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* ── TABS ────────────────────────────────── */
.tabs {
  display: flex; gap: 0.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.2rem;
  width: fit-content;
  margin-bottom: 1.75rem;
}
.tab {
  font-family: var(--font-body);
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: none; border: none;
  cursor: pointer;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.tab:hover { color: var(--text); }
.tab--active { background: var(--saffron); color: #fff; }

.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ── FILTER TABS ─────────────────────────── */
.filter-tabs {
  display: flex; gap: 0.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.2rem;
  flex-wrap: wrap;
}
.ftab {
  font-family: var(--font-body);
  font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted);
  background: none; border: none;
  cursor: pointer;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}
.ftab:hover { color: var(--text); }
.ftab--active { background: var(--saffron); color: #fff; }

/* ── FORM ────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-input, .form-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus { border-color: var(--saffron); }
.form-input::placeholder { color: var(--text-dim); }
.form-select option { background: var(--surface2); color: var(--text); }
.form-hint { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.3rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; justify-content: flex-end; }

/* ── SEARCH ──────────────────────────────── */
.search-wrap { position: relative; }
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.7rem 2.4rem 0.7rem 2.6rem;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--saffron); }
.search-input::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute; left: 0.85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.85rem;
  pointer-events: none;
}
.search-clear {
  position: absolute; right: 0.75rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 0.9rem; display: none;
}
.search-clear.show { display: block; }

/* ── TABLE ───────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-toolbar {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.table-count { font-size: 0.72rem; color: var(--text-muted); }
.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 0.75rem 1.25rem;
  text-align: left;
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td {
  padding: 0.85rem 1.25rem;
  font-size: 0.82rem;
  color: var(--text);
  vertical-align: middle;
}
.td-mono { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); }
.td-bold { font-weight: 600; }
.td-muted { color: var(--text-muted); font-size: 0.78rem; }

/* ── BADGE ───────────────────────────────── */
.badge {
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  white-space: nowrap; display: inline-block;
}
.badge--saffron { background: var(--saffron-dim); color: var(--saffron); }
.badge--green   { background: var(--green-dim);   color: var(--green); }
.badge--red     { background: var(--red-dim);     color: var(--red); }
.badge--yellow  { background: var(--yellow-dim);  color: var(--yellow); }
.badge--blue    { background: var(--blue-dim);    color: var(--blue); }
.badge--muted   { background: var(--surface3);    color: var(--text-muted); }
.badge--solid-red    { background: var(--red);    color: #fff; }
.badge--solid-green  { background: var(--green);  color: #fff; }
.badge--solid-yellow { background: var(--yellow); color: #000; }

/* ── PHONE ICON ──────────────────────────── */
.phone-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--saffron-dim);
  color: var(--saffron);
  text-decoration: none; font-size: 0.78rem;
  border: 1px solid var(--saffron-mid);
  transition: var(--transition); flex-shrink: 0;
}
.phone-btn:hover { background: var(--saffron); color: #fff; }

/* ── MODAL ───────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 460px;
  padding: 2rem;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal__header { margin-bottom: 1.5rem; }
.modal__title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  color: var(--saffron);
  line-height: 1;
}
.modal__sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }
.modal__close {
  position: absolute; top: 1.1rem; right: 1.1rem;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; transition: var(--transition);
}
.modal__close:hover { border-color: var(--red); color: var(--red); }
.modal__divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.modal__section-label {
  font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 0.65rem;
}

/* Confirm Modal */
.confirm-modal {
  background: var(--surface);
  border: 1px solid var(--red);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 360px;
  padding: 2rem; text-align: center;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s;
  box-shadow: var(--shadow-lg);
}
.modal-overlay.open .confirm-modal { transform: translateY(0); }
.confirm-modal__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.confirm-modal__title {
  font-family: var(--font-head);
  font-size: 1.3rem; letter-spacing: 0.05em;
  color: var(--text); margin-bottom: 0.4rem;
}
.confirm-modal__sub { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── FOLLOWUP BADGES ─────────────────────── */
.fu-badge {
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.18rem 0.6rem; border-radius: 99px;
  cursor: pointer; border: none; white-space: nowrap;
  display: inline-block;
}
.fu-badge--interested    { background: var(--green-dim);  color: var(--green); }
.fu-badge--not-interested{ background: var(--red-dim);    color: var(--red); }
.fu-badge--call-back     { background: var(--yellow-dim); color: var(--yellow); }
.fu-badge--joined        { background: var(--blue-dim);   color: var(--blue); }
.fu-badge--no-response   { background: var(--surface3);   color: var(--text-muted); }
.fu-badge--none          { background: var(--surface3);   color: var(--text-dim); font-style: italic; }

/* Followup history */
.fh-list { max-height: 180px; overflow-y: auto; }
.fh-item { padding: 0.55rem 0; border-bottom: 1px dashed var(--border); }
.fh-item:last-child { border-bottom: none; }
.fh-item__top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.2rem; }
.fh-item__date { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); }
.fh-item__note { font-size: 0.76rem; color: var(--text-muted); }
.fh-empty { font-size: 0.75rem; color: var(--text-dim); font-style: italic; padding: 0.75rem 0; text-align: center; }

/* ── SKELETON ────────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--border) 25%, var(--surface3) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  height: 13px; width: 100%; margin-bottom: 8px;
}
.skel--title  { height: 20px; width: 55%; margin-bottom: 10px; }
.skel--short  { width: 40%; }
.skel--xs     { width: 30%; height: 10px; }
.skel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem; min-height: 130px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── STATE SCREENS ───────────────────────── */
.state-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 4rem 2rem; text-align: center;
  grid-column: 1 / -1;
}
.state-screen__icon  { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.4; }
.state-screen__title { font-family: var(--font-head); font-size: 1.2rem; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.3rem; }
.state-screen__sub   { font-size: 0.78rem; color: var(--text-dim); }

.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem; color: var(--text-muted); font-size: 0.85rem; gap: 0.75rem;
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--saffron);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ───────────────────────────────── */
.ef-toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.3rem;
  display: flex; align-items: center; gap: 0.85rem;
  font-size: 0.82rem; color: var(--text);
  transform: translateY(20px); opacity: 0;
  transition: all 0.3s; min-width: 240px;
  box-shadow: var(--shadow-lg);
}
.ef-toast--show { transform: translateY(0); opacity: 1; }
.ef-toast__icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.ef-toast--success .ef-toast__icon { background: var(--green); color: #fff; }
.ef-toast--error   .ef-toast__icon { background: var(--red);   color: #fff; }
.ef-toast--warning .ef-toast__icon { background: var(--yellow); color: #000; }

/* ── QUICK LINKS ─────────────────────────── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.85rem; margin-bottom: 2rem;
}
.qlink {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 0.75rem;
  text-decoration: none;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.5rem;
  transition: var(--transition); text-align: center;
}
.qlink:hover {
  border-color: var(--saffron);
  background: var(--saffron-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.qlink__icon  { font-size: 1.5rem; }
.qlink__label {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.qlink:hover .qlink__label { color: var(--saffron); }

/* ── WEEK BADGE ──────────────────────────── */
.week-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem; color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: 99px;
}

/* ── PROGRESS BARS ───────────────────────── */
.progress-bar {
  height: 5px; background: var(--border);
  border-radius: 99px; overflow: hidden;
}
.progress-bar__fill {
  height: 100%; border-radius: 99px;
  transition: width 0.6s ease;
}
.progress-bar__fill--done    { background: var(--green); }
.progress-bar__fill--next    { background: var(--saffron); }
.progress-bar__fill--pending { background: var(--text-dim); }

/* ── SECTION ─────────────────────────────── */
.section { margin-bottom: 2rem; }
.section__head {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 1rem;
}
.section__title {
  font-family: var(--font-head);
  font-size: 1.1rem; letter-spacing: 0.05em;
  color: var(--text);
}
.section__link { font-size: 0.75rem; color: var(--saffron); text-decoration: none; font-weight: 600; }
.section__link:hover { text-decoration: underline; }

/* ── BALANCE DISPLAY ─────────────────────── */
.balance-display {
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem; margin-bottom: 1rem; text-align: center;
}
.balance-display__val {
  font-family: var(--font-head);
  font-size: 1.8rem; letter-spacing: 0.05em;
  color: var(--red);
}
.balance-display__label { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ── THEME TRANSITION ────────────────────── */
*, *::before, *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease;
}
.btn, .tab, .ftab, .nav__link, .qlink, .phone-btn, .theme-toggle,
.modal__close, .search-clear {
  transition: all 0.2s ease !important;
}

/* ── BOTTOM NAV — Mobile ─────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom));
  display: none;
  grid-template-columns: repeat(5, 1fr);
}
.bottom-nav__item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.2rem;
  text-decoration: none;
  padding: 0.4rem 0.2rem;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s;
  min-height: 52px;
}
.bottom-nav__item--active { color: var(--saffron); }
.bottom-nav__item:hover { color: var(--text); }
.bottom-nav__icon { font-size: 1.3rem; line-height: 1; }

/* ── RESPONSIVE ──────────────────────────── */
@media (max-width: 768px) {
  /* Hide top nav links on mobile - use bottom nav */
  .nav__link { display: none; }
  .nav { padding: 0 1rem; justify-content: space-between; }
  .nav__brand { font-size: 1rem; }
  
  /* Show bottom nav */
  .bottom-nav { display: grid; }
  
  /* Page padding for bottom nav */
  .page {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 5rem; /* bottom nav height */
  }
  
  .page-title { font-size: 2rem; }
  
  /* Table scroll */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 500px; }
  
  /* Stats 2 column */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Modal full screen on mobile */
  .modal {
    max-width: 100% !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    transform: translateY(100%) !important;
    max-height: 92vh;
  }
  .modal-overlay { align-items: flex-end; }
  .modal-overlay.open .modal { transform: translateY(0) !important; }
  
  /* Confirm modal center on mobile */
  .confirm-modal {
    max-width: 92% !important;
    border-radius: var(--radius-xl);
    position: relative;
  }
  
  /* Touch targets */
  .btn { min-height: 44px; }
  .btn--sm { min-height: 36px; }
  .form-input, .form-select { min-height: 48px; font-size: 16px; } /* 16px prevents zoom on iOS */
  .search-input { min-height: 48px; font-size: 16px; }
  
  /* Filter tabs scroll */
  .filter-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .ftab { flex-shrink: 0; }
  
  /* Quick links 3 col */
  .quick-links { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
  
  /* Cards full width */
  .cards-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 380px) {
  .page-title { font-size: 1.7rem; }
  .stat-card__value { font-size: 1.7rem; }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
}

/* ── iOS & Touch Improvements ───────────────*/
* { -webkit-tap-highlight-color: transparent; }
input, select, textarea { -webkit-appearance: none; appearance: none; }
.btn:active { opacity: 0.85; transform: scale(0.97); }
.bottom-nav__item:active { opacity: 0.7; }
.driver-card:active, .dc:active { opacity: 0.9; }

/* Safe area for notched phones */
.bottom-nav {
  padding-bottom: calc(0.4rem + env(safe-area-inset-bottom, 0px));
}
.page { padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
