/* ==========================================================================
   Fleet Flow - Modern Enterprise Logistics & Fleet Management System CSS
   ========================================================================== */

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --primary-hover: #4f46e5;
  
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.3);
  --cyan: #06b6d4;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --purple: #a855f7;
  
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace, monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 20px -5px rgba(99, 102, 241, 0.15);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

button, .btn, .tab-btn, .period-tab-btn, .quick-tab-btn {
  touch-action: manipulation;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Typography & Utilities */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
a {
  color: var(--cyan);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: #38bdf8;
}

.mono {
  font-family: var(--font-mono);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.badge-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Top Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 23, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--primary-glow);
  font-size: 1.25rem;
  color: #fff;
}
.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-subtitle {
  font-size: 0.7rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

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

.demo-pills {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}
.demo-pill {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.demo-pill.active, .demo-pill:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 10px var(--primary-glow);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-full);
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  color: #fff;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px var(--emerald-glow);
}
.btn-emerald:hover {
  background: linear-gradient(135deg, #059669, #047857);
}
.btn-amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}
.btn-rose {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}
.btn-indigo {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}
.btn-indigo:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}


/* Glass Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.glass-card-glow {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kpi-title {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  font-family: var(--font-sans);
}
.kpi-footer {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}

/* Tabs Navigation */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--border-highlight);
  color: #fff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}
.data-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}
.form-control::placeholder {
  color: #475569;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-dialog {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}
.modal-backdrop.active .modal-dialog {
  transform: scale(1);
}
.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 {
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-sm);
}
.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* OCR Scanner Viewfinder & Camera UI */
.ocr-scanner-box {
  background: #000;
  border: 2px dashed rgba(6, 182, 212, 0.5);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  margin-bottom: 1rem;
}
.ocr-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #06b6d4, #10b981, transparent);
  box-shadow: 0 0 15px #06b6d4, 0 0 25px #10b981;
  animation: laserScan 2.5s infinite ease-in-out;
  display: none;
}
.ocr-scanner-box.scanning .ocr-laser-line {
  display: block;
}
@keyframes laserScan {
  0% { top: 0%; opacity: 0.8; }
  50% { top: 96%; opacity: 1; }
  100% { top: 0%; opacity: 0.8; }
}

.ocr-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: #67e8f9;
}

