/* ===== Shared Design System — Premium Cab Platform Prototype ===== */
/* Light, airy, editorial. Deep emerald primary, warm gold for Luxury tier. */

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f4f2ef;
  --surface-3: #ece9e4;
  --border: #e6e2db;
  --border-strong: #d8d3c9;
  --text: #1c1b19;
  --text-dim: #6b6560;
  --text-faint: #9c9690;

  --primary: #0f6d4c;
  --primary-hover: #0a5439;
  --primary-dim: #e6f4ee;
  --primary-text-on: #ffffff;

  --accent: #0f6d4c;
  --accent-dim: #e6f4ee;

  --gold: #b8873a;
  --gold-dim: #f7ecd9;

  --warn: #b06a15;
  --warn-dim: #fbf0dd;
  --danger: #c02f2f;
  --danger-dim: #fbe9e9;

  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  --shadow-sm: 0 1px 2px rgba(28,27,25,0.04), 0 1px 1px rgba(28,27,25,0.03);
  --shadow-md: 0 4px 16px rgba(28,27,25,0.06), 0 1px 2px rgba(28,27,25,0.04);
  --shadow-lg: 0 20px 48px rgba(28,27,25,0.12), 0 4px 12px rgba(28,27,25,0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; }
h1, h2, h3, h4 { letter-spacing: -0.01em; }

/* ---------- Prototype chrome (banner shown on every screen) ---------- */
.proto-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.1rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.proto-banner .tag {
  background: var(--gold-dim);
  color: var(--gold);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  margin-right: 0.5rem;
  letter-spacing: 0.02em;
}
.proto-banner a.home-link {
  color: var(--primary);
  font-weight: 600;
}

/* ---------- Mobile phone frame (Customer / Driver apps) ---------- */
.phone-wrap {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem 4rem;
}
.phone {
  width: 390px;
  max-width: 100%;
  background: #17160f;
  border: 1px solid #17160f;
  border-radius: 40px;
  padding: 10px;
  box-shadow: var(--shadow-lg);
}
.phone-screen {
  background: var(--bg);
  border-radius: 30px;
  min-height: 760px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.status-bar {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
}
.screen-body {
  flex: 1;
  padding: 1rem 1.1rem 1.4rem;
  overflow-y: auto;
}
.app-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0 1.1rem;
}
.app-topbar h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.back-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

/* Bottom tab bar */
.tab-bar {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.tab-bar a {
  flex: 1;
  text-align: center;
  padding: 0.65rem 0 0.85rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.tab-bar a .icon { font-size: 1.15rem; }
.tab-bar a.active { color: var(--primary); }

/* ---------- Cards / lists (shared) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 0.75rem; }

.list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }

.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 0.92rem;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: var(--primary-text-on); box-shadow: 0 2px 8px rgba(15,109,76,0.25); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--primary); color: white; }
.btn-danger { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(192,47,47,0.25); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.82rem; width: auto; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 0.6rem; }
.btn-row .btn { flex: 1; }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge-accent { background: var(--accent-dim); color: var(--primary); }
.badge-warn { background: var(--warn-dim); color: var(--warn); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
.badge-primary { background: #eaf1fb; color: #2f5fa8; }
.badge-neutral { background: var(--surface-2); color: var(--text-dim); }

.chip {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.12s ease;
}
.chip.selected { border-color: var(--primary); color: var(--primary); background: var(--primary-dim); font-weight: 600; }

/* ---------- Forms ---------- */
.field { margin-bottom: 0.9rem; }
.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* ---------- Map placeholder ---------- */
.map-box {
  background:
    repeating-linear-gradient(0deg, #ece7dd, #ece7dd 1px, #f6f3ec 1px, #f6f3ec 24px),
    repeating-linear-gradient(90deg, #ece7dd, #ece7dd 1px, #f6f3ec 1px, #f6f3ec 24px);
  border-radius: var(--radius);
  height: 220px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-box .pin {
  position: absolute;
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(28,27,25,0.25));
}
.map-box .route-line {
  position: absolute;
  border-top: 3px dashed var(--primary);
  opacity: 0.55;
}
.map-box .car {
  position: absolute;
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 4px rgba(28,27,25,0.25));
  animation: drift 3s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(0,0); }
  to { transform: translate(6px, -4px); }
}

/* ---------- Persistent in-trip SOS bar + advanced sheet ---------- */
.sos-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, transparent, var(--bg) 35%);
  padding: 0.6rem 0 0;
  z-index: 20;
}
.sos-bar-btn {
  width: 100%;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 6px 20px rgba(192,47,47,0.3);
  animation: sos-pulse 2s ease-in-out infinite;
}
@keyframes sos-pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(192,47,47,0.3); }
  50% { box-shadow: 0 6px 26px rgba(192,47,47,0.5); }
}

