/* =====================================================================
 *  style.css  |  Feuille COMMUNE aux 4 portails + espace client (index.html)
 * =====================================================================
 *  Plan :
 *   1. Variables (design tokens)      8. Navigation mobile (barre du bas)
 *   2. Reset & base                   9. Composants (boutons, cartes, formulaires...)
 *   3. Écrans de connexion / accès   10. Fenêtres modales, toasts, chargement
 *   4. En-tête fixe                  11. Sections : accueil, colis, suivi
 *   5. Bandeau d'annonces            12. Sections : tarifs, calcul, adresses
 *   6. Disposition générale          13. Sections : contact, profil, factures
 *   7. Menu latéral                  14. Responsive, impression, accessibilité
 *
 *  Les portails admin / entrepôt / agence chargent ce fichier PUIS leur
 *  propre feuille (admin.css, entrepot-chine.css, agence-benin.css).
 * ===================================================================== */


/* =====================================================================
 * 1. VARIABLES
 * ===================================================================== */
:root {
  /* Couleurs de marque */
  --brand-950: #081633;
  --brand-900: #0b1f4b;
  --brand-800: #102a63;
  --brand-700: #14388a;
  --brand-600: #1b4bb0;
  --brand-500: #2563eb;
  --brand-100: #dbe6fd;
  --brand-50:  #eff4ff;
  --accent:     #ff7a1a;
  --accent-600: #e8650a;
  --accent-50:  #fff3e8;

  /* Neutres */
  --ink:       #0f172a;
  --ink-2:     #334155;
  --muted:     #64748b;
  --line:      #e2e8f0;
  --line-2:    #cbd5e1;
  --surface:   #ffffff;
  --bg:        #f4f6fb;

  /* États */
  --success:    #15803d;
  --success-bg: #dcfce7;
  --warn:       #b45309;
  --warn-bg:    #fef3c7;
  --danger:     #b91c1c;
  --danger-bg:  #fee2e2;
  --info:       #1d4ed8;
  --info-bg:    #dbeafe;

  /* Mise en page */
  --sidebar-w: 268px;
  --topbar-h: 64px;          /* recalculée par index.js (en-tête + bandeau) */
  --bottom-nav-h: 66px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / .06), 0 1px 3px rgb(15 23 42 / .06);
  --shadow:    0 4px 6px -2px rgb(15 23 42 / .05), 0 10px 24px -6px rgb(15 23 42 / .12);
  --shadow-lg: 0 24px 60px -12px rgb(15 23 42 / .35);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}


/* =====================================================================
 * 2. RESET & BASE
 * ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* L'attribut hidden doit toujours gagner sur nos "display" */
[hidden] { display: none !important; }

img { max-width: 100%; display: block; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
small { font-size: .8125rem; }

.muted { color: var(--muted); }
.icon { flex-shrink: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-500) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}


/* =====================================================================
 * 3. ÉCRANS DE CONNEXION / ACCÈS REFUSÉ / CHARGEMENT
 * ===================================================================== */
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgb(255 122 26 / .28), transparent 60%),
    radial-gradient(800px 500px at -10% 110%, rgb(37 99 235 / .45), transparent 60%),
    linear-gradient(160deg, var(--brand-950), var(--brand-800));
}

.auth__card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 22px;
  padding: 34px 30px 28px;
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 16px;
}
.auth__card--center { text-align: center; justify-items: center; }
.auth__title { font-size: 1.6rem; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.auth__text { color: var(--ink-2); }
.auth__legal { font-size: .8125rem; color: var(--muted); text-align: center; }

.auth__points { display: grid; gap: 9px; margin: 2px 0 6px; }
.auth__points li {
  position: relative;
  padding-left: 28px;
  color: var(--ink-2);
  font-size: .9375rem;
}
.auth__points li::before {
  content: '';
  position: absolute; left: 0; top: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--success-bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 11px no-repeat;
}

.denied__icon {
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--danger-bg); color: var(--danger);
}

/* Écran de chargement : masqué dès qu'un autre écran est affiché */
.boot {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: var(--bg);
}
#auth-screen:not([hidden]) ~ .boot,
#access-denied:not([hidden]) ~ .boot,
#app:not([hidden]) ~ .boot { display: none; }