/* Driver Specific Action Cards */
.driver-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.driver-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border-color);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.driver-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  font-size: 0.9rem;
}
.toast-success {
  border-left: 4px solid var(--emerald);
}
.toast-error {
  border-left: 4px solid var(--rose);
}
.toast-info {
  border-left: 4px solid var(--cyan);
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
  .app-container {
    padding: 1rem;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Modern Role-Based Login Screen (Matching User Interface Design)
   ========================================================================== */

.login-viewport-wrapper {
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

/* ==========================================================================
   LUXURY MOBILE AUTHENTICATION SCREEN (Obsidian & Gold Aesthetics)
   ========================================================================== */

body.auth-screen-active {
  background-color: #04070e;
  background-image: 
    radial-gradient(ellipse 90% 70% at 85% 15%, rgba(212, 175, 55, 0.16) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 15% 85%, rgba(30, 64, 175, 0.28) 0%, transparent 65%),
    radial-gradient(circle at 50% 50%, rgba(9, 14, 26, 0.95) 0%, #030509 100%);
  color: #ffffff;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

.lux-viewport-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  position: relative;
  overflow-y: auto;
}

/* Luxury iPhone Shell Device Frame */
.lux-mobile-phone-card {
  width: 100%;
  max-width: 412px;
  background: linear-gradient(175deg, #090e1b 0%, #060912 45%, #030509 100%);
  border-radius: 46px;
  border: 3.5px solid rgba(255, 255, 255, 0.13);
  box-shadow: 
    0 35px 80px -15px rgba(0, 0, 0, 0.95), 
    0 0 50px -10px rgba(212, 175, 55, 0.16), 
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  padding: 1rem 1.45rem 1.15rem;
  box-sizing: border-box;
  animation: luxFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes luxFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Background Luxury Metallic Curve Ribbons */
.lux-mobile-phone-card::before {
  content: '';
  position: absolute;
  top: -90px;
  right: -90px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0) 70%);
  pointer-events: none;
  z-index: 1;
}

.lux-mobile-phone-card::after {
  content: '';
  position: absolute;
  top: 15px;
  right: -75px;
  width: 300px;
  height: 360px;
  border-radius: 50%;
  border-top: 2px solid rgba(229, 192, 123, 0.45);
  border-right: 1.5px solid rgba(229, 192, 123, 0.15);
  transform: rotate(-25deg);
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(229, 192, 123, 0.3));
  z-index: 1;
}

/* iOS Status Bar */
.lux-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f1f5f9;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.95rem;
  position: relative;
  z-index: 3;
}

.lux-dynamic-island {
  width: 82px;
  height: 24px;
  background: #000000;
  border-radius: 20px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 9px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.lux-sensor-dot {
  width: 8.5px;
  height: 8.5px;
  border-radius: 50%;
  background: #081223;
  border: 1px solid #1e293b;
}

.lux-status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Inner Content Area */
.lux-content-inner {
  position: relative;
  z-index: 3;
}

/* Security Shield Icon */
.lux-shield-container {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.lux-shield-icon {
  filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.5));
  transition: transform 0.3s ease;
}

.lux-shield-icon:hover {
  transform: scale(1.05);
}

/* Typography */
.lux-secure-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #dfb458;
  margin-bottom: 0.35rem;
  display: block;
}

.lux-hero-title {
  font-family: 'Playfair Display', 'Cinzel', serif;
  font-size: 2.05rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.4rem;
  background: linear-gradient(180deg, #ffffff 0%, #fef3c7 45%, #e2b357 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.015em;
}

.lux-hero-subtitle {
  color: #8b9bb4;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0 0 0.7rem;
  font-weight: 400;
}

.lux-gold-divider {
  width: 48px;
  height: 2.5px;
  background: linear-gradient(90deg, #d4af37, rgba(212, 175, 55, 0.1));
  border-radius: 3px;
  margin-bottom: 0.85rem;
}

/* Role Segmented Track */
.lux-role-pill-track {
  background: rgba(13, 20, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  backdrop-filter: blur(20px);
  margin-bottom: 0.85rem;
}

.lux-role-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.65rem 0.4rem;
  border-radius: 18px;
  border: 1.5px solid transparent;
  background: transparent;
  color: #8a9bb5;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  font-family: var(--font-sans);
}

.lux-role-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.lux-role-icon {
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a9bb5;
  transition: color 0.2s;
}

.lux-role-icon svg {
  width: 100%;
  height: 100%;
}

.lux-role-btn.active {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.55) 0%, rgba(14, 116, 144, 0.45) 100%);
  border-color: #38bdf8;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.4), inset 0 0 14px rgba(56, 189, 248, 0.25);
}

.lux-role-btn.active .lux-role-icon {
  color: #fce59e;
  filter: drop-shadow(0 0 6px rgba(252, 229, 158, 0.6));
}

/* Fields & Floating Cards */
.lux-auth-form {
  margin-bottom: 0.85rem;
}

.lux-input-card {
  background: rgba(12, 19, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 0.55rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.65rem;
  backdrop-filter: blur(14px);
  transition: all 0.25s ease;
}

.lux-input-card:focus-within {
  border-color: rgba(229, 192, 123, 0.65);
  box-shadow: 0 0 25px rgba(229, 192, 123, 0.22), inset 0 0 10px rgba(229, 192, 123, 0.08);
  background: rgba(15, 24, 45, 0.95);
}

.lux-input-left-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5c07b;
}

.lux-input-left-icon svg {
  width: 19px;
  height: 19px;
}

.lux-input-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.lux-input-label {
  font-size: 0.72rem;
  color: #7f90a6;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
}

.lux-input-field {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 600;
  width: 100%;
  padding: 0;
  margin: 0;
  font-family: var(--font-sans);
}

.lux-input-field::placeholder {
  color: #475569;
}

.lux-input-right-badge {
  display: flex;
  align-items: center;
}

.lux-check-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 6px rgba(229, 192, 123, 0.4));
}

.lux-eye-toggle-btn {
  background: transparent;
  border: none;
  color: #8a9bb5;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.2s;
  font-family: var(--font-sans);
}

.lux-eye-toggle-btn:hover {
  color: #ffffff;
}

.lux-eye-icon {
  width: 16px;
  height: 16px;
}

