/* ================================================================
   KMZEN THEME SYSTEM - Optimized CSS
   Only contains CSS variables and custom components.
   Use Tailwind utility classes for layout, spacing, colors, etc.
   ================================================================ */

:root {
  --sidebar-w: 16rem; /* Full width sidebar with labels */
  --sidebar-w-expanded: 16rem; /* Full width when expanded */
  --transition: 240ms;

  /* Safe area insets for iOS */
  --sat: env(safe-area-inset-top);
  --sar: env(safe-area-inset-right);
  --sab: env(safe-area-inset-bottom);
  --sal: env(safe-area-inset-left);

  /* === BASE COLOR PALETTE === */

  /* Primary (Vert Olive - Default) */
  --color-primary-50: #f6f7f4;
  --color-primary-100: #ecefe6;
  --color-primary-200: #d8dfcc;
  --color-primary-300: #bcc7a5;
  --color-primary-400: #9aaa7c;
  --color-primary-500: #7a8f5a;
  --color-primary-600: #627348;
  --color-primary-700: #4d5a39;
  --color-primary-800: #3d472e;
  --color-primary-900: #313a26;

  /* Success (Vert Sauge) */
  --color-success-50: #f4f7f4;
  --color-success-100: #e6ede6;
  --color-success-200: #c8d9c8;
  --color-success-300: #a9c5a9;
  --color-success-400: #7fa87f;
  --color-success-500: #5a8a5a;
  --color-success-600: #4a7150;
  --color-success-700: #3a5a40;
  --color-success-800: #2b4330;
  --color-success-900: #1c2c20;

  /* Warning (Ambre Miel) */
  --color-warning-50: #faf8f2;
  --color-warning-100: #f5f0e0;
  --color-warning-200: #ebe0bd;
  --color-warning-300: #ddc997;
  --color-warning-400: #cab166;
  --color-warning-500: #b89541;
  --color-warning-600: #9a7a35;
  --color-warning-700: #7a5f2a;
  --color-warning-800: #5a461f;
  --color-warning-900: #3b2d14;

  /* Danger (Standard Red) */
  --color-danger-50: #fef2f2;
  --color-danger-100: #fee2e2;
  --color-danger-200: #fecaca;
  --color-danger-300: #fca5a5;
  --color-danger-400: #f87171;
  --color-danger-500: #ef4444;
  --color-danger-600: #dc2626;
  --color-danger-700: #b91c1c;
  --color-danger-800: #991b1b;
  --color-danger-900: #7f1d1d;

  /* Neutral (Warm Grays - Softened) */
  --color-neutral-50: #fafaf9;
  --color-neutral-100: #f5f5f4;
  --color-neutral-200: #e7e5e4;
  --color-neutral-300: #d6d3d1;
  --color-neutral-400: #a8a29e;
  --color-neutral-500: #8a847e;
  --color-neutral-600: #6b665f;
  --color-neutral-700: #524e49;
  --color-neutral-800: #3d3a36;
  --color-neutral-900: #2f2d2a;

  /* === SEMANTIC TOKENS (Light Mode) === */

  /* Surfaces */
  --surface-base: #fafaf9;
  --surface-raised: #fefefe;
  --surface-overlay: #ffffff;
  --surface-sunken: #f5f5f4;
  --surface-muted: #f5f5f4;

  /* Text - Softened for less visual harshness */
  --text-primary: var(--color-neutral-700);
  --text-secondary: var(--color-neutral-500);
  --text-tertiary: var(--color-neutral-400);
  --text-muted: var(--color-neutral-400);
  --text-inverse: #ffffff;
  --text-link: var(--color-primary-600);
  --text-link-hover: var(--color-primary-700);

  /* Borders */
  --border-default: var(--color-neutral-200);
  --border-muted: var(--color-neutral-100);
  --border-strong: var(--color-neutral-300);
  --border-focus: var(--color-primary-500);

  /* Interactive states */
  --interactive-hover: rgba(0, 0, 0, 0.04);
  --interactive-active: rgba(0, 0, 0, 0.08);
  --interactive-selected: var(--color-primary-50);
  --interactive-selected-hover: var(--color-primary-100);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

  /* Component Tokens */
  --btn-primary-bg: var(--color-primary-500);
  --btn-primary-bg-hover: var(--color-primary-600);
  --btn-primary-bg-active: var(--color-primary-700);
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: transparent;
  --btn-secondary-bg-hover: var(--color-neutral-100);
  --btn-secondary-border: var(--color-neutral-300);
  --btn-secondary-text: var(--color-neutral-700);
  --btn-danger-bg: var(--color-danger-500);
  --btn-danger-bg-hover: var(--color-danger-600);
  --btn-danger-text: #ffffff;

  --input-bg: #fefefe;
  --input-border: var(--color-neutral-300);
  --input-border-hover: var(--color-neutral-400);
  --input-border-focus: var(--color-primary-500);
  --input-text: var(--color-neutral-800);
  --input-placeholder: var(--color-neutral-400);
  --input-ring: rgba(122, 143, 90, 0.2);

  --card-bg: #fefefe;
  --card-border: var(--color-neutral-200);
  --card-shadow: var(--shadow-sm);

  --toast-success-bg: var(--color-success-100);
  --toast-success-border: var(--color-success-500);
  --toast-success-text: var(--color-success-800);
  --toast-success-icon: var(--color-success-500);
  --toast-warning-bg: var(--color-warning-100);
  --toast-warning-border: var(--color-warning-500);
  --toast-warning-text: var(--color-warning-800);
  --toast-warning-icon: var(--color-warning-500);
  --toast-danger-bg: var(--color-danger-100);
  --toast-danger-border: var(--color-danger-500);
  --toast-danger-text: var(--color-danger-800);
  --toast-danger-icon: var(--color-danger-500);
  --toast-info-bg: var(--color-primary-100);
  --toast-info-border: var(--color-primary-500);
  --toast-info-text: var(--color-primary-800);
  --toast-info-icon: var(--color-primary-500);

  --sidebar-bg: var(--color-neutral-100);
  --sidebar-text: var(--color-neutral-700);
  --sidebar-text-muted: var(--color-neutral-500);
  --sidebar-border: var(--color-neutral-200);
  --sidebar-item-hover: rgba(0, 0, 0, 0.04);
  --sidebar-item-active-bg: var(--color-primary-50);
  --sidebar-item-active-border: var(--color-primary-500);
  --sidebar-item-active-text: var(--color-primary-700);

  --table-header-bg: var(--color-neutral-50);
  --table-header-text: var(--color-neutral-600);
  --table-row-bg: #fefefe;
  --table-row-hover: var(--color-neutral-50);
  --table-row-selected: var(--color-primary-50);
  --table-border: var(--color-neutral-200);

  --badge-success-bg: var(--color-success-100);
  --badge-success-text: var(--color-success-700);
  --badge-warning-bg: var(--color-warning-100);
  --badge-warning-text: var(--color-warning-700);
  --badge-danger-bg: var(--color-danger-100);
  --badge-danger-text: var(--color-danger-700);
  --badge-info-bg: var(--color-primary-100);
  --badge-info-text: var(--color-primary-700);
  --badge-neutral-bg: var(--color-neutral-100);
  --badge-neutral-text: var(--color-neutral-700);

  --map-route-color: var(--color-primary-500);
  --map-marker-primary: var(--color-primary-500);
  --map-marker-success: var(--color-success-500);
  --map-marker-warning: var(--color-warning-500);
}

