/* ========================================================
   LOGISTPAY - MODERN MULTI-PLATFORM & THEMED STYLES
   Optimized for: Android, iOS, Windows, macOS
   Themes: Light (Standart) & Dark (Qorong'i)
   ======================================================== */

/* ================= THEME TOKENS ================= */
:root,
[data-theme="light"] {
  /* Surface Colors (Light) */
  --bg-app: #f4f7fb;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-secondary: #f8fafc;
  --bg-surface-tertiary: #f1f5f9;
  
  /* Brand & Accents */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.2);

  --success: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;
  --success-glow: rgba(16, 185, 129, 0.25);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  --danger-glow: rgba(239, 68, 68, 0.25);

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  
  --info: #0284c7;
  --info-light: #f0f9ff;

  /* Typography Colors */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --input-bg: #f8fafc;

  /* Elevation Shadows */
  --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.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Fonts */
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'SF Pro Display', BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================= DARK THEME ================= */
[data-theme="dark"] {
  /* Surface Colors (Dark) */
  --bg-app: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1e293b;
  --bg-surface-secondary: #161e2e;
  --bg-surface-tertiary: #1f293d;

  /* Brand & Accents in Dark */
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: rgba(99, 102, 241, 0.18);
  --primary-glow: rgba(99, 102, 241, 0.35);

  --success: #10b981;
  --success-hover: #34d399;
  --success-light: rgba(16, 185, 129, 0.18);
  --success-glow: rgba(16, 185, 129, 0.35);

  --danger: #ef4444;
  --danger-hover: #f87171;
  --danger-light: rgba(239, 68, 68, 0.18);
  --danger-glow: rgba(239, 68, 68, 0.35);

  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.18);

  --info: #38bdf8;
  --info-light: rgba(56, 189, 248, 0.18);

  /* Typography Colors in Dark */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --border-color: #283548;
  --border-light: #1e293b;
  --input-bg: #161e2e;

  /* Elevation Shadows in Dark */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --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 20px -3px rgba(0, 0, 0, 0.6), 0 4px 8px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.7);
}

/* ================= BASE RESET & PLATFORM NORMALIZATION ================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* iOS / Android tap reset */
}

html {
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased; /* macOS & iOS smooth text */
  -moz-osx-font-smoothing: grayscale; /* macOS Firefox */
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overscroll-behavior-y: contain; /* Prevents Android pull bounce */
  touch-action: manipulation; /* Instant tap response without 300ms delay */
}

/* Custom Scrollbars for Windows & macOS */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-subtle);
}

/* App Container with iOS Safe Areas (iPhone Dynamic Island / Notch & Home Indicator) */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* ================= HEADER ================= */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  user-select: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px var(--primary-glow);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* ================= LIVE DATETIME BADGE (DATE + TIME FOR ALL) ================= */
.live-datetime-badge {
  font-family: var(--font-family);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-surface-secondary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  user-select: none;
  transition: var(--transition);
}

.live-datetime-badge:hover {
  border-color: var(--primary);
}

.live-date {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-main);
  font-weight: 700;
}

.live-clock-divider {
  color: var(--text-subtle);
  opacity: 0.5;
  font-weight: 300;
}

.live-time {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.02em;
}

[data-theme="dark"] .live-datetime-badge {
  background: #161e2e;
  border-color: #283548;
}

[data-theme="dark"] .live-time {
  color: #818cf8;
}

