/* Force thème clair */
:root { color-scheme: light; }
/* ============================================================
   BERTOSIO LV — PWA Chauffeurs
   Design : industriel, lisible, grand texte pour terrain
   ============================================================ */

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

/* ============================================================
   THÈME CLAIR (défaut)
   ============================================================ */
:root {
  --bg:          #f0f2f5;
  --surface:     #ffffff;
  --surface2:    #f7f8fa;
  --border:      #d1d5db;
  --text:        #111827;
  --text-soft:   #374151;
  --text-light:  #6b7280;

  --primary:     #1d4ed8;
  --primary-dk:  #1e3a8a;
  --primary-lt:  #dbeafe;
  --primary-txt: #1e3a8a;

  --success:     #15803d;
  --success-lt:  #dcfce7;
  --success-txt: #14532d;
  --warning:     #b45309;
  --warning-lt:  #fef3c7;
  --danger:      #b91c1c;
  --danger-lt:   #fee2e2;
  --danger-txt:  #7f1d1d;
  --orange:      #c2410c;
  --orange-lt:   #ffedd5;
  --orange-txt:  #7c2d12;

  --statut-afaire:  #1d4ed8;
  --statut-encours: #c2410c;
  --statut-termine: #15803d;
  --statut-autre:   #a16207;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow:    0 2px 10px rgba(0,0,0,.10);
  --shadow-lg: 0 6px 24px rgba(0,0,0,.14);

  --header-h: 64px;
  --font:      'Barlow', sans-serif;
  --font-cond: 'Barlow Condensed', sans-serif;

  /* Tailles de texte — volontairement grandes pour terrain */
  --fs-base:  17px;
  --fs-sm:    15px;
  --fs-xs:    13px;
  --fs-lg:    19px;
  --fs-xl:    22px;
  --fs-xxl:   28px;
}

/* ============================================================
   THÈME SOMBRE — Fort contraste, texte blanc pur sur fond très sombre
   ============================================================ */
/* dark mode désactivé */

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: var(--fs-base); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
button { cursor: pointer; font-family: var(--font); border: none; outline: none; }
input  { font-family: var(--font); outline: none; border: none; }
textarea { font-family: var(--font); }

.hidden { display: none !important; }
.w-full { width: 100%; }

/* ============================================================
   ROUTER
   ============================================================ */
.screen {
  display: none;
  min-height: 100dvh;
  flex-direction: column;
  animation: fadeIn .2s ease;
}
.screen.active { display: flex; }

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

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  background: var(--primary);
  color: #fff;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  flex-shrink: 0;
}
.app-header .btn-back {
  background: rgba(255,255,255,.2);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: none;
}
.app-header .btn-back:active { background: rgba(255,255,255,.35); }
.app-header .header-title {
  font-family: var(--font-cond);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: .3px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header .header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.app-header .btn-icon {
  background: rgba(255,255,255,.2);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  border: none;
}
.app-header .btn-icon:active { background: rgba(255,255,255,.35); }

/* ============================================================
   BOUTONS COMMUNS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 700;
  transition: all .15s;
  min-height: 54px;
  border: none;
  letter-spacing: .2px;
}
.btn:active { transform: scale(.97); opacity: .9; }

.btn-primary { background: var(--primary); color: #fff; flex: 1; }
.btn-primary:active { background: var(--primary-dk); }

.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:active { filter: brightness(.85); }

.btn-success { background: var(--success); color: #fff; flex: 1; }
.btn-success:active { filter: brightness(.85); }

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-ghost:active { background: var(--border); }

.btn-lg {
  padding: 17px 24px;
  font-size: var(--fs-lg);
  min-height: 60px;
  border-radius: var(--radius-lg);
}
.btn-sm {
  padding: 10px 14px;
  font-size: var(--fs-sm);
  min-height: 44px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   ÉCRAN 1 — LOGIN
   ============================================================ */
#screen-login {
  background: var(--primary-dk);
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  gap: 28px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.logo-circle {
  width: 96px; height: 96px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.3);
}
.logo-circle svg { width: 58px; height: 58px; fill: #fff; }
.logo-name {
  font-family: var(--font-cond);
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.logo-sub {
  font-size: var(--fs-xs);
  color: rgba(255,255,255,.65);
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.pin-container {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  width: 100%;
  max-width: 340px;
}

.pin-label {
  text-align: center;
  color: rgba(255,255,255,.8);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .5px;
  margin-bottom: 18px;
}

.pin-display {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
  height: 22px;
  align-items: center;
}
.pin-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 2px solid rgba(255,255,255,.5);
  transition: all .15s;
}
.pin-dot.filled {
  background: #fff;
  border-color: #fff;
  transform: scale(1.15);
}

.pin-error {
  text-align: center;
  color: #fca5a5;
  font-size: var(--fs-sm);
  font-weight: 700;
  min-height: 22px;
  margin-bottom: 10px;
  animation: shake .3s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-7px); }
  75%      { transform: translateX(7px); }
}

.pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pin-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-cond);
  padding: 16px;
  border-radius: var(--radius-sm);
  transition: all .12s;
  min-height: 62px;
}
.pin-btn:active { background: rgba(255,255,255,.3); transform: scale(.95); }
.pin-btn.delete {
  background: rgba(185,28,28,.3);
  border-color: rgba(185,28,28,.5);
  font-size: 20px;
}
.pin-btn.delete:active { background: rgba(185,28,28,.5); }

/* ============================================================
   ÉCRAN 2 — SIGNATURE INITIALE
   ============================================================ */
#screen-signature-init { background: var(--bg); }

.sig-init-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 18px 16px;
  gap: 14px;
  overflow-y: auto;
}

.sig-init-info {
  background: var(--primary-lt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.sig-init-info .info-icon { font-size: 22px; flex-shrink: 0; }
.sig-init-info p {
  font-size: var(--fs-sm);
  color: var(--primary-txt);
  line-height: 1.5;
}

.sig-canvas-wrap {
  flex: 1;
  min-height: 240px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.sig-canvas-wrap canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none;
}
.sig-canvas-placeholder {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  color: var(--text-light);
  font-size: var(--fs-base);
}
.sig-canvas-placeholder .placeholder-icon { font-size: 40px; }

.sig-actions { display: flex; gap: 10px; }

/* ============================================================
   ÉCRAN 3 — LISTE MISSIONS
   ============================================================ */
#screen-missions { background: var(--bg); }

.missions-driver-bar {
  background: var(--surface);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}
.driver-name {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
}
.driver-date {
  font-size: var(--fs-sm);
  color: var(--text-soft);
  font-weight: 500;
}

.missions-filters {
  background: var(--surface);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.missions-filters::-webkit-scrollbar { display: none; }

.filter-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 22px;
  font-size: var(--fs-sm);
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  transition: all .15s;
}
.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.filter-btn .count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.12);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: var(--fs-xs);
  margin-left: 4px;
}
.filter-btn.active .count-badge { background: rgba(255,255,255,.28); }

.missions-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mission-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  transition: all .15s;
  border-left: 5px solid var(--border);
}
.mission-card:active { transform: scale(.99); box-shadow: var(--shadow-lg); }
.mission-card.statut-afaire  { border-left-color: var(--statut-afaire); }
.mission-card.statut-encours { border-left-color: var(--statut-encours); }
.mission-card.statut-termine { border-left-color: var(--statut-termine); }
.mission-card.statut-autre   { border-left-color: var(--statut-autre); }

.mission-time {
  font-family: var(--font-cond);
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  flex-shrink: 0;
  min-width: 60px;
  line-height: 1.1;
}
.mission-time .time-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  letter-spacing: .4px;
  font-family: var(--font);
}

