/* ==========================================================================
   AL YOSR TRAVEL - Royal Navy & Metallic Gold Design System (V2)
   Custom Touch-First Tourism Dispatch & Excel Generator
   ========================================================================== */

:root {
  /* Brand Navy Palette (Matching assets/logo.png canvas exactly) */
  --bg-deep: #08101c;
  --bg-navy: #0d1b2e;
  --bg-canvas: #0d1b2e;
  --bg-surface: #12243c;
  --bg-surface-elevated: #162c4a;
  --bg-card: rgba(18, 36, 60, 0.90);
  --bg-card-hover: rgba(22, 44, 74, 0.96);

  /* Metallic Imperial Gold Accent */
  --gold-primary: #d4af37;
  --gold-light: #f3d47c;
  --gold-accent: #e6be53;
  --gold-dark: #aa8214;
  --gold-gradient: linear-gradient(135deg, #f7df99 0%, #d4af37 50%, #996515 100%);
  --gold-gradient-hover: linear-gradient(135deg, #fff2b8 0%, #e6be53 50%, #b8860b 100%);
  --gold-border: rgba(212, 175, 55, 0.35);
  --gold-border-strong: rgba(212, 175, 55, 0.65);
  --gold-glow: 0 0 24px rgba(212, 175, 55, 0.28);

  /* High-Speed Cyan Accents */
  --cyan-accent: #00d2d3;
  --cyan-speed: #38b6ff;
  --cyan-glow: 0 0 16px rgba(0, 210, 211, 0.35);
  --cyan-border: rgba(0, 210, 211, 0.4);

  /* Clean Typography */
  --text-white: #ffffff;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-gold: #f3d47c;

  /* Authentic Excel Replica */
  --excel-header-green: #90ee90;
  --excel-yellow: #90ee90;
  --excel-black: #000000;
  --excel-gray-row: #d9d9d9;
  --excel-border: #000000;

  /* Dimensions & Radius */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Typography Stack */
  --font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  /* 60fps Motion Spring Transitions */
  --spring-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --spring-smooth: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --spring-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  direction: rtl;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(circle at 50% 120px, rgba(22, 44, 74, 0.8) 0%, transparent 70%),
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.1) 0%, transparent 55%),
    radial-gradient(circle at 10% 40%, rgba(0, 210, 211, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-canvas) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 50px;
}

/* Ambient Subtle Grain Canvas Overlay matching logo texture */
.bg-texture-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Custom Scrollbars (Zero Default Browser Scrollbars)
   ========================================================================== */

* {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-primary) var(--bg-canvas);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-canvas);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f3d47c 0%, #d4af37 50%, #996515 100%);
  border-radius: 4px;
  border: 1px solid rgba(13, 27, 46, 0.8);
}

::-webkit-scrollbar-thumb:hover {
  background: #f7df99;
}

/* ==========================================================================
   App Container & Typography
   ========================================================================== */

.app-container {
  max-width: 1050px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  position: relative;
  z-index: 1;
}

/* Brand Header */
.brand-header {
  text-align: center;
  padding: 24px 16px 20px;
  margin-bottom: 20px;
  position: relative;
}

.brand-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 2px;
  background: var(--gold-gradient);
  border-radius: var(--radius-full);
  box-shadow: var(--gold-glow);
}

.logo-wrapper {
  display: inline-block;
  position: relative;
  margin-bottom: 12px;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.65));
}

.brand-logo {
  max-width: 250px;
  height: auto;
  border-radius: var(--radius-md);
  transition: transform var(--spring-smooth);
}

.brand-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: normal;
  margin-top: 4px;
}

.brand-title span {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  font-family: 'Tajawal', sans-serif;
  letter-spacing: 1px;
}

.brand-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* PWA Install Header Button */
.pwa-install-header-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pwa-install-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 22px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16) 0%, rgba(13, 27, 46, 0.95) 100%);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-full);
  color: #f7df99;
  font-family: 'Cairo', sans-serif;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 44px;
}

.pwa-install-header-btn:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.28) 0%, rgba(13, 27, 46, 0.98) 100%);
  color: #ffffff;
  border-color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.35);
}

.pwa-install-header-btn:active {
  transform: translateY(0) scale(0.98);
}

.pwa-install-header-btn svg {
  stroke: var(--gold-primary);
  transition: transform 0.25s ease;
}

.pwa-install-header-btn:hover svg {
  stroke: #ffffff;
  transform: translateY(2px);
}

/* Top Status Bar */
.top-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--gold-border);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  color: var(--text-secondary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.status-chip strong {
  color: var(--gold-light);
  font-size: 1.15rem;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
}

.status-chip-cyan {
  border-color: var(--cyan-border);
  background: rgba(18, 36, 60, 0.8);
  color: #a5f3fc;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--cyan-accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan-accent);
  animation: liveDotPulse 2s infinite ease-in-out;
}

@keyframes liveDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* ==========================================================================
   Section Cards
   ========================================================================== */

.section-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--gold-gradient);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
  padding-bottom: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-light);
}

.section-badge {
  font-size: 0.82rem;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-border);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.section-badge-cyan {
  color: #a5f3fc;
  background: rgba(0, 210, 211, 0.12);
  border-color: var(--cyan-border);
}

/* ==========================================================================
   Vector SVG Icons Architecture (Zero Emojis Anywhere)
   ========================================================================== */

.ui-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  color: var(--gold-light);
}

.ui-icon-sm {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.ui-icon-btn {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-gold {
  color: var(--gold-primary);
}

.icon-cyan {
  color: var(--cyan-accent);
}

.btn-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==========================================================================
   Form System & Mobile-First Touch Controls
   ========================================================================== */

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid-full {
    grid-column: span 2;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.label-tip {
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-muted);
}

/* Custom Text Inputs */
.custom-input {
  width: 100%;
  min-height: 50px;
  background: rgba(10, 20, 35, 0.85);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: var(--spring-fast);
}

.custom-input:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.3);
  background: rgba(14, 28, 48, 0.95);
}

.custom-input::placeholder {
  color: #64748b;
  font-size: 0.95rem;
}

