/* ============================================================
   2AS Livraison — Design system commun (back-office)
   Couleurs de marque : bleu AIBD #003D7A, or #F0A500
   ============================================================ */
:root {
  /* Marque */
  --primary: #003D7A;
  --primary-light: #0A5AAE;
  --primary-50: #EEF4FB;
  --primary-100: #D6E4F5;
  --accent: #F0A500;
  --accent-50: #FFF7E6;

  /* États */
  --success: #15803D;  --success-50: #ECFDF3;
  --warning: #B45309;  --warning-50: #FFF8EB;
  --danger:  #C62828;  --danger-50:  #FEF1F1;
  --info:    #0E7490;  --info-50:    #ECFAFD;
  --violet:  #6D28D9;  --violet-50:  #F3EEFF;

  /* Surfaces & texte */
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --border: #E3E8EF;
  --border-strong: #CBD3DE;
  --text: #13213A;
  --text-muted: #5B6B82;
  --text-faint: #8A97AB;

  /* Sidebar */
  --side-bg: #0A2647;
  --side-bg-2: #0E3160;
  --side-text: rgba(255,255,255,.78);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,32,64,.05), 0 2px 8px rgba(16,32,64,.05);
  --shadow-lg: 0 12px 40px rgba(10,38,71,.18);
  --sidebar-w: 256px;
  --topbar-h: 62px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
code { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace; }
:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.num, .kpi-val, td .money { font-variant-numeric: tabular-nums; }

