:root {
  --primary: #0A2540;
  --primary-dark: #061727;
  --primary-light: #163B66;
  --accent: #F59E0B;
  --accent-hover: #D97706;
  --accent-light: #FEF3C7;
  --accent-gold: #FBBF24;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #3B82F6;
  --dark: #0F172A;
  --gray-900: #1E293B;
  --gray-800: #334155;
  --gray-700: #475569;
  --gray-600: #64748B;
  --gray-400: #94A3B8;
  --gray-200: #E2E8F0;
  --gray-100: #F1F5F9;
  --gray-50: #F8FAFC;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 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.15), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--gray-50);
  color: var(--gray-900);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Brand Header & Navigation --- */
.ksr-navbar {
  background-color: var(--primary);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--white);
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  padding: 2px;
  border: 2px solid var(--accent);
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  color: var(--white);
}

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

.brand-tagline {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-link {
  color: var(--gray-200);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.btn-nav-role {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-nav-role:hover {
  background: var(--accent-hover);
  color: var(--white);
}

/* --- Layout Container --- */
.app-container {
  max-width: 1300px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1rem;
  flex: 1;
}

/* --- Service Cards & Tabs --- */
.service-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.service-tab {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.service-tab:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.service-tab.active {
  border-color: var(--primary);
  background: #F8FAFC;
  box-shadow: 0 0 0 3px rgba(10, 37, 64, 0.15);
}

.service-tab.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent);
}

.service-icon {
  font-size: 1.75rem;
  margin-bottom: 0.4rem;
}

.service-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
}

.service-subtitle {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 0.2rem;
}

/* --- Map Container --- */
#map {
  width: 100%;
  height: 420px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 10;
  border: 1px solid var(--gray-200);
}

.map-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

/* --- Form Controls & Inputs --- */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-900);
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 37, 64, 0.1);
}

.input-with-btn {
  display: flex;
  gap: 0.5rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}

.btn-outline:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.btn-success {
  background: var(--success);
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* --- Quote Summary Box --- */
.quote-card {
  background: linear-gradient(135deg, #0A2540 0%, #163B66 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  margin-top: 1rem;
}

.quote-fare-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 0.75rem;
}

.fare-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.quote-breakdown-table {
  width: 100%;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.quote-breakdown-table td {
  padding: 0.25rem 0;
}

.quote-breakdown-table td:last-child {
  text-align: right;
  font-weight: 600;
}

/* --- Status Badges --- */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-requested { background: #FEF3C7; color: #B45309; }
.badge-accepted { background: #DBEAFE; color: #1E40AF; }
.badge-arrived { background: #E0E7FF; color: #4338CA; }
.badge-in_progress { background: #FCE7F3; color: #9D174D; }
.badge-completed { background: #D1FAE5; color: #065F46; }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }

/* --- Live Driver / Rider Tracking Card --- */
.active-ride-card {
  background: var(--white);
  border-radius: var(--radius);
  border-left: 5px solid var(--accent);
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { border-left-color: var(--accent); }
  50% { border-left-color: var(--primary); }
  100% { border-left-color: var(--accent); }
}

/* --- Grid Utilities --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

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

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

/* --- Tables --- */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 700;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid var(--gray-200);
}

.data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
}

.data-table tr:hover {
  background: var(--gray-50);
}

/* --- Toast Notifications --- */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Responsive Design --- */
@media (max-width: 900px) {
  .service-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .ksr-navbar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }
}

/* --- Vehicle Type Selector Grid --- */
.vehicle-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.5rem;
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
}

.vehicle-tile {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.vehicle-tile:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.vehicle-tile.active {
  border-color: var(--accent);
  background: #FFFBEB;
  box-shadow: 0 0 0 1px var(--accent);
}

.vehicle-tile .v-icon {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.vehicle-tile.active .v-icon {
  color: var(--accent-hover);
}

.vehicle-tile .v-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.1;
}

.vehicle-tile .v-seats {
  font-size: 0.65rem;
  color: var(--gray-600);
  margin-top: 2px;
}

/* --- Support Modal & Cards --- */
.support-card-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.support-card-item:hover {
  border-color: var(--accent);
  background: #FFFBEB;
}

.support-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary);
  color: var(--white);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.support-pill-btn:hover {
  background: var(--accent);
  color: var(--primary);
}

.support-pill-btn.btn-call {
  background: #059669;
}

.support-pill-btn.btn-call:hover {
  background: #047857;
}

.support-pill-btn.btn-mail {
  background: #2563EB;
}

.support-pill-btn.btn-mail:hover {
  background: #1D4ED8;
}

.support-pill-btn.btn-whatsapp {
  background: #10B981;
}

.support-pill-btn.btn-whatsapp:hover {
  background: #059669;
}

.vehicle-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}