/* Touch Display Boxes (Date & Time) */
.touch-display-box {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 20, 35, 0.88);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
  text-align: right;
  transition: var(--spring-fast);
}

.touch-display-box:hover, .touch-display-box:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
  background: rgba(14, 28, 48, 0.95);
}

.touch-display-box:active {
  transform: scale(0.99);
}

.date-text-group {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.date-value-ar {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold-light);
}

.date-value-excel {
  font-size: 0.9rem;
  font-weight: 700;
  color: #a5f3fc;
  direction: ltr;
}

.time-value-display {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--gold-light);
  letter-spacing: 1.5px;
  direction: ltr;
}

.box-action-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
}

/* Quick Chips */
.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip-btn {
  min-height: 46px;
  background: rgba(18, 36, 60, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--spring-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.chip-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  transform: translateY(-1px);
}

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

.chip-btn.active {
  background: var(--gold-gradient);
  border-color: transparent;
  color: #08101e;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.45);
}

/* ==========================================================================
   PAX (Passengers) System: 1 to 30 Sequentially Without Any Skips
   ========================================================================== */

.pax-control-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(10, 20, 35, 0.65);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.pax-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stepper-btn {
  width: 52px;
  height: 52px;
  background: rgba(22, 44, 74, 0.95);
  border: 1.5px solid var(--gold-border);
  color: var(--gold-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--spring-fast);
}

.stepper-btn:hover {
  background: var(--gold-gradient);
  color: #08101e;
  border-color: transparent;
  transform: translateY(-1px);
}

.stepper-btn:active {
  transform: scale(0.94);
}

.pax-readout-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.pax-number-hero {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold-light);
  line-height: 1;
}

.pax-unit-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Responsive Grid with all 30 numbers sequentially (1 to 30) */
.pax-grid-30 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

@media (max-width: 480px) {
  .pax-grid-30 {
    grid-template-columns: repeat(5, 1fr);
  }
}

.pax-num-btn {
  min-height: 48px;
  background: rgba(18, 36, 60, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.22);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--spring-fast);
}

.pax-num-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.15);
}

.pax-num-btn:active {
  transform: scale(0.93);
}

.pax-num-btn.active {
  background: var(--gold-gradient);
  color: #08101e;
  border-color: transparent;
  font-weight: 900;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.45);
}

/* ==========================================================================
   Drivers Grid & Toyota HiAce 2024 Tourism Van Vector Icon
   ========================================================================== */

.drivers-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.driver-card {
  min-height: 105px;
  background: rgba(14, 28, 48, 0.85);
  border: 1.5px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--spring-fast);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.driver-card:hover {
  background: rgba(22, 44, 74, 0.95);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.driver-card:active {
  transform: scale(0.97);
}

.driver-card.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(14, 28, 48, 0.95) 100%);
  border-color: var(--gold-primary);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}

/* Checkmark indicator badge for active driver */
.driver-card.active::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-accent);
  box-shadow: 0 0 8px var(--cyan-accent);
}

.hiace-van-icon {
  width: 68px;
  height: 44px;
  object-fit: contain;
  display: block;
  transition: transform var(--spring-fast);
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}

.driver-card:hover .hiace-van-icon,
.driver-card.active .hiace-van-icon {
  transform: scale(1.08);
}

.driver-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.driver-card.active .driver-name {
  color: var(--gold-light);
  font-weight: 800;
}

/* Add custom driver card */
.custom-add-driver {
  border-style: dashed;
  background: rgba(10, 20, 35, 0.5);
}

.custom-add-driver:hover {
  background: rgba(18, 36, 60, 0.8);
}

.add-driver-plus-icon {
  width: 28px;
  height: 28px;
  color: var(--gold-light);
}

.custom-card-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(230, 57, 70, 0.25);
  border: 1px solid rgba(230, 57, 70, 0.7);
  color: #ff6b6b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  opacity: 0.85;
}

.custom-card-delete-btn:hover {
  background: #e63946;
  color: #ffffff;
  transform: scale(1.18);
  opacity: 1;
}

/* ==========================================================================
   Companies / Clients Grid & Card Styling
   ========================================================================== */

.companies-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.company-card {
  min-height: 90px;
  background: rgba(14, 28, 48, 0.85);
  border: 1.5px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--spring-fast);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.company-card:hover {
  background: rgba(22, 44, 74, 0.95);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.company-card:active {
  transform: scale(0.97);
}

.company-card.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.22) 0%, rgba(14, 28, 48, 0.95) 100%);
  border-color: var(--gold-primary);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.35);
}

.company-card.active::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-accent);
  box-shadow: 0 0 8px var(--cyan-accent);
}

.company-card-icon {
  width: 36px;
  height: 36px;
  display: block;
  transition: transform var(--spring-fast);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
}

.company-card:hover .company-card-icon,
.company-card.active .company-card-icon {
  transform: scale(1.08);
}

.company-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.company-card.active .company-name {
  color: var(--gold-light);
  font-weight: 800;
}

.custom-add-company {
  border-style: dashed;
  background: rgba(10, 20, 35, 0.5);
}

.custom-add-company:hover {
  background: rgba(18, 36, 60, 0.8);
}

.add-company-plus-icon {
  width: 28px;
  height: 28px;
  color: var(--gold-light);
}

/* ==========================================================================
   Primary Submit Button
   ========================================================================== */

.form-actions-row {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.btn-submit-trip {
  flex: 1;
  min-height: 56px;
  background: var(--gold-gradient);
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  color: #08101e;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.45);
  transition: var(--spring-fast);
}

.btn-cancel-edit {
  min-height: 56px;
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: #fca5a5;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--spring-fast);
  flex: 0 0 auto;
}

.btn-cancel-edit:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}

.btn-submit-trip:hover {
  background: var(--gold-gradient-hover);
  box-shadow: 0 8px 30px rgba(212, 175, 55, 0.65);
  transform: translateY(-2px);
}

.btn-submit-trip:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Authentic Excel Live Replica Table (100% Match to Sample Sheet)
   Light Green Header, Solid Black 1px Borders, All Centered
   ========================================================================== */

.excel-preview-wrapper {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.65);
  border: 2px solid var(--gold-primary);
  overflow-x: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.excel-table-container {
  width: 100%;
  min-width: 720px;
  background: #ffffff;
}

