/* ============================================================
   Rockwell Sabay — Design System
   Premium Claymorphism · Mobile-First
   Font: DM Sans (body) + Playfair Display (accent)
   ============================================================ */

/* ─── TOKENS ────────────────────────────────────────────────── */
:root {
  /* Brand */
  --rs-red:        #C0392B;
  --rs-red-soft:   #F5E9E8;
  --rs-red-mid:    #E8A09A;
  --rs-navy:       #1A2B4A;
  --rs-navy-soft:  #EEF1F6;
  --rs-gold:       #B8922A;
  --rs-gold-soft:  #FDF5E4;

  /* Neutrals */
  --gray-50:  #F8F9FB;
  --gray-100: #F1F3F7;
  --gray-200: #E2E7EF;
  --gray-400: #9AA3B2;
  --gray-600: #5A6478;
  --gray-900: #1A1D26;

  /* Semantic */
  --bg:        #F0F2F7;
  --surface:   #FFFFFF;
  --text:      var(--gray-900);
  --text-sub:  var(--gray-600);
  --border:    var(--gray-200);
  --shadow-sm: 0 2px 8px rgba(26,43,74,.06), 0 1px 2px rgba(26,43,74,.04);
  --shadow-md: 0 6px 24px rgba(26,43,74,.10), 0 2px 8px rgba(26,43,74,.06);
  --shadow-lg: 0 16px 48px rgba(26,43,74,.14), 0 4px 12px rgba(26,43,74,.08);

  /* Clay effect */
  --clay-shadow: 0 8px 20px rgba(26,43,74,.12), 0 2px 6px rgba(26,43,74,.08), inset 0 1px 0 rgba(255,255,255,.7);
  --clay-radius: 20px;
  --card-radius: 16px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Nav */
  --topnav-h:    64px;
  --bottomnav-h: 68px;
}

/* ─── RESET ─────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: var(--topnav-h);
  padding-bottom: calc(var(--bottomnav-h) + 16px);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
textarea, input, select { font-family: inherit; }

/* ─── TYPOGRAPHY ────────────────────────────────────────────── */
.playfair { font-family: 'Playfair Display', Georgia, serif; }

h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.15rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1rem; font-weight: 600; }
p  { line-height: 1.6; }

.muted       { color: var(--text-sub); font-size: .85rem; }
.muted-label { color: var(--text-sub); font-size: .8rem; }
.optional    { color: var(--gray-400); font-size: .8rem; font-weight: 400; }

/* ─── LAYOUT ────────────────────────────────────────────────── */
.page-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-md);
}

/* ─── TOP NAV ───────────────────────────────────────────────── */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.topnav__inner {
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topnav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topnav__logo {
  width: 36px; height: 36px;
  background: var(--rs-navy);
  color: #fff;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 700;
  font-family: 'Playfair Display', serif;
  flex-shrink: 0;
}
.topnav__wordmark { display: flex; flex-direction: column; }
.topnav__name { font-size: .9rem; font-weight: 700; color: var(--rs-navy); line-height: 1.1; }
.topnav__sub  { font-size: .68rem; color: var(--text-sub); text-transform: uppercase; letter-spacing: .04em; }

.topnav__actions { display: flex; align-items: center; gap: 8px; }
.topnav__avatar {
  width: 36px; height: 36px;
  background: var(--rs-navy);
  color: #fff;
  border-radius: 50%;
  font-size: .9rem; font-weight: 600;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.topnav__avatar:hover { opacity: .85; }

/* Nav Dropdown */
.nav-dropdown {
  display: none;
  position: fixed;
  top: var(--topnav-h);
  right: var(--space-md);
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.nav-dropdown.is-open { display: block; }
.nav-dropdown__user {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--gray-50);
}
.nav-dropdown__name  { font-weight: 600; font-size: .9rem; color: var(--rs-navy); }
.nav-dropdown__email { font-size: .78rem; color: var(--text-sub); margin-top: 2px; }
.nav-dropdown__item {
  display: block;
  padding: 11px 16px;
  font-size: .88rem;
  color: var(--text);
  transition: background .12s;
}
.nav-dropdown__item:hover, .nav-dropdown__item.is-active { background: var(--gray-50); }
.nav-dropdown__item.is-active { font-weight: 600; color: var(--rs-navy); }
.nav-dropdown__item--danger { color: var(--rs-red); }
.nav-dropdown__divider { border: none; border-top: 1px solid var(--border); }

/* ─── BOTTOM NAV ────────────────────────────────────────────── */
.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.bottomnav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--gray-400);
  transition: color .15s;
  border-radius: 12px;
}
.bottomnav__item.is-active { color: var(--rs-navy); }
.bottomnav__item--cta {
  background: var(--rs-navy);
  color: #fff !important;
  border-radius: 14px;
  margin: 8px 4px;
  box-shadow: var(--shadow-md);
}
.bottomnav__icon { font-size: 1.3rem; line-height: 1; }
.bottomnav__label { font-size: .65rem; font-weight: 500; letter-spacing: .01em; }

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: .875rem;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
  border: 2px solid transparent;
}
.btn--full { width: 100%; }
.btn--lg   { padding: 14px 24px; font-size: 1rem; border-radius: 14px; }
.btn--sm   { padding: 7px 12px; font-size: .8rem; border-radius: 10px; }

