/* Trajexpress — palette + base */
:root {
  --bg: oklch(0.985 0.005 80);
  --bg-soft: oklch(0.96 0.01 75);
  --bg-card: #ffffff;
  --ink: oklch(0.22 0.03 260);
  --ink-2: oklch(0.42 0.03 260);
  --ink-3: oklch(0.62 0.02 260);
  --line: oklch(0.9 0.01 260);
  --line-strong: oklch(0.82 0.015 260);

  --blue: oklch(0.42 0.14 255);
  --blue-deep: oklch(0.32 0.13 258);
  --blue-soft: oklch(0.94 0.03 255);
  --blue-tint: oklch(0.97 0.02 255);

  --red: oklch(0.58 0.18 25);
  --red-deep: oklch(0.48 0.18 25);
  --red-soft: oklch(0.95 0.04 25);

  --gold: oklch(0.78 0.12 80);
  --green: oklch(0.58 0.12 155);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(20, 25, 60, 0.04), 0 1px 1px rgba(20, 25, 60, 0.03);
  --shadow: 0 2px 6px rgba(20, 25, 60, 0.06), 0 8px 24px -8px rgba(20, 25, 60, 0.08);
  --shadow-lg: 0 12px 40px -8px rgba(30, 40, 90, 0.18);

  --font-sans: "Manrope", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: "Fraunces", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a { color: inherit; text-decoration: none; }

/* ---------- App shell ---------- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 250, 246, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 36px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--blue-deep);
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue) 50%, var(--red) 50%, var(--red) 100%);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: white;
  clip-path: polygon(15% 60%, 50% 25%, 85% 60%, 85% 70%, 50% 35%, 15% 70%);
}
.brand sup {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--red);
  margin-left: 4px;
  text-transform: uppercase;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all 0.15s;
}
.nav-link:hover { background: var(--blue-tint); color: var(--blue-deep); }
.nav-link.active { background: var(--blue-soft); color: var(--blue-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue);
  color: white;
}
.btn-primary:hover { background: var(--blue-deep); }
.btn-red {
  background: var(--red);
  color: white;
}
.btn-red:hover { background: var(--red-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-soft); }
.btn-text {
  padding: 8px 12px;
  color: var(--blue-deep);
}
.btn-text:hover { background: var(--blue-tint); }
.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Page container ---------- */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
  width: 100%;
  flex: 1;
}
.page-narrow {
  max-width: 720px;
}

/* ---------- Cards & forms ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.card-soft {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 20px;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink);
  transition: border 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-tint);
}
.textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
}

/* ---------- Pills, badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--ink-2);
}
.pill-blue { background: var(--blue-soft); color: var(--blue-deep); }
.pill-red { background: var(--red-soft); color: var(--red-deep); }
.pill-green { background: oklch(0.94 0.04 155); color: oklch(0.42 0.13 155); }
.pill-gold { background: oklch(0.95 0.05 80); color: oklch(0.52 0.13 80); }
.pill-ink { background: var(--ink); color: white; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(ellipse at 80% 10%, oklch(0.94 0.06 25 / 0.5) 0%, transparent 60%),
    radial-gradient(ellipse at 10% 90%, oklch(0.92 0.06 255 / 0.5) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  padding: 56px 28px 80px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 22px;
}
.hero-eyebrow .pill-blue { padding: 3px 9px; }
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--blue-deep);
  max-width: 880px;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--red-deep);
  font-weight: 400;
}
.hero-sub {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 580px;
  margin: 0 0 32px;
  line-height: 1.5;
}

/* ---------- Search bar ---------- */
.search-bar {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr 0.8fr auto;
  gap: 2px;
  align-items: stretch;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.search-bar::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 22px;
  border: 1px solid var(--red-soft);
  pointer-events: none;
  z-index: -1;
}
.search-cell {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
  position: relative;
}
.search-cell:last-of-type { border-right: none; }
.search-cell-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.search-cell input,
.search-cell select {
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  padding: 0;
  width: 100%;
}
.search-cell input:focus,
.search-cell select:focus { outline: none; }
.search-cell input::placeholder { color: var(--ink-3); font-weight: 500; }
.search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}
.search-submit button {
  height: 100%;
  width: 64px;
  border-radius: 14px;
  background: var(--red);
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.15s;
}
.search-submit button:hover { background: var(--red-deep); }

/* ---------- Hero meta strip ---------- */
.hero-meta {
  margin-top: 36px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  color: var(--ink-2);
  font-size: 14px;
}
.hero-meta b { color: var(--blue-deep); font-weight: 700; font-size: 22px; font-family: var(--font-serif); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 32px;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  color: var(--blue-deep);
}
.section-title em { color: var(--red-deep); font-style: italic; }