.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, Calibri, 'Segoe UI', Tahoma, sans-serif;
  direction: ltr; /* Matches original Excel sheet layout */
  font-size: 13px;
  color: #000000;
  border: 1px solid var(--excel-black);
}

/* Solid Light Green Banner Header */
.excel-table thead tr th {
  background-color: var(--excel-header-green, #90ee90);
  color: var(--excel-black);
  font-weight: 900;
  font-size: 14px;
  text-align: center;
  vertical-align: middle;
  padding: 10px 8px;
  border: 1px solid var(--excel-black);
  letter-spacing: normal;
  white-space: nowrap;
}

/* Explicit Excel Column Widths - Balanced with DRIVER & CLIENT columns */
.excel-table th.col-date   { width: 11%; }
.excel-table th.col-pax    { width: 8%; }
.excel-table th.col-from   { width: 22%; }
.excel-table th.col-to     { width: 23%; }
.excel-table th.col-time   { width: 10%; }
.excel-table th.col-driver { width: 13%; }
.excel-table th.col-client { width: 13%; }
.excel-table th.col-actions{ width: 114px; }

/* Table Body Cells - Solid Black Borders and Full Centering */
.excel-table tbody tr td {
  border: 1px solid var(--excel-black);
  padding: 8px 8px;
  color: var(--excel-black);
  font-size: 13px;
  font-weight: 700;
  height: 38px;
  text-align: center;
  vertical-align: middle;
  background-color: #ffffff;
}

.excel-table td.cell-date {
  font-weight: 800;
}

.excel-table td.cell-pax {
  font-weight: 800;
}

/* Row 1 PAX cell gray highlight matching sample image */
.excel-table td.cell-pax.highlight-gray {
  background-color: var(--excel-gray-row);
}

.excel-table td.cell-from {
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  font-weight: 700;
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: center;
}

.excel-table td.cell-to {
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  font-weight: 700;
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: center;
}

.excel-table td.cell-time {
  font-weight: 800;
  direction: ltr;
  text-align: center;
}

.excel-table td.cell-driver {
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  font-weight: 800;
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: center;
}

.excel-table td.cell-client {
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  font-weight: 800;
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: center;
}

/* Actions Column (Hidden during image and Excel export) */
.excel-table td.row-actions-cell {
  background-color: #f8fafc;
  border: 1px solid var(--excel-black);
}

.action-buttons-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.row-action-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  transition: var(--spring-fast);
}

.row-action-btn:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
}

.row-action-btn.edit-btn:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

/* Hand Selection Button (Icon & State) */
.row-action-btn.hand-btn {
  border-color: rgba(0, 0, 0, 0.22);
  color: #475569;
}

.row-action-btn.hand-btn:hover {
  background: #fff1f2;
  border-color: #f87171;
  color: #e63946;
  transform: scale(1.08);
}

/* Selected state: turns towards subtle stylish red/crimson */
.row-action-btn.hand-btn.selected-hand {
  background: #e63946 !important;
  border-color: #c92a2a !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.55), inset 0 1px 2px rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

/* Table row highlight when hand-selected */
.excel-table tbody tr.row-hand-selected td {
  background-color: #fff1f2 !important;
  border-color: #f87171 !important;
}

.excel-table tbody tr.row-hand-selected td.cell-pax.highlight-gray {
  background-color: #ffe4e6 !important;
}

/* Hand Selection Notification & Quick Clear Banner */
.hand-selection-banner {
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.16) 0%, rgba(13, 27, 46, 0.95) 100%);
  border: 1.5px solid #e63946;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.25);
  animation: fadeIn 0.3s ease-out;
}

.hand-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffccd5;
  font-size: 0.92rem;
  font-weight: 800;
}

.hand-banner-icon {
  color: #ff4d6d;
  animation: handPulse 1.4s infinite ease-in-out;
}

@keyframes handPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(-6deg); }
}

.btn-clear-hand {
  background: rgba(230, 57, 70, 0.22);
  border: 1px solid #e63946;
  color: #ffccd5;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-clear-hand:hover,
.btn-clear-hand:active {
  background: #e63946;
  color: #ffffff;
}

/* Empty rows placeholder below data */
.excel-table tbody tr.empty-row td {
  background-color: #ffffff;
  color: transparent;
  border: 1px solid var(--excel-black);
}

/* ==========================================================================
   Table Export Toolbar
   ========================================================================== */

.table-export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.export-btn {
  flex: 1;
  min-width: 170px;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--spring-fast);
  border: none;
}

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

/* Real Excel .xlsx button */
.btn-export-excel {
  background: linear-gradient(135deg, #107c41 0%, #185a37 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 124, 65, 0.4);
}

.btn-export-excel:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(16, 124, 65, 0.6);
}

/* Image PNG button */
.btn-export-image {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.4);
}

.btn-export-image:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(2, 132, 199, 0.6);
}

/* PDF export button */
.btn-export-pdf {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

.btn-export-pdf:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(220, 38, 38, 0.6);
}

/* Word export button */
.btn-export-word {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.4);
}

.btn-export-word:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(29, 78, 216, 0.6);
}



/* WhatsApp share button */
.btn-share-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
}

.btn-share-whatsapp:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.6);
}

/* Clear table button */
.btn-clear-table {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.45);
  color: #fca5a5;
  min-width: 140px;
  flex: 0 0 auto;
}

.btn-clear-table:hover {
  background: #dc2626;
  color: #ffffff;
}

/* ==========================================================================
   Custom Modals (Zero Browser Dialogs, Zero Emojis)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), var(--gold-glow);
  transform: translateY(20px) scale(0.96);
  transition: transform var(--spring-smooth);
  position: relative;
  direction: rtl;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card-wide {
  max-width: 560px;
}

.modal-backdrop.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--spring-fast);
}

.modal-close-btn:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  margin-bottom: 22px;
}

.confirm-message {
  font-size: 1.1rem;
  color: var(--text-primary);
  line-height: 1.7;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-secondary {
  min-height: 46px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--spring-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-white);
}

.btn-primary {
  min-height: 46px;
  background: var(--gold-gradient);
  border: none;
  color: #08101e;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
  transition: var(--spring-fast);
}

.btn-primary:hover {
  background: var(--gold-gradient-hover);
  transform: translateY(-1px);
}

.btn-danger {
  min-height: 46px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #ffffff;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35);
  transition: var(--spring-fast);
}

.btn-danger:hover {
  filter: brightness(1.15);
}

/* ==========================================================================
   Date Picker Custom Modal (100% Arabic Months)
   ========================================================================== */