/* === DARK THEME === */
[data-theme="dark"] {
  --surface-base: var(--color-neutral-900);
  --surface-raised: var(--color-neutral-800);
  --surface-overlay: var(--color-neutral-800);
  --surface-sunken: #0f0e0d;
  --surface-muted: var(--color-neutral-800);

  --text-primary: var(--color-neutral-100);
  --text-secondary: var(--color-neutral-300);
  --text-tertiary: var(--color-neutral-400);
  --text-muted: var(--color-neutral-500);
  --text-inverse: var(--color-neutral-900);
  --text-link: var(--color-primary-400);
  --text-link-hover: var(--color-primary-300);

  --border-default: var(--color-neutral-700);
  --border-muted: var(--color-neutral-800);
  --border-strong: var(--color-neutral-600);
  --border-focus: var(--color-primary-400);

  --interactive-hover: rgba(255, 255, 255, 0.06);
  --interactive-active: rgba(255, 255, 255, 0.1);
  --interactive-selected: rgba(122, 143, 90, 0.15);
  --interactive-selected-hover: rgba(122, 143, 90, 0.25);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);

  --btn-primary-bg-hover: var(--color-primary-400);
  --btn-primary-bg-active: var(--color-primary-300);
  --btn-secondary-bg-hover: var(--color-neutral-700);
  --btn-secondary-border: var(--color-neutral-600);
  --btn-secondary-text: var(--color-neutral-200);

  --input-bg: var(--color-neutral-800);
  --input-border: var(--color-neutral-600);
  --input-border-hover: var(--color-neutral-500);
  --input-text: var(--color-neutral-100);
  --input-placeholder: var(--color-neutral-500);
  --input-ring: rgba(122, 143, 90, 0.3);

  --card-bg: var(--color-neutral-800);
  --card-border: var(--color-neutral-700);

  --toast-success-bg: rgba(90, 138, 90, 0.2);
  --toast-success-text: var(--color-success-200);
  --toast-warning-bg: rgba(184, 149, 65, 0.2);
  --toast-warning-text: var(--color-warning-200);
  --toast-danger-bg: rgba(239, 68, 68, 0.2);
  --toast-danger-text: var(--color-danger-200);
  --toast-info-bg: rgba(122, 143, 90, 0.2);
  --toast-info-text: var(--color-primary-200);

  --sidebar-bg: var(--color-neutral-800);
  --sidebar-text: var(--color-neutral-200);
  --sidebar-text-muted: var(--color-neutral-400);
  --sidebar-border: var(--color-neutral-700);
  --sidebar-item-hover: rgba(255, 255, 255, 0.06);
  --sidebar-item-active-bg: rgba(122, 143, 90, 0.15);
  --sidebar-item-active-text: var(--color-primary-300);

  --table-header-bg: var(--color-neutral-800);
  --table-header-text: var(--color-neutral-400);
  --table-row-bg: var(--color-neutral-900);
  --table-row-hover: var(--color-neutral-800);
  --table-row-selected: rgba(122, 143, 90, 0.15);
  --table-border: var(--color-neutral-700);

  --badge-success-bg: rgba(90, 138, 90, 0.2);
  --badge-success-text: var(--color-success-300);
  --badge-warning-bg: rgba(184, 149, 65, 0.2);
  --badge-warning-text: var(--color-warning-300);
  --badge-danger-bg: rgba(239, 68, 68, 0.2);
  --badge-danger-text: var(--color-danger-300);
  --badge-info-bg: rgba(122, 143, 90, 0.2);
  --badge-info-text: var(--color-primary-300);
  --badge-neutral-bg: var(--color-neutral-700);
  --badge-neutral-text: var(--color-neutral-300);
}

/* === DARK MODE OVERRIDES FOR TAILWIND CLASSES === */
/* These rules transform hardcoded Tailwind classes to use CSS variables in dark mode */

/* Background overrides */
[data-theme="dark"] .bg-white { background-color: var(--color-neutral-800) !important; }
[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-neutral-50 { background-color: var(--color-neutral-900) !important; }
[data-theme="dark"] .bg-gray-100,
[data-theme="dark"] .bg-neutral-100 { background-color: var(--color-neutral-800) !important; }
[data-theme="dark"] .bg-gray-200,
[data-theme="dark"] .bg-neutral-200 { background-color: var(--color-neutral-700) !important; }

/* Text color overrides */
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-neutral-900 { color: var(--color-neutral-100) !important; }
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-neutral-800 { color: var(--color-neutral-100) !important; }
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-neutral-700 { color: var(--color-neutral-200) !important; }
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-neutral-600 { color: var(--color-neutral-300) !important; }
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-neutral-500 { color: var(--color-neutral-400) !important; }
[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-neutral-400 { color: var(--color-neutral-500) !important; }

/* Border color overrides */
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-neutral-200 { border-color: var(--color-neutral-700) !important; }
[data-theme="dark"] .border-gray-300,
[data-theme="dark"] .border-neutral-300 { border-color: var(--color-neutral-600) !important; }
[data-theme="dark"] .border-gray-400,
[data-theme="dark"] .border-neutral-400 { border-color: var(--color-neutral-500) !important; }

/* Divide color overrides */
[data-theme="dark"] .divide-gray-200 > * + *,
[data-theme="dark"] .divide-neutral-200 > * + * { border-color: var(--color-neutral-700) !important; }

/* Ring color overrides */
[data-theme="dark"] .ring-gray-200,
[data-theme="dark"] .ring-neutral-200 { --tw-ring-color: var(--color-neutral-700) !important; }

/* Form inputs */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background-color: var(--input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--input-text) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--input-placeholder) !important;
}

/* Cards and panels */
[data-theme="dark"] .rounded-lg.border,
[data-theme="dark"] .rounded-xl.border,
[data-theme="dark"] .rounded-md.border {
  background-color: var(--card-bg);
  border-color: var(--card-border);
}

/* Hover states for backgrounds */
[data-theme="dark"] .hover\:bg-gray-50:hover,
[data-theme="dark"] .hover\:bg-neutral-50:hover { background-color: var(--color-neutral-700) !important; }
[data-theme="dark"] .hover\:bg-gray-100:hover,
[data-theme="dark"] .hover\:bg-neutral-100:hover { background-color: var(--color-neutral-700) !important; }

/* Primary color backgrounds - adjust for dark mode */
[data-theme="dark"] .bg-primary-50 { background-color: rgba(122, 143, 90, 0.1) !important; }
[data-theme="dark"] .bg-primary-100 { background-color: rgba(122, 143, 90, 0.15) !important; }

/* Success backgrounds */
[data-theme="dark"] .bg-success-50 { background-color: rgba(90, 138, 90, 0.1) !important; }
[data-theme="dark"] .bg-success-100 { background-color: rgba(90, 138, 90, 0.15) !important; }

/* Warning backgrounds */
[data-theme="dark"] .bg-warning-50 { background-color: rgba(184, 149, 65, 0.1) !important; }
[data-theme="dark"] .bg-warning-100 { background-color: rgba(184, 149, 65, 0.15) !important; }

/* Danger backgrounds */
[data-theme="dark"] .bg-danger-50 { background-color: rgba(239, 68, 68, 0.1) !important; }
[data-theme="dark"] .bg-danger-100 { background-color: rgba(239, 68, 68, 0.15) !important; }

/* Shadow adjustments */
[data-theme="dark"] .shadow,
[data-theme="dark"] .shadow-md,
[data-theme="dark"] .shadow-lg,
[data-theme="dark"] .shadow-xl {
  --tw-shadow-color: rgba(0, 0, 0, 0.5);
}

