/* ============================================================
   FLEET FOR YOU — Design System
   Refined Electric Dark — Tesla / Apple / Startup
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overscroll-behavior: none;
}
body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100dvh;
  height: 100%;
  overflow-x: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Native Mobile Feel ---------- */
/* Supprime le flash bleu/gris au tap sur tous les éléments */
* { -webkit-tap-highlight-color: transparent; }

/* Empêche la sélection de texte sur les éléments interactifs */
button, .nav-btn, .nav-fab, .tab-pill, .seg-btn,
.vehicle-select-card, .bottom-nav, .fab-menu-item,
.contract-card, .settings-item, .cal-cell, .cal-event-item,
.list-item, .history-item, .vehicle-card-full, label {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Empêche le zoom sur focus d'input (iOS) */
input, select, textarea {
  font-size: max(16px, 1rem);
  font-family: inherit;
}

/* Scrolling momentum iOS */
.page-content, .modal-sheet, .filter-vehicles,
.tab-pills, .damage-list, .cal-grid {
  -webkit-overflow-scrolling: touch;
}

img { display: block; max-width: 100%; -webkit-user-drag: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary:      #060608;
  --bg-secondary:    #0D0D12;
  --bg-card:         #111116;
  --bg-elevated:     #1C1C22;
  --bg-input:        #111116;
  --bg-overlay:      rgba(0,0,0,0.82);
  --bg-glass:        rgba(255,255,255,0.04);
  --bg-glass-strong: rgba(255,255,255,0.07);

  --text-primary:    #FFFFFF;
  --text-secondary:  #8E8E93;
  --text-tertiary:   #636366;

  --accent:          #0A84FF;
  --accent-hover:    #0A7AE8;
  --accent-glow:     rgba(10,132,255,0.35);
  --accent-dim:      rgba(10,132,255,0.12);
  --success:         #30D158;
  --success-dim:     rgba(48,209,88,0.14);
  --warning:         #FF9F0A;
  --warning-dim:     rgba(255,159,10,0.14);
  --danger:          #FF453A;
  --danger-dim:      rgba(255,69,58,0.14);
  --purple:          #BF5AF2;
  --purple-dim:      rgba(191,90,242,0.14);
  --teal:            #5AC8FA;

  --border:          rgba(255,255,255,0.07);
  --border-strong:   rgba(255,255,255,0.14);
  --border-glow:     rgba(10,132,255,0.4);

  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 6px rgba(0,0,0,0.6);
  --shadow-md:  0 4px 24px rgba(0,0,0,0.7);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.8);
  --shadow-fab: 0 8px 32px rgba(10,132,255,0.5), 0 0 0 1px rgba(10,132,255,0.2);

  --nav-height: 76px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.4s cubic-bezier(0.4,0,0.2,1);
  --spring: 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

/* ---------- Page Layout ---------- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  animation: page-enter 0.28s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes page-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.page-content {
  flex: 1;
  padding: 16px 16px calc(var(--nav-height) + var(--safe-bottom) + 16px);
  overflow-y: auto;
}
.page-content.no-nav {
  padding-bottom: 24px;
}
.page-content.no-header {
  padding-top: 0;
}

/* ---------- Header ---------- */
.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6,6,8,0.88);
  border-bottom: 1px solid var(--border);
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: calc(var(--header-height) + var(--safe-top));
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
}
.page-header .header-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  flex: 1;
  text-align: center;
}
.page-header .header-left,
.page-header .header-right {
  width: 40px;
  display: flex;
  align-items: center;
}
.page-header .header-right { justify-content: flex-end; }

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-dim);
  transition: var(--transition);
}
.btn-icon:active { transform: scale(0.92); }
.btn-icon.ghost { background: transparent; color: var(--text-secondary); }

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10,10,14,0.94);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  padding-top: 10px;
  z-index: 200;
}
.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  padding: 4px 0;
  color: var(--text-tertiary);
  transition: var(--transition);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  position: relative;
}
.nav-btn svg { width: 22px; height: 22px; transition: var(--transition); }
.nav-btn.active { color: var(--accent); }
.nav-btn.active svg { filter: drop-shadow(0 0 6px rgba(10,132,255,0.6)); }
.nav-btn::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transition: var(--transition);
}
.nav-btn.active::after { opacity: 1; }
.nav-btn:active { transform: scale(0.88); }