.date-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 28, 48, 0.95);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.date-preview-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.date-preview-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-light);
}

.modal-section-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.month-chips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.month-chip-btn {
  min-height: 48px;
  background: rgba(21, 40, 67, 0.75);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--spring-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.month-chip-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.month-chip-btn.active {
  background: var(--gold-gradient);
  border-color: transparent;
  color: #08101e;
  font-weight: 900;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.45);
}

.days-chips-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(8, 16, 29, 0.65);
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.day-chip-btn {
  min-height: 44px;
  aspect-ratio: 1;
  background: rgba(21, 40, 67, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--spring-fast);
}

.day-chip-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.day-chip-btn.active {
  background: var(--gold-gradient);
  color: #08101e;
  border-color: transparent;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.45);
}

/* ==========================================================================
   Time Picker Custom Modal (Hours 1-24 and Minutes 00-59)
   ========================================================================== */

.time-picker-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.time-col-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.time-col-header {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold-light);
}

.time-col-scroll {
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 6px;
  background: rgba(8, 16, 29, 0.65);
  border-radius: var(--radius-md);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.time-num-option {
  min-height: 48px;
  padding: 6px;
  text-align: center;
  background: rgba(21, 40, 67, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--spring-fast);
}

.time-num-option:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.time-num-option.active {
  background: var(--gold-gradient);
  color: #08101e;
  border-color: transparent;
  font-weight: 900;
}

/* Common Minutes Bar in Time Picker */
.common-minutes-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.common-minute-btn {
  flex: 1;
  min-height: 44px;
  background: rgba(21, 40, 67, 0.8);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--spring-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.common-minute-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.common-minute-btn.active {
  background: var(--gold-gradient);
  color: #08101e;
  border-color: transparent;
  font-weight: 800;
}



.time-preview-bar {
  margin-top: 14px;
  padding: 12px;
  background: rgba(8, 16, 29, 0.8);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.time-preview-text {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--gold-light);
  letter-spacing: 1px;
  direction: ltr;
}

/* ==========================================================================
   60fps Luxury Loading Modal & Overlay
   ========================================================================== */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 28, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.loading-modal-box {
  background: var(--bg-surface);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), var(--gold-glow);
  transform: scale(0.92);
  transition: transform var(--spring-smooth);
  width: 90%;
  max-width: 420px;
  text-align: center;
}

.loading-overlay.active .loading-modal-box {
  transform: scale(1);
}

/* 10-Second Luxury Video Countdown Modal for Downloads & Exports */
.countdown-video-wrapper {
  position: relative;
  width: 240px;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  background: #08101c;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85), 0 0 25px rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.countdown-video-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  border-radius: 14px;
}

.countdown-video-glow {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  box-shadow: inset 0 0 16px rgba(212, 175, 55, 0.3);
  pointer-events: none;
}

.countdown-van-hero {
  width: 140px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: vanDrivePulse 2.2s ease-in-out infinite;
}

.countdown-hiace-hero {
  max-width: 140px;
  max-height: 84px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.7));
}

@keyframes vanDrivePulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.02); }
}

.countdown-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1.4;
}

.countdown-number-badge {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  background: rgba(10, 20, 35, 0.85);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-full);
  padding: 6px 22px;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.3);
}

.countdown-num-val {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.countdown-sec-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cyan-accent);
}

.countdown-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(8, 16, 29, 0.9);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.3);
  position: relative;
}

.countdown-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4af37, #00d2d3);
  border-radius: var(--radius-full);
  box-shadow: 0 0 10px rgba(0, 210, 211, 0.5);
}

.countdown-sub-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Luxury Swift Button Light Flash (Triggered strictly on Click / Active)
   Normal state: Pristine and Stationary (0% distraction, zero clipping)
   Press state: Swift 300ms gold/white beam sweeps completely edge-to-edge
   ========================================================================== */

.btn-submit-trip,
.btn-export-excel,
.btn-export-image,
.export-btn,
.btn-primary,
.btn-cancel-edit,
.modal-btn-confirm {
  position: relative;
  overflow: hidden;
}

.btn-submit-trip::after,
.btn-export-excel::after,
.btn-export-image::after,
.export-btn::after,
.btn-primary::after,
.btn-cancel-edit::after,
.modal-btn-confirm::after {
  content: '';
  position: absolute;
  top: 0;
  left: -160%;
  width: 90%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.25) 20%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(212, 175, 55, 0.25) 80%,
    transparent 100%
  );
  transform: skewX(-25deg);
  opacity: 0;
  pointer-events: none;
}

/* Activated strictly on :active (press) or .btn-clicked-glow (JS click flash) */
.btn-submit-trip:active::after,
.btn-export-excel:active::after,
.btn-export-image:active::after,
.export-btn:active::after,
.btn-primary:active::after,
.btn-cancel-edit:active::after,
.modal-btn-confirm:active::after,
.btn-submit-trip.btn-clicked-glow::after,
.btn-export-excel.btn-clicked-glow::after,
.btn-export-image.btn-clicked-glow::after,
.export-btn.btn-clicked-glow::after,
.btn-primary.btn-clicked-glow::after,
.btn-cancel-edit.btn-clicked-glow::after,
.modal-btn-confirm.btn-clicked-glow::after {
  opacity: 1;
  animation: luxuryButtonFlash 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes luxuryButtonFlash {
  0% {
    left: -150%;
    opacity: 0.95;
  }
  100% {
    left: 240%;
    opacity: 0;
  }
}

/* ==========================================================================
   Toast Notification System (Zero Browser Alerts, Zero Emojis)
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: 90%;
  max-width: 420px;
}

.toast {
  background: rgba(14, 28, 48, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: var(--text-primary);
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75), var(--gold-glow);
  pointer-events: auto;
  animation: toastSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.success {
  border-color: #10b981;
}

.toast.success .toast-icon {
  color: #34d399;
}

.toast.warning {
  border-color: #f59e0b;
}

.toast.warning .toast-icon {
  color: #fbbf24;
}

.toast-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   Clean Footer
   ========================================================================== */

.app-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.app-footer strong {
  color: var(--gold-light);
}

/* ==========================================================================
   Ultra-Premium 5-Second Luxury Splash Screen (Site Visit / Reload)
   ========================================================================== */

.app-splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: radial-gradient(ellipse at center, #11233b 0%, #0c1828 50%, #050b14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
}

.app-splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.04);
  filter: blur(4px);
}