/* ================= THEME TOGGLE BUTTON ================= */
.btn-theme-toggle {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.btn-theme-toggle:hover {
  background: var(--border-color);
  transform: translateY(-1px);
}

.btn-theme-toggle:active {
  transform: scale(0.95);
}

.btn-theme-toggle i {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

[data-theme="dark"] .btn-theme-toggle {
  background: #1e293b;
  border-color: #334155;
  color: #f59e0b;
}

[data-theme="dark"] .btn-theme-toggle i {
  color: #f59e0b;
  transform: rotate(360deg);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ================= MAIN CONTENT ================= */
.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1350px;
  width: 100%;
  margin: 0 auto;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

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

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 12px var(--success-glow);
}

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

.btn-secondary {
  background: var(--bg-surface-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: var(--bg-surface-secondary);
}

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

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

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
}

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

.btn-icon.danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ================= 1. LOGIN SECTION ================= */
#login-section {
  display: none;
  min-height: calc(100vh - 160px);
}

#login-section.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-badge {
  width: 60px;
  height: 60px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.login-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input,
.input-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition);
}

.input-wrapper input:focus,
.input-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px;
  font-size: 1rem;
}

.toggle-password:hover {
  color: var(--text-main);
}

/* ================= 2. DRIVER VIEW ================= */
.driver-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

.driver-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.driver-profile-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.driver-avatar-circle {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: #fff;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 6px 16px var(--primary-glow);
  flex-shrink: 0;
}

.driver-meta {
  flex: 1;
}

.meta-greeting {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.driver-title-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.2;
}

.driver-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.tag-truck, .tag-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.tag-truck strong {
  font-family: var(--font-mono);
  color: var(--primary);
}

/* Stats Grids */
.driver-stats-grid,
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

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

@media (max-width: 960px) {
  .driver-stats-grid.six-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .driver-stats-grid.six-cards {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--success-light), var(--bg-surface));
  border-color: rgba(16, 185, 129, 0.4);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.purple { background: var(--primary-light); color: var(--primary); }
.stat-icon.blue { background: var(--info-light); color: var(--info); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.green { background: var(--success-light); color: var(--success); }

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

.stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

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

.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }

/* Shift Action Card (BIG BUTTONS) */
.shift-action-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.shift-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.status-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
}

.status-indicator-pill.working {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.4);
}

.status-indicator-pill.completed {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.4);
}

.status-indicator-pill.idle {
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
  border-color: var(--border-color);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-subtle);
  display: inline-block;
}

.status-indicator-pill.working .pulse-dot {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 1.6s infinite;
}

@keyframes pulseGreen {
  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 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.current-date-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 600;
}

.shift-times-box {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 1.5rem;
}

.time-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.time-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.time-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.time-date {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  width: fit-content;
}

[data-theme="dark"] .time-date {
  background: #1e293b;
  color: #a5b4fc;
  border-color: #334155;
}

.time-separator {
  color: var(--text-subtle);
  font-size: 1.1rem;
}

/* BIG BUTTONS FOR DRIVERS */
.action-buttons-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.btn-big {
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  user-select: none;
}

.btn-big:active:not(:disabled) {
  transform: scale(0.96);
}

.btn-big:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.6);
  box-shadow: none !important;
}

/* Checkin Green Button */
.btn-checkin {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 10px 20px -3px rgba(16, 185, 129, 0.4);
}

.btn-checkin:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 14px 24px -2px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

/* Checkout Red Button */
.btn-checkout {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 10px 20px -3px rgba(239, 68, 68, 0.4);
}

.btn-checkout:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 14px 24px -2px rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
}

.btn-big-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}

.btn-big-content {
  display: flex;
  flex-direction: column;
}

.btn-big-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.btn-big-sub {
  font-size: 0.8rem;
  opacity: 0.9;
  font-weight: 500;
}

.alert-success-card {
  margin-top: 1.25rem;
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-icon {
  width: 44px;
  height: 44px;
  background: var(--success);
  color: #fff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.alert-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 0.2rem;
}

.alert-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Minimum 4-hour shift notice */
.shift-min-notice {
  margin-top: 1.15rem;
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  animation: fadeIn 0.25s ease-in-out;
}

.shift-min-notice .notice-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.shift-min-notice .notice-content strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.shift-min-notice .notice-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-weight: 500;
}

[data-theme="dark"] .shift-min-notice {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

/* History Card */
.driver-history-card,
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: 1.25rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-main);
}

.card-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