.btn--primary {
  background: var(--rs-navy);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,43,74,.25);
}
.btn--primary:hover { background: #243d68; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(26,43,74,.3); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: var(--gray-100);
  color: var(--gray-600);
  border-color: var(--gray-200);
}
.btn--ghost:hover { background: var(--gray-200); }

.btn--outline {
  background: transparent;
  border-color: var(--rs-navy);
  color: var(--rs-navy);
}
.btn--outline:hover { background: var(--rs-navy-soft); }

.btn--success {
  background: #1A6B42;
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,107,66,.2);
}
.btn--warning {
  background: #B8922A;
  color: #fff;
}
.btn--danger {
  background: var(--rs-red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(192,57,43,.25);
}
.btn--danger:hover { background: #a93226; }

/* ─── SECTION ───────────────────────────────────────────────── */
.section { margin-bottom: var(--space-xl); }
.section__title { margin-bottom: var(--space-sm); color: var(--rs-navy); }
.section__hint  { font-size: .85rem; color: var(--text-sub); margin-bottom: var(--space-md); margin-top: -4px; }
.section__titlerow { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); }
.section__link { font-size: .82rem; color: var(--rs-navy); font-weight: 600; }
.section__link-block {
  display: block;
  text-align: center;
  padding: 12px;
  font-size: .85rem;
  color: var(--rs-navy);
  font-weight: 600;
  background: var(--gray-50);
  border-radius: 12px;
  margin-top: 8px;
}

/* ─── PAGE HEADER ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}
.page-header__title { font-size: 1.4rem; color: var(--rs-navy); }
.page-header__sub   { font-size: .85rem; color: var(--text-sub); margin-top: 4px; }
.back-btn { font-size: .82rem; color: var(--text-sub); padding: 4px 0; }

/* ─── GREETING ──────────────────────────────────────────────── */
.greeting {
  background: var(--rs-navy);
  border-radius: var(--clay-radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.greeting__inner { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); }
.greeting__date  { font-size: .8rem; opacity: .7; text-transform: uppercase; letter-spacing: .06em; }
.greeting__name  { font-size: 1.3rem; font-weight: 700; margin: 4px 0 2px; }
.greeting__sub   { font-size: .88rem; opacity: .75; }
.greeting .btn--primary { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: #fff; white-space: nowrap; flex-shrink: 0; }
.greeting .btn--primary:hover { background: rgba(255,255,255,.28); }

/* ─── RIDE CARD (Active / Confirmed) ───────────────────────── */
.ride-card {
  background: var(--surface);
  border-radius: var(--clay-radius);
  box-shadow: var(--clay-shadow);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}
.ride-card--active { border-left: 4px solid var(--rs-navy); }

.ride-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.ride-card__period { font-size: .82rem; color: var(--text-sub); }

.ride-card__route { margin-bottom: var(--space-md); }
.ride-card__stop  { display: flex; align-items: center; gap: 10px; font-size: .9rem; padding: 3px 0; }
.route-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.route-dot--origin { background: var(--rs-gold); }
.route-dot--dest   { background: var(--rs-navy); }
.route-line {
  width: 2px; height: 20px;
  background: var(--gray-200);
  margin-left: 5px;
}

.ride-card__partner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray-50);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: var(--space-sm);
}
.ride-card__partner-label { font-size: .75rem; color: var(--text-sub); display: block; }
.ride-card__partner-name  { font-weight: 600; font-size: .95rem; }

.ride-card__vehicle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  margin-bottom: var(--space-sm);
  color: var(--text-sub);
}