.splash-backdrop-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, rgba(0, 210, 211, 0.08) 50%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  animation: splashAuraPulse 3s ease-in-out infinite;
}

.splash-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 440px;
  width: 100%;
}

/* Video Showcase & Logo Container */
.splash-video-box {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 200px;
  border-radius: 20px;
  background: #08101c;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.9), 0 0 35px rgba(212, 175, 55, 0.4);
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-sound-prompt {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #d4af37 0%, #e6be53 100%);
  color: #08101c;
  padding: 8px 16px;
  border-radius: 9999px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), 0 0 16px rgba(212, 175, 55, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  z-index: 10;
  white-space: nowrap;
  animation: promptPulse 1.6s ease-in-out infinite;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.splash-sound-prompt.sound-active {
  display: none !important;
}

.prompt-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00d2d3;
  box-shadow: 0 0 8px #00d2d3;
}

@keyframes promptPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), 0 0 16px rgba(212, 175, 55, 0.6);
  }
  50% {
    transform: translateX(-50%) scale(1.04);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.7), 0 0 24px rgba(212, 175, 55, 0.9);
  }
}

.splash-video-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  border-radius: 18px;
}

.splash-video-glow {
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.35);
  pointer-events: none;
}

.splash-logo-container {
  position: relative;
  width: 280px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.splash-orbital-ring {
  position: absolute;
  pointer-events: none;
}

.splash-orbital-ring.ring-outer {
  width: 290px;
  height: 200px;
  border-radius: 26px;
  border: 2px dashed rgba(212, 175, 55, 0.5);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.25);
  animation: spinClockwise 14s linear infinite;
}

.splash-orbital-ring.ring-inner {
  display: none;
}

.splash-orbital-ring.ring-cyan {
  width: 270px;
  height: 180px;
  border-radius: 22px;
  border: 2px solid transparent;
  border-left-color: #00d2d3;
  border-right-color: #38b6ff;
  box-shadow: 0 0 20px rgba(0, 210, 211, 0.35);
  animation: spinCounterClockwise 5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.splash-glow-aura {
  position: absolute;
  width: 220px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(212, 175, 55, 0.4) 0%, rgba(0, 210, 211, 0.18) 60%, transparent 100%);
  filter: blur(18px);
  animation: splashAuraPulse 2.4s ease-in-out infinite;
}

.splash-logo-frame {
  position: relative;
  z-index: 3;
  width: 240px;
  height: 155px;
  border-radius: 18px;
  background: #0d1b2e;
  border: 2px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(212, 175, 55, 0.35);
  overflow: hidden;
  padding: 8px;
}

.splash-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}

/* Brand Titles */
.splash-brand-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.splash-gold-text {
  font-size: 2.1rem;
  font-weight: 900;
  background: linear-gradient(135deg, #f7df99 0%, #d4af37 50%, #e6be53 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: normal;
}

.splash-sub-en {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: 3px;
  opacity: 0.9;
}

.splash-tagline {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-weight: 600;
  line-height: 1.4;
}

/* Loader Panel: Arc Spinner, Timer Badge & Progress */
.splash-loader-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.splash-spinner-wrap {
  position: relative;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-spinner-arc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(212, 175, 55, 0.15);
  border-top-color: var(--gold-primary);
  border-left-color: var(--cyan-accent);
  animation: spinClockwise 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.splash-timer-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.splash-countdown-val {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}

.splash-countdown-unit {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--cyan-accent);
  margin-top: 2px;
}

.splash-progress-track {
  width: 100%;
  max-width: 280px;
  height: 6px;
  background: rgba(8, 16, 29, 0.9);
  border-radius: 9999px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.35);
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.splash-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4af37 0%, #f3d47c 50%, #00d2d3 100%);
  border-radius: 9999px;
  box-shadow: 0 0 10px rgba(0, 210, 211, 0.7);
}

.splash-status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  min-height: 20px;
  transition: opacity 0.3s ease;
}

@keyframes spinClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinCounterClockwise {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes splashAuraPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* Splash Audio Indicator / Button */
.splash-audio-control {
  margin-top: 10px;
}

.splash-audio-btn {
  background: rgba(18, 36, 60, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold-light);
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--spring-fast);
  backdrop-filter: blur(6px);
}

.splash-audio-btn:hover {
  background: rgba(26, 52, 86, 0.95);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

/* ==========================================================================
   Main System Navigation Switcher (Tabs)
   ========================================================================== */

.main-system-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

/* ==========================================================================
   Gateway Portal View (بوابة اختيار النظام)
   ========================================================================== */

.gateway-hero-card {
  background: var(--navy-surface);
  border: 2px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 35px rgba(212, 175, 55, 0.2);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.gateway-welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--gold-light);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 5px 16px;
  border-radius: 9999px;
  margin-bottom: 16px;
}

.gateway-hero-title {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--text-white);
  margin-bottom: 10px;
  letter-spacing: normal;
}

.gateway-hero-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  max-width: 680px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.gateway-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  text-align: right;
}

.gateway-choice-card {
  background: linear-gradient(145deg, rgba(13, 27, 46, 0.95) 0%, rgba(18, 38, 64, 0.9) 100%);
  border: 2px solid rgba(212, 175, 55, 0.32);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--spring-smooth);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.gateway-choice-card:hover,
.gateway-choice-card:focus-visible {
  border-color: var(--gold-primary);
  transform: translateY(-5px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.75), 0 0 30px rgba(212, 175, 55, 0.35);
}