/* ── Layout ───────────────────────────────────────────────── */
body.app { display: block; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  color: #fff; display: flex; flex-direction: column; z-index: 120;
  overflow-y: auto; transition: transform .25s ease;
}
.sidebar-logo { padding: 18px 18px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo img { height: 38px; width: auto; background: #fff; border-radius: 9px; padding: 4px; }
.sidebar-logo-text .brand { font-weight: 700; font-size: 14px; letter-spacing: .2px; color: #fff; }
.sidebar-logo-text .sub { font-size: 11px; color: rgba(255,255,255,.55); }
.sidebar-nav { flex: 1; padding: 10px 10px 16px; }
.nav-section { padding: 16px 12px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .9px; color: rgba(255,255,255,.38); text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 1px 0;
  color: var(--side-text); font-size: 13.5px; font-weight: 500; border-radius: 9px;
  transition: background .15s, color .15s; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.nav-item i { width: 18px; text-align: center; font-size: 14px; opacity: .9; }
.nav-badge { margin-left: auto; background: var(--accent); color: #1a1200; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 10px; min-width: 20px; text-align: center; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar, .avatar { width: 34px; height: 34px; background: var(--accent); color: #1a1200; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.sidebar-user .name { font-size: 12.5px; font-weight: 600; color: #fff; line-height: 1.3; }
.sidebar-user .role { font-size: 11px; color: rgba(255,255,255,.55); text-transform: capitalize; }
.sidebar-user .logout { margin-left: auto; color: rgba(255,255,255,.6); padding: 6px; border-radius: 7px; }
.sidebar-user .logout:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-backdrop { display: none; }

.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border); padding: 0 24px; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 60;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { flex-wrap: wrap; justify-content: flex-end; }
.topbar-title { font-size: 17px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.2px; }
.topbar-btn { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); transition: background .15s, color .15s; flex-shrink: 0; }
.topbar-btn:hover { background: var(--surface-2); color: var(--text); }
.main-content { flex: 1; padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.page-head p { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }

/* ── Cartes ───────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.card-title { font-size: 14px; font-weight: 650; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--primary-light); }
.card-body { padding: 18px; }
.card-header a { color: var(--primary-light); font-weight: 500; }

/* ── KPI ──────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 14px; position: relative; overflow: hidden; }
.kpi-card::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kpi, var(--primary)); }
.kpi-card.blue  { --kpi: var(--primary-light); --kpi-bg: var(--primary-50); }
.kpi-card.green { --kpi: var(--success); --kpi-bg: var(--success-50); }
.kpi-card.amber { --kpi: var(--accent);  --kpi-bg: var(--accent-50); }
.kpi-card.red   { --kpi: var(--danger);  --kpi-bg: var(--danger-50); }
.kpi-card.cyan  { --kpi: var(--info);    --kpi-bg: var(--info-50); }
.kpi-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; background: var(--kpi-bg, var(--primary-50)); color: var(--kpi, var(--primary)); }
.kpi-val { font-size: 26px; font-weight: 750; line-height: 1.1; letter-spacing: -.5px; }
.kpi-label { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }
.kpi-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; }

/* Mini stats (ex. CA par mode de paiement) */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.stat-tile .ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.stat-tile .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-tile .l { font-size: 11.5px; color: var(--text-muted); }

/* Grilles utilitaires */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-3-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }

/* ── Badges de statut ─────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.5; background: var(--surface-2); color: var(--text-muted); border: 1px solid transparent; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-attente, .badge-en_attente, .badge-warning { background: var(--warning-50); color: var(--warning); border-color: #F8DDB0; }
.badge-validee    { background: var(--success-50); color: var(--success); border-color: #BDE5CB; }
.badge-livre      { background: var(--success); color: #fff; }
.badge-livre::before { background: #fff; }
.badge-refusee, .badge-echec, .badge-danger { background: var(--danger-50); color: var(--danger); border-color: #F5C6C6; }
.badge-annulee    { background: var(--danger-50); color: var(--danger); border-color: #F5C6C6; }
.badge-en_cours   { background: var(--primary-50); color: var(--primary-light); border-color: var(--primary-100); }
.badge-en_route   { background: var(--violet-50); color: var(--violet); border-color: #DCCFFB; }
.badge-en_attente_bagage, .badge-bagage_recu, .badge-info { background: var(--info-50); color: var(--info); border-color: #BEE8F1; }
.badge-pret_livrer { background: #EAFBF2; color: #0F766E; border-color: #B8EBD4; }
.badge-success { background: var(--success-50); color: var(--success); border-color: #BDE5CB; }
.badge-primary { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); }
.badge-secondary { background: #F1F3F6; color: #4B5563; }
.badge.no-dot::before { display: none; }

/* ── Tableaux ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 10px 14px; background: var(--surface-2); font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; text-transform: uppercase; letter-spacing: .4px; }
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #F7FAFE; }
td code, .ref { font-size: 11.5px; background: var(--primary-50) !important; color: var(--primary); padding: 2px 7px; border-radius: 6px; white-space: nowrap; font-weight: 600; }
.empty-row { text-align: center; padding: 36px 16px !important; color: var(--text-faint); }
.empty-row i { display: block; font-size: 26px; margin-bottom: 8px; opacity: .5; }

/* ── Formulaires ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 550; color: var(--text); margin-bottom: 6px; }
.form-label .req, .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 9px 12px; min-height: 40px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.form-control:hover { border-color: #AEB9C8; }
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(10,90,174,.14); }
select.form-control { appearance: none; padding-right: 34px; 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='%235B6B82' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
textarea.form-control { min-height: 80px; resize: vertical; }
.form-row { display: grid; gap: 16px; margin-bottom: 16px; }
.form-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.form-row.cols-5 { grid-template-columns: repeat(5, 1fr); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.filters label, .filter-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; display: block; text-transform: uppercase; letter-spacing: .4px; }

/* ── Boutons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; min-height: 38px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background .15s, box-shadow .15s, transform .08s, opacity .15s; font-family: inherit; line-height: 1; white-space: nowrap; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #00305F; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #116632; }
.btn-warning { background: var(--accent); color: #241700; }
.btn-warning:hover { background: #D99500; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #A61F1F; }
.btn-info    { background: var(--info); color: #fff; }
.btn-info:hover { background: #0B5E75; }
.btn-light   { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-light:hover { background: var(--surface-2); }
.btn-ghost   { background: transparent; color: var(--primary-light); }
.btn-ghost:hover { background: var(--primary-50); }
.btn-sm      { padding: 6px 11px; min-height: 32px; font-size: 12.5px; border-radius: 7px; }
.btn-lg      { padding: 12px 22px; min-height: 46px; font-size: 15px; }
.btn-block   { width: 100%; }
.btn-icon    { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 8px; }

/* ── Lignes d'info ────────────────────────────────────────── */
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 12.5px; color: var(--text-muted); }
.info-value { font-size: 13px; font-weight: 550; text-align: right; overflow-wrap: anywhere; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.page-btn { min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; cursor: pointer; }
.page-btn:hover { background: var(--surface-2); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Alertes ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid; }
.alert > i { margin-top: 2px; }
.alert-success { background: var(--success-50); color: #14532D; border-color: #BDE5CB; }
.alert-danger  { background: var(--danger-50);  color: #7F1D1D; border-color: #F5C6C6; }
.alert-warning { background: var(--warning-50); color: #78350F; border-color: #F8DDB0; }
.alert-info    { background: var(--info-50);    color: #164E63; border-color: #BEE8F1; }

/* ── Modales ──────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(10,25,48,.5); backdrop-filter: blur(2px); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .18s; }
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; transform: translateY(8px) scale(.98); transition: transform .18s; }
.modal-overlay.open .modal { transform: none; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: none; background: var(--surface-2); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 15px; }
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); }

/* ── Toasts ───────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #13213A; color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: toastIn .22s ease; max-width: 360px; }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warning { background: var(--accent); color: #241700; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── Divers ───────────────────────────────────────────────── */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.pm { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pm i { width: 16px; text-align: center; }
.pm-cash i { color: var(--success); }
.pm-wave i { color: #1D9BF0; }
.pm-orange_money i { color: #FF7900; }
.pm-virement i { color: var(--primary-light); }
.rank { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex-shrink: 0; background: var(--surface-2); color: var(--text-muted); }
.rank-1 { background: var(--accent); color: #241700; }
.rank-2 { background: #C7CFDA; color: #1F2937; }
.rank-3 { background: #D9A06B; color: #fff; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }
.menu-toggle { display: none; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1200px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  /* Grilles écrites en ligne dans les anciennes pages */
  .main-content [style*="repeat(4,1fr)"], .main-content [style*="repeat(5,1fr)"],
  .main-content [style*="1fr 1fr 1fr 1fr 1fr auto"] { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(10,25,48,.45); z-index: 110; }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .grid-2-1, .grid-3-2, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .main-content [style*="grid-template-columns:2fr 1fr"], .main-content [style*="grid-template-columns:3fr 2fr"],
  .main-content [style*="grid-template-columns:1fr 2fr"], .main-content [style*="grid-template-columns:2fr 1fr 1fr"] { grid-template-columns: minmax(0,1fr) !important; }
  .form-row.cols-3, .form-row.cols-4, .form-row.cols-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .main-content { padding: 16px; }
  .topbar { padding: 0 12px; }
  .topbar-title { font-size: 15px; }
  .topbar-right .btn span.hide-sm, .hide-sm { display: none !important; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { padding: 14px; gap: 10px; flex-direction: column; }
  .kpi-val { font-size: 21px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .form-row.cols-2, .form-row.cols-3, .form-row.cols-4, .form-row.cols-5 { grid-template-columns: 1fr; }
  .main-content [style*="grid-template-columns"] { grid-template-columns: minmax(0,1fr) !important; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  #toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
  thead th, tbody td { padding: 10px; }
}
@media print {
  .sidebar, .topbar, .sidebar-backdrop, #toast-container { display: none !important; }
  .main-wrap { margin: 0; }
  .card { box-shadow: none; }
}

/* ── Écrans de connexion ──────────────────────────────────── */
body.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 480px); background: var(--surface); }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 10% 110%, rgba(240,165,0,.22), transparent 60%), linear-gradient(150deg, #071C36 0%, #0A2647 45%, #0A5AAE 100%); }
.auth-hero::after { content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); }
.auth-hero .brand-row { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.auth-hero .brand-row img { height: 48px; background: #fff; border-radius: 12px; padding: 5px; }
.auth-hero .brand-row b { display: block; font-size: 17px; }
.auth-hero .brand-row span { font-size: 12.5px; color: rgba(255,255,255,.65); }
.auth-hero h2 { font-size: 34px; line-height: 1.15; font-weight: 800; letter-spacing: -.8px; max-width: 520px; position: relative; z-index: 1; }
.auth-hero h2 em { font-style: normal; color: var(--accent); }
.auth-hero ul { list-style: none; display: grid; gap: 12px; margin-top: 22px; position: relative; z-index: 1; }
.auth-hero li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: rgba(255,255,255,.85); }
.auth-hero li i { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.1); display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.auth-hero small { color: rgba(255,255,255,.5); font-size: 12px; position: relative; z-index: 1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box .mobile-logo { display: none; text-align: center; margin-bottom: 20px; }
.auth-box .mobile-logo img { height: 56px; }
.auth-box h1 { font-size: 24px; font-weight: 750; letter-spacing: -.4px; }
.auth-box .lead { color: var(--text-muted); font-size: 14px; margin: 4px 0 26px; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 14px; pointer-events: none; }
.input-icon .form-control { padding-left: 40px; min-height: 46px; font-size: 15px; }
.input-icon .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; color: var(--text-faint); }
.input-icon .eye:hover { background: var(--surface-2); color: var(--text); }
.auth-box .btn-lg { width: 100%; margin-top: 6px; }
.auth-links { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.auth-links a { color: var(--primary-light); font-weight: 550; display: inline-flex; align-items: center; gap: 8px; }
.auth-links a:hover { text-decoration: underline; }
@media (max-width: 900px) {
  body.auth-page { grid-template-columns: 1fr; background: var(--bg); }
  .auth-hero { display: none; }
  .auth-panel { min-height: 100vh; padding: 24px 16px; }
  .auth-box { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px 22px; box-shadow: var(--shadow); }
  .auth-box .mobile-logo { display: block; }
}

/* ── Listes : onglets, recherche, filtres repliables ─────── */
.tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 9px 14px; font-size: 13.5px; font-weight: 550; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.searchline { display: flex; gap: 8px; align-items: center; }
.searchline .form-control { min-height: 42px; }
.more-filters { margin-top: 10px; }
.more-filters summary { cursor: pointer; font-size: 13px; font-weight: 550; color: var(--primary-light); list-style: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 0; }
.more-filters summary::-webkit-details-marker { display: none; }
.table-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 4px; }

/* Tableau → cartes sur téléphone */
@media (max-width: 720px) {
  table.table-responsive thead { display: none; }
  table.table-responsive, table.table-responsive tbody, table.table-responsive tr, table.table-responsive td { display: block; width: 100%; }
  table.table-responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  table.table-responsive td { border: none; padding: 3px 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: baseline; text-align: right !important; font-weight: inherit; }
  table.table-responsive td[data-label]::before { content: attr(data-label); grid-row: 1 / span 4; color: var(--text-faint); font-size: 12px; font-weight: 500; text-align: left; }
  table.table-responsive td > * { grid-column: 2; justify-self: end; text-align: right; }
  table.table-responsive td.row-actions { justify-content: flex-end; padding-top: 10px; }
  table.table-responsive td.empty-row { display: block; text-align: center !important; }
  .searchline .btn { padding: 0 12px; }
}

/* ── Formulaires : erreurs, aides, choix en cartes ───────── */
.form-control.error, .form-control.is-invalid { border-color: var(--danger) !important; background: #FFFBFB; }
.field-error { color: var(--danger); font-size: 12px; margin-top: 5px; display: flex; gap: 5px; align-items: baseline; }
.field-hint { color: var(--text-faint); font-size: 12px; margin-top: 5px; }
.label-note { font-size: 11.5px; color: var(--text-faint); font-weight: 400; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--success-50); color: var(--success); margin-left: 6px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.choice { position: relative; cursor: pointer; display: block; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card { border: 1.5px solid var(--border-strong); border-radius: 11px; padding: 13px 12px; display: flex; align-items: center; gap: 10px; background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; min-height: 54px; }
.choice-card i { font-size: 18px; width: 22px; text-align: center; color: var(--text-faint); }
.choice-card b { display: block; font-size: 13.5px; font-weight: 600; }
.choice-card small { display: block; font-size: 11.5px; color: var(--text-muted); }
.choice:hover .choice-card { border-color: #9FB0C6; }
.choice input:checked + .choice-card { border-color: var(--primary-light); background: var(--primary-50); box-shadow: 0 0 0 3px rgba(10,90,174,.12); }
.choice input:checked + .choice-card i { color: var(--primary-light); }
.choice input:focus-visible + .choice-card { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.stepper-num { display: flex; align-items: stretch; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); min-height: 42px; }
.stepper-num button { width: 44px; border: none; background: var(--surface-2); font-size: 15px; color: var(--text-muted); cursor: pointer; }
.stepper-num button:hover { background: var(--border); color: var(--text); }
.stepper-num input { flex: 1; min-width: 0; border: none; text-align: center; font: inherit; font-weight: 700; font-size: 16px; color: var(--text); background: transparent; -moz-appearance: textfield; }
.stepper-num input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper-num input:focus { outline: none; }

/* ── Assistant en étapes (saisie d'une demande) ──────────── */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.wz-steps { display: flex; gap: 6px; margin-bottom: 16px; }
.wz-step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 550; color: var(--text-muted); cursor: default; text-align: left; font-family: inherit; min-width: 0; }
.wz-step .n { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1.5px solid var(--border-strong); color: var(--text-muted); }
.wz-step .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wz-step.active { border-color: var(--primary-light); color: var(--primary); box-shadow: 0 0 0 3px rgba(10,90,174,.1); }
.wz-step.active .n { background: var(--primary); border-color: var(--primary); color: #fff; }
.wz-step.done { cursor: pointer; color: var(--text); }
.wz-step.done .n { background: var(--success); border-color: var(--success); color: #fff; }
.wz-step.done:hover { border-color: var(--border-strong); }
.wz-step.has-error .n { background: var(--danger); border-color: var(--danger); color: #fff; }
.wz-panel { display: none; }
.wz-panel.active { display: block; animation: wzIn .18s ease-out; }
@keyframes wzIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.wz-section { font-size: 11.5px; font-weight: 650; letter-spacing: .6px; text-transform: uppercase; color: var(--text-faint); margin: 6px 0 12px; display: flex; align-items: center; gap: 10px; }
.wz-section::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.wz-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.wz-aside { position: sticky; top: calc(var(--topbar-h) + 18px); }
.price-box { background: linear-gradient(135deg, var(--primary) 0%, #0A4E96 100%); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 14px; position: relative; overflow: hidden; }
.price-box::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(240,165,0,.18); }
.price-box .l { font-size: 12px; color: rgba(255,255,255,.7); font-weight: 500; }
.price-box .v { font-size: 30px; font-weight: 800; letter-spacing: -.6px; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.price-box .v small { font-size: 14px; font-weight: 600; opacity: .8; margin-left: 4px; }
.price-box .d { font-size: 12px; color: rgba(255,255,255,.78); margin-top: 6px; position: relative; z-index: 1; }
.price-box.warn { background: linear-gradient(135deg, #7F1D1D, var(--danger)); }
.recap { font-size: 13px; }
.recap .row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.recap .row:last-child { border-bottom: none; }
.recap .row span:first-child { color: var(--text-muted); flex-shrink: 0; }
.recap .row span:last-child { font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.recap .row.empty span:last-child { color: var(--text-faint); font-weight: 400; }
.upload-zone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; background: var(--surface-2); color: var(--text-muted); transition: border-color .15s, background .15s; display: block; font-size: 13px; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--primary-light); background: var(--primary-50); }
.upload-zone i { font-size: 24px; color: var(--primary-light); margin-bottom: 6px; display: block; }
.upload-zone b { color: var(--text); font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumbs img { width: 68px; height: 68px; border-radius: 9px; object-fit: cover; border: 1px solid var(--border); }
.mobile-total { display: none; }

@media (max-width: 1100px) {
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .wz-aside { position: static; }
}
@media (max-width: 720px) {
  .wz-steps { gap: 4px; }
  .wz-step { padding: 8px 4px; justify-content: center; flex-direction: column; gap: 4px; font-size: 11px; text-align: center; }
  .wz-step .t { max-width: 100%; }
  .wz-nav { position: sticky; bottom: 0; background: var(--bg); margin: 16px -16px -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); z-index: 20; flex-wrap: wrap; }
  .wz-nav .btn { flex: 1; }
  .mobile-total { display: block; font-size: 12px; color: var(--text-muted); text-align: center; flex-basis: 100%; order: -1; }
  .mobile-total b { color: var(--primary); font-size: 14px; }
}

/* ── Écran « demande enregistrée » ───────────────────────── */
.done-card { max-width: 640px; margin: 10px auto; text-align: center; }
.done-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--success-50); color: var(--success); font-size: 28px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; box-shadow: 0 0 0 8px rgba(21,128,61,.07); }
.ref-copy { display: inline-flex; align-items: center; gap: 12px; margin: 18px 0 6px; padding: 12px 16px 12px 20px; border-radius: 12px; border: 1.5px dashed var(--primary-light); background: var(--primary-50); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 20px; font-weight: 700; color: var(--primary); letter-spacing: 1px; cursor: pointer; max-width: 100%; overflow-wrap: anywhere; }
.ref-copy i { font-size: 15px; color: var(--primary-light); }
.ref-copy.copied { border-color: var(--success); background: var(--success-50); color: var(--success); }
.done-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; text-align: left; }
.done-actions .btn { justify-content: flex-start; }
@media (max-width: 560px) { .done-actions { grid-template-columns: 1fr; } .ref-copy { font-size: 16px; } }

/* ── Pages publiques (suivi client, enquête) ─────────────── */
body.pub { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.pub-header { background: var(--side-bg); color: #fff; }
.pub-header-in { max-width: 680px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.pub-header img { height: 40px; background: #fff; border-radius: 10px; padding: 4px; }
.pub-header b { display: block; font-size: 15px; }
.pub-header span { font-size: 12px; color: rgba(255,255,255,.65); }
.pub-header .btn { margin-left: auto; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }
.pub-hero { background: linear-gradient(180deg, var(--side-bg) 0, var(--side-bg) 70px, var(--bg) 70px); padding: 8px 16px 0; }
.pub-hero > .card { max-width: 648px; margin: 0 auto; box-shadow: var(--shadow-lg); }
.pub-main { flex: 1; width: 100%; max-width: 680px; margin: 0 auto; padding: 16px 16px 24px; }
.pub-main > .card { margin-bottom: 14px; }
.pub-footer { text-align: center; font-size: 12.5px; color: var(--text-faint); padding: 12px 16px 28px; line-height: 1.8; }
.pub-footer a { color: var(--primary-light); font-weight: 550; }
.pub h1 { font-size: 19px; font-weight: 750; letter-spacing: -.3px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; gap: 2px; margin-bottom: 12px; }
.seg button { border: none; background: none; padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 550; color: var(--text-muted); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(16,32,64,.12); }

.track-status { display: flex; gap: 14px; align-items: center; }
.track-status .ic { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; background: var(--tone-bg, var(--primary-50)); color: var(--tone, var(--primary)); }
.track-status .lab { font-size: 19px; font-weight: 750; color: var(--tone, var(--primary)); letter-spacing: -.3px; line-height: 1.2; }
.track-status .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.tone-ok { --tone: var(--success); --tone-bg: var(--success-50); }
.tone-run { --tone: var(--violet); --tone-bg: var(--violet-50); }
.tone-wait { --tone: var(--warning); --tone-bg: var(--warning-50); }
.tone-ko { --tone: var(--danger); --tone-bg: var(--danger-50); }
.tone-info { --tone: var(--primary-light); --tone-bg: var(--primary-50); }
.progress { display: flex; margin: 22px 0 4px; }
.progress .pst { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; min-width: 0; }
.progress .pst::before { content: ''; position: absolute; top: 15px; right: 50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.progress .pst:first-child::before { display: none; }
.progress .pst.done::before, .progress .pst.now::before { background: var(--success); }
.progress .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-faint); position: relative; z-index: 1; }
.progress .pst.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.progress .pst.now .dot { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 0 0 5px rgba(0,61,122,.14); }
.progress .pst span { font-size: 11.5px; color: var(--text-faint); margin-top: 7px; font-weight: 550; }
.progress .pst.done span, .progress .pst.now span { color: var(--text); }
.tl { list-style: none; }
.tl li { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl li:last-child { padding-bottom: 0; }
.tl li:not(:last-child)::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--border); }
.tl .d { width: 24px; height: 24px; border-radius: 50%; background: var(--success-50); color: var(--success); display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; border: 1px solid #BDE5CB; }
.tl li:first-child .d { background: var(--success); color: #fff; border-color: var(--success); }
.tl b { font-size: 13.5px; font-weight: 600; display: block; }
.tl small { font-size: 12px; color: var(--text-muted); }
.tl p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.rating { display: flex; justify-content: center; gap: 4px; flex-direction: row-reverse; }
.rating input { position: absolute; opacity: 0; pointer-events: none; }
.rating label { font-size: 40px; line-height: 1; color: #D9DEE6; cursor: pointer; transition: color .12s, transform .12s; padding: 2px; }
.rating label:hover, .rating label:hover ~ label, .rating input:checked ~ label { color: var(--accent); }
.rating label:hover { transform: scale(1.12); }
.rating input:focus-visible + label { outline: 2px solid var(--primary-light); border-radius: 6px; }
.rating.sm label { font-size: 22px; padding: 1px; }
.crit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.crit > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; }
.crit > div > span { display: block; font-size: 12px; color: var(--text-muted); font-weight: 550; margin-bottom: 4px; }
@media (max-width: 420px) { .rating label { font-size: 34px; } .progress .pst span { font-size: 10px; } .crit { grid-template-columns: 1fr; } }

/* ── Tablette / téléphone livreur ────────────────────────── */
body.driver { background: var(--bg); padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
.drv-head { background: var(--side-bg); color: #fff; position: sticky; top: 0; z-index: 100; padding-top: env(safe-area-inset-top); }
.drv-head-in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.drv-head .avatar { width: 40px; height: 40px; font-size: 14px; }
.drv-head b { display: block; font-size: 15px; line-height: 1.2; }
.drv-head small { font-size: 12px; color: rgba(255,255,255,.65); display: flex; align-items: center; gap: 6px; }
.drv-head small .live { width: 8px; height: 8px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.drv-head .hbtn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; }
.drv-head .hbtn:hover { background: rgba(255,255,255,.16); }
.drv-head .hbtn.ok { color: #34D399; }
.drv-main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.drv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.drv-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.drv-kpi .v { font-size: 22px; font-weight: 750; letter-spacing: -.4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.drv-kpi .l { font-size: 11.5px; color: var(--text-muted); font-weight: 550; margin-top: 2px; }
.drv-kpi.hl { background: linear-gradient(135deg, var(--primary), #0A4E96); color: #fff; border-color: transparent; }
.drv-kpi.hl .l { color: rgba(255,255,255,.75); }
.drv-panel { display: none; }
.drv-panel.active { display: block; }
.drv-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 4px 2px 12px; }
.drv-panel-head h2 { font-size: 17px; font-weight: 750; letter-spacing: -.3px; }
.drv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; align-items: start; }
.job { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.job-top { padding: 14px 16px 12px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.job-top .who { font-size: 16px; font-weight: 700; line-height: 1.25; }
.job-top .ref { display: inline-block; margin-bottom: 5px; }
.job-pay { text-align: right; flex-shrink: 0; }
.job-pay .amt { font-size: 19px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.job-pay .how { font-size: 11.5px; font-weight: 600; margin-top: 2px; }
.job-pay .how.collect { color: var(--warning); }
.job-pay .how.paid { color: var(--success); }
.job-addr { margin: 0 16px; padding: 11px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.job-addr > i { color: var(--danger); margin-top: 3px; }
.job-addr b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.job-addr small { font-size: 12px; color: var(--text-muted); }
.job-facts { padding: 10px 16px 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.fact { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 4px 9px; border-radius: 8px; background: var(--primary-50); color: var(--primary); }
.fact.warn { background: var(--warning-50); color: var(--warning); }
.job-note { margin: 6px 16px 0; font-size: 12.5px; color: var(--warning); display: flex; gap: 7px; }
.job-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 16px 0; }
.job-actions .btn { min-height: 44px; padding: 0 6px; font-size: 12.5px; }
.job-main { padding: 10px 16px 16px; display: flex; gap: 8px; }
.job-main .btn { min-height: 50px; font-size: 15px; flex: 1; }
.job-main .btn-fail { flex: 0 0 auto; width: 50px; padding: 0; background: var(--danger-50); color: var(--danger); border: 1px solid #F5C6C6; }
.job.route { border-color: #DCCFFB; box-shadow: 0 0 0 3px rgba(109,40,217,.08), var(--shadow); }
.job .route-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--violet); background: var(--violet-50); padding: 3px 8px; border-radius: 99px; margin-bottom: 6px; letter-spacing: .3px; }
.done-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.done-row:last-child { border-bottom: none; }
.done-row .ck { width: 34px; height: 34px; border-radius: 50%; background: var(--success-50); color: var(--success); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.drv-empty { text-align: center; padding: 46px 20px; color: var(--text-muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 14px; }
.drv-empty i { font-size: 30px; color: var(--primary-light); opacity: .55; margin-bottom: 10px; }
.drv-empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.drv-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(16,32,64,.06); }
.drv-nav button { flex: 1; max-width: 220px; border: none; background: none; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-faint); padding: 9px 4px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; }
.drv-nav button i { font-size: 19px; }
.drv-nav button.active { color: var(--primary); }
.drv-nav button.active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.drv-nav .cnt { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #241700; font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.sig-wrap { position: relative; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.sig-wrap canvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.sig-wrap .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 13px; pointer-events: none; gap: 8px; }
.sig-wrap.signed .ph { display: none; }
.photo-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); color: var(--primary-light); font-weight: 600; cursor: pointer; overflow: hidden; }
.photo-btn img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.photo-btn.has { border-style: solid; padding: 0; }
.collect-box { border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; background: var(--warning-50); border: 1px solid #F8DDB0; }
.collect-box .v { font-size: 22px; font-weight: 800; color: var(--warning); font-variant-numeric: tabular-nums; }
.collect-box.paid { background: var(--success-50); border-color: #BDE5CB; }
.collect-box.paid .v { color: var(--success); font-size: 15px; }
@media (max-width: 720px) {
  .drv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drv-grid { grid-template-columns: minmax(0, 1fr); }
  .drv-main { padding: 12px; }
}

/* ── Statistiques : jauges, barre empilée, variations ────── */
.seg-a { padding: 7px 13px; border-radius: 8px; font-size: 13px; font-weight: 550; color: var(--text-muted); white-space: nowrap; }
.seg-a:hover { color: var(--text); }
.seg-a.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(16,32,64,.12); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; vertical-align: middle; letter-spacing: 0; }
.delta.up { background: var(--success-50); color: var(--success); }
.delta.down { background: var(--danger-50); color: var(--danger); }
.price-box .delta.up { background: rgba(52,211,153,.18); color: #A7F3D0; }
.price-box .delta.down { background: rgba(248,113,113,.2); color: #FECACA; }
.stack-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.stack-bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--text); }
.meter-row { padding: 7px 0; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.meter-top > span:last-child { white-space: nowrap; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.meter-top b { color: var(--text); }
.meter { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; background: var(--primary-light); }
.prog-bar-wrap { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.prog-bar { height: 100%; border-radius: 99px; background: var(--primary-light); }

/* ── Zones : grille de tarifs, localités ─────────────────── */
.tarif-grid .form-control { min-width: 78px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; padding: 8px 10px; }
.tarif-grid td { padding: 10px 8px; }
.loc-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.loc { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 12px; border: 1px solid var(--border); border-radius: 99px; background: var(--surface-2); font-size: 13px; }
.loc form { display: contents; }
.loc-n { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--primary-50); color: var(--primary); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.loc-btn { width: 24px; height: 24px; border: none; border-radius: 50%; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.loc-btn:hover { background: var(--border); color: var(--text); }
.loc-btn.danger:hover { background: var(--danger-50); color: var(--danger); }
@media (max-width: 720px) { .tarif-grid .form-control { min-width: 0; width: 130px; } }

/* ── Tarifs négociés : lignes éditables ──────────────────── */
.tc-head, .tc-row { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(90px, 1.1fr) minmax(90px, 1.1fr) minmax(70px, .9fr) auto; gap: 10px; align-items: center; padding: 8px 16px; }
.tc-head { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tc-row { border-bottom: 1px solid var(--border); }
.tc-row:last-child { border-bottom: none; }
.tc-row .form-control { text-align: right; font-weight: 600; padding: 7px 9px; font-variant-numeric: tabular-nums; }
.tc-act { display: flex; gap: 4px; justify-content: flex-end; }
@media (max-width: 560px) {
  .tc-head { display: none; }
  .tc-row { grid-template-columns: 1fr 1fr; }
  .tc-row b { grid-column: 1 / -1; }
  .tc-row [data-ex]::before { content: 'Ex. 4 bag. : '; }
}

/* ── Interrupteur « disponible » ─────────────────────────── */
.switch-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-muted); border-radius: 99px; padding: 4px 12px 4px 4px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.switch-pill span { width: 30px; height: 18px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s; }
.switch-pill span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch-pill.on { background: var(--success-50); color: var(--success); border-color: #BDE5CB; }
.switch-pill.on span { background: var(--success); }
.switch-pill.on span::after { transform: translateX(12px); }

/* Codes longs et tableaux hors .table-wrap : jamais de débordement */
.main-content code { overflow-wrap: anywhere; }
.main-content .card-body table:not(.table-responsive) { display: block; max-width: 100%; overflow-x: auto; }

/* ── Connexion : panneau « activité AIBD » ───────────────── */
.auth-hero { background: radial-gradient(1200px 500px at 10% 110%, rgba(240,165,0,.16), transparent 60%), linear-gradient(160deg, #0A2647 0%, #0E3160 55%, #003D7A 100%); }
.auth-hero-main { position: relative; z-index: 1; max-width: 620px; }
.auth-hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .4px; color: rgba(255,255,255,.75); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 6px 12px; border-radius: 99px; margin-bottom: 18px; }
.auth-hero .eyebrow i { color: var(--accent); }
.auth-hero h2 { font-size: 32px; }
.auth-hero .lead-hero { color: rgba(255,255,255,.75); font-size: 15px; line-height: 1.55; margin-top: 12px; max-width: 520px; }
.hero-trajet { margin: 22px -8px 6px; }
.trajet { width: 100%; height: auto; display: block; overflow: visible; }
.hero-steps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.hero-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); font-size: 12.5px; color: rgba(255,255,255,.7); line-height: 1.4; }
.hero-steps li span { width: 24px; height: 24px; flex-shrink: 0; border-radius: 8px; background: var(--accent); color: #241700; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.hero-steps li b { display: block; color: #fff; font-size: 13px; margin-bottom: 1px; }
.auth-box .mobile-tag { font-size: 12.5px; color: var(--text-muted); font-weight: 550; margin-top: 8px; }
.auth-box .mobile-tag i { color: var(--accent); }
@media (max-height: 760px) { .auth-hero .lead-hero { display: none; } .hero-trajet { margin-top: 12px; } }

/* ── Suivi : trajet, livreur, aide ───────────────────────── */
.track-phrase { font-size: 13.5px; margin-top: 14px; color: var(--text); line-height: 1.5; }
.track-trajet { margin: 10px -6px 0; }
.driver-box { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--violet-50); border: 1px solid #DCCFFB; }
.driver-box small { display: block; font-size: 11.5px; color: var(--text-muted); }
.driver-box b { font-size: 14.5px; }
.how { list-style: none; display: grid; gap: 12px; margin-top: 6px; }
.how li { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.how li > i { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--primary-50); color: var(--primary-light); display: flex; align-items: center; justify-content: center; }
.how li b { color: var(--text); }
.how li div > b:first-child { display: block; font-size: 13.5px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { padding: 13px 18px; cursor: pointer; font-size: 13.5px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details p { padding: 0 18px 14px; font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.pub-main .list-row:hover { background: var(--surface-2); }
@media (max-width: 480px) { .trajet .t1 { font-size: 21px; } .trajet .t2 { display: none; } .track-trajet { margin: 18px -6px 4px; } }
.faq summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 11px; color: var(--text-faint); transition: transform .15s; }

/* ── Application installable livreur ─────────────────────── */
.pwa-bar { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 250; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 16px; background: #0A2647; color: #fff; box-shadow: 0 12px 34px rgba(10,38,71,.35); animation: wzIn .25s ease-out; }
body.driver .pwa-bar { bottom: calc(80px + env(safe-area-inset-bottom)); }
.pwa-bar img { width: 42px; height: 42px; border-radius: 11px; background: #fff; flex-shrink: 0; }
.pwa-txt { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.35; color: rgba(255,255,255,.8); }
.pwa-txt b { display: block; color: #fff; font-size: 14px; }
.pwa-go { border: none; border-radius: 10px; background: var(--accent); color: #241700; font: inherit; font-weight: 700; font-size: 13.5px; padding: 10px 14px; cursor: pointer; }
.pwa-x { border: none; background: transparent; color: rgba(255,255,255,.6); font-size: 22px; line-height: 1; padding: 4px 6px; cursor: pointer; }
/* Ouverte comme application : l'en-tête suit la barre d'état du téléphone */
.pwa-app body.driver .drv-head { padding-top: max(env(safe-area-inset-top), 0px); }