.mission-info { flex: 1; min-width: 0; }
.mission-client {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mission-chantier {
  font-size: var(--fs-base);
  color: var(--text-soft);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mission-article {
  font-size: var(--fs-sm);
  color: var(--text-light);
  margin-top: 5px;
}
.mission-chauffeur-tag {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-lt);
  padding: 3px 9px;
  border-radius: 8px;
  margin-top: 5px;
  display: inline-block;
}

.mission-statut-badge {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-afaire  { background: #dbeafe; color: var(--statut-afaire); }
.badge-encours { background: #ffedd5; color: var(--statut-encours); }
.badge-termine { background: #dcfce7; color: var(--statut-termine); }
.badge-autre   { background: #fef9c3; color: var(--statut-autre); }

.missions-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 14px;
  color: var(--text-light);
  padding: 40px;
  text-align: center;
}
.missions-empty .empty-icon { font-size: 52px; }
.missions-empty p { font-size: var(--fs-lg); }

.realtime-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.5);
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ============================================================
   ÉCRAN 4 — DÉTAIL MISSION
   ============================================================ */
#screen-detail { background: var(--bg); }

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.detail-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.detail-value {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.detail-value.large {
  font-size: var(--fs-xxl);
  font-family: var(--font-cond);
  font-weight: 800;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-instructions {
  background: #fffbeb;
  border: 2px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px 16px;
}
.detail-instructions .instr-title {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: #92400e;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-instructions .instr-text {
  font-size: var(--fs-base);
  color: #78350f;
  line-height: 1.5;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 16px 24px;
  flex-shrink: 0;
}

.btn-call {
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  font-size: var(--fs-lg);
  font-weight: 800;
  text-decoration: none;
  min-height: 58px;
}
.btn-call:active { filter: brightness(.85); }

.btn-nav {
  background: #1e293b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  font-size: var(--fs-lg);
  font-weight: 800;
  min-height: 58px;
  border: none;
  cursor: pointer;
}
.btn-nav:active { filter: brightness(1.2); }

/* ============================================================
   ÉCRAN 5 — CONSTATS ET PHOTO
   ============================================================ */
#screen-constats { background: var(--bg); }

.constats-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  font-family: var(--font-cond);
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--text);
  letter-spacing: .3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.defauts-grid { display: flex; flex-direction: column; gap: 8px; }

.defaut-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all .15s;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
}
.defaut-item:active { transform: scale(.99); }
.defaut-item.selected {
  border-color: var(--danger);
  background: var(--danger-lt);
  color: var(--danger);
  font-weight: 800;
}

.defaut-check {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 2px solid var(--border);
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 800;
  transition: all .15s;
}
.defaut-item.selected .defaut-check {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.commentaire-zone {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: var(--fs-base);
  color: var(--text);
  resize: none;
  transition: border-color .2s;
}
.commentaire-zone:focus { border-color: var(--primary); }
.commentaire-zone::placeholder { color: var(--text-light); }

.photo-zone { display: flex; flex-direction: column; gap: 10px; }

.photo-preview {
  width: 100%;
  height: 180px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.photo-preview img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-size: var(--fs-base);
}
.photo-placeholder .photo-icon { font-size: 40px; }

.photo-btns { display: flex; gap: 10px; }

/* ============================================================
   ÉCRAN 6 — SIGNATURE MISSION
   ============================================================ */
#screen-signature-mission { background: var(--bg); }

.sig-mission-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.recap-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.recap-title {
  font-family: var(--font-cond);
  font-size: var(--fs-xxl);
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
}
.recap-line {
  font-size: var(--fs-base);
  color: var(--text-soft);
  line-height: 1.8;
}
.recap-line strong {
  color: var(--text);
  font-weight: 700;
}
.recap-anomalies {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--danger-lt);
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  color: var(--danger);
  font-weight: 700;
  white-space: pre-line;
}
.recap-date {
  font-family: var(--font-cond);
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--text-soft);
  margin-top: 12px;
}

.sig-actions-bottom {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* ============================================================
   LOADING & TOAST
   ============================================================ */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.loading-overlay.hidden { display: none; }
.loading-spinner {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: var(--fs-base);
  color: var(--text-soft);
  font-weight: 600;
}

.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 420px;
}
.toast {
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  font-weight: 700;
  color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 12px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--primary); }
@keyframes toastIn  { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
@keyframes toastOut { to   { opacity:0; transform:translateY(14px); } }

/* ============================================================
   RESPONSIVE TABLETTE
   ============================================================ */
@media (min-width: 600px) {
  :root { --fs-base: 18px; --fs-sm: 16px; --fs-lg: 20px; --fs-xl: 23px; --fs-xxl: 30px; }

  .pin-container { max-width: 380px; }
  .pin-btn { font-size: 30px; min-height: 70px; }

  .missions-list { padding: 16px; gap: 12px; }
  .mission-card  { padding: 18px 20px; }

  .detail-body, .constats-body, .sig-mission-body, .sig-init-body {
    max-width: 700px; margin: 0 auto; width: 100%; padding: 20px 24px;
  }
  .detail-actions, .sig-actions-bottom {
    max-width: 700px; margin: 0 auto; width: 100%;
    padding-left: 24px; padding-right: 24px;
  }
}

@media (min-width: 900px) {
  .missions-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   CORRECTIONS SUPPLÉMENTAIRES
   ============================================================ */

/* Signature : fond blanc ABSOLU, jamais surchargé par le thème */
.sig-canvas-wrap,
.sig-canvas-wrap canvas {
  background: #ffffff !important;
  background-color: #ffffff !important;
}
/* dark mode désactivé */

/* Bouton "Envoyer la mission" STICKY en bas — toujours visible */
.sig-actions-bottom {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 12px 16px 24px !important;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.10);
  z-index: 10;
}
/* dark mode désactivé */

/* Bouton constats → signature aussi sticky */
.constats-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  padding: 12px 16px 24px;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.10);
  flex-shrink: 0;
}
/* dark mode désactivé */

/* Boutons détail mission aussi sticky */
.detail-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  padding: 12px 16px 24px !important;
  z-index: 10;
}