.gateway-card-badge {
  position: absolute;
  top: 18px;
  left: 18px;
  background: rgba(0, 210, 211, 0.15);
  border: 1px solid rgba(0, 210, 211, 0.5);
  color: var(--cyan-accent);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
}

.gateway-card-badge.badge-gold {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.5);
  color: var(--gold-light);
}

.gateway-card-visual {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.gateway-card-img {
  max-height: 90px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6));
  transition: transform var(--spring-bounce);
}

.gateway-choice-card:hover .gateway-card-img {
  transform: scale(1.08);
}

.gateway-doc-icon {
  width: 72px;
  height: 72px;
  stroke: var(--gold-light);
  filter: drop-shadow(0 6px 14px rgba(212, 175, 55, 0.4));
  transition: transform var(--spring-bounce);
}

.gateway-choice-card:hover .gateway-doc-icon {
  transform: scale(1.1);
}

.gateway-card-heading {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.gateway-card-summary {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
}

.gateway-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.gateway-feature-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

.btn-gateway-action {
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  transition: all var(--spring-fast);
}

.btn-gateway-trips {
  background: linear-gradient(135deg, #00d2d3 0%, #0abde3 100%);
  color: #08101c;
  box-shadow: 0 6px 20px rgba(0, 210, 211, 0.4);
}

.btn-gateway-trips:hover {
  background: linear-gradient(135deg, #2fe0e1 0%, #22c5e5 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 210, 211, 0.6);
}

.btn-gateway-invoices {
  background: linear-gradient(135deg, #d4af37 0%, #f3d47c 100%);
  color: #08101c;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-gateway-invoices:hover {
  background: linear-gradient(135deg, #dfbc4b 0%, #fae298 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(212, 175, 55, 0.6);
}

.system-tab-btn {
  background: rgba(18, 36, 60, 0.75);
  border: 2px solid rgba(212, 175, 55, 0.28);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: right;
  transition: all var(--spring-smooth);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.system-tab-btn:hover {
  background: rgba(22, 44, 74, 0.95);
  border-color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.2);
}

.system-tab-btn.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(18, 36, 60, 0.96) 100%);
  border-color: var(--gold-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(212, 175, 55, 0.35);
}

.tab-btn-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  stroke: var(--text-muted);
  transition: stroke var(--spring-fast), transform var(--spring-bounce);
}

.system-tab-btn:hover .tab-btn-icon {
  stroke: var(--gold-light);
  transform: scale(1.1);
}

.system-tab-btn.active .tab-btn-icon {
  stroke: var(--gold-primary);
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.6));
  transform: scale(1.08);
}

.tab-btn-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.tab-btn-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text-primary);
  transition: color var(--spring-fast);
}

.system-tab-btn.active .tab-btn-title {
  color: var(--gold-light);
}

.tab-btn-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.system-tab-btn.active .tab-btn-sub {
  color: var(--cyan-accent);
}

.tab-active-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #d4af37, #00d2d3);
  opacity: 0;
  transition: opacity var(--spring-smooth);
}

.system-tab-btn.active .tab-active-indicator {
  opacity: 1;
}

.system-tab-view {
  animation: tabViewFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ==========================================================================
   Section 2: Invoices Configuration (Companies, Months, Year)
   ========================================================================== */

.invoice-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.invoice-companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.invoice-company-card {
  background: rgba(13, 27, 46, 0.8);
  border: 1.5px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  transition: all var(--spring-smooth);
  user-select: none;
}

.invoice-company-card:hover {
  border-color: var(--gold-light);
  background: rgba(22, 44, 74, 0.9);
  transform: translateY(-2px);
}

.invoice-company-card.active {
  border-color: var(--gold-primary);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.16) 0%, rgba(18, 36, 60, 0.95) 100%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(212, 175, 55, 0.25);
}

.invoice-company-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}

.invoice-company-card.active .invoice-company-name {
  color: var(--gold-light);
}

.company-vat-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.3;
}

.company-vat-badge.vat-on {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
}

.company-vat-badge.vat-off {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
}

.btn-add-invoice-company {
  border-style: dashed;
  justify-content: center;
}

.btn-add-invoice-company:hover {
  border-color: var(--cyan-accent);
}

/* Months Grid */
.invoice-months-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.invoice-month-btn {
  background: rgba(13, 27, 46, 0.75);
  border: 1.5px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--spring-fast);
  text-align: center;
  font-family: inherit;
}

.invoice-month-btn:hover {
  border-color: var(--gold-light);
  background: rgba(22, 44, 74, 0.9);
  color: var(--text-white);
}

.invoice-month-btn.active {
  background: var(--gold-gradient);
  color: #08101c;
  border-color: var(--gold-primary);
  font-weight: 900;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.4);
}

/* Year Stepper */
.year-stepper-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(13, 27, 46, 0.85);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  width: fit-content;
}

.year-display-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold-light);
  min-width: 70px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Section 2: Invoice Entry Form Controls
   ========================================================================== */

.invoice-day-selector-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-stepper-control {
  display: flex;
  align-items: center;
  gap: 14px;
}

.day-hero-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: rgba(13, 27, 46, 0.9);
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 6px 20px;
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.25);
}

.day-hero-display .day-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold-light);
  line-height: 1;
}

.day-hero-display .day-formatted-label {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cyan-accent);
}

.invoice-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 8px 6px;
  background: rgba(13, 27, 46, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: var(--radius-md);
  direction: rtl;
  margin-top: 4px;
}

@media (max-width: 480px) {
  .invoice-days-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 6px 3px;
  }
}

.invoice-day-grid-btn {
  height: 42px;
  min-width: 0;
  border-radius: var(--radius-sm);
  background: rgba(13, 27, 46, 0.85);
  border: 1.5px solid rgba(212, 175, 55, 0.25);
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--spring-fast);
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.invoice-day-grid-btn:hover {
  border-color: var(--gold-light);
  color: var(--text-white);
  background: rgba(22, 44, 74, 0.95);
  transform: translateY(-1px);
}

.invoice-day-grid-btn.active {
  background: var(--gold-gradient);
  color: #08101c;
  border-color: var(--gold-primary);
  font-weight: 900;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.45);
  transform: scale(1.04);
}

