/* ==========================================================================
   ALT Reclaim Pro - Design System & Stylesheet
   ========================================================================== */

/* ----------------------------- CSS Variables ----------------------------- */
:root {
  /* Light Theme Palette */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-surface-elevated: #ffffff;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.15);
  
  --emerald: #059669;
  --emerald-hover: #047857;
  --emerald-light: #ecfdf5;
  --emerald-glow: rgba(5, 150, 105, 0.15);
  
  --blue: #2563eb;
  --blue-light: #eff6ff;
  --violet: #7c3aed;
  --violet-hover: #6d28d9;
  --violet-light: #f5f3ff;
  --violet-glow: rgba(124, 58, 237, 0.18);
  --amber: #d97706;
  --amber-light: #fffbeb;
  --rose: #e11d48;
  --rose-hover: #be123c;
  --rose-light: #fff1f2;
  --rose-glow: rgba(225, 29, 72, 0.18);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* Dark Theme Palette */
[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-surface: #111827;
  --bg-surface-subtle: #1e293b;
  --bg-surface-elevated: #1e293b;
  --border-color: #334155;
  --border-subtle: #1e293b;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-glow: rgba(59, 130, 246, 0.25);
  
  --emerald: #10b981;
  --emerald-hover: #34d399;
  --emerald-light: rgba(16, 185, 129, 0.15);
  --emerald-glow: rgba(16, 185, 129, 0.25);
  
  --blue: #3b82f6;
  --blue-light: rgba(59, 130, 246, 0.15);
  --violet: #8b5cf6;
  --violet-hover: #a78bfa;
  --violet-light: rgba(139, 92, 246, 0.15);
  --violet-glow: rgba(139, 92, 246, 0.25);
  --amber: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.15);
  --rose: #f43f5e;
  --rose-hover: #fb7185;
  --rose-light: rgba(244, 63, 94, 0.15);
  --rose-glow: rgba(244, 63, 94, 0.25);
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
}

/* ----------------------------- Reset & Base ----------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ambient Background Glows */
.bg-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(120px);
  opacity: 0.45;
}
.bg-glow-1 {
  top: -150px;
  left: -100px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, rgba(59, 130, 246, 0) 70%);
}
.bg-glow-2 {
  top: 30%;
  right: -150px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0) 70%);
}

/* ----------------------------- Header ----------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
[data-theme="dark"] .app-header {
  background-color: rgba(17, 24, 39, 0.85);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--emerald) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-pro {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--emerald) 0%, #10b981 100%);
  color: #ffffff;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* DB Status Pill */
.db-status-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* User Session Pill */
.user-session-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--violet) 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-session-details {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.user-session-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}
.user-session-role {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}
.theme-toggle:hover {
  background-color: var(--border-color);
  transform: translateY(-1px);
}
.icon-sun { display: none; }
.icon-moon { display: inline-block; color: var(--text-secondary); }
[data-theme="dark"] .icon-sun { display: inline-block; color: #f59e0b; }
[data-theme="dark"] .icon-moon { display: none; }

/* ----------------------------- Auth Hero Welcome Screen ----------------------------- */
.auth-hero-banner {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

.auth-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.25rem;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.auth-hero-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  max-width: 800px;
  margin-bottom: 1rem;
}

.auth-hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.auth-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
}

.auth-hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.hero-feat-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.hero-feat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.feat-icon {
  font-size: 1.6rem;
  margin-bottom: 0.85rem;
  display: block;
}
.hero-feat-card strong {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.35rem;
}
.hero-feat-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ----------------------------- Layout & Grids ----------------------------- */
.main-layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Role Notice Strip */
.role-notice-banner {
  background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-surface-subtle) 100%);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.role-notice-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.role-notice-icon {
  font-size: 1.35rem;
  color: var(--primary);
}
.role-notice-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: block;
}
.role-notice-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Admin Quick Search Card */
.admin-quick-search-card {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05) 0%, rgba(37, 99, 235, 0.08) 100%);
  border: 2px solid var(--violet);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 4px 16px var(--violet-glow);
}
.quick-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.quick-search-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.quick-search-title i {
  font-size: 1.35rem;
}
.quick-search-title strong {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-primary);
}
.quick-search-title p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.quick-search-form {
  display: flex;
  gap: 0.75rem;
}
@media (max-width: 600px) {
  .quick-search-form {
    flex-direction: column;
  }
}