/* Modal and overlay backgrounds */
[data-theme="dark"] .bg-opacity-50 { --tw-bg-opacity: 0.7 !important; }

/* Specific component adjustments */
[data-theme="dark"] .tab-content { background-color: var(--surface-base); }
[data-theme="dark"] .main { background-color: var(--surface-base); }

/* Table adjustments */
[data-theme="dark"] table thead { background-color: var(--table-header-bg); }
[data-theme="dark"] table thead th { color: var(--table-header-text); }
[data-theme="dark"] table tbody tr { background-color: var(--table-row-bg); }
[data-theme="dark"] table tbody tr:hover { background-color: var(--table-row-hover); }
[data-theme="dark"] table tbody td { color: var(--text-primary); }

/* Gradients - replace with dark-friendly versions */
[data-theme="dark"] .bg-gradient-to-br,
[data-theme="dark"] .bg-gradient-to-r {
  background: var(--color-neutral-800) !important;
}

/* Labels and headings */
[data-theme="dark"] label { color: var(--text-secondary); }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
  color: var(--text-primary);
}

/* Modals */
[data-theme="dark"] .modal-content,
[data-theme="dark"] [class*="modal"] .bg-white {
  background-color: var(--color-neutral-800) !important;
}

/* Icons in neutral colors */
[data-theme="dark"] .text-neutral-400 i,
[data-theme="dark"] .text-neutral-500 i,
[data-theme="dark"] .text-neutral-600 i {
  color: inherit !important;
}

/* Focus rings */
[data-theme="dark"] .focus\:ring-primary-500:focus {
  --tw-ring-color: var(--color-primary-400);
}

/* Placeholder text */
[data-theme="dark"] .placeholder-neutral-400::placeholder,
[data-theme="dark"] .placeholder-neutral-500::placeholder {
  color: var(--color-neutral-500) !important;
}

/* === ACCENT COLORS === */
[data-accent="taupe"] {
  --color-primary-50: #faf8f5;
  --color-primary-100: #f0ebe3;
  --color-primary-200: #e0d6c8;
  --color-primary-300: #cfbfad;
  --color-primary-400: #b8a08a;
  --color-primary-500: #9d826b;
  --color-primary-600: #826954;
  --color-primary-700: #68533e;
  --color-primary-800: #4d3d2d;
  --color-primary-900: #33281d;
}

[data-accent="ocean"] {
  /* Bleu Ardoise - Slate blue, muted and natural */
  --color-primary-50: #f4f6f8;
  --color-primary-100: #e8ecf0;
  --color-primary-200: #d0d9e1;
  --color-primary-300: #a8b8c7;
  --color-primary-400: #7d94a8;
  --color-primary-500: #5f7a8f;
  --color-primary-600: #4d6375;
  --color-primary-700: #3f505e;
  --color-primary-800: #333f4a;
  --color-primary-900: #2a333b;
}

[data-accent="forest"] {
  /* Vert Olive - Earthy olive green */
  --color-primary-50: #f6f7f4;
  --color-primary-100: #ecefe6;
  --color-primary-200: #d8dfcc;
  --color-primary-300: #bcc7a5;
  --color-primary-400: #9aaa7c;
  --color-primary-500: #7a8f5a;
  --color-primary-600: #627348;
  --color-primary-700: #4d5a39;
  --color-primary-800: #3d472e;
  --color-primary-900: #313a26;
}

[data-accent="berry"] {
  /* Mauve Poudré - Dusty mauve/plum */
  --color-primary-50: #f8f6f7;
  --color-primary-100: #f0eaed;
  --color-primary-200: #e0d4da;
  --color-primary-300: #c9b5c0;
  --color-primary-400: #ac8f9e;
  --color-primary-500: #8f7082;
  --color-primary-600: #755a6a;
  --color-primary-700: #5e4755;
  --color-primary-800: #4a3944;
  --color-primary-900: #3d2f38;
}

[data-accent="sunset"] {
  /* Terracotta - Earthy warm tone */
  --color-primary-50: #faf6f4;
  --color-primary-100: #f4ebe6;
  --color-primary-200: #e8d5cc;
  --color-primary-300: #d6b5a5;
  --color-primary-400: #c0917a;
  --color-primary-500: #a87460;
  --color-primary-600: #8c5d4a;
  --color-primary-700: #704a3b;
  --color-primary-800: #5a3c30;
  --color-primary-900: #4a3229;
}

/* === BASE STYLES === */
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial;
  margin: 0;
  color: var(--text-primary);
  background: var(--surface-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Pill-shaped buttons */
button:not(input):not(select):not(textarea) {
  border-radius: 1.5rem !important;
}

.hidden { display: none !important; }

/* Border standardization */
.border-gray-200 { border-color: var(--border-default) !important; }

/* === LAYOUT === */
#appLayout {
  display: flex;
  height: 100vh;
  transition: all var(--transition) ease;
}

/* === SIDEBAR (Desktop: compact with tooltip on hover) === */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: visible;
  overflow-y: auto;
  background: var(--sidebar-bg);
  z-index: 50;
  will-change: width;
  padding-top: 0.25rem;
}

.sidebar > * { visibility: visible; opacity: 1; }

/* Desktop: Full sidebar with labels (same as mobile) */
@media (min-width: 769px) {
  .sidebar {
    overflow: visible;
  }
}

.sidebar.collapsed {
  width: 60px;
  min-width: 60px;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-content,
.sidebar.collapsed footer { display: none; }

.layout-collapsed .sidebar {
  width: 0 !important;
  transform: translateX(-100%);
  min-width: 0 !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

.layout-collapsed .main { margin-left: 0; }

.main {
  flex: 1;
  transition: margin-left var(--transition) ease;
}

/* Sidebar sections (visible on mobile) */
.sidebar-section { padding: 0; margin-bottom: 0.25rem; }

.sidebar-section-header {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-default) 20%, var(--border-default) 80%, transparent);
  margin: 1rem 0;
  opacity: 0.6;
}

/* Tab buttons base styles */
.tab-btn { cursor: pointer; user-select: none; transition: background 0.15s ease; }
.tab-btn:focus { outline: none; }

/* Hover state - subtle gray background */
.sidebar .tab-btn:hover {
  background: rgba(0, 0, 0, 0.06) !important;
}

/* Active/selected tab - slightly darker gray background */
.sidebar .tab-btn.bg-primary-50 {
  background: rgba(0, 0, 0, 0.08) !important;
  font-weight: 500;
  border: none !important;
}

/* Support menu */
.support-menu { position: relative; }
.support-menu-toggle { cursor: pointer; user-select: none; }
.support-menu-toggle:focus { outline: none; }
.support-chevron { font-size: 0.625rem; transition: transform 0.2s ease; }
.support-chevron.rotate-180 { transform: rotate(180deg); }
.support-submenu { overflow: hidden; transition: all 0.2s ease; }
.support-submenu:not(.hidden) { animation: slideDown 0.2s ease; }

/* Burger button - hidden on desktop, shown on mobile (inside app bar) */
.sidebar-burger-btn,
#sidebarToggle {
  display: none; /* Hidden by default on desktop */
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-burger-btn:hover,
#sidebarToggle:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

/* === TOASTS === */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--toast-info-bg);
  color: var(--toast-info-text);
  padding: 14px 18px;
  border-radius: 0.5rem;
  border-left: 4px solid var(--toast-info-border);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  min-width: 280px;
  max-width: 420px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.show { opacity: 1; pointer-events: auto; transform: translateY(-10px); }