.sos-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28,27,25,0.45);
  z-index: 200;
  display: none;
}
.sos-sheet-backdrop.open { display: block; }
.sos-sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 390px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 1.1rem 1.1rem 1.4rem;
  box-shadow: 0 -12px 32px rgba(28,27,25,0.15);
}
.sos-sheet h3 { margin: 0 0 0.2rem; color: var(--danger); font-size: 1.05rem; }
.sos-sheet p.sub { margin: 0 0 1rem; color: var(--text-dim); font-size: 0.8rem; }
.sos-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  text-align: left;
  width: 100%;
  color: var(--text);
}
.sos-option .ic { font-size: 1.3rem; flex-shrink: 0; }
.sos-option .txt { flex: 1; }
.sos-option .txt .t { font-size: 0.86rem; font-weight: 600; }
.sos-option .txt .d { font-size: 0.72rem; color: var(--text-dim); }
.sos-option.active { border-color: var(--danger); background: var(--danger-dim); }
.sos-option.active .txt .t { color: var(--danger); }

.rec-indicator {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: var(--danger-dim);
  color: var(--danger);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
}
.rec-indicator.show { display: flex; }
.rec-indicator .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger);
  animation: sos-pulse-dot 1s ease-in-out infinite;
}
@keyframes sos-pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.fake-call-overlay {
  position: fixed;
  inset: 0;
  background: #17160f;
  z-index: 500;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4rem 2rem;
  color: white;
  text-align: center;
}
.fake-call-overlay.show { display: flex; }
.fake-call-overlay .caller-avatar { font-size: 4rem; }
.fake-call-overlay .caller-name { font-size: 1.4rem; font-weight: 700; margin-top: 1rem; }
.fake-call-overlay .caller-sub { color: rgba(255,255,255,0.6); margin-top: 0.3rem; }
.fake-call-overlay .call-actions { display: flex; gap: 3rem; }
.fake-call-overlay .call-actions button {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  color: white;
}
.fake-call-overlay .decline { background: var(--danger); }
.fake-call-overlay .accept { background: var(--primary); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #262420;
  color: #fdfcfa;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(28,27,25,0.28);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* ---------- Progress / stepper ---------- */
.stepper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1rem;
}
.stepper .dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
}
.stepper .dot.done { background: var(--primary); }

/* ---------- Desktop dashboard shell (Admin / Provider) ---------- */
.dash {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 39px);
}
.dash-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.4rem 1rem;
}
.dash-sidebar .brand {
  font-weight: 800;
  font-size: 1.05rem;
  padding: 0 0.5rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}
.dash-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}
.dash-nav a:hover { background: var(--surface-2); color: var(--text); }
.dash-nav a.active { background: var(--primary-dim); color: var(--primary); font-weight: 600; }
.dash-main {
  padding: 1.9rem 2.2rem 3rem;
  max-width: 1200px;
}
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.6rem;
}
.dash-header h1 { margin: 0; font-size: 1.55rem; font-weight: 800; }
.dash-header p.sub { margin: 0.25rem 0 0; color: var(--text-dim); font-size: 0.88rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.stat-card .label { color: var(--text-dim); font-size: 0.78rem; font-weight: 500; }
.stat-card .value { font-size: 1.65rem; font-weight: 800; margin: 0.3rem 0; letter-spacing: -0.02em; }
.stat-card .delta { font-size: 0.76rem; font-weight: 600; }
.stat-card .delta.up { color: var(--primary); }
.stat-card .delta.down { color: var(--danger); }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; color: var(--text-dim); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); }
td { padding: 0.75rem 0.75rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--text);
}

.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

.muted { color: var(--text-dim); }
.small { font-size: 0.8rem; }
.center { text-align: center; }

@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
}