/* ================= 3. ADMIN VIEW ================= */
.admin-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Admin Tabs */
.admin-tabs-nav {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-surface);
  padding: 0.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-secondary);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.admin-tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.admin-tab-pane.active {
  display: block;
}

.panel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-title-group h3 {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panel-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.panel-actions-group {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-item label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.max-w-700 {
  max-width: 700px;
  margin: 0 auto;
}

/* Driver Summary Row */
.driver-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-driver-badge {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: default;
  transition: var(--transition);
  user-select: none;
}

.summary-driver-badge .name {
  font-weight: 700;
  font-size: 0.9rem;
}

.summary-driver-badge .stats {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.summary-driver-badge .earned {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--success);
  font-size: 0.95rem;
}

.summary-driver-badge .badge-click-hint {
  display: none !important;
}

/* ================= TABLES ================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch; /* iOS inertial scroll */
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
  min-width: 600px; /* Telefon ekranlarida jadvallar siqilib ketmasligi uchun kafolat */
}

#admin-attendance-table {
  min-width: 920px; /* 11 ta ustunli katta jadval hech qachon qisilib qolmaydi, gorizontal ravon suriladi */
}

.data-table th {
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background-color: var(--bg-surface-secondary);
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-status.active {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-status.completed {
  background: var(--success-light);
  color: var(--success);
}

.badge-status.danger {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-status.warning {
  background: var(--warning-light);
  color: var(--warning);
}

/* Yo'lda ketayotgan yuk mashinasi (Aylanib ketish o'rniga haqiqiy yo'l animatsiyasi) */
.truck-on-road {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding-bottom: 2px;
  line-height: 1;
}

.truck-on-road::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: -1px;
  right: -1px;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    currentColor 0px,
    currentColor 3px,
    transparent 3px,
    transparent 6px
  );
  background-size: 6px 2px;
  opacity: 0.55;
  border-radius: 1px;
  animation: roadStripesMove 0.5s linear infinite;
}

@keyframes roadStripesMove {
  from {
    background-position: 6px 0;
  }
  to {
    background-position: 0 0;
  }
}

.truck-driving {
  display: inline-block;
  animation: truckDriveRoad 1.3s ease-in-out infinite;
  transform-origin: bottom center;
  will-change: transform;
}

@keyframes truckDriveRoad {
  0% {
    transform: translateX(0) translateY(0);
  }
  20% {
    transform: translateX(1.5px) translateY(-1.2px);
  }
  40% {
    transform: translateX(3px) translateY(0.4px);
  }
  60% {
    transform: translateX(4px) translateY(-0.8px);
  }
  80% {
    transform: translateX(2px) translateY(0.3px);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

/* Truck Number Plate Badge (Avtoraqam belgisi - Dark va Light uchun) */
.truck-badge {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

[data-theme="dark"] .truck-badge {
  background: #1e1b4b;
  color: #c7d2fe;
  border: 1px solid #4338ca;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.truck-badge i {
  font-size: 0.78rem;
  opacity: 0.85;
}

/* Credential Code for logins/passwords */
.credential-code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  display: inline-block;
}

[data-theme="dark"] .credential-code {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}

/* Forms */
.admin-form .form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.col-6 { flex: 1; }
.col-12 { flex: 1; width: 100%; }

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 0.3rem;
}

.auth-credentials-group {
  background: var(--bg-surface-secondary);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

.form-actions {
  display: flex;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

.danger-zone-box {
  background: var(--danger-light);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.danger-zone-box h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 0.25rem;
}

.danger-zone-box p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.danger-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  top: max(1.5rem, env(safe-area-inset-top));
  right: max(1.5rem, env(safe-area-inset-right));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border-color);
  border-left-width: 4px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-danger {
  border-left-color: var(--danger);
}

.toast.toast-warning {
  border-left-color: var(--warning);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ================= MODAL STYLES (DRIVER DETAILS REPORT) ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-in-out;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 1180px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface-secondary);
}

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

.modal-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.modal-subtitle {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 700;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-modal:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Modal KPI Cards */
.modal-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
}

.modal-kpi-card {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-kpi-card.highlight {
  background: var(--primary-light);
  border-color: rgba(99, 102, 241, 0.3);
}

.modal-kpi-card.highlight.green {
  background: var(--success-light);
  border-color: rgba(16, 185, 129, 0.3);
}

.modal-kpi-card .kpi-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.modal-kpi-card .kpi-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.modal-table-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.modal-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  margin-top: 0.65rem;
}

#modal-driver-attendance-table {
  min-width: 1050px;
}

#modal-driver-advances-table {
  min-width: 800px;
}