/* Primary Gold Button */
.lux-gold-submit-btn {
  width: 100%;
  padding: 0.82rem 1.4rem;
  margin-top: 0.65rem;
  margin-bottom: 0.65rem;
  border-radius: 9999px;
  border: none;
  outline: none;
  background: linear-gradient(135deg, #fce59e 0%, #e6be67 35%, #b8862d 75%, #e1b95f 100%);
  color: #1a1204;
  font-size: 1.02rem;
  font-weight: 800;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4), 0 2px 4px rgba(0,0,0,0.3);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lux-gold-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 38px rgba(212, 175, 55, 0.55);
}

.lux-gold-submit-btn:active {
  transform: translateY(0);
}

.lux-gold-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.lux-btn-arrow {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.lux-gold-submit-btn:hover .lux-btn-arrow {
  transform: translateX(4px);
}

/* Bottom Help Strip */
.lux-help-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.25rem;
}

.lux-help-strip:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(212, 175, 55, 0.25);
  transform: translateY(-1px);
}

.lux-help-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lux-help-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dfb458;
}

.lux-help-icon svg {
  width: 18px;
  height: 18px;
}

.lux-help-text {
  text-align: left;
}

.lux-help-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #f1f5f9;
}

.lux-help-subtitle {
  font-size: 0.7rem;
  color: #8b9bb4;
}

.lux-help-arrow {
  color: #8b9bb4;
  display: flex;
  align-items: center;
}

.lux-help-arrow svg {
  width: 15px;
  height: 15px;
}

/* Home Indicator */
.lux-home-indicator {
  width: 130px;
  height: 4.5px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  margin: 0.75rem auto 0.1rem;
  opacity: 0.85;
}

/* Mobile Responsive: Edge-to-edge native app layout on phones */
@media (max-width: 480px) {
  .lux-viewport-wrapper {
    padding: 0;
  }
  .lux-mobile-phone-card {
    border-radius: 0;
    border: none;
    min-height: 100vh;
    box-shadow: none;
    padding: 0.85rem 1.25rem 2rem;
  }
}

/* ==========================================================================
   Driver Destination Allocation & Live Active Ride Components
   ========================================================================== */

.driver-ride-main-card {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.88) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 25px rgba(16, 185, 129, 0.12);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.driver-ride-main-card.is-active {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 35px rgba(245, 158, 11, 0.2);
}

.driver-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 1rem;
}

.quick-dest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 14px;
}

.quick-dest-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.quick-dest-chip:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
  transform: translateY(-1px);
}

.route-visualizer {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.route-node {
  flex: 1;
  min-width: 140px;
}

.route-node-label {
  font-size: 0.725rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.route-node-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.route-arrow-track {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.route-line {
  height: 2px;
  width: 60px;
  background: linear-gradient(90deg, #10b981, #06b6d4);
  position: relative;
}

.active-ride-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.active-kpi-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.active-kpi-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.active-kpi-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.live-beacon {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseBeacon 1.5s infinite;
  margin-right: 6px;
  vertical-align: middle;
}

.live-beacon-amber {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

@keyframes pulseBeacon {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Role-based UI Privacy & Complete Portal Isolation */
#demo-role-selector,
.demo-pills {
  display: none !important;
}

/* ==========================================================================
   Accountant Driver Excel Spreadsheet Grid & Report Entry
   ========================================================================== */
.excel-sheet-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(9, 14, 26, 0.98) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(16, 185, 129, 0.08);
  position: relative;
  overflow: hidden;
}

.excel-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.excel-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.excel-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.excel-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.excel-search-box {
  position: relative;
  min-width: 220px;
}

.excel-search-box input {
  padding-left: 2rem;
  font-size: 0.85rem;
  height: 38px;
}

.excel-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.85rem;
  pointer-events: none;
}

.excel-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 1.25rem;
}

.excel-stat-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
}

.excel-stat-lbl {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.excel-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
}

.excel-stat-grand {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}

.excel-table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 13, 23, 0.7);
}

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

.excel-table th {
  background: rgba(15, 23, 42, 0.95);
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.excel-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.excel-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.excel-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Driver Live GPS Navigation Map & Telematics HUD
   ========================================================================== */
.driver-live-map-wrapper {
  position: relative;
  margin: 1.25rem 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(6, 182, 212, 0.15);
  background: #090e1b;
}

#driver-live-map {
  width: 100%;
  height: 380px;
  background: #0a0e17;
  z-index: 1;
}

#driver-live-map.leaflet-container {
  font-family: inherit;
  background: #090e1b;
}

#driver-live-map .leaflet-tile {
  filter: brightness(0.95) contrast(1.05);
}