.toast.success { background: var(--toast-success-bg); border-left-color: var(--toast-success-border); color: var(--toast-success-text); }
.toast.success i { color: var(--toast-success-icon); }
.toast.info { background: var(--toast-info-bg); border-left-color: var(--toast-info-border); color: var(--toast-info-text); }
.toast.info i { color: var(--toast-info-icon); }
.toast.warning { background: var(--toast-warning-bg); border-left-color: var(--toast-warning-border); color: var(--toast-warning-text); }
.toast.warning i { color: var(--toast-warning-icon); }
.toast.error { background: var(--toast-danger-bg); border-left-color: var(--toast-danger-border); color: var(--toast-danger-text); }
.toast.error i { color: var(--toast-danger-icon); }

/* === TABLES === */
#tripsTable tbody tr:hover { background-color: var(--table-row-hover); }
#tripsTable thead { position: sticky; top: 0; z-index: 10; background-color: var(--table-header-bg); }
#tripsTable thead th { background-color: var(--table-header-bg); }

/* === AWESOMPLETE (Autocomplete) === */
.awesomplete { position: relative; z-index: 10000 !important; }
.awesomplete > ul { z-index: 10001 !important; position: absolute !important; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important; }
.awesomplete > ul:empty { display: none !important; }
.awesomplete mark { background: var(--color-warning-400); }

#fromInput::placeholder,
#toInput::placeholder { opacity: 0 !important; visibility: hidden !important; }

#tripFormContainer { overflow: visible !important; z-index: 100 !important; padding-top: 1rem; }
#tripFormContent { overflow: visible !important; }
#tripFormContent > div { overflow: visible !important; position: relative; z-index: 1; }
#tripFormContent > div:has(#fromInput) { z-index: 10002 !important; }

.awesomplete > ul > li { display: flex; align-items: center; padding: 8px 12px; }
.awesomplete > ul > li .suggestion-icon { margin-right: 10px; font-size: 14px; flex-shrink: 0; width: 16px; text-align: center; color: var(--text-tertiary); }
.awesomplete > ul > li[data-source="excel"] .suggestion-icon { color: var(--color-success-500); }
.awesomplete > ul > li[data-source="addressbook"] .suggestion-icon,
.awesomplete > ul > li[data-source="free"] .suggestion-icon { color: var(--color-primary-500); }

.suggestion-content { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.suggestion-name { font-size: 14px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.suggestion-address { font-size: 12px; color: var(--text-secondary); line-height: 1.3; }

.awesomplete > ul > li[data-source="separator"] {
  pointer-events: none;
  background: transparent !important;
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 12px;
  cursor: default;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  margin: 4px 0;
}

.awesomplete > ul > li[data-source="excel"] { background-color: var(--surface-muted); }
.awesomplete > ul > li[data-source="free"] { background-color: var(--surface-raised); }

.awesomplete > ul > li[data-source="excel"]:hover,
.awesomplete > ul > li[data-source="free"]:hover {
  background-color: var(--color-primary-500) !important;
  color: var(--text-inverse) !important;
}

.address-source-icon { display: inline-block; margin-right: 4px; font-size: 14px; cursor: help; }

/* === HEADER & FOOTER === */
#appHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  padding-top: var(--sat);
  padding-left: max(1.5rem, var(--sal));
  padding-right: max(1.5rem, var(--sar));
}

.app-header-content { display: flex; align-items: center; gap: 1rem; width: 100%; }
.app-header-logo { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; border: 2px solid white; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
.app-header-title { display: flex; flex-direction: column; gap: 0.125rem; }
.app-header-name { font-size: 1.125rem; font-weight: 700; color: var(--text-primary); }
.app-header-version { font-size: 0.75rem; color: var(--text-secondary); }

#appFooter {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: var(--surface-raised);
  border-top: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 90;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
  padding-bottom: var(--sab);
  padding-left: max(1.5rem, var(--sal));
  padding-right: max(1.5rem, var(--sar));
}

.app-footer-content { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 0.8rem; color: var(--text-secondary); }
.footer-left { display: flex; align-items: center; gap: 0.75rem; }
.footer-app-name { font-weight: 700; color: var(--text-primary); font-size: 0.875rem; }
.footer-version { font-size: 0.7rem; color: var(--text-tertiary); padding: 0.15rem 0.5rem; background: var(--surface-muted); border-radius: 12px; }
.footer-center { flex: 1; text-align: center; font-size: 0.75rem; }
.footer-right { display: flex; align-items: center; gap: 1rem; }
.footer-link { display: flex; align-items: center; gap: 0.5rem; color: var(--color-primary-500); text-decoration: none; font-size: 0.8rem; transition: color 0.2s; }
.footer-link:hover { color: var(--color-primary-600); }
.footer-link i { font-size: 0.9rem; }

/* === COMPANY HEADER === */
.company-header { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: var(--card-bg); border-radius: 0.5rem; border: 1px solid var(--card-border); margin-bottom: 1rem; }
.company-header-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--surface-base); flex-shrink: 0; }
.company-header-info { display: flex; flex-direction: column; gap: 0.25rem; }
.company-header-name { font-size: 1rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.company-header-version { font-size: 0.75rem; color: var(--text-secondary); }
.company-header:not(:has(.company-header-logo[src]:not([src=""]))) .company-header-logo { display: none; }

/* === LOGO === */
.logo { height: 50px; width: auto; display: block; }
.app-logo { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); transition: transform 0.2s ease; border-radius: 50%; }
.app-logo:hover { transform: scale(1.05); }

/* === LICENSE STATUS === */
.license-status-badge { padding: 0.35rem 0.75rem; border-radius: 20px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.license-status-valid { background: var(--badge-success-bg); color: var(--badge-success-text); }
.license-status-demo { background: var(--badge-warning-bg); color: var(--badge-warning-text); }
.license-status-invalid { background: var(--badge-danger-bg); color: var(--badge-danger-text); }
.demo-counter { background: var(--color-warning-500); color: var(--text-inverse); border-radius: 10px; padding: 0.25rem 0.5rem; font-size: 0.7rem; font-weight: 600; margin-left: 0.5rem; }

#license-details { border-top: 1px solid var(--border-default); padding-top: 0.5rem; margin-top: 0.5rem; }
#license-key-display { font-family: 'Courier New', monospace; font-size: 0.7rem; background: var(--surface-muted); padding: 2px 4px; border-radius: 3px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

/* === EXPORT CONTROLS === */
.export-controls { display: flex; align-items: flex-end; gap: 10px; margin-left: auto; }
.export-control-group { display: flex; flex-direction: column; }
.export-control-label { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 4px; white-space: nowrap; }
.export-control { border: 1px solid var(--input-border); border-radius: 0.375rem; padding: 8px 12px; font-size: 0.875rem; background: var(--input-bg); color: var(--input-text); height: 40px; box-sizing: border-box; }
#exportMonth { min-width: 120px; }
#exportYear { min-width: 90px; }
#employeeName { min-width: 160px; }

/* Button hover effects */
#addBtn, #calcAllBtn, #exportCsvBtn, #clearBtn { transition: all 0.2s ease; position: relative; overflow: hidden; }
#addBtn:hover, #calcAllBtn:hover, #exportCsvBtn:hover, #clearBtn:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
#addBtn:active, #calcAllBtn:active, #exportCsvBtn:active, #clearBtn:active { transform: translateY(0); }

/* === LOADING STATES === */
.loading { opacity: 0.7; pointer-events: none; position: relative; }
.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--color-neutral-200);
  border-top: 2px solid var(--color-primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* === MAP PANEL === */
.map-panel {
  width: 40%;
  min-width: 400px;
  max-width: 600px;
  height: 100vh;
  background: var(--surface-raised);
  border-left: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 120;
}

.map-panel.hidden { width: 0; min-width: 0; opacity: 0; overflow: hidden; border-left: none; }
.map-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem; background: var(--surface-raised); border-bottom: 1px solid var(--border-default); flex-shrink: 0; }
.map-panel-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--text-primary); font-size: 0.875rem; }
.map-panel-title i { color: var(--text-secondary); }
.map-panel-actions { display: flex; gap: 0.5rem; }
.map-panel-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-default); border-radius: 1.5rem; background: var(--surface-raised); color: var(--text-tertiary); cursor: pointer; transition: all 0.2s ease; }
.map-panel-btn:hover { background: var(--surface-muted); color: var(--text-secondary); }
.map-panel-btn-close { width: 32px; height: 32px; background: var(--surface-raised); color: var(--text-secondary); border-color: var(--border-default); font-size: 0.875rem; }
.map-panel-btn-close:hover { background: var(--surface-muted); color: var(--text-primary); }
.map-container { flex: 1; min-height: 300px; overflow: hidden; }