.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid var(--brand-100);
  border-top-color: var(--brand-600);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.noscript { padding: 20px; text-align: center; color: var(--danger); }


/* =====================================================================
 * 4. EN-TÊTE FIXE
 * ===================================================================== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 60;
  background: var(--brand-900);
  color: #fff;
  box-shadow: 0 2px 14px rgb(8 22 51 / .35);
}
.topbar__main {
  height: 64px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: inherit; font-weight: 800; letter-spacing: -.01em;
  min-width: 0;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(145deg, var(--accent), var(--accent-600));
  color: #fff;
  box-shadow: 0 4px 12px rgb(255 122 26 / .4);
}
.brand__name { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand--lg { color: var(--brand-900); }
.brand--lg .brand__mark { width: 48px; height: 48px; border-radius: 14px; }
.brand--lg .brand__name { font-size: 1.3rem; }

.userchip {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: rgb(255 255 255 / .1);
  color: #fff; font-weight: 600; font-size: .875rem;
  max-width: 220px;
}
.userchip:hover { background: rgb(255 255 255 / .18); text-decoration: none; }
.userchip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  background: var(--brand-600);
  border: 2px solid rgb(255 255 255 / .35);
}
/* Avatar sans image : on masque l'icône cassée */
.avatar:not([src]) { visibility: hidden; }