.modal-table-responsive thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-surface-secondary);
  box-shadow: 0 1px 0 var(--border-color);
  padding: 0.95rem 1.15rem;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.modal-table-responsive td {
  padding: 0.95rem 1.15rem;
  font-size: 0.92rem;
  white-space: nowrap;
  vertical-align: middle;
}

.empty-state-cell {
  text-align: center;
  padding: 2rem 1.5rem !important;
  color: var(--text-muted);
  background: var(--bg-surface);
}

.empty-state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.empty-state-box i {
  font-size: 2rem;
  opacity: 0.4;
  color: var(--text-subtle);
}

.empty-state-box span {
  font-size: 0.92rem;
  font-weight: 600;
}

.modal-footer {
  padding: 1.15rem 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: var(--bg-surface-secondary);
}

.modal-footer .btn {
  height: 48px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
}

/* ================= FOOTER ================= */
.app-footer {
  margin-top: auto;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

/* ================= RESPONSIVE DESIGN (Android, iOS, Windows, macOS) ================= */

/* Tablets / Foldables / iPad (640px to 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
  .main-content {
    padding: 1.25rem;
  }
  .driver-stats-grid,
  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Screens (Android & iOS Smartphones < 640px) */
@media (max-width: 640px) {
  .app-header {
    padding: 0.75rem 1rem;
  }

  .brand-title {
    font-size: 1.15rem;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .header-controls {
    gap: 0.5rem;
  }

  .theme-text-label {
    display: none; /* Icon-only on mobile to save header space */
  }

  .btn-theme-toggle {
    padding: 0.45rem 0.6rem;
  }

  .main-content {
    padding: 0.85rem;
  }

  .btn-text-desktop {
    display: none;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  /* Big driver buttons stack vertically on phone screens */
  .action-buttons-wrapper {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .btn-big {
    padding: 1.25rem 1rem;
    border-radius: var(--radius-md);
  }

  .btn-big-icon {
    width: 46px;
    height: 46px;
    font-size: 1.35rem;
  }

  .btn-big-title {
    font-size: 1.15rem;
  }

  .driver-hero-card,
  .shift-action-card,
  .driver-history-card,
  .panel-card {
    padding: 1.15rem;
    border-radius: var(--radius-lg);
  }

  .driver-profile-header {
    flex-direction: column;
    text-align: center;
    gap: 0.85rem;
  }

  .driver-avatar-circle {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .driver-tags {
    justify-content: center;
  }

  .driver-stats-grid,
  .admin-stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.9rem;
  }

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

  .admin-tabs-nav {
    padding: 0.3rem;
  }

  .tab-btn {
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
  }

  .panel-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-actions-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .panel-actions-group .filter-item,
  .panel-actions-group .input-control,
  .panel-actions-group .btn {
    width: 100%;
  }

  .header-left {
    gap: 0.6rem;
  }

  .live-datetime-badge {
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    gap: 0.4rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    top: 1rem;
  }

  .toast {
    min-width: unset;
    width: 100%;
  }

  .modal-card {
    max-height: 94vh;
  }

  .modal-header {
    padding: 1rem 1.15rem;
  }

  .modal-body {
    padding: 1rem 1.15rem;
    gap: 1rem;
  }

  .modal-kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Extra Small Mobile Screens (Smartphones < 480px, masalan: iPhone SE, Galaxy A) */
@media (max-width: 480px) {
  .app-header {
    padding: 0.65rem 0.85rem;
  }

  .header-left {
    gap: 0.45rem;
  }

  .live-datetime-badge {
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
    gap: 0.35rem;
  }

  .brand-subtitle {
    display: none; /* Kichik ekranlarda sarlavha 1 qator bo'lib erkin turishi uchun */
  }

  .user-details {
    display: none; /* Tepada joy tejash uchun foydalanuvchi matni yashirilib, avatar qoladi */
  }

  .user-pill {
    padding: 0.2rem;
    background: transparent;
    border: none;
  }

  .shift-times-box {
    padding: 0.85rem 0.5rem;
    gap: 0.4rem;
  }

  .time-value {
    font-size: 1rem;
  }

  .time-label {
    font-size: 0.72rem;
  }

  .btn-big {
    padding: 1.15rem 0.9rem;
    gap: 0.85rem;
  }

  .btn-big-title {
    font-size: 1.1rem;
  }

  .btn-big-sub {
    font-size: 0.75rem;
  }

  .login-card {
    padding: 1.5rem 1rem;
  }
}

/* ========================================================
   NEW FEATURES: TRUCK FLEET, 12 REGIONS ROUTE, ADVANCES & REYSLAR
   ======================================================== */

/* 6-Cards Driver Stats Grid */
.driver-stats-grid.six-cards {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-icon.red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.stat-icon.teal {
  background: rgba(20, 184, 166, 0.15);
  color: #14b8a6;
}

.stat-icon.cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}

.stat-icon.indigo {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
}

.stat-icon.yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.text-danger {
  color: var(--danger) !important;
}

.text-net {
  color: #10b981 !important;
  font-weight: 800;
}

.highlight-net {
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(6, 182, 212, 0.04)) !important;
}

.advance-card {
  border: 1px solid rgba(239, 68, 68, 0.25) !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), transparent) !important;
}

/* Driver Advance Alert Banner */
.driver-advance-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(245, 158, 11, 0.08));
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.1);
  animation: slideInDown 0.35s ease;
}