/* Trip info */
.map-trip-info { padding: 0.75rem 1rem; background: var(--surface-raised); border-bottom: 1px solid var(--border-default); font-size: 0.8rem; flex-shrink: 0; display: flex; flex-direction: column; gap: 1rem; }
.trip-info-section { display: flex; flex-direction: column; gap: 0.5rem; }
.trip-info-section-title { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); margin: 0; padding-bottom: 0.25rem; border-bottom: 1px solid var(--border-default); }
.trip-info-section-title i { color: var(--color-primary-500); font-size: 0.7rem; }
.trip-info-row { display: flex; gap: 1.5rem; margin-bottom: 0.5rem; }
.trip-info-item { display: flex; align-items: center; gap: 0.5rem; color: var(--text-primary); font-size: 0.75rem; }
.trip-info-item i { color: var(--text-secondary); font-size: 0.7rem; }
.trip-info-addresses { display: flex; flex-direction: column; gap: 0.375rem; }
.trip-info-address { display: flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); font-size: 0.7rem; line-height: 1.3; }
.address-marker { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.address-departure { background: var(--color-success-500); border: 1px solid var(--color-success-600); }
.address-arrival { background: var(--color-danger-500); border: 1px solid var(--color-danger-600); }

/* Leaflet popups */
.leaflet-popup-content-wrapper { border-radius: 0.5rem; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); border: 1px solid var(--color-neutral-200); }
.leaflet-popup-content { margin: 10px 14px; font-size: 0.8125rem; line-height: 1.4; }
.map-popup-title { font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
.map-popup-address { color: var(--text-secondary); font-size: 0.75rem; }

/* Custom markers */
.custom-marker { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 600; color: white; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.marker-departure { background: var(--color-success-500); border: 2px solid var(--color-success-600); }
.marker-arrival { background: var(--color-danger-500); border: 2px solid var(--color-danger-600); }

/* === ACTION BUTTONS === */
.action-buttons { display: flex; gap: 0.5rem; align-items: center; }
.action-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 1.5rem; cursor: pointer; transition: all 0.2s ease; font-size: 0.875rem; position: relative; }

.action-btn.map-btn { background: var(--color-primary-50); color: var(--color-primary-500); border: 1px solid var(--color-primary-200); }
.action-btn.map-btn:hover { background: var(--color-primary-500); color: white; border-color: var(--color-primary-500); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(122, 143, 90, 0.4); }

.action-btn.delete-btn { background: var(--color-danger-50); color: var(--color-danger-500); border: 1px solid var(--color-danger-200); }
.action-btn.delete-btn:hover { background: var(--color-danger-500); color: white; border-color: var(--color-danger-500); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(163, 106, 79, 0.4); }

.action-btn:focus { outline: 2px solid var(--color-primary-500); outline-offset: 2px; }
.action-btn:focus:not(:focus-visible) { outline: none; }

/* Tooltip */
.action-btn[title]::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.375rem 0.625rem;
  background: var(--color-neutral-800);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 100;
}
.action-btn[title]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--color-neutral-800);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 100;
}
.action-btn[title]:hover::after,
.action-btn[title]:hover::before { opacity: 1; visibility: visible; }

/* === BULK ACTIONS === */
.bulk-actions-bar {
  background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-primary-100) 100%);
  border: 1px solid var(--color-primary-200);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 2px 4px rgba(122, 143, 90, 0.1);
}
.bulk-actions-bar.hidden { display: none; }
.bulk-actions-content { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 1rem; }
.bulk-selection-info { display: flex; align-items: center; gap: 0.75rem; }
.bulk-selection-count { font-size: 0.875rem; font-weight: 600; color: var(--color-primary-700); }
.bulk-actions-buttons { display: flex; gap: 0.5rem; }
.bulk-action-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; border: 1px solid transparent; border-radius: 0.375rem; cursor: pointer; transition: all 0.15s ease; }
.bulk-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.bulk-action-delete { background: var(--color-danger-500); color: white; border-color: var(--color-danger-500); }
.bulk-action-delete:not(:disabled):hover { background: var(--color-danger-600); box-shadow: 0 4px 12px rgba(163, 102, 77, 0.4); }
.bulk-action-export { background: var(--color-success-600); color: white; border-color: var(--color-success-600); }
.bulk-action-export:not(:disabled):hover { background: var(--color-success-700); box-shadow: 0 4px 12px rgba(90, 138, 90, 0.4); }

/* === ROW MAP BUTTON === */
.row-map-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-primary-200);
  border-radius: 50%;
  background: var(--color-primary-50);
  color: var(--color-primary-500);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}
.row-map-btn:hover:not(.disabled) { background: var(--color-primary-500); color: white; border-color: var(--color-primary-500); transform: translateY(-1px); box-shadow: 0 3px 8px rgba(122, 143, 90, 0.4); }
.row-map-btn.disabled { opacity: 0.4; cursor: not-allowed; background: var(--surface-muted); color: var(--text-tertiary); border-color: var(--color-neutral-200); }
.row-map-btn:focus:not(.disabled) { outline: 2px solid var(--color-primary-500); outline-offset: 2px; }