/* ---------- Popular routes grid ---------- */
.routes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.route-tile {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-align: left;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.route-tile:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.route-tile-route {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.route-arrow {
  display: inline-block;
  color: var(--red);
  font-weight: 700;
}
.route-meta {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  gap: 10px;
}
.route-price {
  margin-top: 6px;
  font-size: 13px;
  color: var(--blue-deep);
  font-weight: 600;
}

/* ---------- How it works ---------- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.how-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.how-card-num {
  font-family: var(--font-serif);
  font-size: 60px;
  line-height: 1;
  color: var(--red-soft);
  position: absolute;
  top: 10px;
  right: 18px;
  font-weight: 500;
}
.how-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--blue-deep);
}
.how-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- Trip card (search results) ---------- */
.results-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
}
.filter-card { position: sticky; top: 90px; }
.filter-group { margin-bottom: 20px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  margin: 0 0 10px;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
  margin-bottom: 6px;
  cursor: pointer;
}
.checkbox-row input { accent-color: var(--blue); }
.checkbox-row .count { margin-left: auto; color: var(--ink-3); font-size: 12px; }

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.results-header h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 26px;
  margin: 0;
  color: var(--blue-deep);
}
.results-header h2 em { color: var(--red-deep); }

.trip-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: 90px 1fr 180px 130px;
  gap: 20px;
  align-items: center;
  transition: all 0.15s;
  cursor: pointer;
}
.trip-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.trip-time {
  text-align: center;
}
.trip-time-start {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 28px;
  color: var(--blue-deep);
  line-height: 1;
}
.trip-time-dur {
  font-size: 11px;
  color: var(--ink-3);
  margin: 6px 0;
  letter-spacing: 0.04em;
}
.trip-time-end {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 22px;
  color: var(--ink-2);
  line-height: 1;
}
.trip-route {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trip-route-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.trip-route-line .marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.trip-route-line.from .marker { background: var(--blue); }
.trip-route-line.to .marker { background: var(--red); }
.trip-route-divider {
  width: 1px;
  height: 14px;
  background: var(--line-strong);
  margin-left: 4px;
}
.trip-driver {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--line);
}
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.trip-driver-info { line-height: 1.2; min-width: 0; }
.trip-driver-name { font-weight: 600; font-size: 14px; }
.trip-driver-rating {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.star { color: var(--gold); }
.trip-price-block { text-align: right; }
.trip-price {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 30px;
  color: var(--blue-deep);
  line-height: 1;
}
.trip-price-unit { font-size: 13px; color: var(--ink-3); }
.trip-seats {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 6px;
}
.trip-seats.few { color: var(--red-deep); font-weight: 600; }

/* ---------- Trip detail ---------- */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
}
.timeline {
  position: relative;
  padding-left: 22px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 16px;
  bottom: 16px;
  width: 2px;
  background: var(--line-strong);
}
.timeline-step {
  position: relative;
  padding-bottom: 22px;
}
.timeline-step::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.timeline-step:last-child::before { background: var(--red); }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-time {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--blue-deep);
  line-height: 1;
}
.timeline-place { font-weight: 600; font-size: 15px; margin-top: 6px; }
.timeline-addr { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

.detail-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.detail-section:last-child { border-bottom: none; }
.detail-section h3 {
  margin: 0 0 14px;
  font-size: 17px;
  color: var(--blue-deep);
  font-family: var(--font-serif);
  font-weight: 500;
}
.detail-feat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  font-size: 14px;
  color: var(--ink-2);
}
.detail-feat-grid .row { display: flex; align-items: center; gap: 8px; }
.detail-feat-grid .check { color: var(--green); font-weight: 700; }
.detail-feat-grid .cross { color: var(--red); }

.booking-card {
  position: sticky;
  top: 90px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.price-summary {
  background: var(--blue-tint);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 14px 0;
}
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--ink-2);
  padding: 4px 0;
}
.price-row.total {
  font-size: 18px;
  color: var(--blue-deep);
  font-weight: 700;
  border-top: 1px dashed var(--line-strong);
  padding-top: 10px;
  margin-top: 6px;
}
.price-row.total b { font-family: var(--font-serif); font-size: 24px; }

.notice {
  background: var(--red-soft);
  border-left: 3px solid var(--red);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--red-deep);
  margin: 14px 0;
  line-height: 1.5;
}
.notice b { display: block; margin-bottom: 2px; }
.notice-blue {
  background: var(--blue-tint);
  border-left-color: var(--blue);
  color: var(--blue-deep);
}