/* FAB */
.nav-fab {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: linear-gradient(145deg, #2196FF 0%, #0055D4 100%);
  box-shadow: 0 0 0 1px rgba(10,132,255,0.25), 0 8px 32px rgba(10,132,255,0.5), 0 2px 8px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: var(--spring);
  margin-top: -20px;
  animation: fab-pulse 3s ease-in-out infinite;
}
.nav-fab.open {
  animation: none;
  background: linear-gradient(145deg, #444450, #2A2A34);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 8px 24px rgba(0,0,0,0.5);
}
.nav-fab:active { transform: scale(0.85) !important; animation: none; }
.nav-fab svg { width: 24px; height: 24px; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.nav-fab.open svg { transform: rotate(45deg); }
@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(10,132,255,0.25), 0 8px 32px rgba(10,132,255,0.5), 0 2px 8px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(10,132,255,0.15), 0 8px 40px rgba(10,132,255,0.65), 0 2px 8px rgba(0,0,0,0.4); }
}

/* ---------- Typography ---------- */
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg   { font-size: 17px; }
.text-xl   { font-size: 20px; }
.text-2xl  { font-size: 24px; }
.text-3xl  { font-size: 30px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.text-accent    { color: var(--accent); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }

.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  padding: 0 2px;
  margin-top: 24px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 1px 0 0 rgba(255,255,255,0.04) inset;
}
.card:active { transform: scale(0.985); opacity: 0.92; }
.card-body { padding: 16px; }
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}
.card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-glass);
}

/* ---------- Stat Cards ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.stat-card .stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.stat-card .stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-icon.blue   { background: var(--accent-dim);   color: var(--accent); }
.stat-icon.green  { background: var(--success-dim);  color: var(--success); }
.stat-icon.orange { background: var(--warning-dim);  color: var(--warning); }
.stat-icon.red    { background: var(--danger-dim);   color: var(--danger); }
.stat-icon.purple { background: var(--purple-dim);   color: var(--purple); }

/* ---------- Vehicle Cards ---------- */
.vehicle-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.vehicle-card:active { transform: scale(0.98); background: var(--bg-elevated); }
.vehicle-color-dot {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}
.vehicle-thumb {
  width: 56px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}
.vehicle-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vehicle-info { flex: 1; min-width: 0; }
.vehicle-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vehicle-plate {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.vehicle-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ---------- Badges / Tags ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-blue    { background: var(--accent-dim);   color: var(--accent); }
.badge-green   { background: var(--success-dim);  color: var(--success); }
.badge-orange  { background: var(--warning-dim);  color: var(--warning); }
.badge-red     { background: var(--danger-dim);   color: var(--danger); }
.badge-purple  { background: var(--purple-dim);   color: var(--purple); }
.badge-gray    { background: var(--bg-elevated);  color: var(--text-secondary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 24px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.1px;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.95); }
.btn-full { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #1A8FFF 0%, #0055D4 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(10,132,255,0.35), 0 0 0 1px rgba(10,132,255,0.2);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(10,132,255,0.5), 0 0 0 1px rgba(10,132,255,0.3); }
.btn-primary:active { box-shadow: 0 2px 10px rgba(10,132,255,0.3); }
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-danger {
  background: rgba(255,69,58,0.12);
  color: var(--danger);
  border: 1px solid rgba(255,69,58,0.2);
}
.btn-ghost {
  background: transparent;
  color: var(--accent);
}
.btn-sm {
  padding: 9px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ---------- Forms ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}
.form-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  padding: 0 2px;
}
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  padding: 14px 15px;
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--accent);
  background: rgba(10,132,255,0.06);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.15);
}
.form-control::placeholder { color: var(--text-tertiary); }
.form-control.error { border-color: var(--danger); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select.form-control option { background: var(--bg-card); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 0 2px;
}
.form-error {
  font-size: 12px;
  color: var(--danger);
  padding: 0 2px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.input-prefix {
  position: relative;
}
.input-prefix .prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 15px;
  pointer-events: none;
}
.input-prefix .form-control { padding-left: 28px; }

/* ---------- Signature Canvas ---------- */
.sig-canvas {
  width: 100%; height: 160px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-strong);
  cursor: crosshair; touch-action: none;
  background: var(--bg-card); display: block;
}
.sig-preview {
  width: 100%; height: 60px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card); display: block; margin-top: 8px;
}

