:root {
  --ink: #0f172a;
  --ink-secondary: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-dark: #334155;
  --bg: #f8fafc;
  --card: #ffffff;
  --brand: #f59e0b;
  --brand-hover: #d97706;
  --brand-light: #fef3c7;
  --dark: #0f172a;
  --dark-surface: #1e293b;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --blue: #3b82f6;
  --blue-bg: #eff6ff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.wrap {
  width: min(1280px, 94%);
  margin: auto;
}

/* ==========================================================================
   Header & Top Nav (CRITICAL REQUIREMENT #3 & #35)
   ========================================================================== */
.top {
  height: 80px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--dark);
}

.brandmark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--dark);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 14px;
}

.brand span b {
  color: var(--brand);
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.navlinks a {
  transition: color 0.15s ease;
}

.navlinks a:hover {
  color: var(--brand-hover);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Highly visible buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

.btn-dark {
  background: var(--dark);
  color: #ffffff;
}

.btn-dark:hover {
  background: var(--dark-surface);
  transform: translateY(-1px);
}

.btn-gold {
  background: var(--brand);
  color: var(--dark);
}

.btn-gold:hover {
  background: var(--brand-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: #f1f5f9;
  color: var(--dark);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: #e2e8f0;
}

.btn-outline-gold {
  background: transparent;
  border: 2px solid var(--brand);
  color: var(--brand);
}

.btn-outline-gold:hover {
  background: var(--brand);
  color: var(--dark);
}

/* ==========================================================================
   Hero & Booking Engine (SECTION 32)
   ========================================================================== */
.hero {
  background: radial-gradient(circle at 80% 20%, #1e293b 0%, #0f172a 50%, #020617 100%);
  color: #ffffff;
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, rgba(0,0,0,0) 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -2px;
  margin: 12px 0 20px;
  font-weight: 800;
}

.hero h1 em {
  font-style: normal;
  color: var(--brand);
}

.hero p {
  max-width: 540px;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1.6;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.booking {
  background: #ffffff;
  color: var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.tab {
  padding: 16px 8px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.2s;
  text-align: center;
}

.tab.active {
  background: #ffffff;
  color: var(--dark);
  box-shadow: inset 0 -3px var(--brand);
}

.booking-body {
  padding: 24px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.field {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f8fafc;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.route-info {
  margin: 8px 0 16px;
  padding: 12px 16px;
  background: var(--blue-bg);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #1e40af;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-btn {
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--dark);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  transition: background 0.2s, transform 0.1s;
}

.search-btn:hover {
  background: var(--brand-hover);
}

/* ==========================================================================
   Sections & Cards
   ========================================================================== */
.section {
  padding: 80px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 36px;
}

.section h2 {
  font-size: 36px;
  letter-spacing: -1px;
  margin: 6px 0;
  font-weight: 800;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.car-img {
  height: 190px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.car-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #ffffff;
  border-radius: var(--radius-full);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.live-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card h3 {
  font-size: 20px;
  margin: 6px 0;
}

.price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.price {
  font-size: 26px;
  font-weight: 900;
  color: var(--dark);
}

.notice {
  padding: 18px 20px;
  background: var(--brand-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: #92400e;
  line-height: 1.5;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.feature strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--dark);
}

/* ==========================================================================
   Partner CTA Section (SECTION 34)
   ========================================================================== */
.partner-cta-section {
  background: radial-gradient(circle at 10% 50%, #1e293b, #0f172a);
  color: #ffffff;
  padding: 90px 0;
  border-radius: var(--radius-lg);
  margin: 40px auto;
  text-align: center;
}

.partner-cta-content {
  max-width: 680px;
  margin: auto;
}

.partner-cta-content h2 {
  font-size: 42px;
  margin-bottom: 16px;
}

.partner-cta-content p {
  font-size: 18px;
  color: #94a3b8;
  margin-bottom: 32px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: #090d16;
  color: #94a3b8;
  padding: 70px 0 40px;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer .brand {
  color: #ffffff;
  margin-bottom: 14px;
}

.footer b {
  display: block;
  color: #ffffff;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.footer a {
  display: block;
  margin: 10px 0;
  font-size: 14px;
  transition: color 0.15s;
}

.footer a:hover {
  color: var(--brand);
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-box {
  width: min(650px, 100%);
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  border: 0;
  background: #f1f5f9;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background 0.15s;
}

.close-btn:hover {
  background: #e2e8f0;
  color: var(--ink);
}

/* ==========================================================================
   Dashboard Layouts (Admin & Agent)
   ========================================================================== */
.dash {
  min-height: 100vh;
  background: #f1f5f9;
}

.dash-topbar {
  background: #0f172a;
  color: #ffffff;
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid #1e293b;
}

.dash-nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dash-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 70px);
}

.dash-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-secondary);
  transition: all 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.side-link:hover {
  background: #f8fafc;
  color: var(--dark);
}

.side-link.active {
  background: var(--brand-light);
  color: #92400e;
  font-weight: 700;
}

.dash-main {
  padding: 32px;
  overflow-y: auto;
}

.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.stat span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.stat b {
  font-size: 32px;
  font-weight: 800;
  color: var(--dark);
  display: block;
  margin-top: 4px;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.tablewrap {
  overflow-x: auto;
  margin-top: 18px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  background: #f8fafc;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tr:hover {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.green {
  background: var(--green-bg);
  color: var(--green);
}

.badge.red {
  background: var(--red-bg);
  color: var(--red);
}

.badge.blue {
  background: var(--blue-bg);
  color: var(--blue);
}

.badge.gold {
  background: var(--brand-light);
  color: #92400e;
}

/* ==========================================================================
   Multi-step Wizard
   ========================================================================== */
.wizard-steps {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.wizard-step {
  flex: 1;
  padding: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.wizard-step.active {
  color: var(--brand-hover);
  border-bottom-color: var(--brand);
}

.wizard-step.completed {
  color: var(--green);
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

/* File Upload Card */
.upload-box {
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  background: #f8fafc;
  transition: all 0.2s;
  position: relative;
}

.upload-box:hover {
  border-color: var(--brand);
  background: #fffbeb;
}

.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-preview {
  margin-top: 10px;
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--dark);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  background: #065f46;
  border-left: 4px solid var(--green);
}

.toast-error {
  background: #991b1b;
  border-left: 4px solid var(--red);
}

/* ==========================================================================
   Mapbox Live Map
   ========================================================================== */
.map-container {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}

.marker-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
}

.marker-dot.online {
  background: var(--green);
}

.marker-dot.offline {
  background: var(--red);
}

.map-popup {
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
  min-width: 180px;
}

.popup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin-bottom: 6px;
}

/* ==========================================================================
   Auth / Login Layout
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 20%, #1e293b, #0f172a 80%);
  padding: 24px;
}

.auth-card {
  width: min(480px, 100%);
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-xl);
}

.auth-card h1 {
  font-size: 28px;
  margin: 8px 0 12px;
}

/* ==========================================================================
   Responsive Breakpoints (SECTION 37)
   ========================================================================== */
@media (max-width: 1024px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    display: none;
  }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .navlinks {
    display: none;
  }
  .features {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .top {
    height: 70px;
  }
  .brand {
    font-size: 18px;
  }
  .brandmark {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }
  .nav-actions .btn-ghost {
    padding: 8px 12px;
    font-size: 12px;
  }
  .nav-actions .btn-dark {
    padding: 8px 12px;
    font-size: 12px;
  }
  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid2, .grid3, .grid4 {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .dash-main {
    padding: 16px;
  }
  .auth-card {
    padding: 24px;
  }
}