/* Vehicle Type Toggle Buttons */
.vehicle-type-toggle-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.vehicle-toggle-btn {
  background: rgba(13, 27, 46, 0.85);
  border: 2px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all var(--spring-smooth);
  font-family: inherit;
}

.vehicle-toggle-btn:hover {
  border-color: var(--gold-light);
  background: rgba(22, 44, 74, 0.95);
}

.vehicle-toggle-btn.active {
  border-color: var(--gold-primary);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(18, 36, 60, 0.98) 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(212, 175, 55, 0.35);
}

.vehicle-type-ar {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-primary);
}

.vehicle-toggle-btn.active .vehicle-type-ar {
  color: var(--gold-light);
}

.vehicle-type-en {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.vehicle-toggle-btn.active .vehicle-type-en {
  color: var(--cyan-accent);
}

/* Suggestions & Price Chips */
.invoice-suggestions-row,
.invoice-price-chips {
  margin-top: 8px;
}

/* ==========================================================================
   Section 2: Invoice Document Paper & Table (100% Authentic Replica)
   ========================================================================== */

/* Mobile Table Scroll Guidance Hint */
.mobile-table-scroll-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(18, 36, 60, 0.95);
  border: 1px dashed rgba(212, 175, 55, 0.55);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
  color: var(--gold-light);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  user-select: none;
}

.invoice-paper-wrapper {
  background: #09121f;
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--radius-lg);
  padding: 20px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
  width: 100%;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
  direction: rtl;
}

.invoice-paper {
  background-color: #ffffff;
  color: #000000;
  width: 100%;
  max-width: 860px;
  min-width: 620px;
  margin-inline: auto;
  padding: 30px 22px 38px;
  border-radius: 4px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85);
  box-sizing: border-box;
  position: relative;
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  direction: rtl;
}

.invoice-capsule-container {
  text-align: center;
  margin-bottom: 22px;
}

.invoice-title-capsule {
  display: inline-block;
  padding: 8px 38px;
  border: 1.5px solid #4a4a4a;
  border-radius: 8px;
  background: linear-gradient(180deg, #f2f2f2 0%, #d8d8d8 100%);
  color: #000000;
  font-size: 1.28rem;
  font-weight: 900;
  letter-spacing: normal !important;
  font-variant-ligatures: normal !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), inset 0 1px 0 #ffffff;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #000000;
  direction: rtl;
  margin: 0;
  background-color: #ffffff;
  table-layout: fixed;
  letter-spacing: normal !important;
}

.invoice-table th,
.invoice-table td {
  border: 1px solid #000000;
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  color: #000000;
  box-sizing: border-box;
  line-height: 1.35;
  letter-spacing: normal !important;
  font-variant-ligatures: normal !important;
}

.invoice-table th {
  background-color: #d9d9d9;
  font-weight: 900;
  font-size: 0.98rem;
  letter-spacing: normal !important;
}

.col-inv-m {
  width: 44px;
  background-color: #d9d9d9;
  font-weight: 800;
  font-size: 0.95rem;
}

.col-inv-date {
  width: 76px;
  font-weight: 800;
  font-size: 0.95rem;
}

.inv-date-text {
  display: inline-block;
  direction: ltr;
  unicode-bidi: isolate;
  font-weight: 800;
  letter-spacing: normal !important;
}

.col-inv-file {
  width: 84px;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
}

.col-inv-desc {
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  word-break: break-word;
}

.col-inv-vehicle {
  width: 86px;
  font-weight: 800;
  font-size: 0.95rem;
}

.col-inv-price {
  width: 98px;
  font-weight: 800;
  font-size: 0.98rem;
}

.col-inv-actions {
  width: 82px;
  background-color: #f7f7f7;
}

.invoice-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.inv-row-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--spring-fast);
}

.inv-row-btn.btn-edit-row {
  color: #1d4ed8;
}

.inv-row-btn.btn-edit-row:hover {
  background-color: rgba(29, 78, 216, 0.12);
}

.inv-row-btn.btn-del-row {
  color: #dc2626;
}

.inv-row-btn.btn-del-row:hover {
  background-color: rgba(220, 38, 38, 0.12);
}

/* Totals Rows in Invoice Footer */
.totals-label-cell {
  background-color: #d9d9d9;
  font-weight: 900;
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: normal !important;
  font-variant-ligatures: normal !important;
}

.totals-val-cell {
  background-color: #ffffff;
  font-weight: 900;
  font-size: 1.08rem;
  text-align: center;
  letter-spacing: normal !important;
}

/* Custom VAT Toggle Switch for Modal */
.vat-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.custom-vat-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}

.vat-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.vat-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #1e3a5f;
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  transition: 0.3s;
  border-radius: 34px;
}

.vat-switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 2.5px;
  background-color: var(--text-muted);
  transition: 0.3s;
  border-radius: 50%;
}