/* ---------- Upload Zone ---------- */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.upload-zone:active, .upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone .upload-icon {
  width: 48px; height: 48px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.upload-zone.has-image { border-style: solid; border-color: var(--border); padding: 0; }
.upload-zone.has-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.upload-zone-sm {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  background: var(--bg-input);
}
.upload-zone-sm input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-zone-sm .upload-thumb {
  width: 40px; height: 40px;
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.upload-zone-sm .upload-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Color Picker ---------- */
.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.color-swatch:active { transform: scale(0.9); }
.color-swatch.selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}
.color-hex-input {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.color-preview {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  border: 2px solid var(--border-strong);
}

/* ---------- Fuel Selector ---------- */
.fuel-selector {
  display: flex;
  gap: 6px;
}
.fuel-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.fuel-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Step Indicator ---------- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 16px 16px;
}
.step-item {
  display: flex;
  align-items: center;
  flex: 1;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: var(--transition);
}
.step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.step-dot.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border-strong);
  transition: var(--transition);
}
.step-line.done { background: var(--success); }

/* ---------- Damage Schema ---------- */
.damage-schema-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  padding: 12px;
  overflow: hidden;
}
.damage-schema-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.damage-tool-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.damage-tool-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.damage-schema-svg {
  width: 100%;
  aspect-ratio: 1 / 1.8;
  cursor: crosshair;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  touch-action: none;
  max-height: 340px;
}
.damage-schema-svg svg { width: 100%; height: 100%; }
.damage-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--spring);
  animation: marker-pop 0.3s var(--spring) both;
}
.damage-marker.scratch  { background: var(--danger-dim); color: var(--danger); }
.damage-marker.dent     { background: var(--warning-dim); color: var(--warning); }
.damage-marker.crack    { background: var(--purple-dim); color: var(--purple); }
.damage-marker.other    { background: var(--bg-elevated); color: var(--text-secondary); }
@keyframes marker-pop {
  from { transform: translate(-50%,-50%) scale(0); opacity: 0; }
  to   { transform: translate(-50%,-50%) scale(1); opacity: 1; }
}
.damage-legend {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}
.legend-dot {
  width: 14px; height: 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
}

/* ---------- Calendar ---------- */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
}
.cal-month-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.cal-nav-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.cal-nav-btn:active { transform: scale(0.9); }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  gap: 2px;
}
.cal-cell:active { background: var(--bg-elevated); }
.cal-cell.today .cal-day-num {
  background: var(--accent);
  color: #fff;
}
.cal-cell.other-month .cal-day-num { color: var(--text-tertiary); }
.cal-cell.selected { background: var(--accent-dim); }
.cal-day-num {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
}
.cal-dots {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
}
.cal-dot {
  width: 5px; height: 5px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.cal-event-list {
  margin-top: 16px;
}
.cal-event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.cal-event-item:active { transform: scale(0.98); }
.cal-event-color {
  width: 4px;
  height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---------- List Items ---------- */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: var(--bg-elevated); }
.list-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-content { flex: 1; min-width: 0; }
.list-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.list-meta {
  text-align: right;
  flex-shrink: 0;
}
.list-amount {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- Tab Pills ---------- */
.tab-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.tab-pills::-webkit-scrollbar { display: none; }
.tab-pill {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}
.tab-pill.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.tab-pill:active { transform: scale(0.95); }

/* ---------- Segmented Control ---------- */
.segmented {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}
.seg-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.seg-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- FAB Menu (modal overlay) ---------- */
.fab-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.4,0,0.2,1);
}
.fab-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.fab-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.fab-menu {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - var(--nav-height) - var(--safe-bottom) - 110px);
  overflow-y: auto;
  padding: 10px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transform: translateY(28px);
  transition: transform 0.38s cubic-bezier(0.34,1.2,0.64,1);
  scrollbar-width: none;
}
.fab-menu::-webkit-scrollbar { display: none; }
.fab-overlay.open .fab-menu { transform: translateY(0); }
.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  background: rgba(20,20,28,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  animation: fab-item-in 0.4s cubic-bezier(0.34,1.4,0.64,1) both;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  opacity: 0;
}
.fab-menu-item:active {
  transform: scale(0.965);
  background: rgba(255,255,255,0.05);
}
.fab-menu-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
}
.fab-menu-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.fab-menu-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 0px;
  font-weight: 400;
  display: none;
}
@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes fab-item-in {
  from { transform: translateY(16px) scale(0.95); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.fab-menu-item:nth-child(1) { animation-delay: 0.02s; }
.fab-menu-item:nth-child(2) { animation-delay: 0.06s; }
.fab-menu-item:nth-child(3) { animation-delay: 0.10s; }
.fab-menu-item:nth-child(4) { animation-delay: 0.14s; }
.fab-menu-item:nth-child(5) { animation-delay: 0.18s; }
.fab-menu-item:nth-child(6) { animation-delay: 0.22s; }
.fab-menu-item:nth-child(7) { animation-delay: 0.26s; }
.fab-close-btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 32px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.1px;
  cursor: pointer;
  margin: 10px auto 0;
  pointer-events: auto;
  flex-shrink: 0;
  transition: var(--spring);
  animation: fab-item-in 0.3s 0.04s both;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.fab-close-btn::after { content: 'Fermer'; }
.fab-close-btn:active {
  transform: scale(0.93);
  background: var(--bg-card);
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.modal-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid var(--border-strong);
  padding: 8px 20px calc(var(--safe-bottom) + 24px);
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32,0.72,0,1);
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 -24px 80px rgba(0,0,0,0.6);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-handle {
  width: 40px; height: 4px;
  border-radius: 2px;
  background: var(--border-strong);
  margin: 12px auto 24px;
}
.modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 20px;
}

/* ---------- Progress / Profitability ---------- */
.progress-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}
.profitability-ring {
  position: relative;
  width: 80px; height: 80px;
}
.profitability-ring svg { width: 80px; height: 80px; transform: rotate(-90deg); }
.profitability-ring .ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
}
.toast.hiding { animation: toast-out 0.3s forwards; }
.toast-success { background: rgba(48,209,88,0.18); color: var(--success); border: 1px solid rgba(48,209,88,0.3); }
.toast-error   { background: rgba(255,69,58,0.18);  color: var(--danger);  border: 1px solid rgba(255,69,58,0.3); }
.toast-info    { background: rgba(10,132,255,0.18); color: var(--accent);  border: 1px solid rgba(10,132,255,0.3); }
@keyframes toast-in  { from { transform: translateY(-12px); opacity: 0; } }
@keyframes toast-out { to   { transform: translateY(-12px); opacity: 0; } }