/* ---------- Auth & form panels ---------- */
.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.auth-side {
  background:
    radial-gradient(ellipse at 30% 20%, oklch(0.55 0.16 25 / 0.18) 0%, transparent 60%),
    linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 100%);
  color: white;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 540px;
}
.auth-side h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.1;
  margin: 0 0 16px;
}
.auth-side h2 em { color: oklch(0.85 0.12 25); font-style: italic; }
.auth-side p { color: oklch(0.86 0.02 255); font-size: 15px; max-width: 320px; }
.auth-side-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: oklch(0.92 0.02 255);
}
.auth-side-list .row { display: flex; gap: 10px; align-items: flex-start; }
.auth-side-list .bullet {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: oklch(0.85 0.12 25);
  color: var(--blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.auth-body {
  padding: 40px;
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 22px;
  width: fit-content;
}
.auth-tab {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.auth-tab.active { background: white; color: var(--blue-deep); box-shadow: var(--shadow-sm); }

/* ---------- Driver dashboard ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
}
.dash-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-link {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  transition: all 0.15s;
}
.dash-link:hover { background: var(--bg-soft); }
.dash-link.active { background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-card .label-stat {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.stat-card .val {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 32px;
  color: var(--blue-deep);
  margin: 4px 0;
  line-height: 1.05;
}
.stat-card .sub {
  font-size: 12px;
  color: var(--ink-3);
}
.stat-card.accent .val { color: var(--red-deep); }

/* ---------- Admin ---------- */
.admin-lock {
  max-width: 460px;
  margin: 60px auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.admin-lock::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue) 50%, var(--red) 50%, var(--red) 100%);
}
.admin-lock h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 28px;
  color: var(--blue-deep);
  margin: 14px 0 8px;
}
.admin-lock p { color: var(--ink-2); margin: 0 0 24px; }
.admin-code-input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.4em;
  font-weight: 700;
  padding: 16px;
}
.admin-hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-3);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.admin-stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
}
.admin-stat .label-stat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.admin-stat .val {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 500;
  color: var(--blue-deep);
  margin: 6px 0 2px;
  line-height: 1.05;
}
.admin-stat.red .val { color: var(--red-deep); }
.admin-stat .trend {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

.admin-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* ---------- Tables ---------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg-soft); }

/* ---------- Chart placeholder ---------- */
.chart {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 14px 4px 4px;
}
.bar {
  flex: 1;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-deep) 100%);
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 10%;
  transition: opacity 0.15s;
}
.bar.red {
  background: linear-gradient(180deg, var(--red) 0%, var(--red-deep) 100%);
}
.bar:hover { opacity: 0.85; }
.bar-label {
  position: absolute;
  bottom: -20px;
  left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 60px;
  padding: 36px 28px;
  background: var(--blue-deep);
  color: oklch(0.86 0.02 255);
  font-size: 13px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer .brand { color: white; }
.footer .brand-mark { background: white; }
.footer .brand-mark::after { background: var(--blue-deep); }
.footer-links { display: flex; gap: 18px; }
.footer-links a:hover { color: white; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.spacer-sm { height: 12px; }
.spacer { height: 22px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.row-gap { display: flex; gap: 10px; align-items: center; }
.text-c { text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.placeholder-img {
  background:
    repeating-linear-gradient(135deg, var(--bg-soft), var(--bg-soft) 8px, white 8px, white 16px);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue-deep);
  color: white;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: toastIn 0.25s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Messages (chat) ---------- */
.messages-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 600px;
  height: calc(100vh - 220px);
  max-height: 760px;
}
.messages-list {
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  overflow-y: auto;
}
.conv-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s;
}
.conv-item:hover { background: white; }
.conv-item.active { background: white; box-shadow: inset 3px 0 0 var(--red); }
.conv-item-body { min-width: 0; }
.conv-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.conv-item-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item-time {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.conv-item-preview {
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 2px 0;
}
.conv-item-trip {
  font-size: 11px;
  color: var(--blue-deep);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.messages-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    radial-gradient(ellipse at top, var(--blue-tint) 0%, transparent 40%),
    white;
}
.thread-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: white;
  flex-shrink: 0;
}
.thread-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.thread-time {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 14px 0 8px;
}
.bubble {
  max-width: 70%;
  margin: 2px 0;
  display: flex;
}
.bubble.me { align-self: flex-end; }
.bubble.them { align-self: flex-start; }
.bubble-text {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.me .bubble-text {
  background: var(--blue);
  color: white;
  border-bottom-right-radius: 5px;
}
.bubble.them .bubble-text {
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.thread-input {
  display: flex;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: white;
  flex-shrink: 0;
}
.thread-input .input {
  flex: 1;
}
.thread-input .btn {
  padding: 11px 18px;
}
.thread-note {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  padding: 6px 22px 12px;
  font-size: 11px;
  color: var(--ink-3);
  background: white;
}

@media (max-width: 900px) {
  .messages-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .messages-list {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 280px;
  }
  .thread-scroll { padding: 18px; }
}

/* ---------- Burger + menu mobile ---------- */
.nav-burger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}
.nav-burger:hover { background: var(--bg-soft); }
.burger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
  height: 16px;
}
.burger-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--blue-deep);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}
.burger-icon.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger-icon.open span:nth-child(2) { opacity: 0; }
.burger-icon.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  position: fixed;
  inset: 0;
  top: 61px;
  background: rgba(20, 25, 60, 0.35);
  z-index: 40;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.nav-mobile {
  display: none;
  position: fixed;
  top: 61px;
  left: 0;
  right: 0;
  z-index: 45;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px 24px;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow-lg);
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease-out, opacity 0.22s;
  max-height: calc(100vh - 61px);
  overflow-y: auto;
}
.nav-mobile.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.nav-mobile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.nav-mobile-link {
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.12s;
}
.nav-mobile-link:hover { background: var(--bg-soft); }
.nav-mobile-link.active { background: var(--blue-soft); color: var(--blue-deep); }