.ride-card__time {
  font-size: .82rem;
  color: var(--text-sub);
  margin-bottom: var(--space-md);
}

.ride-card__actions { display: flex; flex-direction: column; gap: 8px; }

.plate-badge {
  background: var(--rs-navy-soft);
  color: var(--rs-navy);
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .05em;
}

/* ─── MATCH CARD (Pending / Blind) ─────────────────────────── */
.match-card {
  background: var(--surface);
  border-radius: var(--clay-radius);
  box-shadow: var(--clay-shadow);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  border-left: 4px solid var(--rs-gold);
}
.match-card--past { border-left-color: var(--gray-200); opacity: .85; }

.match-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.match-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--rs-gold-soft);
  border-radius: 10px;
  padding: 6px 12px;
  min-width: 60px;
}
.match-score__num   { font-size: 1.2rem; font-weight: 700; color: var(--rs-gold); line-height: 1; }
.match-score__label { font-size: .65rem; color: var(--rs-gold); text-transform: uppercase; letter-spacing: .06em; }

.match-card__privacy-note {
  font-size: .78rem;
  color: var(--text-sub);
  background: var(--gray-50);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: var(--space-md);
}

.match-card__blind { margin-bottom: var(--space-md); }
.match-card__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: .875rem;
}
.match-card__row:last-child { border-bottom: none; }
.match-label { color: var(--text-sub); font-size: .8rem; flex-shrink: 0; padding-right: 12px; }

.match-card__cta-hint {
  font-size: .8rem;
  color: var(--rs-gold);
  font-weight: 600;
  margin-bottom: 8px;
}
.match-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.waiting-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: var(--text-sub);
  padding: 8px 0;
}
.waiting-dots {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }

/* ─── TRIP CARD ─────────────────────────────────────────────── */
.trip-card {
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}
.trip-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-md);
  border-bottom: 1px solid var(--gray-100);
}
.trip-card__role {
  font-size: .82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
}
.role--driver { background: #EEF6FF; color: #1A4C8A; }
.role--rider  { background: var(--rs-red-soft); color: var(--rs-red); }

.trip-card__body  { padding: 12px var(--space-md); }
.trip-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: .875rem;
}
.trip-detail__label { color: var(--text-sub); font-size: .78rem; width: 58px; flex-shrink: 0; padding-top: 1px; }
.trip-detail__value { font-weight: 500; }
.trip-detail--notes .trip-detail__value { font-weight: 400; }

.trip-card__footer {
  padding: 10px var(--space-md);
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.trip-card__actions { display: flex; gap: 6px; }
.vehicle-tag { font-size: .78rem; color: var(--text-sub); }

/* ─── DRIVER CHIP (available drivers) ───────────────────────── */
.driver-list { display: flex; flex-direction: column; gap: 8px; }
.driver-chip {
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  padding: 12px var(--space-md);
  display: flex;
  align-items: center;
  gap: 12px;
}
.driver-chip__period { font-size: 1.3rem; }
.driver-chip__info   { flex: 1; min-width: 0; }
.driver-chip__dest   { display: block; font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.driver-chip__time   { display: block; font-size: .78rem; color: var(--text-sub); }
.driver-chip__car    { display: block; font-size: .75rem; color: var(--gray-400); }

/* ─── DAY GROUP ─────────────────────────────────────────────── */
.day-group { margin-bottom: var(--space-lg); }
.day-group__label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-sub);
  margin-bottom: 10px;
  padding: 0 4px;
}