/* === CONTROL PANEL === */
.table-control-panel { display: flex; gap: 1rem; padding: 0.75rem 1rem; background: var(--surface-muted); border-radius: 0.5rem; border: 1px solid var(--border-default); }
.section-stats { display: flex; align-items: center; gap: 1rem; }
.section-filters { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.section-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.filter-controls { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.filter-group { display: flex; flex-direction: column; gap: 0.25rem; min-width: 140px; }
.filter-label { font-size: 0.6875rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.025em; }
.filter-select { padding: 0.375rem 0.75rem; font-size: 0.8125rem; border: 1px solid var(--border-default); border-radius: 0.375rem; background: var(--surface-raised); color: var(--text-primary); cursor: pointer; transition: border-color 0.15s ease; }
.filter-select:focus { outline: none; border-color: var(--color-primary-500); box-shadow: 0 0 0 2px var(--input-ring); }
.filter-select.active { border-color: var(--color-primary-500); background: var(--color-primary-50); font-weight: 500; }
.filter-clear-btn { padding: 0.375rem 0.75rem; font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); background: transparent; border: 1px solid var(--border-default); border-radius: 0.375rem; cursor: pointer; transition: all 0.15s ease; }
.filter-clear-btn:hover { border-color: var(--color-danger-500); color: var(--color-danger-500); background: var(--color-danger-50); }
.filter-clear-btn.visible { border-color: var(--color-primary-500); color: var(--color-primary-500); }

/* Stats cards */
.stats-cards { display: flex; gap: 0.75rem; }
.stat-card { display: flex; flex-direction: column; gap: 0.125rem; padding: 0.5rem 0.75rem; background: var(--surface-raised); border: 1px solid var(--border-default); border-radius: 0.375rem; min-width: 80px; }
.stat-card-label { font-size: 0.625rem; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.025em; }
.stat-card-value { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.stat-card-value.highlight { color: var(--color-primary-600); }

/* Action controls */
.action-controls { display: flex; gap: 0.5rem; }
.action-export { background: var(--color-success-500); color: white; border-color: var(--color-success-500); }
.action-export:hover { background: var(--color-success-600); box-shadow: 0 4px 12px rgba(90, 138, 90, 0.4); }
.action-clear { background: var(--surface-raised); color: var(--color-danger-600); border-color: var(--color-danger-600); }
.action-clear:hover { background: var(--color-danger-600); color: white; box-shadow: 0 4px 12px rgba(163, 102, 77, 0.4); }
.action-backup { background: var(--color-primary-500); color: white; border-color: var(--color-primary-500); gap: 0.25rem; }
.action-backup:hover { background: var(--color-primary-600); box-shadow: 0 4px 12px rgba(122, 143, 90, 0.4); }
.action-chevron { font-size: 0.625rem; transition: transform 0.2s ease; }

/* === DROPDOWN MENUS === */
.action-dropdown { position: relative; }
.action-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 160px;
  background: var(--surface-overlay);
  border: 1px solid var(--color-neutral-200);
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  overflow: hidden;
  transition: all 0.2s ease;
}
.action-dropdown-menu.hidden { opacity: 0; visibility: hidden; transform: translateY(-4px); }
.action-dropdown-menu:not(.hidden) { opacity: 1; visibility: visible; transform: translateY(0); animation: dropdownSlide 0.2s ease; }
.action-dropdown-item { width: 100%; display: flex; align-items: center; gap: 0.625rem; padding: 0.625rem 0.875rem; background: var(--surface-overlay); border: none; text-align: left; font-size: 0.875rem; color: var(--color-neutral-700); cursor: pointer; transition: background-color 0.15s ease; }
.action-dropdown-item:hover { background: var(--surface-muted); color: var(--color-neutral-800); }
.action-dropdown-item i { font-size: 0.875rem; width: 1em; text-align: center; color: var(--color-neutral-500); }
.action-dropdown-item:hover i { color: var(--color-neutral-700); }
.action-dropdown-item-danger { color: var(--color-danger-600); }
.action-dropdown-item-danger:hover { background: var(--color-danger-50); }
.action-dropdown-divider { height: 1px; background: var(--color-neutral-200); margin: 0.5rem 0; }

/* === MODALS === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--surface-overlay);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
  position: relative;
}

.modal-overlay:not(.no-close-on-overlay) { cursor: pointer; }
.modal-overlay:not(.no-close-on-overlay) .modal-content { cursor: default; }

/* Update modal */
.update-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.update-modal.hidden { display: none; }
.update-modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.update-modal-content { position: relative; width: 90%; max-width: 600px; background: var(--surface-raised); border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); overflow: hidden; animation: modalSlideIn 0.3s ease-out; }
.update-modal-header { padding: 2rem; background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%); color: white; text-align: center; position: relative; }
.update-icon { width: 64px; height: 64px; margin: 0 auto 1rem; background: rgba(255, 255, 255, 0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.update-title { margin: 0; font-size: 1.5rem; font-weight: 700; }
.update-modal-close { position: absolute; top: 1rem; right: 1rem; width: 32px; height: 32px; border: none; background: rgba(255, 255, 255, 0.2); color: white; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.update-modal-close:hover { background: rgba(255, 255, 255, 0.3); }
.update-modal-body { padding: 2rem; }
.update-version-info { display: flex; align-items: center; justify-content: center; }

/* Trip form modal/drawer */
.trip-form-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999; display: flex; align-items: center; justify-content: flex-end; }
.trip-form-modal.hidden { display: none; }
.trip-form-modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(2px); animation: fadeIn 0.2s ease; }
.trip-form-modal-drawer { position: relative; width: 100%; max-width: 500px; height: 100%; background: var(--surface-raised); box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; animation: slideInRight 0.3s ease; }
.trip-form-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem; border-bottom: 1px solid var(--color-neutral-200); flex-shrink: 0; }
.trip-form-modal-close { background: none; border: none; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--color-neutral-500); transition: all 0.15s ease; border-radius: 0.375rem !important; }
.trip-form-modal-close:hover { background: var(--color-neutral-100); color: var(--text-primary); }
.trip-form-modal-body { flex: 1; overflow-y: auto; padding: 1.5rem; }
.trip-form-modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 0.75rem; padding: 1.5rem; border-top: 1px solid var(--color-neutral-200); flex-shrink: 0; }

/* === TRIPS TOOLBAR === */
.trips-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; background: var(--surface-muted); border: 1px solid var(--color-neutral-200); border-radius: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.trips-toolbar-left, .trips-toolbar-center, .trips-toolbar-right { display: flex; align-items: center; gap: 0.75rem; }
.trips-toolbar-center { flex: 1; justify-content: center; }

.toolbar-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 500; border: 1px solid var(--color-neutral-300); background: var(--surface-raised); color: var(--color-neutral-700); border-radius: 0.375rem; cursor: pointer; transition: all 0.15s ease; white-space: nowrap; }
.toolbar-btn:hover { background: var(--surface-muted); border-color: var(--color-neutral-400); }
.toolbar-btn-primary { background: var(--color-primary-500); border-color: var(--color-primary-500); color: white; }
.toolbar-btn-primary:hover { background: var(--color-primary-700); border-color: var(--color-primary-700); }
.toolbar-divider { width: 1px; height: 24px; background: var(--color-neutral-300); }

.toolbar-filters-dropdown { position: relative; z-index: 100; }
.filters-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; background: var(--color-danger-600); color: white; font-size: 0.6875rem; font-weight: 600; border-radius: 9px; line-height: 1; }
.filters-badge.hidden { display: none; }
.filters-dropdown-menu { position: absolute; top: calc(100% + 0.5rem); left: 0; min-width: 280px; background: var(--surface-raised); border: 1px solid var(--color-neutral-200); border-radius: 0.5rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); z-index: 100; padding: 0.5rem; }
.filters-dropdown-menu.hidden { display: none; }
.filter-dropdown-item { padding: 0.75rem; }
.filter-dropdown-item .filter-label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--color-neutral-500); margin-bottom: 0.375rem; text-transform: uppercase; letter-spacing: 0.025em; }
.filter-dropdown-item .filter-select { width: 100%; padding: 0.5rem 0.75rem; font-size: 0.875rem; border: 1px solid var(--color-neutral-300); border-radius: 0.375rem; background: var(--surface-raised); color: var(--text-primary); cursor: pointer; }
.filter-dropdown-item .filter-select:focus { outline: none; border-color: var(--color-primary-500); box-shadow: 0 0 0 2px rgba(122, 143, 90, 0.2); }
.filter-dropdown-footer { padding: 0.5rem 0.75rem; border-top: 1px solid var(--color-neutral-200); margin-top: 0.5rem; }
.filter-clear-all-btn { width: 100%; padding: 0.5rem 0.75rem; font-size: 0.875rem; font-weight: 500; color: var(--color-danger-600); background: var(--color-danger-50); border: 1px solid var(--color-danger-200); border-radius: 0.375rem; cursor: pointer; transition: all 0.15s ease; }
.filter-clear-all-btn:hover { background: var(--color-danger-100); border-color: var(--color-danger-300); }