/* Missions terminées : grisées pour les non-admin */
.mission-terminee {
  opacity: 0.55;
  cursor: default !important;
}
.mission-terminee:active { transform: none !important; }

/* ============================================================
   NAVIGATION JOURS — flèches planning
   ============================================================ */
.missions-driver-bar {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 12px !important;
}
.driver-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.btn-jour-nav {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.btn-jour-nav:active  { background: var(--primary-dk); transform: scale(.93); }
.btn-jour-nav:disabled {
  background: var(--border);
  color: var(--text-light);
  cursor: default;
  transform: none;
}

.today-bar {
  background: var(--warning-lt);
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.btn-today {
  background: var(--warning);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.btn-today:active { filter: brightness(.9); }

/* ============================================================
   BADGE TYPE MISSION (Dépôt / Enlèvement / BigBag...)
   ============================================================ */
.mission-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.mission-type-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
}

/* ============================================================
   MISSIONS INACTIVES (autre jour ou terminées non-admin)
   ============================================================ */
.mission-inactive {
  opacity: 0.5;
  cursor: default !important;
}
.mission-inactive:active { transform: none !important; box-shadow: var(--shadow) !important; }

/* Supprimer l'ancienne classe */
.mission-terminee { opacity: 0.5; cursor: default !important; }

/* ============================================================
   FORCE THÈME CLAIR — jamais de dark mode
   ============================================================ */
:root { color-scheme: light only; }
html, body { color-scheme: light; }

/* ============================================================
   LOGO LOGIN
   ============================================================ */
.login-logo-img {
  width: 220px;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  /* Logo fond blanc sur fond sombre — arrondi pour l'intégration */
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

/* Flèches navigation jours — style amélioré */
.btn-jour-nav {
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px !important;
  background: rgba(255,255,255,0.2) !important;
  color: var(--primary) !important;
  font-size: 24px !important;
  border: 2px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
}
.btn-jour-nav:active  { background: var(--primary-lt) !important; }
.btn-jour-nav:disabled {
  background: var(--surface2) !important;
  color: var(--text-light) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

/* Bouton refresh — animation rotation */
@keyframes spin-btn {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
#btn-refresh { transition: none; }

/* Date/heure sur l'écran de signature */
.sig-datetime {
  text-align: center;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--primary);
  padding: 10px 0 4px;
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
}