/* KPI Ribbon */
.kpi-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.kpi-card-emerald .kpi-icon { background-color: var(--emerald-light); color: var(--emerald); }
.kpi-card-blue .kpi-icon { background-color: var(--blue-light); color: var(--blue); }
.kpi-card-violet .kpi-icon { background-color: var(--violet-light); color: var(--violet); }
.kpi-card-amber .kpi-icon { background-color: var(--amber-light); color: var(--amber); }

.kpi-content {
  display: flex;
  flex-direction: column;
}
.kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Two Column Portal Grid */
.portal-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .portal-grid {
    grid-template-columns: 1fr;
  }
}

/* Card Container */
.portal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.step-badge {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-badge-blue { background-color: var(--primary); }
.step-badge-emerald { background-color: var(--emerald); }

.card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseAnimation 1.8s infinite;
}
@keyframes pulseAnimation {
  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); }
}

/* ----------------------------- Forms & Controls ----------------------------- */
.form-row {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}
.form-row-2 {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 600px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
label i {
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.required {
  color: var(--rose);
  font-weight: 700;
}

.form-control {
  width: 100%;
  height: 42px;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-control:disabled, .form-control[readonly] {
  background-color: var(--bg-surface-subtle);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-action .form-control {
  padding-right: 4.5rem;
}
.btn-input-action {
  position: absolute;
  right: 6px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-input-action:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.input-group-addon {
  position: relative;
  display: flex;
  align-items: center;
}
.addon-prefix {
  position: absolute;
  left: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.95rem;
  pointer-events: none;
}
.addon-suffix {
  position: absolute;
  right: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}
.input-group-addon .form-control {
  padding-left: 1.8rem;
  padding-right: 3.5rem;
  font-weight: 600;
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Vehicle Selector Cards */
.vehicle-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.vehicle-option {
  cursor: pointer;
  margin: 0;
}
.vehicle-option input {
  display: none;
}
.vehicle-box {
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-align: center;
  transition: var(--transition);
}
.vehicle-box i {
  font-size: 1.1rem;
  color: var(--text-secondary);
}
.vehicle-box span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}
.rate-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}

.vehicle-option input:checked + .vehicle-box {
  border-color: var(--primary);
  background-color: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-glow);
}
.vehicle-option input:checked + .vehicle-box i {
  color: var(--primary);
}

/* Location Boxes */
.location-box {
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  margin-bottom: 0.5rem;
  position: relative;
  transition: var(--transition);
}
.from-box {
  border-left: 4px solid var(--emerald);
}
.to-box {
  border-left: 4px solid var(--rose);
}

.location-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}
.loc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.from-pill {
  background-color: var(--emerald-light);
  color: var(--emerald);
}
.to-pill {
  background-color: var(--rose-light);
  color: var(--rose);
}
.loc-actions {
  display: flex;
  gap: 0.35rem;
}

.input-icon-wrapper {
  position: relative;
  width: 100%;
}
.input-icon-wrapper .input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}
.input-icon-wrapper .form-control {
  padding-left: 2.3rem;
  padding-right: 2rem;
}
.clear-input-btn {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
}
.clear-input-btn:hover {
  color: var(--rose);
}

/* Autocomplete Dropdown */
.autocomplete-container {
  position: relative;
}
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  z-index: 500;
  max-height: 240px;
  overflow-y: auto;
}
.suggestion-item {
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.suggestion-item:last-child {
  border-bottom: none;
}
.suggestion-item:hover, .suggestion-item.active {
  background-color: var(--primary-light);
}
.suggestion-icon {
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-size: 0.85rem;
}
.suggestion-main {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.suggestion-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.suggestion-loading, .suggestion-empty {
  padding: 0.85rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Location Selected Preview Strip */
.location-selected-preview {
  margin-top: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.loc-text-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  font-size: 0.78rem;
}
.loc-address {
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.loc-coords {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: monospace;
  flex-shrink: 0;
}

.swap-locations-divider {
  display: flex;
  justify-content: center;
  margin: -0.25rem 0;
  position: relative;
  z-index: 5;
}
.btn-swap {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.btn-swap:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: rotate(180deg);
}

/* Return Journey Card */
.return-journey-card {
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
  margin: 0.9rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: var(--transition);
}
.return-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  margin: 0;
  width: 100%;
}
.toggle-content {
  display: flex;
  flex-direction: column;
}
.toggle-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.toggle-title i {
  color: var(--primary);
}
.toggle-sub {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Custom Switch Toggle */
.toggle-switch-wrapper {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.custom-toggle {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-color);
  transition: .3s;
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.custom-toggle:checked + .toggle-slider {
  background-color: var(--emerald);
}
.custom-toggle:checked + .toggle-slider:before {
  transform: translateX(20px);
}
.return-multiplier-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-pill);
  background-color: var(--emerald-light);
  color: var(--emerald);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ----------------------------- Live Calculation Hero Card ----------------------------- */
.calculation-hero-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(5, 150, 105, 0.08) 100%);
  border: 2px solid var(--emerald);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.25rem;
  margin: 1.15rem 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 20px var(--emerald-glow);
}
[data-theme="dark"] .calculation-hero-card {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(16, 185, 129, 0.15) 100%);
}

.calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.calc-title {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.calc-road-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  background-color: var(--emerald-light);
  color: var(--emerald);
}

.calc-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.calc-item {
  display: flex;
  flex-direction: column;
}
.calc-item-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.calc-item-value-group {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}
.calc-item-value {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
}
.calc-item-unit {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.calc-sub-detail {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.calc-operator {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-muted);
  align-self: center;
}

.highlight-amount {
  font-size: 1.85rem;
  color: var(--emerald);
  letter-spacing: -0.02em;
}

@media (max-width: 650px) {
  .calc-grid {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .calc-operator {
    display: none;
  }
}

/* ----------------------------- Buttons & Badges ----------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald) 0%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--emerald-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--emerald-hover) 0%, #059669 100%);
  box-shadow: 0 6px 16px var(--emerald-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.btn-outline:hover {
  background-color: var(--bg-surface-subtle);
  border-color: var(--text-muted);
}

.btn-ghost {
  background-color: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
}

.btn-success {
  background-color: var(--emerald);
  color: #ffffff;
}
.btn-success:hover {
  background-color: var(--emerald-hover);
}

.btn-danger {
  background-color: var(--rose);
  color: #ffffff;
}
.btn-danger:hover {
  background-color: var(--rose-hover);
}

.btn-info {
  background-color: var(--blue);
  color: #ffffff;
}
.btn-info:hover {
  background-color: var(--primary-hover);
}

.btn-block {
  width: 100%;
}
.btn-lg {
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.btn-xs {
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
}

/* ----------------------------- Map Section ----------------------------- */
.map-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 600px;
}

.map-controls-group {
  display: flex;
  gap: 0.4rem;
}

.map-wrapper {
  position: relative;
  flex: 1;
  min-height: 480px;
  height: 480px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.leaflet-map-canvas {
  width: 100% !important;
  height: 100% !important;
  min-height: 480px;
  background-color: #e5e7eb;
}

/* Leaflet Layer Switcher Styling */
.leaflet-control-layers {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-md) !important;
  font-family: inherit !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .leaflet-control-layers {
  background: rgba(30, 41, 59, 0.95) !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
[data-theme="dark"] .leaflet-control-layers label {
  color: #f1f5f9 !important;
}

/* Dark mode map tile styling */
[data-theme="dark"] .leaflet-layer,
[data-theme="dark"] .leaflet-control-zoom-in,
[data-theme="dark"] .leaflet-control-zoom-out,
[data-theme="dark"] .leaflet-control-attribution {
  filter: brightness(0.85) invert(1) contrast(1.1) hue-rotate(200deg) saturate(0.8);
}
[data-theme="dark"] .leaflet-marker-icon,
[data-theme="dark"] .leaflet-popup,
[data-theme="dark"] .leaflet-control-layers {
  filter: none !important;
}

/* Map Helper Banner */
.map-helper-banner {
  background-color: var(--primary);
  color: #ffffff;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  animation: bannerSlide 0.3s ease;
}
@keyframes bannerSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.banner-cancel-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  cursor: pointer;
}
.banner-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

/* Floating Map Overlay */
.map-route-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 400;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  box-shadow: var(--shadow-lg);
  max-width: 220px;
}
[data-theme="dark"] .map-route-overlay {
  background-color: rgba(17, 24, 39, 0.92);
}

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.overlay-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}
.overlay-duration {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.overlay-distance {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--emerald);
  line-height: 1.1;
}
.overlay-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

/* Quick Route Preset Chips */
.quick-presets {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.preset-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.chip:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* ----------------------------- History & Table Section ----------------------------- */
.history-panel {
  margin-top: 0.5rem;
}

.history-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.export-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.export-policy-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0369a1;
  background-color: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.02em;
}
[data-theme="dark"] .export-policy-badge {
  background-color: rgba(3, 105, 161, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
.btn-export {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface-subtle);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.btn-export:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn-excel:hover { background-color: #107c41; color: #ffffff; border-color: #107c41; }
.btn-csv:hover { background-color: var(--primary); color: #ffffff; border-color: var(--primary); }
.btn-print:hover { background-color: var(--violet); color: #ffffff; border-color: var(--violet); }
.btn-pdf:hover { background-color: var(--rose); color: #ffffff; border-color: var(--rose); }

/* Filter Card */
.filter-card {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
}
.filter-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1fr 1fr 1fr 1fr;
  gap: 0.75rem;
  align-items: end;
}
@media (max-width: 1100px) {
  .filter-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 650px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.filter-item label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Admin Batch Bar */
.admin-batch-bar {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
  border: 1.5px solid var(--violet);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  animation: fadeIn 0.2s ease;
}
.batch-bar-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}
.batch-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* History Totals Strip */
.history-totals-bar {
  background: linear-gradient(90deg, var(--bg-surface-subtle) 0%, var(--bg-surface) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.totals-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.stat-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.stat-number {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}
.totals-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-color);
}
@media (max-width: 650px) {
  .history-totals-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .totals-divider {
    display: none;
  }
}

/* Claims Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
}

.claims-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.claims-table th {
  background-color: var(--bg-surface-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.85rem 1rem;
  border-bottom: 1.5px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.claims-table th:hover {
  color: var(--text-primary);
}
.sort-icon {
  font-size: 0.7rem;
  margin-left: 0.25rem;
  opacity: 0.5;
}

.claims-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.claims-table tbody tr {
  transition: var(--transition);
}
.claims-table tbody tr:hover {
  background-color: var(--bg-surface-subtle);
}
.claims-table tbody tr:last-child td {
  border-bottom: none;
}

.text-right { text-align: right; }
.text-center { text-align: center; }

/* Voucher Pill */
.voucher-tag-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.status-pending { background-color: var(--amber-light); color: var(--amber); border: 1px solid rgba(217, 119, 6, 0.3); }
.status-approved { background-color: var(--emerald-light); color: var(--emerald); border: 1px solid rgba(5, 150, 105, 0.3); }
.status-paid { background-color: var(--blue-light); color: var(--blue); border: 1px solid rgba(37, 99, 235, 0.3); }
.status-rejected { background-color: var(--rose-light); color: var(--rose); border: 1px solid rgba(225, 29, 72, 0.3); }

/* Table Elements Styling */
.table-emp-cell {
  display: flex;
  flex-direction: column;
}
.emp-name-text {
  font-weight: 600;
  color: var(--text-primary);
}
.emp-id-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.table-loc-cell {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
}

.vehicle-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 600;
}
.vehicle-badge-bike { background-color: var(--amber-light); color: var(--amber); }
.vehicle-badge-car { background-color: var(--blue-light); color: var(--blue); }
.vehicle-badge-other { background-color: var(--violet-light); color: var(--violet); }

.km-pill {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}
.return-tag-sm {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--emerald);
  background-color: var(--emerald-light);
  padding: 0.05rem 0.3rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-left: 0.25rem;
}

.amount-pill {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  color: var(--emerald);
}

.table-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-table-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  transition: var(--transition);
}
.btn-table-action:hover {
  transform: translateY(-1px);
}
.btn-action-view:hover { background-color: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.btn-action-verify:hover { background-color: var(--violet-light); color: var(--violet); border-color: var(--violet); }
.btn-action-delete:hover { background-color: var(--rose-light); color: var(--rose); border-color: var(--rose); }

/* Empty Table State */
.empty-table-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-secondary);
}
.empty-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.empty-table-state h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.empty-table-state p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ----------------------------- Modals ----------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-lg {
  max-width: 760px;
}
@keyframes slideUp {
  from { transform: translateY(20px) scale(0.96); }
  to { transform: translateY(0) scale(1); }
}

.modal-content {
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.modal-icon {
  font-size: 1.35rem;
  color: var(--primary);
}
.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-header p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* Auth Tabs */
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  background-color: var(--bg-surface-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
}
.auth-tab-btn {
  padding: 0.55rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.auth-tab-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.admin-shield-badge {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(37, 99, 235, 0.1) 100%);
  border: 1px solid var(--violet);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.admin-shield-badge i {
  font-size: 1.5rem;
  color: var(--violet);
}
.admin-shield-badge strong {
  font-size: 0.88rem;
  color: var(--text-primary);
  display: block;
}
.admin-shield-badge p {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.auth-helper-box {
  background-color: var(--bg-surface-subtle);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}
.demo-account-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.pill-btn {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.pill-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ----------------------------- HIGH-FIDELITY CORPORATE VOUCHER ----------------------------- */
/* ----------------------------- HIGH-FIDELITY CORPORATE VOUCHER (ALT RECLAIM PRO) ----------------------------- */
.voucher-card {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--bg-surface);
  position: relative;
  box-shadow: var(--shadow-lg);
}

.voucher-top-strip {
  background: #112338;
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0f1e2e;
}
.voucher-brand-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.voucher-company-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #ffffff;
}
.voucher-brand-icon {
  color: #10b981;
  font-size: 1.2rem;
}
.voucher-cert-sub {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.voucher-meta-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}
.voucher-no-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  background: #1b3a5d;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.02em;
}
.voucher-barcode-bars {
  color: #38bdf8;
  font-size: 0.75rem;
}
.voucher-cert-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.85rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.voucher-cert-badge.status-approved {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #6ee7b7;
}
.voucher-cert-badge.status-paid {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.voucher-cert-badge.status-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.voucher-cert-badge.status-rejected {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.voucher-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background-color: var(--bg-surface);
}

.voucher-section-box {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.15rem;
}

.voucher-barcode-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.voucher-sha-text {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.2rem;
}
.visual-barcode-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.barcode-svg {
  height: 32px;
  width: 140px;
}

.voucher-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 650px) {
  .voucher-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

.voucher-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.voucher-field-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.voucher-purpose-box {
  background: #f0f7ff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}
[data-theme="dark"] .voucher-purpose-box {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.3);
  color: #f1f5f9;
}

.voucher-route-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.voucher-route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.voucher-route-point {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
}
.voucher-point-title {
  color: var(--text-primary);
  font-weight: 500;
}
.voucher-coords-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.1rem;
}
.point-dot-from { color: #10b981; margin-top: 0.2rem; font-size: 0.95rem; }
.point-dot-to { color: #ef4444; margin-top: 0.2rem; font-size: 0.95rem; }

.voucher-route-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 0.65rem;
  margin-top: 0.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.voucher-calc-breakdown-box {
  background: #f0fdf4;
  border: 2px dashed #10b981;
  border-radius: 12px;
  padding: 1.15rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
[data-theme="dark"] .voucher-calc-breakdown-box {
  background: rgba(16, 185, 129, 0.1);
}
.calc-label-highlight {
  font-size: 0.75rem;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calc-formula-display {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0.2rem 0;
  font-family: var(--font-heading);
}
.calc-in-words {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-style: italic;
}
.calc-label-right {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calc-amount-emerald {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: #059669;
  letter-spacing: -0.02em;
}

.voucher-audit-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.voucher-audit-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.voucher-audit-by-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.voucher-admin-remarks-box {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
}

/* Voucher Admin Action Bar */
.voucher-admin-action-bar {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08) 0%, rgba(37, 99, 235, 0.08) 100%);
  border-top: 2px solid var(--violet);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.admin-action-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-decision-buttons {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.immutable-notice {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ----------------------------- Database Manager Modal ----------------------------- */
.db-info-box {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.db-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.db-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.db-stat-item strong {
  font-size: 1.05rem;
  color: var(--text-primary);
}

.db-action-card {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.db-action-info strong {
  font-size: 0.85rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.15rem;
}
.db-action-info p {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Lookup Results List in Admin Modal */
.lookup-results-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.lookup-result-item {
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}
.lookup-result-item:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

/* ----------------------------- Toast Notifications ----------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast.toast-hiding {
  opacity: 0;
  transform: translateY(10px);
}
.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.toast-success .toast-icon { color: var(--emerald); }
.toast-error .toast-icon { color: var(--rose); }
.toast-info .toast-icon { color: var(--primary); }
.toast-warning .toast-icon { color: var(--amber); }

.toast-content {
  flex: 1;
}
.toast-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}
.toast-msg {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ----------------------------- Printable Stylesheet ----------------------------- */
.printable-report {
  display: none;
}

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }
  .app-header,
  .kpi-ribbon,
  .portal-grid,
  .filter-card,
  .export-toolbar,
  .modal-backdrop,
  .toast-container,
  .bg-glow,
  .th-action,
  .table-actions-cell,
  .role-notice-banner,
  .admin-quick-search-card,
  .admin-batch-bar,
  .th-checkbox {
    display: none !important;
  }
  
  .history-panel {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .printable-report {
    display: block !important;
    padding: 20px;
    background: #ffffff;
    color: #000000;
  }

  .print-header {
    border-bottom: 2px solid #000000;
    padding-bottom: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  .print-title {
    font-size: 18pt;
    font-weight: bold;
    margin-bottom: 4px;
  }
  .print-meta {
    font-size: 9pt;
    color: #444444;
  }

  .print-summary-box {
    border: 1px solid #cccccc;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    background-color: #f9f9f9;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 9.5pt;
  }
  .print-table th, .print-table td {
    border: 1px solid #999999;
    padding: 6px 8px;
    text-align: left;
  }
  .print-table th {
    background-color: #eeeeee;
    font-weight: bold;
  }

  .print-sign-row {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    padding-top: 30px;
  }
  .print-sign-box {
    width: 200px;
    border-top: 1px solid #000000;
    text-align: center;
    font-size: 9pt;
    padding-top: 5px;
  }
}

/* ----------------------------- Custom Leaflet Marker Styling ----------------------------- */
.custom-pin-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
}
.custom-pin-marker i {
  transform: rotate(45deg);
  color: #ffffff;
  font-size: 1rem;
}
.pin-from {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: 2px solid #ffffff;
}
.pin-to {
  background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
  border: 2px solid #ffffff;
}
.pin-pulse {
  animation: markerDrop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes markerDrop {
  0% { transform: translateY(-20px) rotate(-45deg) scale(0.5); opacity: 0; }
  100% { transform: translateY(0) rotate(-45deg) scale(1); opacity: 1; }
}

/* Helper Utilities */
.text-emerald { color: var(--emerald) !important; }
.text-blue { color: var(--blue) !important; }
.text-violet { color: var(--violet) !important; }
.text-rose { color: var(--rose) !important; }
.text-amber { color: var(--amber) !important; }
.text-muted { color: var(--text-muted) !important; }
.hidden { display: none !important; }