.toolbar-stats { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: var(--color-neutral-500); }
.toolbar-stat { display: inline-flex; align-items: center; gap: 0.375rem; }
.toolbar-stat strong { color: var(--text-primary); font-weight: 600; }
.toolbar-stat-divider { color: var(--color-neutral-300); }
.selection-indicator { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.75rem; background: var(--color-primary-100); color: var(--color-primary-700); font-size: 0.875rem; font-weight: 600; border-radius: 1rem; margin-right: 0.75rem; }

.toolbar-actions-dropdown { position: relative; z-index: 100; }
.actions-dropdown-menu { position: absolute; top: calc(100% + 0.5rem); right: 0; min-width: 220px; background: var(--surface-raised); border: 1px solid var(--color-neutral-200); border-radius: 0.5rem; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); z-index: 100; padding: 0.5rem; }
.actions-dropdown-menu.hidden { display: none; }

/* === TRIPS TABLE === */
.trips-table-container { margin-top: 1rem; border: 1px solid var(--color-neutral-200); border-radius: 0.5rem; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
.trips-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.trips-table thead { background: var(--surface-muted); position: sticky; top: 0; z-index: 10; }
.trips-table-th { padding: 0.625rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 600; color: var(--color-neutral-500); text-transform: uppercase; letter-spacing: 0.025em; border-bottom: 1px solid var(--color-neutral-200); white-space: nowrap; }
.trips-table-th-checkbox { width: 40px; text-align: center; padding: 0.625rem 0.5rem; }
.trips-table-th-number { text-align: right; }
.trips-table-th-actions { width: 80px; text-align: center; }
.trips-table tbody tr { border-bottom: 1px solid var(--color-neutral-100); transition: background-color 0.15s ease; }
.trips-table tbody tr:hover { background: var(--surface-muted); }
.trips-table tbody tr.row-selected { background: var(--color-primary-50); }
.trips-table tbody tr.row-selected:hover { background: var(--color-primary-100); }
.trips-table tbody td { padding: 0.5rem 1rem; color: var(--text-primary); }
.trips-table tbody td .checkbox-cell { text-align: center; padding: 0.5rem; }

/* === FAB BUTTON === */
.fab-add-trip, #fabAddTrip, #fabAddAddress, #fabAddEmployee {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--btn-primary-bg);
  border: none;
  box-shadow: 0 4px 12px rgba(122, 143, 90, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--btn-primary-text);
  font-size: 1.5rem;
  align-items: center;
  justify-content: center;
}
.fab-add-trip:hover, #fabAddTrip:hover, #fabAddAddress:hover, #fabAddEmployee:hover { background: var(--btn-primary-bg-hover); transform: scale(1.1); box-shadow: 0 6px 16px rgba(122, 143, 90, 0.6); }

#tripFormContent { transition: max-height 0.3s ease-out, opacity 0.3s ease-out; overflow: hidden; }
#tripFormContent.collapsed { max-height: 0 !important; opacity: 0; pointer-events: none; }
#tripFormContainer.mobile-hidden { display: none; }

/* === API SERVICE CARDS === */
.api-service-card { transition: all 0.2s ease; }
.api-service-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.company-info-auto-save:focus, .api-key-auto-save:focus, .rate-auto-save:focus { outline: none; box-shadow: 0 0 0 3px rgba(122, 143, 90, 0.1); }
.auto-saved { animation: successFlash 0.8s ease; }
.service-favorite-toggle { background: transparent; border: none; cursor: pointer; padding: 0.25rem; transition: all 0.2s ease; color: var(--color-neutral-300); font-size: 1.25rem; }
.service-favorite-toggle:hover { color: var(--color-warning-400); transform: scale(1.15); }
.service-favorite-toggle.active { color: var(--color-warning-500); }
.service-favorite-toggle.active:hover { color: var(--color-warning-600); }
.api-service-toggle { cursor: pointer; transition: all 0.15s ease; }
.api-service-toggle:hover { transform: scale(1.05); }

/* === LICENSE EXPIRATION BAR === */
#licenseExpirationBar { height: 56px; }
body.expiration-bar-visible .main { padding-bottom: 56px; }

/* === ANIMATIONS === */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInFromLeft { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes dropdownSlide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-30px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes tooltipFadeIn { to { opacity: 1; } }
@keyframes successFlash { 0% { border-color: var(--color-success-500); box-shadow: 0 0 0 3px rgba(90, 138, 90, 0.2); } 100% { border-color: var(--border-default); box-shadow: none; } }

.export-pulse { animation: pulse 2s infinite; }
.success-flash { animation: successFlash 0.5s ease-in-out; }

/* === TOGGLE SWITCHES === */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-neutral-300);
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--color-primary-500);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 2px var(--input-ring);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* API Toggle variant (smaller) */
.api-toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.api-toggle-checkbox {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.api-toggle-slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background-color: var(--color-neutral-300);
  border-radius: 20px;
  transition: 0.3s;
}

.api-toggle-slider::before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.api-toggle-checkbox:checked + .api-toggle-slider {
  background-color: var(--color-primary-500);
}

.api-toggle-checkbox:checked + .api-toggle-slider::before {
  transform: translateX(16px);
}

.api-toggle-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* === VERTICAL SCROLLING FIX === */
.tab-content {
  overflow-y: auto;
  max-height: calc(100vh - 80px);
}

.main {
  overflow-y: auto;
}

/* === APP BAR (Page title header) === */
/* Hidden by default on desktop, shown on mobile */
.app-bar,
.mobile-app-bar {
  display: none; /* Hidden on desktop */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  z-index: 60;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}

.app-bar-title,
.mobile-app-bar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.app-bar-title i,
.mobile-app-bar-title i {
  color: var(--color-primary-500);
  font-size: 1.25rem;
}

/* Main content - no padding on desktop (no app bar) */
.main {
  padding-top: 0;
}

/* Hide tab titles - redundant with sidebar (desktop) or app bar (mobile) */
.tab-content > .max-w-4xl > h2:first-child,
.tab-content > .max-w-5xl > h2:first-child,
.tab-content > div > h2:first-of-type,
.tab-content > .space-y-6 > h2:first-child,
.tab-content h2.text-xl:first-of-type,
#tripsTab > div:first-of-type > h2 {
  display: none;
}

/* === TRIAL/DEMO STATUS BADGE (Sidebar - Compact) === */
.trial-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  margin: 0.25rem 0 0.75rem 0;
  background: var(--color-warning-100);
  border: 1px solid var(--color-warning-300);
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-warning-700);
}

.trial-status-badge:hover {
  background: var(--color-warning-200);
  border-color: var(--color-warning-400);
}

.trial-status-badge i {
  font-size: 0.75rem;
}

.trial-status-badge .trial-count {
  background: var(--color-warning-500);
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
}

[data-theme="dark"] .trial-status-badge {
  background: rgba(184, 149, 65, 0.2);
  border-color: var(--color-warning-600);
  color: var(--color-warning-300);
}

[data-theme="dark"] .trial-status-badge .trial-count {
  background: var(--color-warning-600);
}