.advance-banner-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.advance-banner-body {
  flex: 1;
}

.advance-banner-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.advance-alert-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.advance-val-text {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  letter-spacing: -0.5px;
}

.advance-banner-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.advance-banner-desc strong {
  color: var(--text-main);
}

/* Trip Configuration Box */
.trip-config-box {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: var(--transition);
}

/* ================= REDESIGNED TRIP CONFIGURATION BOX ================= */
.trip-config-box {
  background: var(--bg-surface-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
}

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

.trip-config-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 0;
}

.trip-rule-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.trip-security-notice {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.45;
}

.trip-security-notice i {
  font-size: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}

.trip-setup-sections {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.trip-setup-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.trip-setup-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.trip-setup-label i {
  font-size: 1.1rem;
}

.required-star {
  color: var(--danger);
  font-weight: 900;
}

.select-truck-large {
  width: 100%;
  height: 52px;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface-secondary);
  color: var(--text-main);
  transition: var(--transition);
  cursor: pointer;
}

.select-truck-large:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

.select-truck-large option:disabled {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.08);
  font-weight: 600;
}

[data-theme="dark"] .select-truck-large option:disabled {
  color: #f87171;
  background-color: rgba(239, 68, 68, 0.2);
}

.trip-setup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.truck-avail-badge {
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.truck-select-status-hint {
  margin-top: 0.65rem;
  font-size: 0.88rem;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.truck-select-status-hint.empty {
  background: var(--bg-surface-secondary);
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
}

.truck-select-status-hint.free {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
}

.truck-select-status-hint.busy {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-weight: 600;
}

/* Route builder grid */
.route-builder-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-end;
  gap: 1.25rem;
}

@media (max-width: 680px) {
  .route-builder-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .route-swap-box {
    display: flex;
    justify-content: center;
  }
}

.route-point-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.route-point-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.route-select-large {
  width: 100%;
  height: 52px;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface-secondary);
  color: var(--text-main);
  transition: var(--transition);
  cursor: pointer;
}