/* ─── STATUS PILLS ──────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill--open      { background: #E8F5E9; color: #2E7D32; }
.pill--pending   { background: #FFF8E1; color: #F57F17; }
.pill--confirmed { background: #E3F2FD; color: #1565C0; }
.pill--enroute   { background: #EDE7F6; color: #4527A0; }
.pill--dropping  { background: #FCE4EC; color: #880E4F; }
.pill--done      { background: #E8F5E9; color: #1B5E20; }
.pill--cancelled { background: var(--gray-100); color: var(--gray-600); }
.pill--suggested { background: var(--rs-gold-soft); color: var(--rs-gold); }
.pill--default   { background: var(--gray-100); color: var(--gray-600); }

/* ─── FORMS ─────────────────────────────────────────────────── */
.trip-form { display: flex; flex-direction: column; gap: 0; }
.form-section {
  background: var(--surface);
  border-radius: var(--card-radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.form-section__label {
  display: block;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rs-navy);
  margin-bottom: var(--space-md);
}
.form-group { margin-bottom: var(--space-md); }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.form-hint { display: block; font-size: .75rem; color: var(--gray-400); margin-top: 4px; }
.form-row  { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--rs-navy);
  box-shadow: 0 0 0 3px rgba(26,43,74,.08);
}
.form-control--locked {
  background: var(--gray-50);
  color: var(--text-sub);
  cursor: default;
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-md);
  font-size: .9rem;
}
.form-check input[type="checkbox"] {
  width: 18px; height: 18px;
  cursor: pointer;
  accent-color: var(--rs-navy);
}

/* Role Toggle */
.role-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  transition: all .15s;
  text-align: center;
}
.role-btn.is-active {
  background: var(--rs-navy-soft);
  border-color: var(--rs-navy);
  box-shadow: 0 0 0 3px rgba(26,43,74,.08);
}
.role-btn__icon { font-size: 1.8rem; }
.role-btn__label { font-size: .85rem; font-weight: 700; color: var(--rs-navy); }
.role-btn__sub   { font-size: .72rem; color: var(--text-sub); }

/* Seat Picker */
.seat-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.seat-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  transition: all .12s;
}
.seat-btn.is-active {
  background: var(--rs-navy);
  border-color: var(--rs-navy);
  color: #fff;
}

.vehicle-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--gray-50);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: var(--space-md);
  font-size: .9rem;
  font-weight: 500;
}

.form-submit-area { padding: var(--space-md) 0; }
.form-submit-hint { text-align: center; font-size: .78rem; color: var(--text-sub); margin-top: 8px; }

/* ─── PROFILE SECTIONS ──────────────────────────────────────── */
.profile-section {
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
  overflow: hidden;
}
.profile-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--space-md);
  cursor: pointer;
  transition: background .12s;
}
.profile-section__header:hover { background: var(--gray-50); }
.profile-section__title { font-size: 1rem; font-weight: 700; color: var(--rs-navy); }
.profile-section__sub   { font-size: .8rem; color: var(--text-sub); margin-top: 2px; }
.chevron { color: var(--gray-400); font-size: .85rem; transition: transform .2s; }
.chevron.is-open { transform: rotate(180deg); }
.profile-section__body { padding: var(--space-md) var(--space-lg) var(--space-lg); border-top: 1px solid var(--gray-100); }