#driver-google-embed-map iframe {
  width: 100%;
  height: 380px;
  border: 0;
  display: block;
}

.map-hud-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(10, 15, 29, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.map-hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.map-hud-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.map-coords-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: rgba(9, 14, 26, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Custom Leaflet Map Markers */
.truck-map-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.truck-map-pin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
  border: 2.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.8);
  z-index: 2;
  position: relative;
}

.truck-radar-pulse {
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.35);
  animation: radarWave 2s infinite ease-out;
  pointer-events: none;
  z-index: 1;
}

@keyframes radarWave {
  0% { transform: scale(0.5); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.dest-map-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.dest-map-pin {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 2.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
}

/* ==========================================================================
   Dual Fleet Indicators: Green (On Route) & Red (Available)
   ========================================================================== */
.pulse-indicator-circle {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pulse-indicator-circle .ping-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0.75;
  animation: pingAnimation 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.pulse-indicator-circle .core-circle {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.green-circle .green-ping {
  background-color: #10b981;
}
.green-circle .green-core {
  background-color: #10b981;
  box-shadow: 0 0 12px #10b981;
}
.red-circle .red-ping {
  background-color: #ef4444;
}
.red-circle .red-core {
  background-color: #ef4444;
  box-shadow: 0 0 12px #ef4444;
}
@keyframes pingAnimation {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.pulse-beacon {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulseBeacon 1.5s infinite;
}
.pulse-beacon.green {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}
.pulse-beacon.red {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}
@keyframes pulseBeacon {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.on-route-card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.on-route-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}
.available-card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.available-card:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}
.single-line-vehicle-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 9px;
  padding: 8px 12px;
  gap: 10px;
  transition: all 0.2s ease;
}
.single-line-vehicle-row.green-row {
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.single-line-vehicle-row.green-row:hover {
  border-color: rgba(16, 185, 129, 0.75);
  background: rgba(15, 23, 42, 0.95);
  transform: translateX(2px);
}
.single-line-vehicle-row.red-row {
  border: 1px solid rgba(239, 68, 68, 0.35);
}
.single-line-vehicle-row.red-row:hover {
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(15, 23, 42, 0.95);
  transform: translateX(2px);
}

/* ==========================================================================
   DRIVER WEEKLY & MONTHLY SETTLEMENT & PERFORMANCE REPORT STYLES
   ========================================================================== */
.periodic-report-card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(99, 102, 241, 0.08);
  position: relative;
  overflow: hidden;
}
.periodic-report-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #06b6d4, #6366f1, #a855f7);
}
.period-tabs {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.9);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 4px;
  flex-wrap: wrap;
}
.period-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.period-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.period-tab-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.excel-download-btn {
  background: linear-gradient(135deg, #107c41, #15803d);
  color: #ffffff !important;
  border: 1px solid rgba(52, 211, 153, 0.4);
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(16, 124, 65, 0.3);
}
.excel-download-btn:hover {
  background: linear-gradient(135deg, #16a34a, #107c41);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 124, 65, 0.5);
  color: #ffffff !important;
}
.periodic-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}
.periodic-kpi-item {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 14px;
  transition: all 0.2s ease;
}
.periodic-kpi-item:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}
.periodic-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.periodic-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
}
.settlement-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.settlement-badge.settled {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.settlement-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.settlement-badge.surplus {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ==========================================================================
   MONTHLY REPORT UPLOADS (PDF & EXCEL) STYLES
   ========================================================================== */
.file-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.file-badge-pdf {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.35);
}
.file-badge-excel {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.file-badge-csv {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.35);
}
.upload-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: 14px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  transform: scale(1.01);
}
.admin-reports-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(17, 24, 39, 0.98));
  border: 1.5px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(99, 102, 241, 0.12);
  position: relative;
  overflow: hidden;
}
.admin-reports-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #06b6d4, #10b981);
}

/* ==========================================================================
   100% COMPREHENSIVE MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================================================== */