/* ---------- Loading ---------- */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 999;
}
.loading-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.4) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: logo-breathe 2s ease-in-out infinite;
  position: relative;
}
.loading-logo::after {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(10,132,255,0.2) 0%, transparent 70%);
  animation: logo-breathe 2s ease-in-out infinite;
  pointer-events: none;
}
.loading-bar {
  width: 48px;
  height: 2px;
  background: var(--bg-elevated);
  border-radius: 1px;
  overflow: hidden;
}
.loading-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 40%;
  background: var(--accent);
  border-radius: 1px;
  animation: loading-slide 1.2s ease-in-out infinite;
}
@keyframes loading-slide {
  0%   { transform: translateX(-200%); }
  100% { transform: translateX(400%); }
}
@keyframes logo-breathe {
  0%,100% { opacity: 0.7; }
  50%     { opacity: 1; }
}
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.3; } }
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  gap: 12px;
}
.empty-icon {
  font-size: 48px;
  opacity: 0.3;
}
.empty-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.empty-sub {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 260px;
}

/* ---------- Divider ---------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}
.section-gap { margin-bottom: 24px; }

/* ---------- Auth / Landing ---------- */
.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(10,132,255,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(191,90,242,0.06) 0%, transparent 50%);
}
.auth-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 32px 32px;
  text-align: center;
  gap: 16px;
}
.auth-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 46px;
  font-weight: 900;
  letter-spacing: -2px;
  background: linear-gradient(145deg, #ffffff 0%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}
:root[data-theme="light"] .auth-logo {
  background: linear-gradient(145deg, #1A1A1E 0%, #3A3A44 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.auth-tagline {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
}
.auth-features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  margin-top: 8px;
}
.auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-feature-dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
  background: var(--accent);
  flex-shrink: 0;
}
.auth-panel {
  background: rgba(17,17,22,0.96);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 24px 24px calc(var(--safe-bottom) + 32px);
  backdrop-filter: blur(32px);
}
:root[data-theme="light"] .auth-panel {
  background: rgba(255,255,255,0.98);
  border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.10);
}
.auth-tabs {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  padding: 9px;
  border-radius: calc(var(--radius-sm) - 2px);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- Profile Avatar ---------- */
.avatar {
  width: 64px; height: 64px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 80px; height: 80px; font-size: 32px; }

/* ---------- Contract Card ---------- */
.contract-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.contract-card:active { transform: scale(0.98); }
.contract-card-header {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.contract-vehicle-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  margin-right: 8px;
  flex-shrink: 0;
}
.contract-card-body {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.contract-card-field { font-size: 12px; color: var(--text-secondary); }
.contract-card-value { font-size: 13px; font-weight: 500; margin-top: 2px; }

/* desktop-only: hidden on mobile, visible in sidebar */
.desktop-only { display: none !important; }

/* ===== Light Theme ===== */
:root[data-theme="light"] {
  --bg-primary:      #FFFFFF;
  --bg-secondary:    #F2F2F7;
  --bg-card:         #FFFFFF;
  --bg-elevated:     #E8E8ED;
  --bg-input:        #F8F8FB;
  --bg-overlay:      rgba(0,0,0,0.45);
  --bg-glass:        rgba(0,0,0,0.03);
  --bg-glass-strong: rgba(0,0,0,0.06);

  --text-primary:    #1A1A1E;
  --text-secondary:  #6A6A72;
  --text-tertiary:   #A0A0A8;

  --border:          rgba(0,0,0,0.09);
  --border-strong:   rgba(0,0,0,0.16);
  --border-glow:     rgba(10,132,255,0.35);

  --shadow-sm:  0 1px 6px rgba(0,0,0,0.10);
  --shadow-md:  0 4px 24px rgba(0,0,0,0.14);
  --shadow-lg:  0 12px 48px rgba(0,0,0,0.18);
  --shadow-fab: 0 8px 32px rgba(10,132,255,0.28), 0 0 0 1px rgba(10,132,255,0.15);
}
:root[data-theme="light"] body { background: var(--bg-secondary); }
:root[data-theme="light"] .loading-screen { background: #FFFFFF; }
:root[data-theme="light"] .loading-logo  {
  background: linear-gradient(135deg, #1A1A1E 0%, #3A3A44 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
:root[data-theme="light"] .loading-bar::after { background: linear-gradient(90deg,transparent,#0A84FF,transparent); }
:root[data-theme="light"] .page-header { background: rgba(255,255,255,0.92); }
:root[data-theme="light"] .bottom-nav  { background: rgba(255,255,255,0.96); border-top: 1px solid rgba(0,0,0,0.08); }
:root[data-theme="light"] .revenue-card { background: linear-gradient(135deg,#0A84FF 0%,#0055D4 100%); }
:root[data-theme="light"] .nav-btn.active { color: var(--accent); }
:root[data-theme="light"] .nav-btn.active svg { filter: none; }
:root[data-theme="light"] .fab-menu-item {
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 2px 16px rgba(0,0,0,0.10);
}
:root[data-theme="light"] .fab-menu-item:active { background: rgba(0,0,0,0.04); }
:root[data-theme="light"] .fab-close-btn { box-shadow: 0 2px 16px rgba(0,0,0,0.10); }
:root[data-theme="light"] .form-control:focus { background: rgba(10,132,255,0.05); }
:root[data-theme="light"] .form-control.error { background: rgba(255,69,58,0.05); }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); }
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.28); }

/* ===== Light Theme — Enhanced Components ===== */
:root[data-theme="light"] .card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
}
:root[data-theme="light"] .stat-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
}
:root[data-theme="light"] .stat-card::before {
  background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, transparent 60%);
}
:root[data-theme="light"] .vehicle-card {
  box-shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
}
:root[data-theme="light"] .form-control {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.18);
}
:root[data-theme="light"] .form-control:focus {
  border-color: var(--accent) !important;
  background: #FFFFFF !important;
  box-shadow: 0 0 0 3px rgba(10,132,255,0.10);
}
:root[data-theme="light"] select.form-control option { background: #FFFFFF; color: #1A1A1E; }
:root[data-theme="light"] .btn-secondary {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
  border: 1px solid rgba(0,0,0,0.14);
}
:root[data-theme="light"] .btn-secondary:hover,
:root[data-theme="light"] .btn-secondary:active { background: rgba(0,0,0,0.10); }
:root[data-theme="light"] .badge-green  { background: rgba(5,150,105,0.10);  color: #059669; }
:root[data-theme="light"] .badge-blue   { background: rgba(10,132,255,0.10); color: #0060CC; }
:root[data-theme="light"] .badge-orange { background: rgba(160,90,0,0.10);   color: #955200; }
:root[data-theme="light"] .badge-red    { background: rgba(220,38,38,0.10);  color: #C82020; }
:root[data-theme="light"] .badge-purple { background: rgba(124,58,237,0.10); color: #6D28D9; }
:root[data-theme="light"] .badge-gray   { background: rgba(0,0,0,0.07);      color: #4B5563; }
:root[data-theme="light"] .modal-sheet  { background: #FFFFFF; box-shadow: 0 -4px 32px rgba(0,0,0,0.12); }
:root[data-theme="light"] .modal-backdrop { background: rgba(0,0,0,0.38); }
:root[data-theme="light"] .modal-title { color: #111827; }
:root[data-theme="light"] .revenue-card { box-shadow: 0 4px 20px rgba(10,132,255,0.20); }
:root[data-theme="light"] .tab-pill { border-color: rgba(0,0,0,0.14); background: rgba(0,0,0,0.05); color: var(--text-secondary); }
:root[data-theme="light"] .tab-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
:root[data-theme="light"] .seg-btn { color: var(--text-secondary); }
:root[data-theme="light"] .seg-btn.active { background: #FFFFFF; color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.10); }
:root[data-theme="light"] .page-header { background: rgba(255,255,255,0.96); border-bottom-color: rgba(0,0,0,0.09); }
:root[data-theme="light"] .card-header { background: rgba(0,0,0,0.02); }
:root[data-theme="light"] .card-footer { background: rgba(0,0,0,0.02); }
:root[data-theme="light"] .history-item { border-bottom-color: rgba(0,0,0,0.06); }
:root[data-theme="light"] .list-item { border-bottom-color: rgba(0,0,0,0.06); }
:root[data-theme="light"] .contract-mini { border-bottom-color: rgba(0,0,0,0.06); }
:root[data-theme="light"] .contract-mini:hover { background: rgba(0,0,0,0.025); }
:root[data-theme="light"] .settings-item { border-bottom-color: rgba(0,0,0,0.06); }
:root[data-theme="light"] .empty-state .empty-title { color: #374151; }
:root[data-theme="light"] .damage-zone { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.10); }
:root[data-theme="light"] .doc-item { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.10); }
:root[data-theme="light"] .doc-item-label { color: #374151; }
:root[data-theme="light"] .form-hint { color: #6B7280; }
:root[data-theme="light"] .form-label { color: #374151; font-weight: 600; }
:root[data-theme="light"] .section-title { color: #8B95A1; }

/* ---------- Responsive Desktop ---------- */
@media (min-width: 480px) {
  .page { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .bottom-nav { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .page { max-width: 600px; }
  .bottom-nav { max-width: 600px; }
}

/* ===== DESKTOP SAAS LAYOUT (960px+) ===== */
@media (min-width: 960px) {
  :root { --nav-height: 64px; }

  body {
    background: var(--bg-secondary);
    min-height: 100dvh;
  }

  /* ── Full-width flex shell ── */
  .page {
    max-width: 100%;
    width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border: none;
    animation: none;
    opacity: 1;
    background: transparent;
    margin: 0;
  }

  /* ── Top header — full width ── */
  .page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: rgba(6,6,8,0.95);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    height: 60px;
    min-height: 60px;
    padding: 0 40px;
    width: 100%;
  }

  /* Left-align title on desktop for SaaS feel */
  .page-header .header-title {
    text-align: left !important;
    font-size: 16px !important;
    font-weight: 700 !important;
  }

  /* ── Content — flex child, pads for footer bar ── */
  .page-content {
    flex: 1;
    padding: 32px 40px calc(var(--nav-height) + var(--safe-bottom) + 32px);
    background: var(--bg-secondary);
    border-left: none;
  }

  /* ── Footer navigation bar (fixed bottom) ── */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: var(--nav-height);
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding: 0 20px 0 12px;
    gap: 2px;
    border: none;
    border-top: 1px solid var(--border);
    transform: none;
    background: var(--bg-primary);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    overflow: visible;
    z-index: 200;
    padding-bottom: var(--safe-bottom);
  }

  /* Brand — pinned left via margin-right auto */
  .bottom-nav::before {
    content: 'Fleet For You';
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--text-primary);
    padding: 0 16px 0 4px;
    margin-right: auto;
    border-bottom: none;
    margin-bottom: 0;
    order: -3;
  }

  .bottom-nav::after { content: none; }

  /* FAB → compact pill button, rightmost in footer */
  .nav-fab {
    order: 10;
    width: auto;
    height: 38px;
    padding: 0 16px 0 12px;
    margin: 0 0 0 8px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: var(--accent);
    animation: none;
    box-shadow: 0 2px 12px rgba(10,132,255,0.35);
    margin-top: 0;
  }
  .nav-fab:hover { background: var(--accent-hover); transform: none; box-shadow: 0 4px 20px rgba(10,132,255,0.5); }
  .nav-fab.open { background: var(--bg-elevated); box-shadow: none; animation: none; }
  .nav-fab svg { width: 16px; height: 16px; }

  /* Nav items → horizontal footer tabs */
  .nav-btn:first-of-type { margin-top: 0; }

  .nav-btn {
    flex-direction: row;
    justify-content: center;
    gap: 7px;
    flex: 0;
    width: auto;
    margin: 0 1px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-secondary);
    transition: var(--spring);
    min-height: 42px;
  }
  .nav-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
  .nav-btn.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
  .nav-btn.active svg { filter: none; opacity: 1; }
  .nav-btn::after { display: none; }
  .nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.65; }
  .nav-btn.active svg { opacity: 1; }

  /* ── Pages without nav (forms, detail pages) ── */
  .page:not(:has(.bottom-nav)) {
    max-width: 880px;
    margin: 0 auto;
  }
  .page:not(:has(.bottom-nav)) .page-header,
  .page:not(:has(.bottom-nav)) .page-content {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
  .page:not(:has(.bottom-nav)) .page-content {
    padding: 32px 40px 60px;
    background: var(--bg-primary);
  }

  .page-content.no-nav { padding-bottom: 60px; }

  /* ── Avatar visible in header ── */
  .page-header .header-left .avatar-sm { display: flex; }

  /* ── Content layout grids ── */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
  .doc-upload-grid { grid-template-columns: repeat(3, 1fr); }

  /* Revenue card desktop */
  .revenue-card { padding: 28px 32px; border-radius: var(--radius-lg); }
  .revenue-amount { font-size: 44px; }

  /* Dashboard two-column layout */
  .dashboard-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  /* Contract cards on desktop — elevated hover */
  .card { background: var(--bg-card); }
  .card:hover { border-color: var(--border-strong); }
  .contract-mini:hover { background: var(--bg-elevated); }
  .settings-item:hover { background: var(--bg-elevated); }
  .cal-event-item:hover { background: var(--bg-elevated); }
  .vehicle-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

  /* Contract card wider layout */
  .contract-card-body { grid-template-columns: repeat(4, 1fr); }

  /* Better search panel */
  .search-panel { max-width: 680px !important; }

  /* Form layout */
  .form-section { max-width: 720px; }
  .form-row { grid-template-columns: 1fr 1fr; }

  /* Show desktop-only sidebar items */
  .desktop-only { display: flex !important; }

  /* Sidebar scrollbar */
  .bottom-nav::-webkit-scrollbar { width: 4px; }
  .bottom-nav::-webkit-scrollbar-track { background: transparent; }
  .bottom-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

  /* Stat cards bigger on desktop */
  .stat-card .stat-value { font-size: 30px; }
  .stat-card { padding: 20px; }

  /* Section title larger gap on desktop */
  .section-title { margin-top: 28px; }

  /* ── FAB overlay → dropdown above footer, opens upward ── */
  .fab-overlay {
    position: fixed;
    inset: auto;
    bottom: calc(var(--nav-height) + 8px);
    right: 12px;
    top: auto;
    left: auto;
    width: 260px;
    height: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 -8px 40px rgba(0,0,0,0.45), 0 4px 16px rgba(0,0,0,0.25);
    padding: 6px 0;
    overflow-y: auto;
    max-height: calc(100dvh - var(--nav-height) - 80px);
    opacity: 0;
    transform: scale(0.96) translateY(8px);
    transform-origin: bottom right;
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    z-index: 500;
  }
  .fab-overlay.open { opacity: 1; transform: scale(1) translateY(0); pointer-events: all; }
  .fab-backdrop { display: none !important; }
  .fab-close-btn { display: none !important; }
  .fab-menu { position: static; transform: none !important; width: 100%; padding: 0; overflow: visible; }
  .fab-menu-item {
    padding: 9px 12px; margin: 1px 6px; border-radius: var(--radius-sm);
    box-shadow: none !important; opacity: 1 !important; animation: none !important; transition: background 0.12s;
  }
  .fab-menu-item:hover { background: var(--bg-elevated) !important; }
  .fab-menu-icon { width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
  .fab-menu-label { font-size: 13px; }
  .fab-menu-sub { font-size: 11px; }

  /* ── Sidebar toggle — hidden (footer bar mode) ── */
  .sidebar-toggle-btn { display: none !important; }

  /* ── Light theme desktop footer bar ── */
  :root[data-theme="light"] body { background: #ECEEF2; }
  :root[data-theme="light"] .page-content { background: #ECEEF2; }
  :root[data-theme="light"] .page-header {
    background: rgba(255,255,255,0.98) !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
  }
  :root[data-theme="light"] .bottom-nav {
    background: rgba(255,255,255,0.97) !important;
    border-top: 1px solid rgba(0,0,0,0.08) !important;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.07) !important;
    border-right: none !important;
  }
  :root[data-theme="light"] .bottom-nav::before { color: #111827; }
  :root[data-theme="light"] .nav-btn { color: #5A636D; }
  :root[data-theme="light"] .nav-btn:hover { background: rgba(0,0,0,0.04) !important; color: #111827; }
  :root[data-theme="light"] .nav-btn.active { background: rgba(10,132,255,0.09) !important; color: var(--accent); }
  :root[data-theme="light"] .nav-fab { box-shadow: 0 2px 12px rgba(10,132,255,0.25), 0 1px 4px rgba(10,132,255,0.15); }
  :root[data-theme="light"] .nav-fab.open { background: rgba(0,0,0,0.06); box-shadow: none; }
  :root[data-theme="light"] .card { box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04); }
  :root[data-theme="light"] .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); }
  :root[data-theme="light"] .stat-card { box-shadow: 0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04); }
  :root[data-theme="light"] .vehicle-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.10) !important; }
  :root[data-theme="light"] .fab-overlay {
    background: #FFFFFF;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.09);
  }
  :root[data-theme="light"] .fab-menu-item:hover { background: rgba(0,0,0,0.04) !important; }
  :root[data-theme="light"] .page:not(:has(.bottom-nav)) .page-content { background: #FFFFFF; }
  :root[data-theme="light"] .contract-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); }
  :root[data-theme="light"] .settings-item:hover { background: rgba(0,0,0,0.025) !important; }
  :root[data-theme="light"] .cal-cell:hover { background: rgba(10,132,255,0.05); }
  :root[data-theme="light"] .cal-event-item:hover { background: rgba(0,0,0,0.025) !important; }
}

/* Doc thumb — input overlay mobile fix */
.doc-thumb {
  position: relative !important;
  overflow: hidden;
}

/* ===== Cropper Modal ===== */
.cropper-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px;
}
.cropper-container {
  width: 100%; max-width: 500px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 90dvh;
}
.cropper-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 700;
}
.cropper-canvas-wrap {
  flex: 1; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #000; min-height: 260px;
  position: relative;
}
.cropper-canvas-wrap canvas {
  max-width: 100%; max-height: 360px;
  display: block;
}
.cropper-actions {
  padding: 16px 20px;
  display: flex; gap: 10px;
}
.cropper-hint {
  font-size: 12px; color: var(--text-tertiary);
  text-align: center; padding: 6px 20px 0;
}

/* ===== Avatar Picker ===== */
.avatar-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  padding: 8px 0;
}
.avatar-option {
  width: 52px; height: 52px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; cursor: pointer;
  border: 2.5px solid transparent;
  transition: var(--spring);
  background: var(--bg-elevated);
}
.avatar-option:active { transform: scale(0.9); }
.avatar-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.client-avatar-display {
  width: 60px; height: 60px;
  border-radius: var(--radius-full);
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer;
  border: 2px solid var(--border-strong);
  transition: var(--transition);
  flex-shrink: 0;
}
.client-avatar-display:active { transform: scale(0.95); }

/* ===== Deposit Forfeit Modal ===== */
.deposit-modal .modal-sheet { max-height: 85dvh; overflow-y: auto; }
.deposit-amount-input {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  color: var(--text-primary);
  width: 100%;
  padding: 8px 0;
  outline: none;
  font-family: inherit;
  letter-spacing: -1px;
}
.appt-suggestion {
  background: var(--warning-dim);
  border: 1px solid rgba(255,159,10,0.3);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}
.appt-suggestion:active { transform: scale(0.98); }
.appt-suggestion-icon { font-size: 24px; flex-shrink: 0; }
.appt-suggestion-text { flex: 1; }
.appt-suggestion-title { font-size: 14px; font-weight: 600; }
.appt-suggestion-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Scrollbar (desktop) ---------- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