.vat-switch-input:checked + .vat-switch-slider {
  background-color: var(--gold-dark);
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.vat-switch-input:checked + .vat-switch-slider:before {
  transform: translateX(23px);
  background-color: #ffffff;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
}

.vat-toggle-label-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ==========================================================================
   Multi-Page Clean PDF Rendering Staging Styles
   ========================================================================== */

.pdf-staging-wrapper {
  position: fixed;
  left: 0;
  top: 0;
  width: 794px;
  background: #ffffff;
  z-index: -9999;
  pointer-events: none;
}

.invoice-pdf-page {
  width: 794px;
  height: 1123px;
  max-height: 1123px;
  background-color: #ffffff;
  color: #000000;
  padding: 38px 32px 50px 32px;
  box-sizing: border-box;
  font-family: 'Cairo', 'Tajawal', Tahoma, Arial, sans-serif;
  direction: rtl;
  display: flex;
  flex-direction: column;
  position: relative;
  page-break-after: always;
  overflow: hidden;
  letter-spacing: normal !important;
}

.invoice-pdf-page.invoice-pdf-page-1 {
  padding-bottom: 50px;
}

.invoice-image-full-sheet {
  width: 850px;
  background-color: #ffffff;
  color: #000000;
  padding: 36px 32px 48px 32px;
  box-sizing: border-box;
  font-family: 'Cairo', 'Tajawal', Tahoma, Arial, sans-serif;
  direction: rtl;
  letter-spacing: normal !important;
}

.invoice-image-full-sheet,
.invoice-image-full-sheet * {
  letter-spacing: normal !important;
  font-variant-ligatures: normal !important;
  box-sizing: border-box;
}

.invoice-pdf-page,
.invoice-pdf-page * {
  letter-spacing: normal !important;
  font-variant-ligatures: normal !important;
  text-rendering: optimizeLegibility !important;
  box-sizing: border-box;
}

.invoice-pdf-page .invoice-capsule-container {
  margin-bottom: 22px;
  text-align: center;
  flex-shrink: 0;
}

.invoice-pdf-page .invoice-title-capsule {
  display: inline-block;
  padding: 9px 48px;
  border: 1.5px solid #333333;
  border-radius: 8px;
  background: linear-gradient(180deg, #f5f5f5 0%, #dcdcdc 100%);
  color: #000000;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: normal !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.invoice-pdf-page .invoice-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #000000;
  table-layout: fixed;
  direction: rtl;
  margin: 0;
  background-color: #ffffff;
}

.invoice-pdf-page .invoice-table th {
  background-color: #d9d9d9;
  font-weight: 900;
  font-size: 1.12rem;
  border: 1px solid #000000;
  padding: 12px 6px;
  text-align: center;
  vertical-align: middle;
  color: #000000;
  height: 50px;
  letter-spacing: normal !important;
}

.invoice-pdf-page .invoice-table td {
  border: 1px solid #000000;
  padding: 11px 8px;
  text-align: center;
  vertical-align: middle;
  color: #000000;
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: normal !important;
}

.invoice-pdf-page .col-inv-m {
  width: 48px;
  background-color: #d9d9d9;
  font-weight: 900;
  font-size: 1.05rem;
}

.invoice-pdf-page .col-inv-date {
  width: 86px;
  font-weight: 800;
  font-size: 1.05rem;
}

.invoice-pdf-page .col-inv-file {
  width: 86px;
  font-weight: 800;
  font-size: 1.05rem;
  text-align: center;
}

.invoice-pdf-page .col-inv-desc {
  font-weight: 700;
  font-size: 1.02rem;
  text-align: center;
  word-break: break-word;
}

.invoice-pdf-page .col-inv-vehicle {
  width: 95px;
  font-weight: 800;
  font-size: 1.05rem;
}

.invoice-pdf-page .col-inv-price {
  width: 125px;
  font-weight: 900;
  font-size: 1.10rem;
}

.invoice-pdf-page .totals-label-cell {
  background-color: #d9d9d9;
  font-weight: 900;
  font-size: 1.15rem;
  text-align: center;
  height: 48px;
  border: 1px solid #000000;
  padding: 10px 8px;
  letter-spacing: normal !important;
}

.invoice-pdf-page .totals-val-cell {
  background-color: #ffffff;
  font-weight: 900;
  font-size: 1.18rem;
  text-align: center;
  height: 48px;
  border: 1px solid #000000;
  padding: 10px 8px;
  letter-spacing: normal !important;
}

/* ==========================================================================
   Print Layout (@media print) for High Precision A4 Output
   ========================================================================== */

@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .app-splash-screen,
  .bg-texture-canvas,
  .brand-header,
  .main-system-tabs,
  .top-status-bar,
  #trip-form,
  #invoice-entry-form,
  .section-header,
  .invoice-config-grid,
  .table-export-bar,
  .app-footer,
  .modal-backdrop,
  .loading-overlay,
  .toast-container,
  .no-print,
  #view-gateway-portal {
    display: none !important;
  }

  .app-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .section-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .invoice-paper-wrapper {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .invoice-paper {
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 10mm 10mm !important;
    margin: 0 auto !important;
  }

  .invoice-title-capsule {
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .invoice-table {
    border-collapse: collapse !important;
    page-break-inside: auto;
  }

  .invoice-table thead {
    display: table-header-group !important;
  }

  .invoice-table tfoot {
    display: table-footer-group !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-table th,
  .invoice-table td,
  .col-inv-m,
  .totals-label-cell {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ==========================================================================
   Mobile-First Media Query Optimizations
   ========================================================================== */

/* ==========================================================================
   Persistent Storage & Backup/Restore Bar
   ========================================================================== */

.storage-backup-bar {
  background: #0d1b2e;
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 36px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.storage-backup-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.backup-title {
  display: block;
  color: var(--gold-light);
  font-size: 0.98rem;
  font-weight: 800;
}

.backup-sub {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 2px;
}

.storage-backup-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-backup-action {
  background: rgba(18, 36, 60, 0.95);
  border: 1.5px solid var(--gold-primary);
  color: var(--text-white);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-backup-action:hover,
.btn-backup-action:active {
  background: var(--gold-primary);
  color: #08101c;
  transform: translateY(-1px);
}

/* ==========================================================================
   Mobile-First & 60 FPS Performance Optimizations
   ========================================================================== */

@media (max-width: 768px) {
  /* 60 FPS Engine: Disable expensive GPU blur shaders during scroll on mobile */
  .section-card,
  .app-header,
  .driver-card,
  .company-card,
  .tab-pill,
  .trip-table-wrapper,
  .invoice-paper-wrapper,
  .storage-backup-bar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .section-card {
    background: #0d1b2e !important;
  }

  .mobile-table-scroll-hint {
    display: flex;
  }

  .storage-backup-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 14px;
  }

  .storage-backup-actions {
    width: 100%;
  }

  .btn-backup-action {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .app-container {
    padding: 10px 10px 36px;
  }
  .brand-logo {
    max-width: 200px;
  }
  .brand-title {
    font-size: 1.45rem;
  }
  .section-card {
    padding: 18px 12px;
    border-radius: var(--radius-md);
  }
  .drivers-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .companies-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .export-btn {
    min-width: 100%;
  }
  .month-chips-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .main-system-tabs {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .invoice-months-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .invoice-paper {
    padding: 18px 10px 24px;
    min-width: 590px;
  }
  .invoice-title-capsule {
    font-size: 1.08rem;
    padding: 6px 20px;
  }
}