@media (max-width: 1024px) {
  .app-container {
    padding: 1.25rem 1rem;
    max-width: 100%;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* Global Resets */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    -webkit-text-size-adjust: 100%;
  }
  .app-container {
    padding: 0.85rem 0.65rem !important;
    width: 100% !important;
  }

  /* Top Navigation Bar */
  .navbar {
    padding: 0.65rem 0.85rem !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }
  .nav-brand {
    gap: 8px !important;
  }
  .brand-logo {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.1rem !important;
  }
  .brand-title {
    font-size: 1.05rem !important;
  }
  .brand-subtitle {
    font-size: 0.62rem !important;
  }
  .nav-actions {
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  .user-profile-widget {
    padding: 3px 8px 3px 4px !important;
    gap: 6px !important;
  }
  .user-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.75rem !important;
  }
  #user-name-display {
    max-width: 100px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.76rem !important;
  }

  /* Header & Banner Cards */
  .glass-card {
    padding: 1.1rem 0.9rem !important;
    border-radius: 14px !important;
    margin-bottom: 1.25rem !important;
  }
  .glass-card > div[style*="display: flex; justify-content: space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .glass-card h1 {
    font-size: 1.3rem !important;
    line-height: 1.25 !important;
  }

  /* Action Buttons Group */
  .glass-card > div > div[style*="display: flex; gap: 8px"],
  .excel-sheet-header .excel-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .glass-card > div > div[style*="display: flex; gap: 8px"] .btn,
  .excel-sheet-header .excel-toolbar .btn,
  .excel-download-btn {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 130px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* KPI Grids */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 1.25rem !important;
  }
  .kpi-card {
    padding: 0.85rem !important;
    border-radius: 12px !important;
  }
  .kpi-title {
    font-size: 0.7rem !important;
  }
  .kpi-value {
    font-size: 1.35rem !important;
  }
  .kpi-icon {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.95rem !important;
  }

  /* Tabs Navigation */
  .tabs-nav {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    margin-bottom: 1.25rem !important;
    gap: 6px !important;
    scrollbar-width: none !important;
  }
  .tabs-nav::-webkit-scrollbar {
    display: none !important;
  }
  .tab-btn {
    flex-shrink: 0 !important;
    padding: 6px 12px !important;
    font-size: 0.82rem !important;
  }

  /* Dual Indicators Mobile */
  .fleet-telematics-indicators > div[style*="grid-template-columns: repeat(auto-fit, minmax(400px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .indicator-column {
    padding: 0.85rem !important;
    border-radius: 12px !important;
  }
  .single-line-vehicle-row {
    padding: 7px 10px !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  /* Driver Periodic Reports Mobile */
  .periodic-report-card {
    padding: 1.1rem 0.85rem !important;
    border-radius: 14px !important;
  }
  .periodic-report-card > div[style*="display: flex; justify-content: space-between"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .period-tabs {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    gap: 4px !important;
    padding: 3px !important;
    scrollbar-width: none !important;
  }
  .period-tabs::-webkit-scrollbar {
    display: none !important;
  }
  .period-tab-btn {
    flex-shrink: 0 !important;
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
  }
  .periodic-kpi-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .periodic-kpi-item {
    padding: 8px 10px !important;
  }
  .periodic-kpi-val {
    font-size: 1.1rem !important;
  }

  /* Filter Controls Mobile Stacking */
  .periodic-report-card > div[style*="background: rgba(15, 23, 42, 0.75)"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .periodic-report-card > div[style*="background: rgba(15, 23, 42, 0.75)"] > div:last-child {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
  }
  #dpr-driver-filter, #dpr-start-date, #dpr-end-date {
    width: 100% !important;
  }

  /* Excel Sheet Header & Grid */
  .excel-sheet-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .excel-header-title {
    width: 100% !important;
  }
  .excel-stats-bar {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .excel-stat-pill {
    padding: 8px 10px !important;
  }
  .excel-stat-grand {
    grid-column: span 2 !important;
  }

  /* Table Containers Horizontal Touch Scroll */
  .table-container, .excel-table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    position: relative !important;
  }
  .data-table, .excel-table {
    min-width: 650px !important;
    width: max-content !important;
    min-width: 100% !important;
  }
  .data-table th, .excel-table th {
    padding: 10px 12px !important;
    font-size: 0.72rem !important;
  }
  .data-table td, .excel-table td {
    padding: 10px 12px !important;
    font-size: 0.82rem !important;
  }

  /* Modals Mobile Bottom Sheet Style */
  .modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    margin: 0 !important;
    border-radius: 22px 22px 0 0 !important;
    border-bottom: none !important;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  @keyframes modalSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  .modal-header {
    padding: 1rem 1.15rem !important;
  }
  .modal-body {
    padding: 1rem 1.15rem !important;
    max-height: calc(92vh - 130px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .modal-footer {
    padding: 0.85rem 1.15rem !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .modal-footer button {
    flex: 1 1 auto !important;
    min-height: 44px !important;
  }

  /* Collapse 2-column grid forms inside modals on mobile */
  .modal-body [style*="grid-template-columns: 1fr 1fr"],
  .modal-body [style*="grid-template-columns: 1fr 1fr 1fr"],
  .modal-body .form-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .form-control {
    font-size: 16px !important; /* Prevents iOS auto zoom on focus */
    padding: 0.7rem 0.85rem !important;
    min-height: 42px !important;
  }

  /* Driver Action Cards */
  .driver-action-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Charts Container */
  div[style*="grid-template-columns: repeat(auto-fit, minmax(450px, 1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Buttons Touch Targets */
  .btn {
    min-height: 38px !important;
    font-size: 0.82rem !important;
  }
}

@media (max-width: 480px) {
  /* Extra Compact Mobile Phones */
  .app-container {
    padding: 0.5rem 0.35rem !important;
  }
  .kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .periodic-kpi-strip {
    grid-template-columns: 1fr !important;
  }
  .excel-stats-bar {
    grid-template-columns: 1fr !important;
  }
  .excel-stat-pill {
    width: 100% !important;
  }

  /* Luxury Login on Mobile */
  .lux-viewport-wrapper {
    padding: 0 !important;
    min-height: 100vh !important;
  }
  .lux-mobile-phone-card {
    border: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    box-shadow: none !important;
  }
  .lux-content-inner {
    padding: 1.5rem 1.25rem 2rem !important;
  }
}

/* ==========================================================================
   PARTY PORTAL & PRINTABLE TAX INVOICE STYLES
   ========================================================================== */

.party-portal-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.party-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.party-meta-item {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.party-meta-item .meta-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.party-meta-item .meta-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
}

.party-stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.party-stat-box {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  position: relative;
  overflow: hidden;
}

.party-stat-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--stat-color, var(--primary));
}

.party-stat-box .stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
}

.party-stat-box .stat-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
}

/* Modal Overlay for Tax Invoice */
.invoice-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.invoice-modal-container {
  width: 100%;
  max-width: 900px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
}

.invoice-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Printable Paper Preview (Light A4 sheet for high-fidelity print) */
.invoice-paper {
  background: #ffffff !important;
  color: #0f172a !important;
  padding: 2.5rem 3rem;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 0;
  position: relative;
  line-height: 1.45;
}

.invoice-paper * {
  color: #0f172a;
}

.invoice-paper .inv-brand-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.invoice-paper .inv-company-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  text-transform: uppercase;
}