.topbar__menu { display: none; color: #fff; }


/* =====================================================================
 * 5. BANDEAU D'ANNONCES (défilement infini)
 *    Deux groupes identiques : le 1er sort à gauche pendant que le 2e
 *    entre -> boucle sans coupure. Durée calculée par index.js.
 * ===================================================================== */
.ticker {
  height: 38px;
  display: flex; align-items: stretch;
  background: var(--accent);
  color: #1b0f00;
  font-size: .875rem; font-weight: 600;
  overflow: hidden;
}
.ticker__label {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 16px 0 18px;
  background: #1b0f00; color: #fff;
  font-size: .75rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  position: relative; z-index: 1;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  padding-right: 24px;
}
.ticker__viewport { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker__track {
  display: flex; width: max-content;
  animation: ticker-scroll var(--ticker-duration, 40s) linear infinite;
  will-change: transform;
}
.ticker:hover .ticker__track { animation-play-state: paused; }

.ticker__group {
  display: flex; align-items: center; gap: 56px;
  padding-right: 56px;
  min-width: 100vw;
  flex-shrink: 0;
}
.ticker__item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }

@keyframes ticker-scroll { to { transform: translateX(-50%); } }


/* =====================================================================
 * 6. DISPOSITION GÉNÉRALE
 * ===================================================================== */
.main {
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 28px) 32px 48px;
  max-width: calc(var(--sidebar-w) + 1180px);
  outline: none;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-title { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.page-sub { color: var(--muted); margin-top: 4px; }

.section-title {
  font-size: 1.05rem; font-weight: 700;
  margin: 28px 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.section-title a { font-size: .875rem; font-weight: 600; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 12px; }


/* =====================================================================
 * 7. MENU LATÉRAL
 * ===================================================================== */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0;
  width: var(--sidebar-w);
  z-index: 50;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.nav { padding: 16px 14px; flex: 1; display: grid; gap: 20px; align-content: start; }
.nav-group__title {
  padding: 0 12px 6px;
  font-size: .6875rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--ink-2); font-weight: 600; font-size: .9375rem;
}
.nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-link[aria-current='page'] {
  background: var(--brand-50); color: var(--brand-700);
}
.nav-link[aria-current='page'] .icon { color: var(--brand-600); }
.nav-badge {
  margin-left: auto;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--accent); color: #fff;
  font-size: .75rem; font-weight: 700;
}

.sidebar__foot { padding: 14px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.sidebar__user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar__user .avatar { width: 38px; height: 38px; border-color: var(--line); }
.sidebar__userinfo { display: grid; min-width: 0; line-height: 1.3; }
.sidebar__userinfo strong, .sidebar__userinfo small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar__userinfo small { color: var(--muted); }

.overlay {
  position: fixed; inset: 0; z-index: 55;
  background: rgb(8 22 51 / .55);
  backdrop-filter: blur(2px);
}


/* =====================================================================
 * 8. NAVIGATION MOBILE (barre du bas)
 * ===================================================================== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 58;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgb(15 23 42 / .06);
  display: none;
  grid-template-columns: repeat(5, 1fr);
}
.bottom-nav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: .6875rem; font-weight: 600;
  position: relative;
}
.bottom-nav__item:hover { text-decoration: none; }
.bottom-nav__item[aria-current='page'] { color: var(--brand-600); }
.bottom-nav__item--fab .bottom-nav__fab {
  width: 48px; height: 48px; margin-top: -22px;
  border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-600));
  color: #fff; box-shadow: 0 8px 18px rgb(255 122 26 / .45);
}
.bottom-nav__dot {
  position: absolute; top: 9px; left: calc(50% + 6px);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
}


/* =====================================================================
 * 9. COMPOSANTS
 * ===================================================================== */

/* ----- Boutons ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .9375rem; line-height: 1.2;
  cursor: pointer; text-align: center;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy='true'] { opacity: .6; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 13px; font-size: .8125rem; }

.btn--primary { background: var(--brand-600); color: #fff; box-shadow: 0 2px 8px rgb(37 99 235 / .3); }
.btn--primary:hover:not(:disabled) { background: var(--brand-700); }
.btn--accent { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgb(255 122 26 / .35); }
.btn--accent:hover:not(:disabled) { background: var(--accent-600); }
.btn--ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); }
.btn--ghost:hover:not(:disabled) { background: var(--bg); }
.btn--danger-ghost { background: var(--surface); color: var(--danger); border-color: #fecaca; }
.btn--danger-ghost:hover:not(:disabled) { background: var(--danger-bg); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--whatsapp { background: #16a34a; color: #fff; }
.btn--whatsapp:hover { background: #15803d; }
.btn--google {
  background: #fff; color: var(--ink);
  border-color: var(--line-2); padding: 13px 18px;
  box-shadow: var(--shadow-sm);
}
.btn--google:hover:not(:disabled) { background: var(--bg); }

.icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-grid; place-items: center;
  background: transparent; border: 0; cursor: pointer; color: inherit;
}
.icon-btn:hover { background: rgb(100 116 139 / .15); }

/* ----- Cartes ----- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card__title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.card__sub { color: var(--muted); font-size: .875rem; }

/* ----- Formulaires ----- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field__label { font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.field__hint { font-size: .8125rem; color: var(--muted); }
.field__error { font-size: .8125rem; color: var(--danger); font-weight: 600; }

.input, .select, .textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: #94a3b8; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgb(37 99 235 / .15);
}
.input[readonly] { background: var(--bg); color: var(--muted); }
.textarea { min-height: 110px; resize: vertical; }
.input-group { position: relative; }
.input-group .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-group .input { padding-left: 42px; }

/* Choix du mode d'expédition (cartes radio) */
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice__box {
  display: grid; gap: 4px; justify-items: start;
  padding: 16px; border-radius: var(--radius);
  border: 2px solid var(--line); background: #fff;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice__box .icon { color: var(--brand-600); }
.choice__title { font-weight: 700; }
.choice__meta { font-size: .8125rem; color: var(--muted); }
.choice input:checked + .choice__box {
  border-color: var(--brand-500); background: var(--brand-50);
  box-shadow: 0 0 0 4px rgb(37 99 235 / .12);
}
.choice input:focus-visible + .choice__box { outline: 3px solid var(--brand-500); outline-offset: 2px; }

/* ----- Badges de statut ----- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
  background: #e2e8f0; color: #334155;
}
.badge--declared         { background: #e2e8f0; color: #334155; }
.badge--received_china   { background: #e0e7ff; color: #3730a3; }
.badge--in_transit       { background: var(--info-bg); color: var(--info); }
.badge--arrived_benin    { background: #f3e8ff; color: #6b21a8; }
.badge--available_agency { background: var(--warn-bg); color: var(--warn); }
.badge--delivered        { background: var(--success-bg); color: var(--success); }
.badge--paid             { background: var(--success-bg); color: var(--success); }
.badge--unpaid           { background: var(--warn-bg); color: var(--warn); }
.badge--open             { background: var(--warn-bg); color: var(--warn); }
.badge--in_review        { background: var(--info-bg); color: var(--info); }
.badge--resolved         { background: var(--success-bg); color: var(--success); }
.badge--rejected         { background: var(--danger-bg); color: var(--danger); }

/* ----- Pastilles de filtre ----- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff;
  font-size: .875rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--bg); }
.chip[aria-pressed='true'] { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.chip__count {
  min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: rgb(100 116 139 / .18); font-size: .75rem; text-align: center;
}
.chip[aria-pressed='true'] .chip__count { background: rgb(255 255 255 / .22); }

/* ----- Messages d'état ----- */
.empty {
  text-align: center; padding: 44px 20px;
  background: var(--surface); border: 2px dashed var(--line-2);
  border-radius: var(--radius);
  display: grid; justify-items: center; gap: 8px;
}
.empty__icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-600);
}
.empty h3 { font-size: 1.05rem; }
.empty p { color: var(--muted); max-width: 380px; margin-bottom: 8px; }

.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--info-bg); color: #1e3a8a; font-size: .9375rem;
}
.alert--success { background: var(--success-bg); color: #14532d; }
.alert--warn { background: var(--warn-bg); color: #78350f; }
.alert--error { background: var(--danger-bg); color: #7f1d1d; }
.alert .btn { margin-left: auto; }

/* ----- Barre de progression ----- */
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-500), var(--accent));
  transition: width .5s ease;
}