@media (max-width: 980px) {
  .search-bar { grid-template-columns: 1fr 1fr; }
  .results-layout, .detail-layout, .dash-grid, .admin-grid { grid-template-columns: 1fr; }
  .routes-grid { grid-template-columns: repeat(2, 1fr); }
  .how-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .admin-stats, .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Mobile : téléphones et petites tablettes ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; }

  /* Header : on masque la nav bureau, on montre le burger */
  .header-inner { padding: 12px 18px; gap: 12px; }
  .nav-desktop { display: none; }
  .nav-burger { display: flex; }
  .nav-mobile { display: flex; }
  .brand { font-size: 19px; }

  /* Conteneurs */
  .page { padding: 20px 18px; }
  .section { padding: 36px 0; }
  .section-title { font-size: 26px; }

  /* Hero */
  .hero { padding: 36px 18px 48px; }
  .hero h1 { font-size: clamp(32px, 9vw, 44px); }
  .hero-sub { font-size: 16px; }
  .hero-eyebrow { font-size: 12px; flex-wrap: wrap; }

  /* Barre de recherche : empilée verticalement */
  .search-bar {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 6px;
    border-radius: 16px;
  }
  .search-cell {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
  }
  .search-submit { padding: 8px 0 4px; }
  .search-submit button {
    width: 100%;
    height: 52px;
    border-radius: 12px;
  }

  /* Hero meta : en colonne */
  .hero-meta { gap: 14px; flex-direction: column; }

  /* Grilles → une colonne */
  .routes-grid { grid-template-columns: 1fr; }
  .admin-stats, .dash-stats { grid-template-columns: 1fr; }

  /* Carte CTA chauffeur de l'accueil */
  .section .card[style*="grid-template-columns: 1.4fr"],
  .section .card[style*="gridTemplateColumns"] {
    grid-template-columns: 1fr !important;
    padding: 24px !important;
  }

  /* Cartes trajet : passage en bloc empilé */
  .trip-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }
  .trip-time {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
  }
  .trip-time-start { font-size: 24px; }
  .trip-time-dur { margin: 0; }
  .trip-time-end { font-size: 20px; }
  .trip-price-block { text-align: left; border-top: 1px solid var(--line); padding-top: 12px; }

  /* Détail trajet */
  .booking-card { position: static; margin-top: 20px; }
  .filter-card { position: static; }

  /* Tableaux : défilement horizontal */
  .card > .table,
  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Onglets admin : défilement horizontal */
  .admin-stat .val { font-size: 30px; }

  /* Tableau de bord : sidebar en haut, défilement horizontal */
  .dash-sidebar {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .dash-link {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .dash-link .pill { display: none; }

  /* Auth : padding réduit */
  .auth-body, .auth-side { padding: 28px 22px; }
  .auth-side { min-height: auto; }
  .field-row { grid-template-columns: 1fr; gap: 0; }

  /* Pied de page */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }

  /* Messagerie : la liste devient un sélecteur compact */
  .messages-shell { height: auto; min-height: 0; }
  .thread-scroll { max-height: 50vh; }
  .bubble { max-width: 85%; }

  /* Détail : titres plus petits */
  .detail-feat-grid { grid-template-columns: 1fr; }
}

/* ---------- Très petits écrans ---------- */
@media (max-width: 400px) {
  .brand sup { display: none; }
  .hero h1 { font-size: 30px; }
  .section-title { font-size: 23px; }
  .trip-price { font-size: 26px; }
}
