/* ================================================================
   E-RIDEHUB Yasothon v8.0 — Professional Design System
   Inspired by Lovable.app | Prompt Font | HSL Color System
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700;800;900&display=swap');

/* ===== CSS Variables — HSL Design Tokens ===== */
:root {
  /* Colors */
  --primary-h: 160;
  --primary-s: 55%;
  --primary-l: 30%;
  --primary: hsl(160, 55%, 30%);
  --primary-light: hsl(160, 50%, 45%);
  --primary-dark: hsl(160, 40%, 22%);
  --primary-50: hsl(160, 40%, 97%);
  --primary-100: hsl(160, 40%, 92%);
  --primary-200: hsl(160, 40%, 82%);
  --primary-foreground: hsl(45, 30%, 97%);

  --secondary-h: 28;
  --secondary-s: 90%;
  --secondary-l: 55%;
  --secondary: hsl(28, 90%, 55%);
  --secondary-light: hsl(28, 85%, 65%);
  --secondary-dark: hsl(20, 85%, 48%);
  --secondary-foreground: hsl(0, 0%, 100%);

  --accent: hsl(265, 90%, 64%);
  --accent-light: hsl(265, 80%, 75%);
  --accent-foreground: hsl(0, 0%, 100%);

  /* Surfaces */
  --background: hsl(45, 30%, 97%);
  --foreground: hsl(160, 40%, 10%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(160, 40%, 10%);
  --muted: hsl(45, 20%, 92%);
  --muted-foreground: hsl(160, 15%, 45%);
  --border: hsl(45, 20%, 88%);
  --input: hsl(45, 20%, 88%);

  /* Functional */
  --success: hsl(145, 60%, 42%);
  --warning: hsl(45, 95%, 55%);
  --destructive: hsl(0, 84%, 60%);
  --info: hsl(210, 80%, 55%);

  /* Shadows */
  --shadow-sm: 0 1px 3px hsl(160 40% 10% / 0.06);
  --shadow-md: 0 4px 12px hsl(160 40% 10% / 0.08);
  --shadow-lg: 0 8px 30px hsl(160 40% 10% / 0.12);
  --shadow-xl: 0 20px 50px hsl(160 40% 10% / 0.15);
  --shadow-glow: 0 0 20px hsl(28 90% 55% / 0.3);

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, hsl(160, 55%, 30%), hsl(160, 45%, 22%));
  --gradient-accent: linear-gradient(135deg, hsl(28, 90%, 55%), hsl(20, 85%, 48%));
  --gradient-warm: linear-gradient(135deg, hsl(45, 90%, 65%), hsl(28, 90%, 55%));
  --gradient-card: linear-gradient(180deg, hsl(0, 0%, 100%), hsl(45, 30%, 97%));

  /* Radius */
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  color: var(--foreground);
  background: var(--background);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; font-size: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; border: none; outline: none; }

/* ===== Accessibility ===== */
button, a, input, select { min-height: 44px; }
input, select, textarea { padding: 12px 16px; }