/* ─── TAB BAR ───────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  background: var(--gray-100);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: var(--space-lg);
  gap: 4px;
}
.tab-bar__item {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-sub);
  border-radius: 9px;
  transition: all .15s;
  background: none;
  border: none;
  cursor: pointer;
}
.tab-bar__item.is-active {
  background: var(--surface);
  color: var(--rs-navy);
  box-shadow: var(--shadow-sm);
}

/* ─── HISTORY CARDS ─────────────────────────────────────────── */
.history-card {
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}
.history-card--done     { border-left: 3px solid #2E7D32; }
.history-card--cancelled{ border-left: 3px solid var(--gray-400); }
.history-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px var(--space-md);
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.history-card__body  { padding: 12px var(--space-md); }
.history-card__role  { font-size: .78rem; font-weight: 600; color: var(--text-sub); margin-bottom: 6px; }
.history-card__route { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.route-arrow         { color: var(--gray-400); }
.history-card__meta  { font-size: .78rem; color: var(--text-sub); }
.history-card__cancel-note { font-size: .78rem; color: var(--rs-red); background: var(--rs-red-soft); padding: 6px 10px; border-radius: 8px; margin-top: 8px; }

/* ─── ACTIVITY LOG ──────────────────────────────────────────── */
.activity-list { position: relative; padding-left: 16px; }
.activity-list::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; position: relative; }
.activity-item__dot {
  width: 10px; height: 10px;
  background: var(--rs-navy);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  margin-left: -5px;
}
.activity-item__body  { display: flex; flex-direction: column; gap: 2px; }
.activity-item__action{ font-size: .88rem; font-weight: 500; text-transform: capitalize; }
.activity-item__time  { font-size: .75rem; }

/* ─── ADMIN TABLE ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}
.stat-card {
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card--highlight { background: var(--rs-navy); color: #fff; }
.stat-card--warn      { background: var(--rs-red-soft); }
.stat-card__icon  { font-size: 1.3rem; }
.stat-card__num   { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.stat-card__label { font-size: .75rem; color: inherit; opacity: .7; }
.stat-card--highlight .stat-card__num   { color: #fff; }
.stat-card--highlight .stat-card__label { color: rgba(255,255,255,.7); }

.admin-table-wrap { overflow-x: auto; border-radius: var(--card-radius); box-shadow: var(--shadow-sm); }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: .82rem;
}
.admin-table th {
  background: var(--gray-50);
  padding: 10px 12px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.admin-table td { padding: 10px 12px; border-top: 1px solid var(--gray-100); vertical-align: middle; }
.admin-table tr:hover td { background: var(--gray-50); }

.role-tag {
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.score-badge {
  background: var(--rs-gold-soft);
  color: var(--rs-gold);
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ─── ALERTS ────────────────────────────────────────────────── */
.alert {
  padding: 12px var(--space-md);
  border-radius: 12px;
  margin-bottom: var(--space-md);
  font-size: .875rem;
}
.alert--error   { background: var(--rs-red-soft); color: var(--rs-red); border: 1px solid var(--rs-red-mid); }
.alert--success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.alert--warning { background: var(--rs-gold-soft); color: var(--rs-gold); border: 1px solid #F0D080; }
.alert a { font-weight: 600; text-decoration: underline; }

/* ─── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  background: var(--surface);
  border-radius: var(--clay-radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-xl);
}
.empty-state__icon  { font-size: 3rem; margin-bottom: var(--space-md); }
.empty-state__title { font-size: 1.05rem; color: var(--rs-navy); margin-bottom: 8px; }
.empty-state__body  { font-size: .88rem; color: var(--text-sub); margin-bottom: var(--space-lg); max-width: 280px; margin-left: auto; margin-right: auto; }

/* ─── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,43,74,.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
}
.modal {
  background: var(--surface);
  border-radius: var(--clay-radius) var(--clay-radius) 20px 20px;
  padding: var(--space-xl);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease-out;
}
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:translateY(0);opacity:1} }
.modal__title   { font-size: 1.1rem; color: var(--rs-navy); margin-bottom: 8px; }
.modal__body    { font-size: .88rem; color: var(--text-sub); margin-bottom: var(--space-md); }
.modal__actions { display: flex; flex-direction: column; gap: 8px; margin-top: var(--space-md); }

/* ─── SCROLLBAR ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

/* ─── DRIVER ALERT POPUP ────────────────────────────────────── */
.driver-alert {
  position: fixed;
  top: calc(var(--topnav-h) + 12px);
  left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  background: var(--rs-navy);
  color: #fff;
  border-radius: var(--clay-radius);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  animation: slideDown .3s ease-out;
}
@keyframes slideDown { from{transform:translateX(-50%) translateY(-20px);opacity:0} to{transform:translateX(-50%) translateY(0);opacity:1} }
.driver-alert__inner { display: flex; align-items: flex-start; gap: 12px; padding: 16px; }
.driver-alert__close { position: absolute; top: 10px; right: 12px; background: rgba(255,255,255,.15); border: none; color: #fff; width: 24px; height: 24px; border-radius: 50%; font-size: .8rem; cursor: pointer; display: grid; place-items: center; }
.driver-alert__icon  { font-size: 1.8rem; flex-shrink: 0; }
.driver-alert__title { display: block; font-weight: 700; margin-bottom: 4px; }
.driver-alert__body  { font-size: .82rem; opacity: .85; margin-bottom: 10px; }
.driver-alert__btn   { display: inline-block; background: rgba(255,255,255,.2); color: #fff; font-size: .82rem; font-weight: 700; padding: 6px 14px; border-radius: 20px; border: 1px solid rgba(255,255,255,.3); }

/* ─── MODE CARDS ────────────────────────────────────────────── */
.mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.mode-card {
  background: var(--surface);
  border-radius: var(--clay-radius);
  box-shadow: var(--clay-shadow);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 2px solid transparent;
  transition: border-color .15s;
}
.mode-card--rider       { border-top: 4px solid var(--rs-red); }
.mode-card--driver      { border-top: 4px solid var(--rs-navy); }
.mode-card--active-state{ box-shadow: 0 0 0 2px var(--rs-navy), var(--clay-shadow); }
.mode-card__header      { display: flex; align-items: center; gap: 8px; }
.mode-card__icon        { font-size: 1.4rem; }
.mode-card__title       { font-size: .92rem; font-weight: 700; color: var(--rs-navy); line-height: 1.2; }
.mode-card__sub         { font-size: .78rem; color: var(--text-sub); line-height: 1.4; }
.mode-card__actions     { display: flex; flex-direction: column; gap: 6px; margin-top: auto; padding-top: 8px; }

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px; height: 22px;
  background: var(--rs-navy);
  color: #fff;
  border-radius: 11px;
  font-size: .75rem;
  font-weight: 700;
  padding: 0 6px;
}

/* ─── DRIVER ROW (dashboard compact list) ───────────────────── */
.driver-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  padding: 12px var(--space-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow .15s;
  border-left: 3px solid transparent;
}
.driver-row:hover          { box-shadow: var(--shadow-md); }
.driver-row--new           { border-left-color: var(--rs-gold); }
.driver-row__period        { font-size: 1.3rem; flex-shrink: 0; }
.driver-row__info          { flex: 1; min-width: 0; }
.driver-row__dest          { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.driver-row__meta          { font-size: .76rem; color: var(--text-sub); margin-top: 2px; }
.driver-row__action        { flex-shrink: 0; }

/* ─── TRIP ROW (compact, clickable) ────────────────────────── */
.trip-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  padding: 12px var(--space-md);
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .12s;
}
.trip-row:hover     { box-shadow: var(--shadow-md); }
.trip-row__role     { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; flex-shrink: 0; }
.trip-row__info     { flex: 1; min-width: 0; }
.trip-row__dest     { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trip-row__meta     { font-size: .76rem; color: var(--text-sub); margin-top: 2px; }

/* ─── NEW BADGE ─────────────────────────────────────────────── */
.new-badge {
  display: inline-block;
  background: var(--rs-gold);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: .05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.your-turn-badge {
  font-size: .7rem;
  color: var(--rs-gold);
  font-weight: 700;
  margin-top: 4px;
}

.match-card--my-turn {
  border-left-color: var(--rs-gold);
  background: linear-gradient(135deg, #fff 80%, var(--rs-gold-soft));
}

/* ─── FIND A RIDE PAGE ──────────────────────────────────────── */
.search-bar {
  margin-bottom: 12px;
}
.search-bar__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-bar__icon  { position: absolute; left: 14px; font-size: 1rem; pointer-events: none; }
.search-bar__input {
  width: 100%;
  padding: 13px 40px 13px 42px;
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  font-size: .95rem;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.search-bar__input:focus {
  outline: none;
  border-color: var(--rs-navy);
  box-shadow: 0 0 0 3px rgba(26,43,74,.08);
}
.search-bar__clear {
  position: absolute;
  right: 12px;
  background: var(--gray-200);
  border: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  font-size: .7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600);
}

.filter-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-chips { display: flex; gap: 6px; flex-shrink: 0; }

.filter-chip {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--surface);
  border: 2px solid var(--gray-200);
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
  flex-shrink: 0;
}
.filter-chip.is-active {
  background: var(--rs-navy);
  border-color: var(--rs-navy);
  color: #fff;
}
.filter-chip--date {
  padding: 7px 10px;
  font-size: .78rem;
  min-width: 110px;
}

.area-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: var(--space-md);
  align-items: center;
  scrollbar-width: none;
}
.area-chips::-webkit-scrollbar { display: none; }
.area-chips__label { font-size: .75rem; color: var(--text-sub); flex-shrink: 0; }
.area-chip {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: .78rem;
  font-weight: 500;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all .12s;
  flex-shrink: 0;
}
.area-chip:hover, .area-chip.is-active {
  background: var(--rs-navy-soft);
  border-color: var(--rs-navy);
  color: var(--rs-navy);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--text-sub);
  margin-bottom: var(--space-md);
  padding: 0 4px;
}
.results-header__live { display: flex; align-items: center; gap: 5px; }
.live-dot {
  width: 7px; height: 7px;
  background: #2E7D32;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

/* ─── DRIVER CARD (find-ride) ───────────────────────────────── */
.driver-card {
  background: var(--surface);
  border-radius: var(--clay-radius);
  box-shadow: var(--clay-shadow);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  border-left: 4px solid var(--gray-200);
  transition: box-shadow .15s, border-color .15s;
}
.driver-card:hover       { box-shadow: var(--shadow-lg); }
.driver-card--highlighted {
  border-left-color: var(--rs-gold);
  box-shadow: 0 0 0 2px var(--rs-gold), var(--clay-shadow);
}

.driver-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.driver-card__period { font-size: .88rem; font-weight: 600; color: var(--rs-navy); }

.driver-card__route { margin-bottom: var(--space-md); }
.driver-card__stop  { display: flex; align-items: center; gap: 10px; font-size: .88rem; padding: 3px 0; }
.area-tag {
  display: inline-block;
  background: var(--rs-navy-soft);
  color: var(--rs-navy);
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 4px;
}

.driver-card__meta { display: flex; flex-direction: column; gap: 5px; margin-bottom: var(--space-md); }
.driver-card__meta-item { font-size: .84rem; color: var(--text-sub); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.driver-card__notes {
  background: var(--gray-50);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .82rem;
  color: var(--text-sub);
  margin-bottom: var(--space-md);
}

/* ─── MODAL TALL + CLOSE X ──────────────────────────────────── */
.modal--tall { max-height: 90vh; overflow-y: auto; }
.modal__close-x {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--gray-100);
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: .8rem;
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--gray-600);
}
.modal { position: relative; }

/* ─── SPINNER ───────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--rs-navy);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── EMPTY STATE INLINE ────────────────────────────────────── */
.empty-state--inline { margin-bottom: 0; }