/* === MEDIA QUERIES === */
@media (max-width: 1280px) {
  .map-panel { width: 45%; }
  #exportMonth { width: 130px; }
}

@media (max-width: 1024px) {
  .sidebar { box-shadow: 8px 0 24px rgba(0, 0, 0, 0.1); }
  #exportMonth { width: 120px; }
  .map-panel { position: fixed; right: 0; top: 0; width: 50%; min-width: 320px; box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15); z-index: 130; }
  .table-control-panel { flex-direction: column; gap: 1rem; }
  .control-panel-divider { width: 100%; height: 1px; background: linear-gradient(to right, transparent 0%, var(--color-neutral-200) 20%, var(--color-neutral-200) 80%, transparent 100%); }
  .section-stats, .section-actions { width: 100%; }
  .action-controls { width: 100%; justify-content: flex-end; }
  .stats-cards { justify-content: center; }
}

@media (max-width: 800px) {
  /* Mobile overlay when sidebar is open */
  #appLayout::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
  }
  #appLayout:not(.layout-collapsed)::before { opacity: 1; visibility: visible; pointer-events: auto; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 200; box-shadow: 8px 0 24px rgba(0, 0, 0, 0.06); }
  .layout-collapsed .sidebar { transform: translateX(-100%); width: var(--sidebar-w-expanded); }
  /* Show burger button on mobile */
  .sidebar-burger-btn,
  #sidebarToggle {
    display: flex;
  }

  /* Mobile: Sidebar is full width (expanded mode) */
  .sidebar {
    width: var(--sidebar-w-expanded);
    min-width: var(--sidebar-w-expanded);
    padding-top: 56px;
    gap: 0.25rem; /* Compact spacing on mobile */
  }

  /* Mobile: Show labels, section headers, and all elements */
  .sidebar .sidebar-section-header,
  .sidebar .sidebar-divider,
  .sidebar #sidebarCompanyInfo,
  .sidebar #sidebarTrialBadge {
    display: block;
  }

  .sidebar #sidebarTrialBadge.hidden {
    display: none;
  }

  /* Mobile: Tab buttons full width with labels */
  .sidebar .tab-btn {
    width: 100%;
    height: auto;
    padding: 0.5rem;
    justify-content: flex-start;
    margin: 0;
  }

  .sidebar .tab-btn .tab-label {
    display: inline;
  }

  .sidebar .tab-btn i {
    font-size: 1rem;
    margin-right: 0.5rem;
  }

  /* Mobile: Sidebar content compact padding */
  .sidebar .sidebar-content {
    padding: 0.5rem 1rem 1rem 1rem;
    align-items: stretch;
  }

  /* Mobile: No tooltips */
  .sidebar .tab-btn::after,
  .sidebar .tab-btn::before {
    display: none !important;
  }

  /* Mobile: Show app bar */
  .app-bar,
  .mobile-app-bar {
    display: flex;
  }

  /* Mobile: Main content needs padding for app bar */
  .main {
    padding-top: 56px;
  }

  /* Mobile: Trial badge should be clearly visible */
  #sidebarTrialBadge {
    margin-top: 0.5rem;
  }

  /* Mobile: Show FAB, hide inline add buttons */
  .fab-add-trip, #fabAddTrip, #fabAddAddress, #fabAddEmployee { display: flex !important; }
  #openTripFormBtn, #addAddressBtn { display: none !important; }

  #tripFormContainer { display: none !important; }
  #tripFormContainer.active { display: block !important; }
  #tripFormContent { max-height: 2000px; }
  .tab-content { padding: 0.75rem !important; }
  .table-control-panel { padding: 0.5rem !important; }
  #openSidebarBtn { left: 12px; top: 12px; width: 44px; height: 44px; font-size: 1.1rem; }
  .map-panel {
    position: fixed;
    top: 56px; /* Below app bar */
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    height: calc(100vh - 56px);
    z-index: 130;
  }
  .company-header { padding: 0.75rem; gap: 0.75rem; }
  .company-header-logo { width: 40px; height: 40px; }
  .company-header-name { font-size: 0.875rem; }
  .action-btn { width: 36px; height: 36px; }
  .action-btn[title]::after, .action-btn[title]::before { display: none; }
  .filter-group { min-width: 0; flex: 1 1 calc(50% - 0.25rem); }
  .action-controls { justify-content: center; gap: 0.75rem; }
  .stats-cards { width: 100%; justify-content: space-between; }
  .stat-card { flex: 1; min-width: 0; }
  .bulk-actions-bar { padding: 0.5rem; }
  .bulk-actions-content { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .bulk-selection-info { justify-content: center; }
  .bulk-actions-buttons { justify-content: center; }
  .bulk-action-btn span { display: none; }
  .bulk-action-btn { padding: 0.5rem; min-width: 40px; justify-content: center; }
  /* Toolbar mobile : 2 lignes - boutons puis stats */
  .trips-toolbar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.5rem; }
  .trips-toolbar-left, .trips-toolbar-right { flex: 0 0 auto; gap: 0.375rem; }
  .trips-toolbar-center { flex: 1 1 100%; order: 2; justify-content: center; padding-top: 0.5rem; border-top: 1px solid var(--color-neutral-200); margin-top: 0.25rem; }
  /* Boutons compacts (icônes seules) */
  .toolbar-btn { padding: 0.5rem; font-size: 0.75rem; }
  .toolbar-btn span { display: none; }
  .toolbar-btn i { font-size: 1rem; }
  .toolbar-btn .fa-chevron-down { display: none; }
  .toolbar-divider { height: 20px; }
  /* Stats horizontales compactes */
  .toolbar-stats { flex-direction: row; gap: 0.625rem; flex-wrap: nowrap; justify-content: center; }
  .toolbar-stat { font-size: 0.75rem; gap: 0.25rem; }
  .toolbar-stat i { font-size: 0.625rem; }
  .toolbar-stat-divider { display: inline; font-size: 0.5rem; color: var(--color-neutral-400); }
  /* Mobile: Trip form modal below app bar */
  .trip-form-modal {
    top: 56px;
    height: calc(100vh - 56px);
  }
  .trip-form-modal-overlay {
    top: 0;
  }
  .trip-form-modal-drawer {
    max-width: 100%;
    height: 100%;
  }
  .trips-table { font-size: 0.75rem; min-width: 800px; }
  .trips-table-th, .trips-table tbody td { padding: 0.5rem 0.625rem; }
  .api-service-card { padding: 1rem !important; }
}

@media (max-width: 640px) {
  #licenseExpirationBar { height: auto; min-height: 56px; }
  body.expiration-bar-visible .main { padding-bottom: 80px; }
}

@media (max-width: 600px) {
  .action-buttons { justify-content: flex-end; }
  .action-btn { width: 40px; height: 40px; font-size: 1rem; }
  .filter-controls { flex-direction: column; align-items: stretch; }
  .filter-group { width: 100%; max-width: none; }
  .filter-clear-btn { align-self: center; }
  .row-map-btn { width: 36px; height: 36px; }
  .stats-cards { flex-direction: column; }
  .stat-card { width: 100%; }
  #tripsTable thead th:first-child, #tripsTable tbody td:first-child, #tripsTable tfoot td:first-child { display: table-cell !important; position: sticky; left: 0; background: var(--surface-raised); z-index: 5; }
  #tripsTable thead { display: table-header-group !important; }
  #tripsTable thead th:first-child { background: var(--surface-muted); }
}

@media (hover: none) {
  .row-map-btn[title]::after, .row-map-btn[title]::before, .action-btn[title]::after, .action-btn[title]::before { display: none; }
}