/* ===== Scrollbar ===== */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Gradients ===== */
.gradient-hero { background: linear-gradient(145deg, #0d6b4e 0%, #065f46 50%, #064e3b 100%); }
.gradient-hero-light { background: linear-gradient(145deg, #f0fdf6 0%, #dcfce9 50%, #bbf7d4 100%); }
.gradient-accent { background: linear-gradient(145deg, #f97316 0%, #ea580c 100%); }
.gradient-warm { background: linear-gradient(145deg, #f97316 0%, #ea580c 100%); }
.gradient-purple { background: linear-gradient(145deg, #8b5cf6 0%, #6d28d9 100%); }
.gradient-blue { background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 100%); }
.gradient-dark { background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%); }
.gradient-gold { background: linear-gradient(145deg, #f59e0b 0%, #d97706 100%); }
.gradient-fund { background: linear-gradient(145deg, #059669 0%, #047857 50%, #065f46 100%); }

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes spin-slow { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes bounce-in {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.04); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes progress-fill { from { width: 0; } }
@keyframes ripple { 0% { transform: scale(0); opacity: 0.6; } 100% { transform: scale(4); opacity: 0; } }
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(34,197,94,0.25); }
  50% { box-shadow: 0 0 16px rgba(34,197,94,0.45); }
}
@keyframes pageTransitionIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes skeletonPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px hsl(28 90% 55% / 0.3); opacity: 1; }
  50% { box-shadow: 0 0 25px hsl(28 90% 55% / 0.5); opacity: 0.8; }
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes shine {
  0% { left: -100%; }
  100% { left: 200%; }
}

/* Animation utilities */
.animate-fade-in { animation: fadeIn 0.45s ease-out both; }
.animate-fade-in-down { animation: fadeInDown 0.45s ease-out both; }
.animate-slide-up { animation: slideUp 0.55s ease-out both; }
.animate-slide-left { animation: slideInLeft 0.45s ease-out both; }
.animate-slide-right { animation: slideInRight 0.45s ease-out both; }
.animate-scale-in { animation: scaleIn 0.35s ease-out both; }
.animate-pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-spin-slow { animation: spin-slow 8s linear infinite; }
.animate-bounce-in { animation: bounce-in 0.5s ease-out both; }
.animate-progress { animation: progress-fill 1s ease-out both; }
.animate-glow { animation: glow-pulse 2s ease-in-out infinite; }
.animate-page-in { animation: pageTransitionIn 0.35s ease-out both; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* Stagger children */
[data-stagger] > * { opacity: 0; animation: fadeIn 0.35s ease-out forwards; }
[data-stagger] > *:nth-child(1) { animation-delay: 0.03s; }
[data-stagger] > *:nth-child(2) { animation-delay: 0.06s; }
[data-stagger] > *:nth-child(3) { animation-delay: 0.09s; }
[data-stagger] > *:nth-child(4) { animation-delay: 0.12s; }
[data-stagger] > *:nth-child(5) { animation-delay: 0.15s; }
[data-stagger] > *:nth-child(6) { animation-delay: 0.18s; }
[data-stagger] > *:nth-child(7) { animation-delay: 0.21s; }
[data-stagger] > *:nth-child(8) { animation-delay: 0.24s; }
[data-stagger] > *:nth-child(9) { animation-delay: 0.27s; }
[data-stagger] > *:nth-child(10) { animation-delay: 0.3s; }
[data-stagger] > *:nth-child(n+11) { animation-delay: 0.33s; }

.delay-100 { animation-delay: 0.1s !important; }
.delay-200 { animation-delay: 0.2s !important; }
.delay-300 { animation-delay: 0.3s !important; }
.delay-400 { animation-delay: 0.4s !important; }
.delay-500 { animation-delay: 0.5s !important; }

/* ================================================================
   HERO PREMIUM — Main Landing Section
   ================================================================ */
.hero-premium {
  background: linear-gradient(160deg, #0a5c42 0%, #0d6b4e 25%, #065f46 60%, #064e3b 100%);
  position: relative;
  overflow: hidden;
  min-height: 85vh;
}
.hero-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 600px at 20% 80%, rgba(16,185,129,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 400px 400px at 80% 20%, rgba(245,158,11,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 800px 400px at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 70%);
  pointer-events: none;
}
.hero-premium::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--background), transparent);
  pointer-events: none;
}
.hero-particles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 30%, rgba(255,255,255,0.15), transparent),
    radial-gradient(2px 2px at 30% 70%, rgba(255,255,255,0.1), transparent),
    radial-gradient(2px 2px at 50% 20%, rgba(255,255,255,0.12), transparent),
    radial-gradient(2px 2px at 70% 60%, rgba(255,255,255,0.08), transparent),
    radial-gradient(2px 2px at 90% 40%, rgba(255,255,255,0.1), transparent),
    radial-gradient(1.5px 1.5px at 15% 55%, rgba(245,158,11,0.2), transparent),
    radial-gradient(1.5px 1.5px at 85% 75%, rgba(16,185,129,0.2), transparent);
  pointer-events: none;
}

/* Hero Logo */
.hero-logo-wrapper {
  width: 120px;
  height: 120px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-logo {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  position: relative;
  z-index: 2;
  border: 3px solid rgba(255,255,255,0.2);
}
.hero-logo-glow {
  position: absolute;
  inset: -8px;
  border-radius: 32px;
  background: conic-gradient(
    from 0deg,
    rgba(16,185,129,0.4),
    rgba(245,158,11,0.3),
    rgba(139,92,246,0.3),
    rgba(16,185,129,0.4)
  );
  filter: blur(15px);
  animation: spin-slow 8s linear infinite;
  z-index: 1;
}
.hero-logo-wrapper-sm {
  display: flex;
  justify-content: center;
}
.hero-title {
  text-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.hero-title-gradient {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero Action Cards */
.hero-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  transition: all var(--transition-normal);
  text-align: left;
}
.hero-action-card:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}
.hero-action-card:active {
  transform: scale(0.98);
}
.hero-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hero-action-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(245,158,11,0.25);
  color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.3);
  letter-spacing: 0.03em;
}

/* Stats Bar */
.stats-bar {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px;
}
.stats-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: hsl(160 40% 97%);
}

/* Fund Card Premium */
.fund-card-premium {
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #059669 0%, #047857 40%, #065f46 100%);
  transition: all var(--transition-normal);
}
.fund-card-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(5,150,105,0.3);
}
.fund-card-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}
.fund-stat-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  transition: all var(--transition-fast);
}
.fund-stat-card:hover {
  background: rgba(255,255,255,0.14);
}

/* Role Card */
.role-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  text-align: center;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}
.role-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

/* Footer Premium */
.footer-premium {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* ================================================================
   COMPONENTS
   ================================================================ */

/* Card */
.card-hover {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  will-change: transform;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card-hover:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Glass effect */
.glass {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.3);
}
.glass-dark {
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid hsl(45 20% 88% / 0.6);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
}
.bottom-nav-item {
  transition: all var(--transition-fast);
  min-height: 56px;
  position: relative;
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}
.bottom-nav-item.active i,
.bottom-nav-item.active .nav-icon { transform: scale(1.15); }

/* Score / Progress bar */
.score-bar {
  height: 8px;
  border-radius: 999px;
  background: hsl(45 20% 92%);
  overflow: hidden;
  position: relative;
}
.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.score-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: shimmer 2s ease-in-out infinite;
  background-size: 200% 100%;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge-green { background: #dcfce9; color: #065f46; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-purple { background: #ede9fe; color: #6d28d9; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #374151; }
.badge-gold { background: #fef3c7; color: #92400e; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 400% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e8ecf0 50%, #f1f5f9 75%);
  background-size: 400% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
.skeleton-line.w-3\/4 { width: 75%; }
.skeleton-line.w-1\/2 { width: 50%; }
.skeleton-line.w-1\/3 { width: 33%; }
.skeleton-circle {
  border-radius: 50%;
  background: linear-gradient(90deg, #f1f5f9 25%, #e8ecf0 50%, #f1f5f9 75%);
  background-size: 400% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
.skeleton-rect {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #f1f5f9 25%, #e8ecf0 50%, #f1f5f9 75%);
  background-size: 400% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}

/* Ripple button effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 5px;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
}
.btn-ripple:active::after { animation: ripple 0.5s ease-out; }

/* Status dot */
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
  animation: pulse-dot 2s ease-in-out infinite;
}
.status-dot.busy { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }
.status-dot.offline { background: #94a3b8; }

/* Image */
.img-cover { object-fit: cover; width: 100%; height: 100%; }
.img-placeholder {
  background: linear-gradient(145deg, #e2e8f0, #f1f5f9);
  display: flex; align-items: center; justify-content: center;
}

/* Toast */
.toast {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9999;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  color: white;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: fadeInDown 0.3s ease-out;
  max-width: 420px;
  width: max-content;
  font-size: 0.92rem;
  backdrop-filter: blur(8px);
}
.toast-success { background: rgba(13,107,78,0.95); }
.toast-error { background: rgba(220,38,38,0.95); }
.toast-info { background: rgba(37,99,235,0.95); }
.toast-warning { background: rgba(217,119,6,0.95); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.2s ease-out;
  padding: 0;
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 20px; }
}
.modal-content {
  background: white;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}
@media (min-width: 640px) {
  .modal-content {
    border-radius: var(--radius-xl);
    max-height: 85vh;
  }
}

/* Map container */
.map-container { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }

/* ===== Chatbot ===== */
.chatbot-fab {
  position: fixed; bottom: 80px; right: 16px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(145deg, #0d6b4e, #065f46);
  color: white; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(13,107,78,0.35);
  transition: all var(--transition-normal);
}
.chatbot-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(13,107,78,0.45); }
.chatbot-panel {
  position: fixed; bottom: 144px; right: 16px; z-index: 91;
  width: 350px; max-width: calc(100vw - 32px);
  max-height: 60vh; background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  animation: scaleIn 0.3s ease-out;
  overflow: hidden;
}
.chatbot-messages { flex: 1; overflow-y: auto; padding: 16px; }
.chat-msg { margin-bottom: 12px; max-width: 85%; }
.chat-msg.bot { margin-right: auto; }
.chat-msg.user { margin-left: auto; }
.chat-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.chat-bubble.bot { background: var(--muted); color: var(--foreground); border-bottom-left-radius: 4px; }
.chat-bubble.user { background: var(--primary); color: white; border-bottom-right-radius: 4px; }

/* ===== Page transitions ===== */
.page-wrapper { animation: pageTransitionIn 0.3s ease-out both; }

/* ===== Responsive ===== */
.safe-bottom { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }

@media (min-width: 1024px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 1023px) {
  .desktop-only { display: none !important; }
}

/* ===== Charts ===== */
.chart-bar {
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 4px 4px 0 0;
  position: relative;
}
.chart-bar:hover { filter: brightness(1.08); }
.pie-segment { transition: transform 0.3s; }
.pie-segment:hover { transform: scale(1.03); }

/* ===== Route nodes (milk-run) ===== */
.route-node { position: relative; padding-left: 32px; padding-bottom: 20px; }
.route-node::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: var(--primary);
}
.route-node:last-child::before { display: none; }
.route-node::after {
  content: ''; position: absolute; left: 5px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--primary); border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}

/* Hub / Tiger badges */
.hub-badge {
  background: linear-gradient(145deg, #0d6b4e, #059669);
  color: white; padding: 2px 10px; border-radius: 12px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px;
}
.tiger-badge {
  background: linear-gradient(145deg, #f59e0b, #d97706);
  color: white; padding: 2px 10px; border-radius: 12px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.3px;
  display: inline-flex; align-items: center; gap: 4px;
}

/* Input focus */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px hsl(160 55% 30% / 0.12);
  transition: box-shadow var(--transition-fast);
}

/* Button press */
button:active:not(:disabled) { transform: scale(0.98); }

/* Divider */
.divider { height: 1px; background: linear-gradient(to right, transparent, var(--border), transparent); }

/* Hero pattern overlay */
.hero-pattern {
  position: relative;
  overflow: hidden;
}
.hero-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 70%);
  pointer-events: none;
}

/* Snap scroll */
.snap-scroll { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.snap-scroll > * { scroll-snap-align: start; }

/* ===== Splash Screen ===== */
.splash-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #0d6b4e, #065f46, #064e3b);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash-screen.fade-out { opacity: 0; visibility: hidden; }
.splash-logo { width: 80px; height: 80px; border-radius: 20px; object-fit: cover; box-shadow: 0 8px 32px rgba(0,0,0,0.3); animation: bounce-in 0.6s ease-out; }
.splash-text { color: white; font-weight: 700; font-size: 1.2rem; margin-top: 16px; animation: fadeIn 0.6s ease-out 0.2s both; }
.splash-sub { color: rgba(255,255,255,0.5); font-size: 0.8rem; margin-top: 4px; animation: fadeIn 0.6s ease-out 0.4s both; }
.splash-loader { width: 40px; height: 3px; background: rgba(255,255,255,0.2); border-radius: 3px; margin-top: 24px; overflow: hidden; animation: fadeIn 0.6s ease-out 0.5s both; }
.splash-loader::after { content: ''; display: block; width: 50%; height: 100%; background: white; border-radius: 3px; animation: shimmer 1.2s ease-in-out infinite; }

/* Credit Score Meter */
.credit-meter { position: relative; width: 160px; height: 80px; overflow: hidden; }

/* ===== Accessibility ===== */
@media (prefers-contrast: high) {
  body { font-weight: 500; }
  .badge { border: 1px solid currentColor; }
  .score-bar { border: 1px solid #94a3b8; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Touch Feedback ===== */
@media (hover: none) and (pointer: coarse) {
  .card-hover:active { transform: scale(0.97); transition-duration: 0.1s; }
  .bottom-nav-item:active { transform: scale(0.9); }
}

/* ===== Print ===== */
@media print {
  .bottom-nav, .chatbot-fab, .chatbot-panel { display: none !important; }
  .gradient-hero { background: #0d6b4e !important; print-color-adjust: exact; }
}

/* Refresh indicator */
.refresh-indicator {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: shimmer 1.5s ease-in-out infinite;
  background-size: 200% 100%;
}