/* ----- Liste clé / valeur ----- */
.kv { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.kv > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 10px 14px; font-size: .9rem;
}
.kv > div:nth-child(odd) { background: #f8fafc; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }


/* =====================================================================
 * 10. MODALES, TOASTS, CHARGEMENT
 * ===================================================================== */
.modal {
  border: 0; padding: 0; background: transparent;
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto; overflow: visible; color: var(--ink);
}
.modal--sm { width: min(420px, calc(100vw - 24px)); }
.modal::backdrop { background: rgb(8 22 51 / .6); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.modal__panel {
  background: var(--surface); border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-height: calc(100dvh - 24px);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--line);
}
.modal__title { font-size: 1.1rem; font-weight: 800; }
.modal__body { padding: 20px 22px 22px; overflow-y: auto; display: grid; gap: 18px; }
.modal__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.toast-container {
  position: fixed; z-index: 300;
  right: 20px; bottom: 20px;
  display: grid; gap: 10px;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--brand-900); color: #fff;
  font-size: .9rem; font-weight: 600;
  box-shadow: var(--shadow); animation: toast-in .25s ease-out;
  border-left: 5px solid var(--brand-500);
}
.toast--success { border-left-color: #22c55e; }
.toast--error   { border-left-color: #ef4444; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

.skeleton {
  background: linear-gradient(90deg, #e8edf5 25%, #f4f7fb 50%, #e8edf5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: var(--radius-sm);
}
.skeleton--title { height: 34px; width: 55%; max-width: 360px; margin-bottom: 22px; }
.skeleton--card { height: 120px; border-radius: var(--radius); }
.skeleton-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
@keyframes shimmer { to { background-position: -200% 0; } }


/* =====================================================================
 * 11. SECTIONS : ACCUEIL, MES COLIS, SUIVI
 * ===================================================================== */

/* ----- Bandeau d'accueil ----- */
.hero {
  position: relative; overflow: hidden;
  padding: 26px 28px; border-radius: 20px; color: #fff;
  background:
    radial-gradient(500px 220px at 100% 0%, rgb(255 122 26 / .5), transparent 65%),
    linear-gradient(135deg, var(--brand-800), var(--brand-600));
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.hero p { opacity: .88; margin-top: 4px; }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----- Indicateurs (KPI) ----- */
.kpi {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.kpi__icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-50); color: var(--brand-600);
}
.kpi--accent .kpi__icon { background: var(--accent-50); color: var(--accent-600); }
.kpi--success .kpi__icon { background: var(--success-bg); color: var(--success); }
.kpi--warn .kpi__icon { background: var(--warn-bg); color: var(--warn); }
.kpi__value { font-size: 1.45rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.kpi__label { font-size: .8125rem; color: var(--muted); font-weight: 600; }

/* ----- Carte colis (liste) ----- */
.pkg-list { display: grid; gap: 12px; }
.pkg {
  width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.pkg:hover { border-color: var(--brand-500); box-shadow: var(--shadow); }
.pkg__icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--brand-50); color: var(--brand-600);
}
.pkg__icon--sea { background: #e0f2fe; color: #0369a1; }
.pkg__body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.pkg__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pkg__ref { font-size: .95rem; }
.pkg__track { font-size: .8125rem; color: var(--muted); font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.pkg__desc { font-size: .875rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg__meta { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: .8125rem; color: var(--muted); }
.pkg__meta span:nth-child(2) { color: var(--ink); font-weight: 700; }
.pkg > .icon:last-child { color: var(--line-2); }

.toolbar { display: grid; gap: 12px; margin-bottom: 16px; }

/* ----- Frise de suivi (vertical, lisible sur mobile) ----- */
.timeline { position: relative; display: grid; gap: 0; padding: 4px 0; }
.timeline__step {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  padding-bottom: 18px;
}
.timeline__step:last-child { padding-bottom: 0; }
.timeline__step::before {            /* trait vertical entre les points */
  content: ''; position: absolute;
  left: 13px; top: 28px; bottom: -2px; width: 2px;
  background: var(--line-2);
}
.timeline__step:last-child::before { display: none; }
.timeline__step.is-done::before { background: var(--brand-500); }
.timeline__dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line-2); color: #fff;
  position: relative; z-index: 1;
}
.timeline__step.is-done .timeline__dot { background: var(--brand-500); border-color: var(--brand-500); }
.timeline__step.is-current .timeline__dot {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 6px rgb(255 122 26 / .2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgb(255 122 26 / .08); } }
.timeline__text { display: grid; line-height: 1.35; padding-top: 3px; }
.timeline__text small { color: var(--muted); }
.timeline__step:not(.is-done) .timeline__text strong { color: var(--muted); font-weight: 600; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.photo-grid a { display: block; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; }
.detail-section-title { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }


/* =====================================================================
 * 12. SECTIONS : TARIFS, CALCUL DE FRET, ADRESSES
 * ===================================================================== */
.rate-card {
  position: relative; overflow: hidden;
  display: grid; gap: 10px; padding: 24px;
  border-radius: 20px; color: #fff;
}
.rate-card--air { background: linear-gradient(135deg, var(--brand-800), var(--brand-500)); }
.rate-card--sea { background: linear-gradient(135deg, #075985, #0ea5e9); }
.rate-card .icon { opacity: .9; }
.rate-card__mode { font-weight: 700; font-size: 1.05rem; }
.rate-card__price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.rate-card__price small { font-size: .95rem; font-weight: 600; opacity: .85; letter-spacing: 0; }
.rate-card__delay {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  padding: 5px 12px; border-radius: 999px; font-size: .8125rem; font-weight: 600;
  background: rgb(255 255 255 / .18);
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: #f8fafc; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table td:last-child, .table th:last-child { text-align: right; }
.table td strong { color: var(--brand-700); }

/* Onglets (calculateur) */
.tabs { display: inline-flex; padding: 4px; gap: 4px; background: #e8edf5; border-radius: 12px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 9px; border: 0; background: transparent;
  font-weight: 700; font-size: .9rem; color: var(--ink-2); cursor: pointer;
}
.tab[aria-selected='true'] { background: #fff; color: var(--brand-700); box-shadow: var(--shadow-sm); }

.calc { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.result {
  padding: 24px; border-radius: 20px; color: #fff;
  background: linear-gradient(145deg, var(--brand-900), var(--brand-700));
  display: grid; gap: 14px; position: sticky; top: calc(var(--topbar-h) + 16px);
}
.result__label { font-size: .8125rem; text-transform: uppercase; letter-spacing: .1em; opacity: .75; font-weight: 700; }
.result__amount { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.result__lines { display: grid; gap: 8px; font-size: .9rem; padding-top: 12px; border-top: 1px solid rgb(255 255 255 / .2); }
.result__lines div { display: flex; justify-content: space-between; gap: 12px; }
.result__lines dt { opacity: .75; }
.result__lines dd { font-weight: 700; }
.result__note { font-size: .8125rem; opacity: .75; }

.address-card { display: grid; gap: 14px; }
.address-card__head { display: flex; align-items: center; gap: 12px; }
.address-card__head .kpi__icon { width: 42px; height: 42px; }
.address-box {
  margin: 0; padding: 16px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px dashed var(--line-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
  font: inherit; font-weight: 600; line-height: 1.7;
}


/* =====================================================================
 * 13. SECTIONS : ANNONCES, CONTACT, PROFIL, FACTURES
 * ===================================================================== */
.news {
  display: flex; gap: 14px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.news__icon { color: var(--accent-600); margin-top: 2px; }
.news h3 { font-size: 1rem; margin-bottom: 3px; }
.news p { color: var(--ink-2); white-space: pre-wrap; }
.news small { color: var(--muted); display: block; margin-top: 6px; }

.contact-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); color: inherit;
  transition: transform .15s, box-shadow .15s;
}
.contact-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.contact-card strong { display: block; }
.contact-card small { color: var(--muted); }
.contact-card--wa .kpi__icon { background: #dcfce7; color: #15803d; }

.dispute { display: grid; gap: 6px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dispute__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dispute p { color: var(--ink-2); font-size: .9rem; }

.profile { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.profile__card { text-align: center; display: grid; justify-items: center; gap: 6px; }
.profile__avatar { width: 96px; height: 96px; border: 4px solid var(--brand-100); }
.profile__name { font-size: 1.2rem; font-weight: 800; margin-top: 6px; }
.profile__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; margin-top: 12px; }
.profile__stats div { padding: 12px; background: var(--bg); border-radius: var(--radius-sm); }
.profile__stats strong { display: block; font-size: 1.25rem; }
.profile__stats small { color: var(--muted); }

.invoice-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.invoice {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.invoice__main { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.invoice__amount { font-size: 1.15rem; font-weight: 800; }


/* =====================================================================
 * 14. RESPONSIVE, IMPRESSION, ACCESSIBILITÉ
 * ===================================================================== */

/* ----- Tablette et mobile : menu en tiroir + barre du bas ----- */
@media (max-width: 1023px) {
  .topbar__menu { display: inline-grid; }
  .topbar__main { padding: 0 12px; }

  .sidebar {
    top: 0; z-index: 70; width: min(300px, 86vw);
    padding-top: env(safe-area-inset-top);
    transform: translateX(-102%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .overlay { z-index: 65; }

  .main { margin-left: 0; padding: calc(var(--topbar-h) + 20px) 16px calc(var(--bottom-nav-h) + 36px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: grid; }
  .toast-container { bottom: calc(var(--bottom-nav-h) + 14px + env(safe-area-inset-bottom)); right: 16px; }

  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc { grid-template-columns: 1fr; }
  .result { position: static; }
  .profile { grid-template-columns: 1fr; }
}

/* ----- Mobile ----- */
@media (max-width: 639px) {
  body { font-size: 14.5px; }
  .page-title { font-size: 1.35rem; }
  .userchip { padding: 3px; }
  .userchip__name { display: none; }
  .brand__name { font-size: 1rem; }

  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .kpi__value { font-size: 1.25rem; }

  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 1.25rem; }
  .hero__actions, .hero__actions .btn { width: 100%; }
  .card { padding: 16px; }
  .auth__card { padding: 28px 22px 22px; }
  .invoice-summary { grid-template-columns: 1fr; gap: 12px; }
  .pkg { padding: 14px; gap: 12px; }
  .pkg > .icon:last-child { display: none; }
  .ticker { height: 34px; font-size: .8125rem; }
  .ticker__label span { display: none; }

  /* Modale en "feuille" collée en bas de l'écran */
  .modal { width: 100vw; max-width: 100vw; margin: auto 0 0; }
  .modal__panel { border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .modal--sm { width: calc(100vw - 24px); margin: auto; }
  .modal--sm .modal__panel { border-radius: 20px; }
  .modal__actions .btn { flex: 1; }
}

/* ----- Impression ----- */
@media print {
  .topbar, .sidebar, .bottom-nav, .overlay, .toast-container { display: none !important; }
  .main { margin: 0; padding: 0; }
  body { background: #fff; }
}

/* ----- Mouvement réduit : bandeau fixe défilable à la main ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .ticker__viewport { overflow-x: auto; }
  .ticker__track { animation: none; }
  .ticker__group[aria-hidden='true'] { display: none; }
}


/* =====================================================================
 * 15. COMPOSANTS PARTAGÉS DES PORTAILS STAFF
 *     (administration, entrepôt Chine, agence Bénin)
 *     Utilisés avec <body class="page-staff">.
 * ===================================================================== */

/* ----- En-tête des portails staff ----- */
.page-staff .topbar { background: var(--brand-950); }

.role-tag {
  margin-left: 4px;
  padding: 3px 9px; border-radius: 6px;
  background: var(--accent); color: #fff;
  font-size: .6875rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  white-space: nowrap;
}
.userchip--static { cursor: default; }
.userchip--static:hover { background: rgb(255 255 255 / .1); }

.modal--lg { width: min(760px, calc(100vw - 24px)); }

/* ----- Barre d'outils / filtres ----- */
.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.filters--tight { grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px); }
.result-count { color: var(--muted); font-size: .875rem; margin: 0 2px 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----- Tableaux de données ----- */
.data-table th, .data-table td { white-space: nowrap; }
.data-table td:last-child, .data-table th:last-child { text-align: left; }
.data-table .t-right { text-align: right !important; }
.data-table .t-wrap { white-space: normal; min-width: 180px; }
.data-table .t-mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .8125rem; }
.data-table .t-strong { font-weight: 700; }
.data-table .t-sub { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; }
.data-table .t-check { width: 44px; padding-right: 0; }

.data-table tbody tr.row-link { cursor: pointer; transition: background .12s; }
.data-table tbody tr.row-link:hover { background: var(--brand-50); }
.data-table tbody tr.row-link:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
.data-table tbody tr.is-selected { background: var(--accent-50); }

.row-actions { display: inline-flex; gap: 6px; }
.row-actions .btn { padding: 6px 10px; }
.more-row { text-align: center; padding: 14px; }

/* ----- Pastilles neutres (rôle, type, état) ----- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  background: #e2e8f0; color: #334155;
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.tag--admin       { background: #fee2e2; color: #991b1b; }
.tag--china_staff { background: #e0e7ff; color: #3730a3; }
.tag--benin_staff { background: #dcfce7; color: #166534; }
.tag--client      { background: #e2e8f0; color: #334155; }
.tag--ok          { background: var(--success-bg); color: var(--success); }
.tag--off         { background: var(--danger-bg); color: var(--danger); }
.tag--warn        { background: var(--warn-bg); color: var(--warn); }
.tag--info        { background: var(--info-bg); color: var(--info); }

.badge--preparing { background: #e2e8f0; color: #334155; }
.badge--arrived   { background: #f3e8ff; color: #6b21a8; }
.badge--closed    { background: #e2e8f0; color: #475569; }

/* ----- Formulaires de gestion ----- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section {
  grid-column: 1 / -1;
  margin: 6px 0 -4px;
  font-size: .75rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding-top: 14px; border-top: 1px solid var(--line);
}
.form-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }

/* Interrupteur (actif / inactif) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__ui {
  position: relative; width: 44px; height: 26px; border-radius: 99px;
  background: var(--line-2); transition: background .2s; flex-shrink: 0;
}
.switch__ui::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s;
}
.switch input:checked + .switch__ui { background: var(--success); }
.switch input:checked + .switch__ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__ui { outline: 3px solid color-mix(in srgb, var(--brand-500) 55%, transparent); outline-offset: 2px; }
.switch input:disabled + .switch__ui { opacity: .5; cursor: not-allowed; }

/* Case à cocher */
.check { width: 20px; height: 20px; accent-color: var(--brand-600); cursor: pointer; }

/* ----- Encadré d'information et personne ----- */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--brand-50); color: var(--brand-900); font-size: .9rem; }
.callout .icon { margin-top: 2px; color: var(--brand-600); flex-shrink: 0; }

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .avatar { width: 32px; height: 32px; border-color: var(--line); }
.person__text { display: grid; line-height: 1.3; min-width: 0; }
.person__text small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

/* ----- Responsive des composants staff ----- */
@media (max-width: 1023px) {
  .page-staff .main { padding-bottom: 40px; }
  .page-staff .toast-container { bottom: 16px; }
  .filters, .filters--tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .input-group { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .form-grid { grid-template-columns: 1fr; }
  .actions, .actions .btn { width: 100%; }
  .role-tag { display: none; }
  .filters, .filters--tight { grid-template-columns: 1fr; }
}


/* =====================================================================
 * 16. COMPOSANTS PARTAGÉS ENTREPÔT CHINE / AGENCE BÉNIN
 *     Saisie par scan, cartes colis, sélection groupée, lots.
 * ===================================================================== */

/* ----- Zone de recherche / scan ----- */
.scan-hero {
  padding: 22px;
  border-radius: 20px;
  background:
    radial-gradient(500px 200px at 100% 0%, rgb(255 122 26 / .45), transparent 65%),
    linear-gradient(135deg, var(--brand-900), var(--brand-700));
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.scan-hero__label { color: #fff; font-weight: 700; margin-bottom: 10px; display: block; }
.scan-hero__form { display: flex; gap: 10px; flex-wrap: wrap; }
.scan-hero__form .input-group { flex: 1; min-width: 230px; }
.scan-hero__form .input {
  padding: 16px 16px 16px 46px;
  font-size: 1.125rem; font-weight: 600;
  letter-spacing: .02em;
  border-color: transparent;
}
.scan-hero__form .btn { padding: 15px 22px; font-size: 1rem; }
.scan-hero__hint { color: rgb(255 255 255 / .75); font-size: .8125rem; margin-top: 10px; }
.recv-kpis { margin-bottom: 8px; }

/* ----- Détails d'une carte colis ----- */
.pkg__client { font-size: .875rem; color: var(--ink-2); font-weight: 600; }
.pkg__action { color: var(--brand-600); font-weight: 700; font-size: .8125rem; white-space: nowrap; }

/* ----- En-tête de fiche colis (modale) ----- */
.recv-head { display: grid; gap: 10px; }
.recv-head__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.recv-head__track { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }

/* ----- Barre d'actions groupées ----- */
.bulk-bar {
  position: sticky; bottom: 14px; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--brand-900); color: #fff;
  box-shadow: var(--shadow-lg);
}
.bulk-bar strong { font-weight: 800; }

/* ----- Liste à cocher (colis d'un lot, choix d'un lot, retrait client) ----- */
.lot-pick { display: grid; gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 4px; }
.lot-pick label {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font-size: .9rem;
}
.lot-pick label:hover { background: var(--bg); }
.lot-pick__main { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.lot-pick__main strong { overflow-wrap: anywhere; }
.lot-pick__main small { color: var(--muted); }

/* ----- Totaux d'un lot ----- */
.lot-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.lot-totals div { padding: 12px; background: var(--bg); border-radius: var(--radius-sm); text-align: center; }
.lot-totals strong { display: block; font-size: 1.15rem; }
.lot-totals small { color: var(--muted); }

/* ----- Scanner caméra ----- */
.scan { display: grid; gap: 12px; }
.scan__frame { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan__frame video { width: 100%; height: 100%; object-fit: cover; }
.scan__frame::after {                     /* cadre de visée */
  content: ''; position: absolute; inset: 18% 12%;
  border: 3px solid var(--accent); border-radius: 14px;
  box-shadow: 0 0 0 999px rgb(0 0 0 / .35);
}

@media (max-width: 639px) {
  .scan-hero { padding: 16px; border-radius: 16px; }
  .scan-hero__form .btn { width: 100%; }
  .lot-totals { grid-template-columns: 1fr; }
  .bulk-bar { bottom: 10px; }
  .bulk-bar .btn { width: 100%; }
}