.route-select-large:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

.btn-swap-route-large {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-secondary);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.btn-swap-route-large:hover {
  background: var(--primary);
  color: #ffffff;
  transform: rotate(180deg) scale(1.06);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-swap-route-large:active {
  transform: rotate(180deg) scale(0.95);
}

/* ================= ACTIVE TRIP BANNER & 4-HOUR LOCK CARD ================= */
.active-trip-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(16, 185, 129, 0.08));
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  animation: fadeIn 0.3s ease;
}

.active-trip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.active-trip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--primary);
}

.active-trip-truck-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.active-trip-truck-tag i {
  color: var(--primary);
}

.active-trip-route-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.5rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.route-city {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.route-arrow-track {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.35rem;
  animation: truckBounce 1.5s infinite ease-in-out;
}

@keyframes truckBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

/* 4-Hour Lock Card */
.trip-lock-card {
  background: var(--bg-surface);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.3s ease;
}

.trip-lock-card.unlocked {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), var(--bg-surface));
}

.trip-lock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.trip-lock-indicator {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.lock-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.trip-lock-card.unlocked .lock-icon-box {
  background: var(--success-light);
  color: var(--success);
}

.trip-lock-indicator strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.trip-lock-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.trip-lock-timer-box {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.timer-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.timer-countdown {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 900;
  color: #f59e0b;
  letter-spacing: 0.04em;
}

.trip-lock-card.unlocked .timer-countdown {
  color: var(--success);
}

.trip-lock-progress-container {
  width: 100%;
  height: 10px;
  background: var(--bg-surface-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.trip-lock-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.trip-lock-card.unlocked .trip-lock-progress-fill {
  background: linear-gradient(90deg, #10b981, #059669);
}

.trip-lock-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lock-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.lock-status-badge.locked {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.lock-status-badge.unlocked {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Big Action Buttons - Enhanced */
.action-buttons-wrapper {
  display: grid;
  gap: 1.35rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.action-buttons-wrapper.single-col {
  grid-template-columns: 1fr;
}

.action-buttons-wrapper.two-cols {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
  .action-buttons-wrapper.two-cols {
    grid-template-columns: 1fr;
  }
}

.btn-start-shift {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 10px 24px -2px rgba(16, 185, 129, 0.45);
}

.btn-start-shift:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 14px 28px -2px rgba(16, 185, 129, 0.55);
  transform: translateY(-2px);
}

.btn-end-shift {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  color: #ffffff;
  box-shadow: 0 10px 24px -2px rgba(220, 38, 38, 0.45);
}

.btn-end-shift:hover:not(:disabled) {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  box-shadow: 0 14px 28px -2px rgba(220, 38, 38, 0.55);
  transform: translateY(-2px);
}

.btn-big {
  border: none;
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.6rem;
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-align: left;
  user-select: none;
}

.btn-big-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.btn-big-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.btn-big-title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.15;
}

.btn-big-sub {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 500;
}

.btn-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.7);
  box-shadow: none !important;
}

.btn-checkout.unlocked-ready {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 10px 24px -2px rgba(16, 185, 129, 0.5) !important;
  animation: pulseGreen 2s infinite;
}

/* Route badge in tables */
.route-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-main);
  background: var(--bg-surface-secondary);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.route-badge i {
  color: var(--primary);
  font-size: 0.72rem;
}

.trip-num-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.max-w-500 {
  max-width: 500px !important;
}

.inline-form-grid .form-row {
  align-items: flex-end;
}

.form-btn-align {
  display: flex;
  align-items: flex-end;
}

.form-btn-align button {
  height: 48px;
}

.mt-4 {
  margin-top: 1.5rem !important;
}

.card-badge-info {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
}