.invoice-paper .inv-badge {
  background: #0f172a;
  color: #ffffff !important;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-block;
}

.invoice-paper .inv-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.invoice-paper .inv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.invoice-paper .inv-table th {
  background: #0f172a;
  color: #ffffff !important;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 8px 12px;
  text-align: left;
}

.invoice-paper .inv-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
}

.invoice-paper .inv-total-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 1rem;
  border-top: 1px solid #0f172a;
}

.invoice-paper .inv-sign-box {
  text-align: right;
  margin-top: 2rem;
  padding-top: 1rem;
}

/* Print Only Stylesheet */
@media print {
  body * {
    visibility: hidden !important;
  }

  .invoice-modal-overlay {
    position: static !important;
    background: transparent !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .invoice-modal-header {
    display: none !important;
  }

  .invoice-modal-container {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  #printable-invoice-paper, #printable-invoice-paper * {
    visibility: visible !important;
  }

  #printable-invoice-paper {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 15mm 20mm !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  @page {
    size: A4;
    margin: 10mm;
  }
}

/* ==========================================================================
   SKYLARK LOGISTICS DRIVER DISPATCH PORTAL STYLES (Light & Modern Theme)
   ========================================================================== */
.skylark-portal-container {
  animation: fadeIn 0.3s ease-out;
  width: 100%;
}

body.role-driver {
  background-color: #f8fafc !important;
  background-image: 
    radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(2, 132, 199, 0.05) 0px, transparent 50%) !important;
  color: #0f172a !important;
}

body.role-driver .app-container {
  padding: 0.75rem 1rem 3rem !important;
  max-width: 100% !important;
  margin: 0 auto;
}

body.role-driver #main-navbar {
  display: none !important;
}

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  20%, 60% { transform: rotate(14deg); }
  40%, 80% { transform: rotate(-14deg); }
}
