/* ═══ EROTF — European Red Orient Transport Force ═══
   Thème clair (blanc + rouge) et thème sombre (noir-bleu + rouge).
   Par défaut : thème du système ; bouton soleil/lune = choix mémorisé (data-theme sur <html>). */
:root {
  --bg: #f3f4f7;
  --bg-2: #eceef3;
  --card: #ffffff;
  --card-2: #f8f9fb;
  --line: #e5e7ee;
  --text: #15171c;
  --muted: #6b7280;
  --accent: #e11d2a;
  --accent-2: #b3121d;
  --accent-soft: rgba(225, 29, 42, .08);
  --accent-tint: #fde9eb;
  --row-hover: rgba(225, 29, 42, .035);
  --ok: #16a34a;
  --red: #dc2626;
  --orange: #d97706;
  --blue: #2563eb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --shadow-lg: 0 16px 40px rgba(16, 24, 40, .12);
  --topbar: rgba(255, 255, 255, .92);
  --deco: rgba(20, 30, 50, .035);
  color-scheme: light;
}
/* Sombre noir-bleu */
:root[data-theme="dark"] {
  --bg: #060a14;
  --bg-2: #0a1020;
  --card: #0e1628;
  --card-2: #121c33;
  --line: #1c2842;
  --text: #e6ecf8;
  --muted: #8593b0;
  --accent: #ef3340;
  --accent-2: #c81d2a;
  --accent-soft: rgba(239, 51, 64, .14);
  --accent-tint: rgba(239, 51, 64, .16);
  --row-hover: rgba(255, 255, 255, .025);
  --ok: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --blue: #3b82f6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
  --topbar: rgba(6, 10, 20, .88);
  --deco: rgba(120, 150, 220, .035);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #060a14; --bg-2: #0a1020; --card: #0e1628; --card-2: #121c33; --line: #1c2842;
    --text: #e6ecf8; --muted: #8593b0; --accent: #ef3340; --accent-2: #c81d2a;
    --accent-soft: rgba(239, 51, 64, .14); --accent-tint: rgba(239, 51, 64, .16); --row-hover: rgba(255, 255, 255, .025);
    --ok: #22c55e; --red: #ef4444; --orange: #f59e0b; --blue: #3b82f6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 40px rgba(0, 0, 0, .45);
    --topbar: rgba(6, 10, 20, .88); --deco: rgba(120, 150, 220, .035);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}
/* Décor : grandes bandes diagonales discrètes + barres rouges en bas à gauche */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 62%, var(--deco) 62% 70%, transparent 70% 76%, var(--deco) 76% 80%, transparent 80%),
    linear-gradient(115deg, transparent 0 8%, var(--deco) 8% 14%, transparent 14%);
}
body::after {
  content: ""; position: fixed; left: -110px; bottom: -40px; width: 230px; height: 260px; z-index: -1; pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 38%, var(--accent) 38% 52%, transparent 52% 60%, var(--accent-2) 60% 74%, transparent 74%);
  opacity: .9;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.ic { flex: none; width: 1.15em; text-align: center; line-height: 1; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ── Barre du haut ── */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--topbar); backdrop-filter: blur(10px); border-bottom: 2px solid var(--accent); }
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 64px; height: 30px; display: block; }
.art { display: block; flex: none; }
.kpi-icon .art { width: 32px; height: 32px; }
.kpi-icon .art-truck, .kpi-icon .art-semi { width: 38px; height: 26px; }
.section-head h2 .art { width: 30px; height: 30px; }
.section-head h2 .art-truck, .section-head h2 .art-semi { width: 38px; height: 26px; }
.btn .art { width: 28px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 23px; font-weight: 900; letter-spacing: .5px; color: var(--text); }
.brand-text strong span { color: var(--accent); }
.brand-text small { font-weight: 700; color: var(--muted); font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase; margin-top: 3px; }
.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; position: relative; }
/* Pastille rouge qui glisse sous l'onglet actif */
.nav-pill { position: absolute; left: 0; top: 50%; height: 40px; width: 0; margin-top: -20px; border-radius: 10px; background: var(--accent);
  box-shadow: 0 4px 14px rgba(225, 29, 42, .35); opacity: 0; z-index: 0; pointer-events: none;
  transition: transform .45s cubic-bezier(.22, .9, .25, 1), width .45s cubic-bezier(.22, .9, .25, 1), opacity .25s; }
.nav.no-anim .nav-pill { transition: none; }
.nav a { white-space: nowrap; position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; height: 40px; color: var(--text); opacity: .85; padding: 0 12px; border-radius: 10px; font-weight: 500; font-size: 14px; transition: color .3s, opacity .3s, background-color .2s; }
.nav a .ic { color: var(--muted); transition: color .3s; }
.nav a:hover { opacity: 1; background: var(--accent-soft); text-decoration: none; }
.nav a.active { opacity: 1; color: #fff; font-weight: 700; }
.nav a.active:hover { background: transparent; }
.nav a.active .ic { color: #fff; }
.menu-btn, .theme-btn { display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 10px; width: 38px; height: 38px; cursor: pointer; flex: none; font-size: 17px; }
.menu-btn { display: none; margin-left: auto; }
.theme-btn:hover, .menu-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Contenu + transition entre les pages ── */
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
main.page-in { animation: page-in .38s cubic-bezier(.22, .9, .25, 1) both; }
@media (prefers-reduced-motion: reduce) { main.page-in { animation-duration: .2s; } }
/* main porte aussi .wrap (padding: 0 16px) → espacement haut/bas à redonner ici, sinon le contenu colle au header et au footer */
main.wrap { flex: 1; padding-top: 28px; padding-bottom: 56px; }
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.12; margin: 0 0 6px; letter-spacing: -.5px; font-weight: 900; }
h2 { font-size: 20px; margin: 0 0 14px; letter-spacing: -.2px; font-weight: 800; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--muted); }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.section-head h2 .ic { color: var(--accent); font-size: 22px; width: 28px; }
.section-head > a, .section-head > span { font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.section-head > span { color: var(--accent); }
.section-head > span.muted { color: var(--muted); font-weight: 500; }

/* ── Hero ── */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; min-height: 250px; }
.hero-text { padding: clamp(22px, 4vw, 36px); display: flex; flex-direction: column; justify-content: center; }
.hero h1 { font-size: clamp(26px, 3.4vw, 40px); }
.hero h1 .brand-red { color: var(--accent); display: block; }
.hero h1 .sub { display: block; font-size: .72em; letter-spacing: -.3px; }
.hero p { color: var(--muted); max-width: 520px; margin: 10px 0 22px; font-size: 15.5px; }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.hero-visual { position: relative; min-height: 250px; overflow: hidden; background: #2a0508; }
.hero-visual::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(105deg, var(--card) 0 13%, transparent 13% 17%, var(--accent) 17% 20%, transparent 20% 23%, var(--accent-2) 23% 25%, transparent 25%); }
/* Carrousel : fondu enchaîné + léger zoom lent (Ken Burns) */
.carousel .slide { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transform: scale(1.06); transition: opacity .9s ease, transform 6s ease-out; }
.carousel .slide.on { opacity: 1; transform: scale(1); z-index: 1; }
.carousel .slide.ph { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 14px; padding: 0 8% 0 30%; color: #fff; }
.carousel .ph1 { background-image: linear-gradient(135deg, #3b0a0f 0%, #b3121d 55%, #ff8a3d 100%); }
.carousel .ph2 { background-image: linear-gradient(135deg, #1a0306 0%, #8e0e18 50%, #e11d2a 100%); }
.carousel .ph3 { background-image: linear-gradient(135deg, #2b0710 0%, #c0392b 60%, #f5a623 100%); }
.carousel .ph-art { width: min(62%, 300px); filter: brightness(0) invert(1) drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
.carousel .ph-art .art { width: 100%; height: auto; }
.carousel .ph span { font-weight: 800; font-size: 15px; letter-spacing: .4px; text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.car-btn { position: absolute; top: 50%; z-index: 3; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .35); color: #fff; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .2s, background .2s; }
.car-btn.prev { left: 26%; } .car-btn.prev .ic { transform: rotate(180deg); }
.car-btn.next { right: 14px; }
.carousel:hover .car-btn, .car-btn:focus-visible { opacity: 1; }
.car-btn:hover { background: var(--accent); }
.car-dots { position: absolute; bottom: 12px; right: 16px; z-index: 3; display: flex; gap: 6px; }
.car-dots button { width: 9px; height: 9px; border-radius: 99px; border: 0; padding: 0; background: rgba(255, 255, 255, .5); cursor: pointer; transition: width .3s, background .3s; }
.car-dots button.on { width: 24px; background: #fff; }

/* Petites icônes dessinées dans le texte (remplacent les emojis) */
.art.xs { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -.2em; }
.inline-icons { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.theme-art { width: 22px; height: 22px; }

.btn { display: inline-flex; align-items: center; gap: 9px; background: var(--accent); color: #fff; font-weight: 700; padding: 12px 20px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 700; box-shadow: 0 6px 16px rgba(225, 29, 42, .28); }
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn .ic { font-size: 1.05em; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.ghost.danger { color: var(--danger, #ef4444); } .btn.ghost.danger:hover { border-color: var(--danger, #ef4444); background: rgba(239, 68, 68, .08); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn:disabled { opacity: .6; cursor: default; }

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

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--shadow); }
.card.pad-0 { padding: 0; overflow: hidden; }
.kpi { display: flex; align-items: flex-start; gap: 16px; padding: 20px; }
.kpi-icon { width: 54px; height: 54px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); display: grid; place-items: center; flex: none; }
.kpi-icon .ic { font-size: 23px; width: auto; }
.kpi .label { color: var(--muted); font-size: 14px; }
.kpi > div:last-child { min-width: 0; }
.kpi .value { font-size: clamp(20px, 2.1vw, 27px); font-weight: 900; letter-spacing: -.5px; margin-top: 2px; white-space: nowrap; }
.kpi .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ── Onglets ── */
.tabs { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; box-shadow: var(--shadow); }
.tabs button { background: none; border: 0; color: var(--muted); padding: 7px 13px; border-radius: 9px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--accent); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }

/* ── Tableaux ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; background: var(--card-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
td.right, th.right { text-align: right; }
.rank { width: 64px; font-weight: 800; color: var(--muted); }
.km-strong { color: var(--accent); font-weight: 800; }
.medal { width: 30px; height: 36px; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }

.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--card-2); flex: none; border: 1px solid var(--line); }
.avatar.lg { width: 88px; height: 88px; border-radius: 22px; }
.avatar-fallback { display: grid; place-items: center; font-weight: 800; color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; border: 1px solid transparent; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.green { color: #fff; background: var(--ok); }
.badge.green::before, .badge.red::before, .badge.orange::before, .badge.blue::before { background: #fff; }
.badge.blue { color: #fff; background: var(--blue); }
.badge.orange { color: #fff; background: var(--orange); }
.badge.red { color: #fff; background: var(--accent); }
.badge.plain::before { display: none; }
.badge.plain { color: var(--muted); background: var(--card-2); border-color: var(--line); }

.route { display: inline-flex; align-items: center; gap: 7px; }
.route .arrow { color: var(--text); opacity: .7; }

/* ── Listes accueil (podium / convois) ── */
.list-card { padding: 6px; display: grid; gap: 4px; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 11px; background: var(--accent-soft); color: var(--text); }
.list-row:hover { text-decoration: none; filter: brightness(.99); }
.list-row .grow { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .meta { color: var(--accent); font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }

/* ── Cartes chauffeurs ── */
.drivers { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.driver-card { display: flex; flex-direction: column; gap: 12px; color: var(--text); transition: border-color .15s, transform .15s; }
.driver-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.driver-card .top { display: flex; align-items: center; gap: 12px; }
.driver-card .name { font-weight: 700; }
.driver-card .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }

/* ── Profil ── */
.profile { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.profile-info { flex: 1; min-width: 220px; }
.profile-info .line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.progress { height: 10px; background: var(--card-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: inherit; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bar .fill { width: 100%; max-width: 54px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 8px 8px 3px 3px; min-height: 3px; }
.bar .v { font-size: 12px; font-weight: 700; }
.bar .l { font-size: 12px; color: var(--muted); }

/* ── Listes classées (stats) ── */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rank-list li { display: grid; gap: 5px; }
.rank-list .row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rank-list .row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Détail livraison ── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.detail-grid .item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.detail-grid .k { color: var(--muted); font-size: 12px; }
.detail-grid .v { font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }

/* ── Convois ── */
.convoys { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.convoy { display: flex; flex-direction: column; gap: 12px; }
.convoy img { border-radius: 10px; border: 1px solid var(--line); aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.convoy .when { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.convoy .when .ic { color: var(--accent); }
.convoy dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.convoy dt { color: var(--muted); }
.convoy dd { margin: 0; overflow-wrap: anywhere; }

.empty { text-align: center; color: var(--muted); padding: 34px 16px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.footer { border-top: 1px solid var(--line); padding: 22px 0; font-size: 13px; background: var(--card); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ── Connexion / menus ── */
.btn.sm { padding: 8px 14px; font-size: 13px; }
.user-slot { flex: none; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.user-menu summary:hover { background: var(--accent-soft); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu .avatar { width: 32px; height: 32px; }
.user-menu-list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; z-index: 20; }
.user-menu-list a, .user-menu-list button { color: var(--text); padding: 9px 12px; border-radius: 8px; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; }
.user-menu-list a:hover, .user-menu-list button:hover { background: var(--accent-soft); text-decoration: none; }
.user-menu-list button { color: var(--red); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ok); color: var(--text); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; max-width: calc(100% - 32px); }
.toast.error { border-left-color: var(--red); }

/* ── Formulaires ── */
.form { display: grid; gap: 14px; }
.form h2 { margin: 10px 0 0; font-size: 16px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.form input, .form select, .form textarea { font: inherit; color: var(--text); background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0; max-width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.form label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; font-size: 14px; }
.form label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.role-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.role-chip { position: relative; }
.role-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.role-chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.role-chip input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.role-chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.role-chip.disabled span { opacity: .45; cursor: not-allowed; }
.prose h2 { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; font-size: 18px; } .prose h2:first-child { margin-top: 0; }
.prose p { line-height: 1.6; } .prose td { white-space: normal; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; } .prose th { text-align: left; padding: 8px 10px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }

.dialog { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(560px, calc(100% - 32px)); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(3, 6, 14, .55); backdrop-filter: blur(3px); }

/* ── Cartes (MapLibre) ── */
.map-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.map-panel { display: grid; gap: 12px; }
.map-panel h2 { margin: 0; font-size: 16px; }
.map-box { overflow: hidden; }
.map { width: 100%; height: min(72vh, 680px); background: #0a1020; }
.map-embed { margin-bottom: 14px; overflow: hidden; }
.map-embed .map { height: 340px; }
.map-caption { padding: 10px 14px; font-size: 13px; border-top: 1px solid var(--line); }
.route-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.route-stats > div { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.route-stats .k { display: block; color: var(--muted); font-size: 11px; }
.route-stats .v { font-weight: 800; font-size: 16px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check-line input { accent-color: var(--accent); width: 16px; height: 16px; }
.map-legend { display: grid; gap: 8px; }
.map-legend img { width: 18px; height: 18px; object-fit: contain; }
.map-legend .swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.map-marker { width: 14px; height: 14px; border-radius: 50%; background: var(--c, #22c55e); border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(6, 10, 20, .8); }
.map-marker.end { border-radius: 3px; }
.maplibregl-popup.map-popup .maplibregl-popup-content { background: #121c33; color: #e6ecf8; border: 1px solid #1c2842; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.maplibregl-popup.map-popup .maplibregl-popup-tip { display: none; }
.maplibregl-ctrl-group { background: #121c33 !important; }
.maplibregl-ctrl-group button + button { border-top-color: #1c2842 !important; }
.maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { background: rgba(6, 10, 20, .7) !important; color: #8593b0 !important; }
.maplibregl-ctrl-attrib a { color: #8593b0 !important; }

/* ── Photos de profil ── */
.photo-card { margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.photo-card.busy { opacity: .6; pointer-events: none; }
.photo-img img, .photo-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
/* Photo détourée (PNG transparent, onglet Photos de l'appli) : affichée en entier, façon vitrine */
.photo-img.cutout { display: block; background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(255, 255, 255, .10), transparent 70%), linear-gradient(180deg, var(--card-2), var(--bg-2)); }
.photo-img.cutout img { object-fit: contain; padding: 10px 14px 14px; box-sizing: border-box; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .35)); transition: transform .3s ease; }
.photo-img.cutout:hover img { transform: scale(1.03); }
.gal-item.cutout > img { padding: 14px; box-sizing: border-box; background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(255, 255, 255, .10), transparent 70%), linear-gradient(180deg, var(--card-2), var(--bg-2)); filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .3)); }
.photo-empty { display: grid; place-items: center; align-content: center; gap: 10px; background: var(--card-2); color: var(--muted); font-size: 13px; text-align: center; padding: 12px; }
.photo-empty .art { width: 90px; height: 60px; opacity: .35; }
.photo-card figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; font-weight: 700; flex-wrap: wrap; }
/* ── Admin carrousel ── */
.hero-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.hero-thumb { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card-2); }
.hero-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.hero-thumb figcaption { display: flex; align-items: center; justify-content: space-between; padding: 8px; }
.hero-thumb .btn.sm { padding: 6px 9px; }
.hero-admin-grid > p { grid-column: 1 / -1; margin: 0; }

.brand-img { height: 44px; width: auto; display: block; }
.brand-dark { display: none; }
:root[data-theme="dark"] .brand-light:has(+ .brand-dark) { display: none; }
:root[data-theme="dark"] .brand-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-light:has(+ .brand-dark) { display: none; }
  :root:not([data-theme="light"]) .brand-dark { display: block; }
}
label.btn { cursor: pointer; }
/* ── Compte à rebours (objectif du mois) ── */
.countdown { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.countdown strong { font-size: 18px; font-weight: 800; color: var(--accent); }
.countdown .ic { color: var(--accent); }
/* ── Appli EROTF Présence (Mon espace) ── */
.presence-card { display: grid; gap: 14px; }
.presence-facts { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 3px; }
.presence-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.presence-steps > div { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.presence-steps .step { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 13px; margin-right: 10px; }
.presence-code { font: 800 30px/1.2 Consolas, ui-monospace, monospace; letter-spacing: 4px; color: var(--accent); margin: 12px 0 4px; user-select: all; }
.presence-devices { display: grid; gap: 8px; }
.presence-device { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
/* ── En direct (EROTF Tracker) ── */
.live-list { display: grid; gap: 8px; max-height: min(64vh, 620px); overflow: auto; }
.live-item { text-align: left; font: inherit; color: var(--text); background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.live-item:hover:not([disabled]), .live-item.on { border-color: var(--accent); }
.live-item[disabled] { cursor: default; opacity: .75; }
.live-route { font-weight: 700; }
.live-truck { display: grid; justify-items: center; gap: 2px; cursor: pointer; }
.live-truck .arrow { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45); position: relative; transition: transform .6s; }
.live-truck .arrow::after { content: ""; position: absolute; left: 50%; top: -7px; margin-left: -5px; border: 5px solid transparent; border-bottom: 8px solid #fff; border-top: 0; }
.live-truck.paused .arrow { background: #8593b0; }
.live-truck .tag { font: 700 11px/1 system-ui, sans-serif; color: #fff; background: rgba(6,10,20,.8); padding: 3px 6px; border-radius: 6px; white-space: nowrap; }
.live-popup .maplibregl-popup-content { min-width: 240px; }
.live-pop .progress { background: #1c2842; border-color: #1c2842; }
.live-card .ic { color: var(--accent); }
/* ═══ Refonte (maquettes) ═══ */
.avatar.md { width: 64px; height: 64px; }
.page-head h1 { font-size: clamp(30px, 4.4vw, 46px); }
/* Chauffeurs */
.drivers2 { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); }
@media (max-width: 520px) { .drivers2 { grid-template-columns: 1fr; } }
.dcard { color: var(--text); padding: 22px; display: grid; gap: 18px; transition: border-color .15s, transform .15s; }
.dcard:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.dc-head { display: flex; align-items: center; gap: 16px; }
.dc-name { display: grid; flex: 1; min-width: 0; }
.dc-name strong { font-size: 19px; }
.dc-status { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.dc-stats, .dc-foot { display: grid; border-top: 1px solid var(--line); padding-top: 16px; }
.dc-stats { grid-template-columns: repeat(3, 1fr); }
.dc-foot { grid-template-columns: 1.5fr 1fr; align-items: center; }
.dc-stats > div, .dc-foot > div { display: flex; align-items: center; gap: 12px; padding: 0 12px; min-width: 0; }
.dc-stats > div + div, .dc-foot > div + div { border-left: 1px solid var(--line); }
.dc-stats > div:first-child, .dc-foot > div:first-child { padding-left: 0; }
.dc-stats .ic, .dc-foot .ic { color: var(--accent); font-size: 22px; width: 26px; }
.dc-stats .art, .dc-foot .art { width: 30px; height: 26px; }
.dc-stats span, .dc-foot span { display: grid; min-width: 0; }
.dc-stats small, .dc-foot small { color: var(--muted); font-size: 13px; }
.dc-stats b { font-size: 20px; font-weight: 800; }
.dc-foot b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-photo { width: 110px; height: 62px; object-fit: cover; border-radius: 8px; margin-left: auto; flex: none; }
.dc-truck > span { flex: none; max-width: 55%; }
.dc-truck > span b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* camion détouré (PNG transparent) : en entier, sans cadre, avec ombre */
.dc-photo.cutout { width: 120px; height: 76px; object-fit: contain; object-position: center; border-radius: 0; margin: -10px auto;  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35)); transition: transform .2s ease; }
.driver-card:hover .dc-photo.cutout { transform: scale(1.06); }
@media (max-width: 520px) { .dc-foot { grid-template-columns: 1fr; gap: 12px; } .dc-foot > div + div { border-left: 0; padding-left: 0; } .dc-photo { width: 84px; height: 48px; } .dc-photo.cutout { width: 92px; height: 60px; } }
/* Bandeau (Convois) */
.banner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 240px; margin: -28px -16px 8px; padding: 36px 32px;
  background: linear-gradient(90deg, var(--card) 20%, rgba(14, 22, 40, 0) 100%), linear-gradient(120deg, #3b0a0f, #0e1628);
  border-bottom: 1px solid var(--line); border-radius: 0 0 18px 18px; overflow: hidden; }
.banner[style] { background: linear-gradient(90deg, var(--card) 14%, rgba(14, 22, 40, .45) 52%, rgba(0, 0, 0, 0) 100%), var(--banner) center / cover no-repeat; }
.banner h1 { font-size: clamp(38px, 6vw, 64px); margin: 4px 0 8px; }
.banner p { color: var(--muted); max-width: 470px; margin: 0; font-size: 17px; }
.banner .btn { align-self: flex-start; }
.big-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.big-head .ic { color: var(--accent); font-size: 28px; width: 32px; margin-top: 4px; }
.big-head .art { width: 32px; height: 32px; margin-top: 4px; }
.big-head h2 { margin: 0; font-size: 26px; }
.big-head p { margin: 2px 0 0; }
.empty-box { display: grid; justify-items: center; gap: 6px; padding: 30px; border-style: dashed; text-align: center; }
.empty-box .ic { font-size: 40px; width: auto; color: var(--muted); }
.empty-box .art { width: 60px; height: 44px; opacity: .6; }
.cv-list { display: grid; gap: 14px; }
.cv-row { display: grid; grid-template-columns: 1.25fr 1fr 1fr auto; padding: 18px 20px; align-items: center; }
.cv-row > div { padding: 0 20px; min-width: 0; }
.cv-row > div + div { border-left: 1px solid var(--line); }
.cv-row > div:first-child { padding-left: 0; }
.cv-date { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cv-date > .ic, .cv-date > .art { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 18px; padding: 8px; }
.cv-date span { display: grid; }
.cv-date b { font-size: 16px; }
.cv-date b::first-letter { text-transform: uppercase; }
.cv-date small { color: var(--muted); }
.plain-dot::before { display: none; }
.cv-route { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.cv-city { display: flex; gap: 8px; align-items: flex-start; }
.cv-city .ic { color: var(--accent); margin-top: 3px; }
.cv-city span { display: grid; }
.cv-city small { color: var(--muted); }
.cv-arrow { color: var(--muted); font-size: 18px; }
.cv-col { display: grid; gap: 7px; font-size: 14px; }
.cv-kv { display: grid; grid-template-columns: 18px 110px 1fr; gap: 10px; align-items: center; }
.cv-kv .ic { color: var(--muted); }
.cv-kv span:last-child { overflow: hidden; text-overflow: ellipsis; }
.cv-actions { display: grid; gap: 12px; justify-items: start; font-size: 14px; font-weight: 600; }
.cv-actions a { display: inline-flex; gap: 8px; align-items: center; }
@media (max-width: 1100px) { .cv-row { grid-template-columns: 1fr 1fr; gap: 16px 0; } .cv-row > div:nth-child(3) { border-left: 0; padding-left: 0; } }
@media (max-width: 700px) { .cv-row { grid-template-columns: 1fr; } .cv-row > div { border-left: 0 !important; padding-left: 0; } .cv-kv { grid-template-columns: 18px 100px 1fr; } .banner { padding: 26px 20px; } }
/* Statistiques */
.delta { font-weight: 700; }
.delta.good { color: var(--ok); }
.delta.bad { color: var(--red); }
.stats-mid { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 900px) { .stats-mid { grid-template-columns: 1fr; } }
.chip-lite { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; }
.chart { width: 100%; height: 240px; display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-lbl { fill: var(--muted); font-size: 11px; }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ch-dot { fill: var(--accent); }
.donut { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; justify-content: center; min-height: 240px; }
.donut svg { width: 190px; height: 190px; }
.dn-big { font-size: 34px; font-weight: 800; fill: var(--text); }
.dn-sub { font-size: 14px; fill: var(--muted); }
.donut ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; min-width: 170px; }
.donut li { display: grid; grid-template-columns: 14px 1fr auto 44px; gap: 10px; align-items: center; }
.donut .dot { width: 12px; height: 12px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 130px) 1fr 28px; gap: 12px; align-items: center; font-size: 14px; }
.hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-bar { height: 8px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.hb-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.hbars b { text-align: right; }
.rec { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.rec > .ic { color: var(--accent); font-size: 26px; align-self: start; margin-top: 4px; }
.rec > .art { width: 30px; height: 30px; align-self: start; }
.rec-v { font-size: 26px; font-weight: 800; margin: 2px 0; }
.rec dl { display: grid; grid-template-columns: auto auto; gap: 6px 22px; margin: 0; font-size: 14px; border-left: 1px solid var(--line); padding-left: 22px; }
.rec dt { color: var(--muted); }
.rec dd { margin: 0; }
@media (max-width: 600px) { .rec { grid-template-columns: auto 1fr; } .rec dl { grid-column: 1 / -1; border: 0; padding: 0; } }

/* En-tête plus large (8 onglets + connexion) */
.wrap { max-width: 1360px; }
.nav a { padding: 0 10px; gap: 6px; font-size: 13.5px; }
/* Carte : panneau de calcul + légende */
.map-panel2 { gap: 14px; }
.mp-title { display: flex; align-items: center; gap: 10px; font-size: 18px !important; margin: 0; }
.mp-title .ic { color: var(--accent); }
.mp-form { display: grid; gap: 12px; }
.mp-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.mp-field { display: flex; align-items: center; gap: 8px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px 0 12px; }
.mp-field:focus-within { border-color: var(--accent); }
.mp-field .ic { color: var(--muted); }
.mp-field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 14.5px; padding: 11px 0; }
.mp-clear { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.mp-clear:hover { color: var(--text); background: var(--line); }
.mp-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.mp-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-modes button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.mp-modes button.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.mp-go { justify-content: flex-start; border-radius: 10px; padding: 13px 16px; font-size: 15px; }
.mp-opts { display: grid; gap: 10px; }
.mp-opts label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.mp-opts input { position: absolute; opacity: 0; pointer-events: none; }
.mp-box { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.mp-opts input:checked + .mp-box { background: var(--accent); border-color: var(--accent); }
.mp-opts input:checked + .mp-box::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.mp-opts input:focus-visible + .mp-box { box-shadow: 0 0 0 3px var(--accent-soft); }
.mp-i { margin-left: auto; color: var(--muted); font-style: normal; }
.mp-info { display: flex; gap: 10px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--muted); }
.mp-info .ic { color: var(--muted); margin-top: 2px; }
.map-box2 { position: relative; }
.map-key { position: absolute; top: 12px; right: 52px; z-index: 2; display: grid; gap: 8px; background: rgba(10, 16, 32, .88); border: 1px solid #1c2842; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; color: #e6ecf8; backdrop-filter: blur(4px); }
.map-key div { display: flex; align-items: center; gap: 10px; }
.map-key img { width: 16px; height: 16px; }
.k-line { width: 22px; height: 4px; border-radius: 2px; background: #ef3340; }
.k-ring { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; background: #ef3340; box-sizing: border-box; margin: 0 4px; }
.k-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; margin: 0 8px; }
.k-conv { width: 22px; height: 4px; border-radius: 2px; background: #f59e0b; }
@media (max-width: 700px) { .map-key { display: none; } }
/* En direct : liste + étiquettes */
.count-badge { background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 1px 8px; }
.count-badge:empty { display: none; }
.live-item { display: flex; align-items: center; gap: 12px; }
.live-item .avatar { width: 46px; height: 46px; }
.live-item.on { border-color: var(--accent); background: var(--accent-soft); }
.live-item > .ic { margin-left: auto; color: var(--muted); }
.li-body { display: grid; gap: 1px; min-width: 0; font-size: 13.5px; }
.li-body strong { font-size: 15px; }
.li-route { color: var(--muted); }
.li-route b { color: var(--accent); }
.li-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.li-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.li-state.green { color: var(--ok); } .li-state.orange { color: var(--orange); } .li-state.muted { color: var(--muted); }
.live-truck { cursor: pointer; }
.lt-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(6, 10, 20, .88); border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; padding: 3px 8px 3px 3px; box-shadow: 0 4px 12px rgba(0, 0, 0, .45); white-space: nowrap; }
.lt-ic { width: 24px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--c, #ef3340); color: #fff; font-size: 11px; }
.lt-name { color: #fff; font: 700 12px/1 system-ui, sans-serif; }
/* Chauffeur sélectionné : flèche GPS orientée (même style que l'appli) + halo */
.live-truck { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lt-gps { display: none; width: 46px; height: 46px; position: relative; place-items: center; pointer-events: none; }
.lt-halo { position: absolute; inset: 7px; border-radius: 50%; background: rgba(225, 29, 42, .28); animation: lt-pulse 2.2s ease-out infinite; }
@keyframes lt-pulse { 0% { transform: scale(.55); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.lt-chev { width: 28px; height: 28px; transform: rotate(var(--r, 0deg)); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .55)); transition: transform .6s linear; position: relative; }
.lt-chev path { fill: #fff; stroke: #e11d2a; stroke-width: 3; stroke-linejoin: round; }
.live-truck.sel { z-index: 5; }
.live-truck.sel .lt-gps { display: grid; }
.live-truck.sel .lt-pill { border-color: #ef3340; }
.live-truck.sel .lt-ic { display: none; }
.live-truck.sel .lt-pill { padding: 4px 8px; position: absolute; top: 44px; left: 50%; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { .lt-halo { animation: none; } }
/* Graphique mensuel */
.mchart { width: 100%; height: 200px; display: block; }
.mc-bar { fill: var(--accent); }
.mc-v { fill: var(--text); font-size: 12px; font-weight: 700; }
/* Pied de page */
.footer-inner { align-items: center; }
.foot-id { display: grid; gap: 3px; }
.foot-sub { font-size: 12.5px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0; }
.foot-links a { color: var(--text); opacity: .85; padding: 2px 14px; border-left: 1px solid var(--line); font-size: 13px; }
.foot-links a:first-child { border-left: 0; }
.foot-links a:hover { color: var(--accent); opacity: 1; text-decoration: none; }

/* À propos / Recrutement / Contact */
.about-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.about-list li { display: flex; gap: 12px; align-items: center; }
.about-list .ic, .about-list .fa-brands { color: var(--accent); width: 20px; text-align: center; }
.join-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.join-step { position: relative; display: grid; gap: 8px; align-content: start; padding: 22px; }
.join-step > .ic, .join-step > .fa-brands { font-size: 28px; color: var(--accent); }
.join-step h3 { margin: 4px 0 0; font-size: 17px; }
.join-step p { margin: 0; font-size: 14px; }
.join-n { position: absolute; top: 16px; right: 18px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.contact-how { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.contact-how > .ic { font-size: 30px; color: var(--accent); margin-top: 4px; }
.contact-how h2 { margin: 0 0 4px; }
.contact-how p { margin: 0; }
.contact-cats { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.contact-cat { display: grid; gap: 6px; align-content: start; }
.contact-cat > .ic, .contact-cat > .fa-brands { font-size: 24px; color: var(--accent); }
.contact-cat h3 { margin: 4px 0 0; font-size: 16px; }
.contact-cat p { margin: 0; font-size: 14px; }
/* ── Recrutement ── */
.apps { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.app-card { display: flex; flex-direction: column; gap: 12px; }
.app-card .name { font-weight: 700; }
.app-dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 14px; }
.app-dl dt { color: var(--muted); }
.app-dl dd { margin: 0; overflow-wrap: anywhere; }
.app-motivation { margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--card-2); border-radius: 0 10px 10px 0; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.app-card .btn-row { margin-top: auto; }
.app-result { white-space: normal; max-width: 380px; font-size: 13px; }
@media (max-width: 480px) { .apps { grid-template-columns: 1fr; } }
/* ── Accès au site (gestion) ── */
.access-list { display: grid; gap: 10px; }
.access-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
.access-add { display: grid; gap: 12px; }
@media (max-width: 900px) { .access-row { grid-template-columns: 1fr; } }
/* Bouton-label (envoi de fichier) dans un formulaire : ne pas hériter du style des champs */
.form label.btn { display: inline-flex; justify-self: start; font-size: inherit; color: #fff; gap: 9px; }
.form label.btn.ghost { color: var(--text); }

@media (max-width: 1100px) {
  .nav a span.lbl { display: none; }
  .nav a { padding: 9px 10px; }
  .nav a.active span.lbl { display: inline; }
}
@media (max-width: 900px) {
  .kpis, .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { min-height: 200px; order: -1; }
  .hero-visual::before { display: none; }
  .car-btn.prev { left: 14px; }
  .carousel .slide.ph { padding: 0 8%; align-items: center; }
  .map-layout { grid-template-columns: 1fr; }
  .map { height: 60vh; }
  .section-head { flex-wrap: wrap; row-gap: 6px; }
  .convoy-row { flex-wrap: wrap; row-gap: 4px; }
  .convoy-row .grow { flex-basis: 100%; }
}
@media (max-width: 1100px) {
  .kpi { flex-direction: column; gap: 10px; }
}
/* Bandes rouges du coin : fixes, donc seulement quand la marge à gauche du contenu est assez large pour ne rien recouvrir */
@media (max-width: 1540px) { body::after { display: none; } }
@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .brand-text small { display: none; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--card); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; box-shadow: var(--shadow-lg); }
  .nav.open { display: flex; }
  .nav-pill { display: none; }
  .nav a.active { background: var(--accent); }
  .nav a span.lbl { display: inline; }
  th, td { padding: 10px 12px; }
  .hide-sm { display: none; }
  body::after { display: none; }
}
@media (max-width: 480px) {
  .kpis, .cols-3 { grid-template-columns: 1fr 1fr; }
  .kpi { flex-direction: column; gap: 10px; padding: 16px; }
  .kpi .value { font-size: 21px; }
  .user-menu summary .hide-sm { display: none; }
}

/* ── Ajouts : chauffeur du mois, défi, sur la route, badges, stats détaillées, calendrier, routes fréquentes ── */
.hidden { display: none !important; }
.badge.gold { color: #3b2a00; background: linear-gradient(135deg, #ffd766, #f0b429); }
.badge.gold::before { display: none; }
.badge.gold .ic { font-size: 11px; }
/* Chauffeur du mois */
.dom-card { position: relative; display: flex; align-items: center; gap: 18px; padding: 20px 22px; color: var(--text); overflow: hidden;
  background: linear-gradient(120deg, rgba(240, 180, 41, .16), transparent 60%), var(--card); border-color: rgba(240, 180, 41, .45); }
.dom-card:hover { text-decoration: none; border-color: #f0b429; }
.dom-card > .ic:last-child { margin-left: auto; color: var(--muted); }
.dom-crown { position: absolute; top: 10px; left: 72px; font-size: 20px; color: #f0b429; transform: rotate(-18deg); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.dom-info { display: grid; gap: 3px; min-width: 0; }
.dom-info .eyebrow { margin: 0; color: #d99a1e; }
.dom-info strong { font-size: 22px; font-weight: 900; letter-spacing: -.3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Défi du mois */
.ch-card .section-head { margin-bottom: 6px; }
.ch-title { margin: 0 0 4px; font-weight: 700; }
.ch-num { margin: 0 0 10px; font-size: 16px; }
.ch-num b { font-size: 26px; font-weight: 900; }
.progress.done > span { background: linear-gradient(90deg, #16a34a, var(--ok)); }
.progress.sm { height: 6px; margin-top: 6px; }
/* Sur la route maintenant */
.onroad { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.onroad-card { display: grid; gap: 8px; color: var(--text); padding: 16px; }
.onroad-card:hover { text-decoration: none; border-color: var(--accent); }
.onroad-card .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onroad-card .grow { flex: 1; min-width: 0; }
.onroad-empty { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: livepulse 2s infinite; flex: none; }
.live-dot.paused { background: var(--orange); animation: none; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
/* Badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.bdg { display: flex; gap: 12px; align-items: center; padding: 14px; opacity: .62; filter: grayscale(1); }
.bdg.on { opacity: 1; filter: none; border-color: rgba(240, 180, 41, .5); }
.bdg > div { display: grid; gap: 1px; min-width: 0; flex: 1; }
.bdg b { font-size: 14px; }
.bdg small { font-size: 12px; }
.bdg-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; font-size: 18px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.bdg.on .bdg-ic { background: linear-gradient(135deg, #ffd766, #f0b429); color: #3b2a00; border-color: transparent; }
/* Statistiques détaillées */
.xs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.xs-tile { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.xs-tile > .ic, .xs-tile > svg { color: var(--accent); font-size: 18px; width: 22px; text-align: center; flex: none; }
.xs-tile span { display: grid; min-width: 0; }
.xs-tile small { color: var(--muted); font-size: 12px; }
.xs-tile b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Convois : barre d'outils + calendrier */
.cv-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 18px; }
.cal-sub { position: relative; }
.cal-sub > summary { list-style: none; cursor: pointer; }
.cal-sub > summary::-webkit-details-marker { display: none; }
.cal-sub-box { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); font-size: 14px; }
.cal-url { display: flex; gap: 8px; }
.cal-url input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); }
.cal { padding: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-head h2 { margin: 0; font-size: 20px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day { min-height: 96px; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.out { opacity: .45; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-n { font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-day.today .cal-n { color: var(--accent); }
.cal-ev { display: block; font-size: 12px; line-height: 1.3; padding: 4px 6px; border-radius: 6px; background: rgba(34, 197, 94, .16); color: var(--text); border-left: 3px solid var(--ok); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.ext { background: rgba(59, 130, 246, .16); border-left-color: var(--blue); }
.cal-ev.must { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-ev:hover { text-decoration: none; filter: brightness(1.1); }
.cal-key { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 12.5px; }
.cal-key span { display: inline-flex; align-items: center; gap: 6px; }
.cal-sw { width: 12px; height: 12px; border-radius: 3px; background: var(--ok); display: inline-block; }
.cal-sw.ext { background: var(--blue); }
.cal-sw.must { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
@media (max-width: 700px) { .cal-day { min-height: 64px; padding: 4px; } .cal-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; background: var(--ok); } .cal-ev.ext { background: var(--blue); } .cal-ev b { display: none; } }
/* Carte : routes fréquentes */
.mp-heat-period { margin: -2px 0 2px 30px; }
.mp-heat-period .tabs { box-shadow: none; }
.mp-heat-period .tabs button { padding: 5px 10px; font-size: 12px; }
.k-heat { width: 22px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #f59e0b, #ef3340); }
@media (max-width: 700px) { .dom-card { padding: 16px; gap: 14px; } .dom-info strong { font-size: 18px; } .dom-crown { left: 60px; } }

/* ── Bulles d'info maison (survol prolongé sur [data-tip]) ── */
.tipbox { position: fixed; left: 0; top: 0; z-index: 1000; max-width: 300px; display: grid; gap: 3px; padding: 9px 12px; border-radius: 10px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.45;
  pointer-events: none; opacity: 0; transition: opacity .15s; }
.tipbox.show { opacity: 1; }
.tipbox b { font-size: 13.5px; }
.tipbox span { color: var(--muted); }
.tipbox b + span { color: var(--text); opacity: .85; }
.ch-hit { fill: transparent; cursor: default; }
.ch-hit:hover { fill: var(--accent-soft); }
[data-tip] { cursor: default; }
a[data-tip] { cursor: pointer; }
/* ── Accueil rangé : trio (chauffeur du mois · défi · podium) puis duo (convois · livraisons) ── */
.home-trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: stretch; }
.home-trio > .card { margin: 0; }
.home-trio .dom-card { flex-direction: column; align-items: flex-start; text-align: left; }
.home-trio .dom-card > .ic:last-child { display: none; }
.home-trio .dom-crown { left: 70px; top: 12px; }
.home-podium .list-card { display: grid; gap: 8px; }
.home-podium .section-head { margin-bottom: 10px; }
.home-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lr-main { display: grid; gap: 1px; flex: 1; min-width: 0; }
.lr-main b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-main small { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .avatar { width: 34px; height: 34px; }
@media (max-width: 900px) { .home-duo { grid-template-columns: 1fr; } }
/* ── Fiche chauffeur : onglets ── */
.ptabs { display: flex; gap: 4px; margin: 16px 0 0; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; position: sticky; top: 70px; z-index: 5; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; font-size: 14px; padding: 9px 14px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.ptabs button:hover { color: var(--text); background: var(--card-2); }
.ptabs button.on { background: var(--accent); color: #fff; }
.ptab-n { font-size: 11.5px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--card-2); color: var(--muted); }
.ptab-n:empty { display: none; }
.ptabs button.on .ptab-n { background: rgba(255, 255, 255, .22); color: #fff; }
.pane { display: none; }
.pane.on { display: block; animation: panein .2s ease; }
@keyframes panein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pane.on { animation: none; } }
/* ── Statistiques détaillées regroupées ── */
.xs-groups { align-items: start; }
.xs-group .xs-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
.xs-group .xs-tile { box-shadow: none; background: var(--card-2); }
@media (max-width: 1100px) { .xs-groups { grid-template-columns: 1fr; } .xs-group .xs-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }

/* ── Accueil (maquette) : bandeau pleine largeur + chiffres + livraisons / classement / convoi ── */
html, body { overflow-x: clip; }
.hero2 { position: relative; margin: -28px calc(50% - 50vw) 0; min-height: 360px; display: flex; align-items: center; overflow: hidden; background: #070b16; border-bottom: 1px solid var(--line); isolation: isolate; }
.hero2-bg { position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, #0a0f1e 0%, #1c0508 55%, #7a0d16 100%); }
.hero2-bg::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, rgba(6, 10, 20, .94) 0%, rgba(6, 10, 20, .78) 32%, rgba(6, 10, 20, .25) 62%, rgba(6, 10, 20, .05) 100%),
              linear-gradient(0deg, rgba(6, 10, 20, .55) 0%, transparent 30%); }
.hb-slide { position: absolute; inset: 0; background: center 40% / cover no-repeat; opacity: 0; transform: scale(1.05); transition: opacity 1.2s ease, transform 7s ease-out; }
.hb-slide.on { opacity: 1; transform: scale(1); z-index: 1; }
.hb-dots { position: absolute; right: 24px; bottom: 16px; z-index: 3; display: flex; gap: 6px; }
.hb-dots button { width: 9px; height: 9px; border-radius: 99px; border: 0; padding: 0; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .3s, background .3s; }
.hb-dots button.on { width: 24px; background: #fff; }
.hero2-in { width: 100%; max-width: 1360px; margin: 0 auto; padding: 44px 16px; color: #fff; }
.hero2-eyebrow { display: block; font-size: 12.5px; font-weight: 800; letter-spacing: 2.6px; text-transform: uppercase; color: rgba(255, 255, 255, .78); margin-bottom: 8px; }
.hero2-eyebrow i { font-style: normal; margin: 0 6px; opacity: .6; }
.hero2-title { margin: 0; font-size: clamp(56px, 8.5vw, 104px); font-weight: 900; line-height: .92; letter-spacing: -2px; color: #fff; }
.hero2-title span { color: var(--accent); }
.hero2-sub { margin: 6px 0 0; font-size: clamp(20px, 2.4vw, 30px); font-weight: 800; letter-spacing: -.3px; color: #fff; }
.hero2-text { margin: 14px 0 26px; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.5; color: rgba(255, 255, 255, .86); max-width: 560px; }
.hero2-btn { padding: 13px 22px; font-size: 15px; border-radius: 10px; }
.hero2-btn.ghost { background: rgba(6, 10, 20, .35); color: #fff; border: 1px solid rgba(255, 255, 255, .55); backdrop-filter: blur(4px); }
.hero2-btn.ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.home-kpis { margin-top: 22px; }
.home-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.home-side { display: grid; gap: 16px; }
.home-deliv { padding-bottom: 8px; }
.home-deliv .card.pad-0 { box-shadow: none; border: 0; background: none; }
.home-board table { width: 100%; }
.home-board tr.first td { background: var(--accent-soft); }
.home-board tr.first td:first-child { border-radius: 10px 0 0 10px; } .home-board tr.first td:last-child { border-radius: 0 10px 10px 0; }
.home-board .avatar { width: 32px; height: 32px; }
.nc-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 22px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.nc-empty > .ic { font-size: 28px; color: var(--muted); }
.nc-empty span { font-size: 13px; }
.nc { display: grid; gap: 10px; padding: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); }
.nc:hover { text-decoration: none; filter: brightness(1.05); }
.nc-top { display: flex; gap: 6px; flex-wrap: wrap; }
.nc-route { font-size: 20px; font-weight: 900; letter-spacing: -.3px; }
.nc-route span { color: var(--accent); font-size: .8em; margin: 0 4px; }
.nc-meta { display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.nc-meta .ic { width: 16px; color: var(--accent); }
.nc-count { font-size: 13px; }
.nc-count b { color: var(--accent); }
@media (max-width: 1000px) { .home-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .hero2 { min-height: 300px; } .hero2-in { padding: 32px 16px; } .hero2-bg::after { background: linear-gradient(90deg, rgba(6, 10, 20, .9), rgba(6, 10, 20, .55)); } }
.home-deliv th, .home-deliv td, .home-board th, .home-board td { padding: 10px 8px; white-space: nowrap; font-size: 13.5px; }
.home-deliv th:first-child, .home-deliv td:first-child { padding-left: 12px; }
.home-deliv .table-wrap, .home-board .table-wrap { overflow-x: auto; }
.home-deliv .avatar { width: 30px; height: 30px; }
@media (max-width: 1250px) and (min-width: 1001px) { .home-deliv th:nth-child(5), .home-deliv td:nth-child(5) { display: none; } }
.home-side, .home-side > .card, .home-deliv { min-width: 0; }
@media (max-width: 600px) { .home-deliv th:nth-child(n+4), .home-deliv td:nth-child(n+4) { display: none; } .home-board th:nth-child(4), .home-board td:nth-child(4) { display: none; } .home-board .section-head, .home-deliv .section-head { flex-wrap: wrap; } }

/* ── Recherche globale ── */
.search-btn { font-size: 15px; }
.search-btn + .theme-btn { margin-left: 8px; }
.search-modal { position: fixed; inset: 0; z-index: 900; background: rgba(3, 6, 14, .6); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; animation: srin .15s ease; }
@keyframes srin { from { opacity: 0; } to { opacity: 1; } }
.search-box { width: min(640px, 100%); max-height: 75vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-field > .ic { color: var(--accent); font-size: 17px; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 17px; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field kbd, .search-foot kbd { font: 600 11px/1 inherit; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--card-2); }
.search-res { overflow-y: auto; padding: 8px; }
.sr-group + .sr-group { margin-top: 6px; }
.sr-title { font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text); }
.sr-item:hover, .sr-item.on { background: var(--accent-soft); text-decoration: none; }
.sr-item > .ic:first-child { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--card-2); color: var(--accent); flex: none; }
.sr-item .avatar { width: 30px; height: 30px; }
.sr-item > span { display: grid; min-width: 0; flex: 1; }
.sr-item b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item > .ic:last-child { color: var(--muted); opacity: 0; }
.sr-item.on > .ic:last-child { opacity: 1; }
.sr-empty { padding: 26px; text-align: center; color: var(--muted); }
/* ── Records ── */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.rc { display: flex; gap: 16px; align-items: flex-start; padding: 20px; color: var(--text); position: relative; overflow: hidden; }
a.rc:hover { text-decoration: none; border-color: var(--accent); }
.rc::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--accent-soft); }
.rc-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.rc-ic .art { width: 26px; height: 26px; }
.rc-body { display: grid; gap: 4px; min-width: 0; }
.rc-title { font-size: 13px; color: var(--muted); font-weight: 600; }
.rc-v { font-size: 26px; font-weight: 900; letter-spacing: -.4px; }
.rc-d { font-size: 13px; }
.rc-who { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-top: 2px; }
.rc-who .avatar { width: 26px; height: 26px; }
/* ── Comparer ── */
.cmp-pick { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 16px; }
.cmp-pick label { display: flex; align-items: center; gap: 10px; }
.cmp-pick select { font: inherit; font-weight: 700; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); min-width: 200px; }
.cmp-vs { font-weight: 900; color: var(--accent); font-size: 18px; }
.cmp { padding: 18px 20px; }
.cmp-heads { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 12px; }
.cmp-head { display: flex; align-items: center; gap: 12px; color: var(--text); }
.cmp-head:hover { text-decoration: none; }
.cmp-head div { display: grid; min-width: 0; }
.cmp-head b { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-head.b { flex-direction: row-reverse; text-align: right; }
.cmp-score { margin-left: auto; font-size: 30px; font-weight: 900; color: var(--accent); }
.cmp-head.b .cmp-score { margin-left: 0; margin-right: auto; }
.cmp-mid { font-size: 12px; text-align: center; }
.cmp-row { display: grid; grid-template-columns: 1fr minmax(120px, 190px) 1fr; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.cmp-l { text-align: center; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.cmp-v { display: flex; align-items: center; gap: 10px; }
.cmp-v.a { flex-direction: row-reverse; }
.cmp-v b { min-width: 90px; font-size: 15px; }
.cmp-v.a b { text-align: right; } .cmp-v.b b { text-align: left; }
.cmp-bar { flex: 1; height: 8px; background: var(--card-2); border-radius: 99px; overflow: hidden; display: flex; }
.cmp-v.a .cmp-bar { justify-content: flex-end; }
.cmp-bar span { display: block; height: 100%; border-radius: 99px; background: var(--muted); opacity: .45; }
.cmp-v.win .cmp-bar span { background: var(--accent); opacity: 1; }
.cmp-v.win b { color: var(--accent); }
@media (max-width: 700px) {
  .cmp-row { grid-template-columns: 1fr 1fr; } .cmp-l { grid-column: 1 / -1; grid-row: 1; }
  .cmp-v b { min-width: 0; } .cmp-heads { grid-template-columns: 1fr 1fr; } .cmp-mid { display: none; }
}
@media (max-width: 1500px) { .topbar-inner { gap: 12px; } .user-slot > .btn .hide-sm { display: none; } .user-slot > .btn { padding-left: 12px; padding-right: 12px; } }

/* ── En direct : plein écran / mode TV ── */
body.tv .topbar, body.tv .footer { display: none; }
body.tv main.wrap { max-width: none; padding: 0; }
body.tv .tv-layout { position: fixed; inset: 0; display: block; margin: 0; }
body.tv .tv-layout .map-box { position: absolute; inset: 0; border-radius: 0; border: 0; }
body.tv .tv-layout .map-box .map { height: 100%; }
body.tv .tv-layout .map-panel { position: absolute; left: 16px; top: 16px; z-index: 5; width: 320px; max-height: calc(100vh - 32px); overflow: auto;
  background: rgba(8, 12, 22, .86); backdrop-filter: blur(6px); border-color: rgba(255, 255, 255, .12); color: #eef2fa; }
.tv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tv-brand { font-weight: 900; font-size: 22px; letter-spacing: -.3px; color: #fff; }
.tv-brand b { color: var(--accent); }
.tv-brand small { font-size: 12px; font-weight: 700; color: #aab3c5; margin-left: 6px; text-transform: uppercase; letter-spacing: 1px; }
.tv-clock { margin-left: auto; font-size: 20px; font-weight: 800; }
.live-opts { margin-top: 10px; }

/* ── Galerie ── */
.gal-filters { margin-bottom: 16px; gap: 10px; }
.gallery { columns: 3 300px; column-gap: 14px; }
.gal-item { break-inside: avoid; margin: 0 0 14px; border-radius: 14px; overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); cursor: zoom-in; position: relative; }
.gal-item > img { width: 100%; display: block; transition: transform .4s ease; }
.gal-item:hover > img { transform: scale(1.03); }
.gal-item figcaption { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.gal-item figcaption .avatar { width: 30px; height: 30px; }
.gal-item figcaption span { display: grid; min-width: 0; }
.gal-item figcaption small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer { position: fixed; inset: 0; z-index: 950; background: rgba(3, 6, 14, .92); display: grid; place-items: center; padding: 40px 70px 80px; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.viewer-cap { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; color: #fff; background: rgba(8, 12, 22, .8); border-radius: 99px; padding: 6px 16px 6px 6px; }
.viewer-cap .avatar { width: 30px; height: 30px; }
.viewer-cap a { color: #fff; font-weight: 700; }
.viewer-btn { position: fixed; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 17px; }
.viewer-btn:hover { background: var(--accent); }
.viewer-btn.prev { left: 16px; top: 50%; } .viewer-btn.next { right: 16px; top: 50%; } .viewer-btn.close { right: 16px; top: 16px; }
/* ── Mon année ── */
.yr-banner { display: flex; align-items: center; gap: 14px; margin: 18px 0 0; color: var(--text); background: linear-gradient(110deg, var(--accent-soft), transparent 60%), var(--card); border-color: var(--accent); }
.yr-banner:hover { text-decoration: none; }
.yr-banner span { display: grid; flex: 1; }
.yr-banner > .ic:first-child, .yr-banner > svg:first-child { font-size: 24px; color: var(--accent); }
.yr-hero { display: flex; align-items: center; gap: 22px; padding: 28px; border-radius: 20px; margin-bottom: 18px;
  background: radial-gradient(circle at 85% 20%, rgba(239, 51, 64, .35), transparent 50%), linear-gradient(135deg, #1a0508, #0a1020); color: #fff; }
.yr-hero h1 { margin: 2px 0 6px; font-size: clamp(28px, 4vw, 44px); }
.yr-hero p { margin: 0 0 14px; color: #c9d1e2; }
.yr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.yr-card { display: grid; gap: 4px; align-content: start; padding: 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.yr-card > .ic, .yr-card > svg { font-size: 22px; color: var(--accent); margin-bottom: 4px; }
.yr-card b { font-size: 30px; font-weight: 900; letter-spacing: -.5px; line-height: 1.1; overflow-wrap: anywhere; }
.yr-card small { color: var(--muted); font-size: 13px; }
.yr-card.big { grid-column: span 2; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: 0; }
.yr-card.big > .ic, .yr-card.big small { color: rgba(255, 255, 255, .85); }
.yr-card.big b { font-size: 46px; }
.yr-card.wide { grid-column: span 2; }
.yr-card.gold { background: linear-gradient(135deg, rgba(240, 180, 41, .22), transparent), var(--card); border-color: rgba(240, 180, 41, .5); }
.yr-card.gold > .ic { color: #f0b429; }
@media (max-width: 560px) { .yr-card.big, .yr-card.wide { grid-column: auto; } .yr-hero { flex-direction: column; align-items: flex-start; } }

/* ══ Grosse mise à jour ══ */
/* Liens rapides + annonces (accueil) */
.ann-list { display: grid; gap: 10px; }
.ann { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; }
.ann.pinned { border-color: var(--accent); background: linear-gradient(110deg, var(--accent-soft), transparent 55%), var(--card); }
.ann-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ann p { margin: 3px 0 4px; color: var(--muted); white-space: pre-line; }
.ann-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
/* Mode compact (tableaux) */
body.compact th, body.compact td { padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
body.compact td .avatar { width: 24px; height: 24px; }
body.compact .badge { padding: 2px 8px; font-size: 11px; }
/* Profil personnalisé */
.card.profile.custom { border-color: var(--pc); background: linear-gradient(115deg, color-mix(in srgb, var(--pc) 22%, transparent), transparent 60%), var(--card); }
.card.profile.custom h1 { color: var(--pc); }
.profile-bio { margin: 2px 0 8px; color: var(--muted); font-style: italic; max-width: 640px; }
.profile { position: relative; }
.profile-share { position: absolute; right: 16px; top: 16px; }
.me-profile { display: grid; gap: 12px; }
.me-profile textarea, .me-profile input { width: 100%; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c, transparent); border: 2px solid var(--line); cursor: pointer; }
.sw.none span { background: conic-gradient(var(--accent) 0 50%, #0e1628 0); }
.sw input:checked + span { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--c, var(--accent)); }
.col-stack { display: grid; gap: 16px; align-content: start; }
/* Alertes perso : petites pastilles cliquables + recherche */
.watch-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.watch-search { flex: 1; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 9px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); }
.watch-search:focus-within { border-color: var(--accent); }
.form .watch-search input, .watch-search input { flex: 1; min-width: 0; border: 0 !important; background: none !important; padding: 0 !important; height: auto; box-shadow: none !important; font: inherit; font-size: 14px; color: var(--text); outline: none; }
.watch-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.watch-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow: auto; padding: 2px; }
.wchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px 0 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: 600 13px/1 inherit; cursor: pointer; transition: border-color .15s, background .15s; max-width: 190px; }
.wchip:hover { border-color: var(--accent); }
.wchip .avatar { width: 24px; height: 24px; flex: none; }
.wchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wchip i { display: none; font-style: normal; font-size: 11px; color: var(--accent); }
.wchip.on { border-color: var(--accent); background: var(--accent-soft); }
.wchip.on i { display: inline-flex; }
.wchip[hidden] { display: none; }
.wchip:disabled { opacity: .6; cursor: progress; }
.watch-none { margin: 4px 2px; font-size: 13px; }
/* Page d'un convoi */
.cvp-count { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 16px; }
.cvp-count b { color: var(--accent); font-size: 20px; }
.cvp-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.cvp-dl dt { color: var(--muted); }
.cvp-dl dd { margin: 0; font-weight: 600; }
.cvp-people { display: grid; gap: 6px; }
.cvp-p { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--card-2); color: var(--text); }
.cvp-p:hover { text-decoration: none; filter: brightness(1.05); }
.cvp-p b { flex: 1; }
.cvp-p .avatar { width: 30px; height: 30px; }
.past-map-box { position: relative; }
.past-map-box .map { height: min(70vh, 620px); }
.past-key { position: absolute; left: 12px; bottom: 12px; z-index: 2; background: rgba(10, 16, 32, .88); color: #e6ecf8; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
/* Trajets */
.rt-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.rt-form label { display: grid; gap: 6px; flex: 1; min-width: 180px; font-weight: 600; font-size: 13px; color: var(--muted); }
.rt-form input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); }
.rt-arrow { padding-bottom: 12px; color: var(--accent); }
.rt-pop { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rt-chip { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; color: var(--text); }
.rt-chip:hover { border-color: var(--accent); text-decoration: none; }
.rank-n { width: 26px; text-align: center; font-weight: 800; color: var(--muted); }
/* Revoir la conduite */
.replay { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.replay .tabs { box-shadow: none; }
.replay .tabs button { padding: 5px 10px; }
.replay input[type=range] { flex: 1; min-width: 140px; accent-color: var(--accent); }
.rp-time { font-size: 13px; color: var(--muted); min-width: 92px; text-align: right; }
.rp-truck { width: 26px; height: 26px; display: grid; place-items: center; }
.rp-truck span { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 16px solid #fff; transform: rotate(var(--r, 0deg)); filter: drop-shadow(0 0 3px #e11d2a) drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
/* Copilote (téléphone) */
body.copilot main.wrap { max-width: none; padding: 0; }
.cop { position: fixed; inset: 0; background: #0a1020; }
.cop > .cop-map { position: absolute; inset: 0; height: auto; } /* plus précis que .maplibregl-map (position: relative), chargé après */
.cop-top { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 3; display: flex; align-items: center; gap: 10px; }
.cop-brand { font-weight: 900; font-size: 20px; color: #fff; text-shadow: 0 1px 3px #000; }
.cop-brand b { color: var(--accent); }
.cop-brand small { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: #cbd3e3; margin-left: 4px; }
.cop-clock { margin-left: auto; font-weight: 800; font-size: 18px; color: #fff; text-shadow: 0 1px 3px #000; }
.cop-card { position: absolute; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 3; display: grid; gap: 8px; padding: 14px 16px; border-radius: 16px;
  background: rgba(8, 12, 22, .9); backdrop-filter: blur(8px); color: #eef2fa; border: 1px solid rgba(255, 255, 255, .1); max-width: 560px; margin: 0 auto; }
.cop-speed { display: flex; align-items: baseline; gap: 6px; }
.cop-speed b { font-size: 46px; font-weight: 900; line-height: 1; }
.cop-speed b.over { color: #ff4d57; }
.cop-speed small { color: #aab3c5; }
.cop-limit { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 5px solid #e11d2a; background: #fff; color: #111; display: grid; place-items: center; font-weight: 900; }
.cop-route { font-size: 20px; font-weight: 800; }
.cop-route span { color: var(--accent); }
.cop-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cop-row span { display: grid; }
.cop-row small { color: #aab3c5; font-size: 12px; }
.cop-row b { font-size: 17px; }
.cop-truck { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(225, 29, 42, .3); }
.cop-truck span { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 19px solid #fff; transform: rotate(var(--r, 0deg)); filter: drop-shadow(0 0 3px #e11d2a); }
/* Nouveautés */
.news-card { margin-bottom: 14px; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.news-list li { display: flex; gap: 10px; align-items: baseline; }
.news-list .badge { flex: none; }
.news-modal { position: fixed; inset: 0; z-index: 960; background: rgba(3, 6, 14, .6); display: grid; place-items: center; padding: 16px; }
.news-modal .card { width: min(560px, 100%); max-height: 80vh; overflow: auto; box-shadow: var(--shadow-lg); }
.news-modal .news-list li::before { content: "•"; color: var(--accent); font-weight: 900; }

/* ─── Badges (fiche chauffeur) ─── */
.bdg-head { display: grid; gap: 12px; }
.bdg-score { display: flex; align-items: baseline; gap: 8px; }
.bdg-score b { font-size: 34px; font-weight: 900; line-height: 1; }
.bdg-score span { color: var(--muted); font-weight: 600; }
.bdg-bar { height: 8px; border-radius: 8px; background: var(--card-2); overflow: hidden; }
.bdg-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #f59e0b); border-radius: 8px; }
.rchips { display: flex; flex-wrap: wrap; gap: 6px; }
.rchip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 9px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); }
.rchip i { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 6px var(--rc); }
.rchip b { color: var(--text); }
.bdg-tools { gap: 6px; flex-wrap: wrap; }
.bdg-cat .section-head h2 { display: flex; align-items: center; gap: 8px; }
.bdg-cat-e { font-size: 20px; }
.bdg2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.bdg2 { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 12px 12px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.bdg2::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--rc); opacity: .35; }
.bdg2.on { border-color: color-mix(in srgb, var(--rc) 55%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--rc) 12%, var(--card)), var(--card) 60%); }
.bdg2.on::before { opacity: 1; }
.bdg2-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: var(--card-2); border: 2px solid var(--line); filter: grayscale(1); opacity: .55; }
.bdg2.on .bdg2-ic { filter: none; opacity: 1; border-color: var(--rc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 20%, transparent), 0 0 14px color-mix(in srgb, var(--rc) 35%, transparent); }
.bdg2-tx { display: grid; gap: 2px; min-width: 0; flex: 1; }
.bdg2-tx b { font-size: 14px; }
.bdg2-tx small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.bdg2:not(.on) .bdg2-tx b { color: var(--muted); }
.bdg2-pg { height: 5px; border-radius: 5px; background: var(--card-2); overflow: hidden; margin-top: 6px; }
.bdg2-pg span { display: block; height: 100%; background: var(--rc); border-radius: 5px; }
.bdg2-v { font-size: 11.5px !important; }
.bdg2-r { position: absolute; top: 8px; right: 10px; font-size: 10px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--rc); }
.bdg2.hidden-secret .bdg2-ic { filter: none; opacity: .8; background: #0b0f18; }
.bdg2[style*="#111827"] .bdg2-r { color: var(--muted); }
.awards-list { display: grid; gap: 6px; max-height: 55vh; overflow: auto; }
.award { display: grid; grid-template-columns: auto auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); cursor: pointer; }
.award input { grid-row: span 2; }
.award span { grid-row: span 2; font-size: 20px; }
.award small { grid-column: 3; }
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(4, 7, 14, .62); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal-card { width: min(560px, 100%); max-height: 90vh; overflow: auto; }

/* ─── Badges : zone qui défile, rareté, épingle, vitrine ─── */
.bdg-scroll { max-height: 640px; overflow-y: auto; padding-right: 6px; margin-right: -6px; overscroll-behavior: contain; }
.bdg-scroll::-webkit-scrollbar { width: 9px; }
.bdg-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
.bdg-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); background-clip: padding-box; }
.bdg-scroll .section:first-child { margin-top: 0; }
.bdg-hint { font-size: 13px; margin: 0 0 12px; }
.bdg { position: relative; }
.bdg .bdg-r { color: var(--rc); font-weight: 800; font-size: 10.5px !important; letter-spacing: .5px; text-transform: uppercase; margin-top: 2px; }
.bdg:not(.on) .bdg-r { color: var(--muted); }
.bdg .progress.sm { margin-top: 6px; }
.bdg .bdg-v { font-size: 11.5px !important; }
.bdg.on { border-color: color-mix(in srgb, var(--rc) 50%, transparent); }
.bdg-pin { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: var(--card-2); color: var(--muted); display: grid; place-items: center; cursor: pointer; font-size: 11px; opacity: 0; transition: opacity .15s; }
.bdg:hover .bdg-pin, .bdg-pin.on { opacity: 1; }
.bdg-pin.on { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: none) { .bdg-pin { opacity: 1; } }
.showcase { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sc-badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: color-mix(in srgb, var(--rc) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--rc) 55%, transparent); font-size: 13px; }
.sc-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: linear-gradient(135deg, #ffd766, #f0b429); color: #3b2a00; box-shadow: 0 0 10px color-mix(in srgb, var(--rc) 45%, transparent); }
/* en-tête des badges : reste visible, flou derrière (les badges glissent dessous) */
.bdg-head { position: sticky; top: 132px; z-index: 4; background: color-mix(in srgb, var(--card) 72%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.bdg-scroll { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); padding-top: 10px; padding-bottom: 10px; }
.profile-bio a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.bdg-more { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 9px; border-radius: 10px; border: 1px dashed var(--line); background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.bdg-more:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
/* flou plus marqué derrière l'en-tête des badges */
.bdg-head { background: color-mix(in srgb, var(--card) 45%, transparent); backdrop-filter: blur(22px) saturate(1.5) brightness(.9); -webkit-backdrop-filter: blur(22px) saturate(1.5) brightness(.9);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); box-shadow: 0 12px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06); }

/* ─── Couleurs / bannières débloquables ─── */
.sw.locked { opacity: .45; cursor: not-allowed; }
.sw.locked span { display: grid; place-items: center; color: #fff; font-size: 10px; }
.banners { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 6px; }
.bn { position: relative; cursor: pointer; }
.bn input { position: absolute; opacity: 0; }
.bn-prev { display: flex; align-items: flex-end; height: 54px; padding: 6px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; border: 2px solid transparent; background-color: var(--card-2); }
.bn input:checked + .bn-prev { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bn.locked { cursor: not-allowed; } .bn.locked .bn-prev { filter: grayscale(.85) brightness(.6); }
.bn-none { color: var(--muted); text-shadow: none; border: 2px dashed var(--line); }
@keyframes bn-shift { to { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) { /* bannière sur la fiche : bandeau en haut de la carte profil */
/* ─── Inscription convoi ─── */
.cvp-count { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cvp-rsvp { display: inline-flex; gap: 6px; }
.cvp-rsvp .btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
/* ─── Notifications du navigateur ─── */
.push-on { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 700; margin-bottom: 8px; }
.push-topics { display: grid; gap: 4px; margin-bottom: 10px; font-size: 14px; }
.push-topics label { display: flex; align-items: center; gap: 8px; }
/* ─── Carte des voyages ─── */
.visited-map .map { height: 420px; }
/* ─── Classement des badges ─── */
.badges-page { align-items: start; }
.lb-bdg { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; margin-right: 4px; font-size: 12px; background: linear-gradient(135deg, #ffd766, #f0b429); color: #3b2a00; box-shadow: 0 0 0 2px var(--rc), 0 0 10px color-mix(in srgb, var(--rc) 40%, transparent); }
.lb-rar { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.lb-rar span { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.lb-rar i { width: 9px; height: 9px; border-radius: 50%; background: var(--rc); }
.rare-list { display: grid; gap: 8px; }
.rare-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--rc); }
.rare-row > div { display: grid; }
.rare-row small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; }
.who { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
/* ─── Heatmap des horaires ─── */
.heat { display: grid; grid-template-columns: 38px repeat(24, 1fr); gap: 3px; align-items: center; }
.heat-h { font-size: 10.5px; color: var(--muted); text-align: left; }
.heat-d { font-size: 12px; color: var(--muted); font-weight: 600; }
.heat-c { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), var(--card-2)); min-height: 12px; }
.heat-c:hover { outline: 2px solid var(--text); }
.heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 10px; font-size: 12px; }
.heat-legend i { width: 14px; height: 14px; border-radius: 3px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), var(--card-2)); }

/* ─── Recherche de badges ─── */
.bdg-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); }
.bdg-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bdg-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font: inherit; font-size: 14px; }
.sr-bdg { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 13px; background: linear-gradient(135deg, #ffd766, #f0b429); color: #3b2a00; box-shadow: 0 0 0 2px var(--rc); }
.cat-own { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.bdg.focus { outline: 2px solid var(--accent); outline-offset: 2px; animation: bdg-focus 1.6s ease 2; }
@keyframes bdg-focus { 50% { box-shadow: 0 0 0 8px var(--accent-soft); } }

/* ─── Bannières de fiche ─── */
.pbanner { position: absolute; left: 0; right: 0; top: 0; height: 132px; overflow: hidden; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; pointer-events: none; isolation: isolate; }
.pbanner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, color-mix(in srgb, var(--card) 70%, transparent) 78%, var(--card)); z-index: 3; }
.pb-art, .pb-glow { position: absolute; inset: 0; }
.pb-ic { position: absolute; right: 7%; top: 50%; transform: translateY(-62%) rotate(-10deg); font-size: 96px !important; color: #fff; opacity: .13; z-index: 2; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.card.profile.has-banner { position: relative; overflow: hidden; padding-top: 96px; }
.card.profile.has-banner > :not(.pbanner) { position: relative; z-index: 4; }
.card.profile.has-banner .avatar.lg { box-shadow: 0 0 0 4px var(--card), 0 8px 24px rgba(0, 0, 0, .35); }

/* Route : asphalte qui file vers l'horizon, ligne centrale animée */
.bnr-route { background: radial-gradient(ellipse 60% 70% at 50% 0%, rgba(251, 191, 36, .18), transparent 70%), linear-gradient(180deg, #0a0f1c, #151c2b 55%, #1d2535); }
.bnr-route .pb-art { left: 24%; right: 24%; top: 18%; bottom: -60%; background-color: #2a3243; transform: perspective(140px) rotateX(58deg); transform-origin: 50% 0;
  background-image: repeating-linear-gradient(to bottom, #fbbf24 0 26px, transparent 26px 52px); background-size: 6px 100%; background-repeat: repeat-y; background-position: center 0;
  box-shadow: inset 7px 0 0 #e5e7eb, inset -7px 0 0 #e5e7eb, 0 0 40px rgba(0, 0, 0, .6); animation: bnr-road 1.4s linear infinite; }
@keyframes bnr-road { to { background-position: center 52px; } }

/* Nuit étoilée : ciel profond, étoiles, lune */
.bnr-night { background: radial-gradient(circle at 82% 38%, #fef9c3 0 16px, rgba(254, 249, 195, .25) 17px, transparent 60px), linear-gradient(180deg, #030616, #12123a 55%, #2e1065); }
.bnr-night .pb-art { background-image: radial-gradient(1.4px 1.4px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 58%, #fff 50%, transparent 51%), radial-gradient(1.6px 1.6px at 44% 18%, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 58% 46%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 70% 14%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 92% 62%, #fff 50%, transparent 51%), radial-gradient(1.3px 1.3px at 36% 36%, #c7d2fe 50%, transparent 51%);
  background-size: 260px 132px; animation: bnr-twinkle 4s ease-in-out infinite alternate; }
.bnr-night .pb-glow { background: radial-gradient(ellipse 80% 60% at 20% 120%, rgba(139, 92, 246, .35), transparent 70%); }
@keyframes bnr-twinkle { to { opacity: .55; } }

/* Europe : bleu profond, cercle d'étoiles dorées */
.bnr-europe { background: radial-gradient(ellipse 70% 90% at 75% 40%, #2563eb, transparent 70%), linear-gradient(135deg, #061a4a, #0b2a6b 55%, #1e3a8a); }
.bnr-europe .pb-art { background: url("data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20120%20120%22%3E%3Cg%20fill=%22%23facc15%22%3E%3Cpolygon%20points=%22100.00,53.50%20101.60,57.79%20106.18,57.99%20102.60,60.84%20103.82,65.26%20100.00,62.73%2096.18,65.26%2097.40,60.84%2093.82,57.99%2098.40,57.79%22/%3E%3Cpolygon%20points=%2294.64,73.50%2096.25,77.79%20100.82,77.99%2097.24,80.84%2098.46,85.26%2094.64,82.73%2090.82,85.26%2092.04,80.84%2088.46,77.99%2093.04,77.79%22/%3E%3Cpolygon%20points=%2280.00,88.14%2081.60,92.43%2086.18,92.63%2082.60,95.48%2083.82,99.90%2080.00,97.37%2076.18,99.90%2077.40,95.48%2073.82,92.63%2078.40,92.43%22/%3E%3Cpolygon%20points=%2260.00,93.50%2061.60,97.79%2066.18,97.99%2062.60,100.84%2063.82,105.26%2060.00,102.73%2056.18,105.26%2057.40,100.84%2053.82,97.99%2058.40,97.79%22/%3E%3Cpolygon%20points=%2240.00,88.14%2041.60,92.43%2046.18,92.63%2042.60,95.48%2043.82,99.90%2040.00,97.37%2036.18,99.90%2037.40,95.48%2033.82,92.63%2038.40,92.43%22/%3E%3Cpolygon%20points=%2225.36,73.50%2026.96,77.79%2031.54,77.99%2027.96,80.84%2029.18,85.26%2025.36,82.73%2021.54,85.26%2022.76,80.84%2019.18,77.99%2023.75,77.79%22/%3E%3Cpolygon%20points=%2220.00,53.50%2021.60,57.79%2026.18,57.99%2022.60,60.84%2023.82,65.26%2020.00,62.73%2016.18,65.26%2017.40,60.84%2013.82,57.99%2018.40,57.79%22/%3E%3Cpolygon%20points=%2225.36,33.50%2026.96,37.79%2031.54,37.99%2027.96,40.84%2029.18,45.26%2025.36,42.73%2021.54,45.26%2022.76,40.84%2019.18,37.99%2023.75,37.79%22/%3E%3Cpolygon%20points=%2240.00,18.86%2041.60,23.15%2046.18,23.35%2042.60,26.20%2043.82,30.62%2040.00,28.09%2036.18,30.62%2037.40,26.20%2033.82,23.35%2038.40,23.15%22/%3E%3Cpolygon%20points=%2260.00,13.50%2061.60,17.79%2066.18,17.99%2062.60,20.84%2063.82,25.26%2060.00,22.73%2056.18,25.26%2057.40,20.84%2053.82,17.99%2058.40,17.79%22/%3E%3Cpolygon%20points=%2280.00,18.86%2081.60,23.15%2086.18,23.35%2082.60,26.20%2083.82,30.62%2080.00,28.09%2076.18,30.62%2077.40,26.20%2073.82,23.35%2078.40,23.15%22/%3E%3Cpolygon%20points=%2294.64,33.50%2096.25,37.79%20100.82,37.99%2097.24,40.84%2098.46,45.26%2094.64,42.73%2090.82,45.26%2092.04,40.84%2088.46,37.99%2093.04,37.79%22/%3E%3C/g%3E%3C/svg%3E") no-repeat 78% 42% / 112px 112px; filter: drop-shadow(0 0 8px rgba(250, 204, 21, .45)); }
.bnr-europe .pb-ic { opacity: .07; right: auto; left: 6%; }

/* Convoi : feux de route rouges en mouvement */
.bnr-convoy { background: radial-gradient(ellipse 50% 60% at 85% 60%, rgba(239, 51, 64, .45), transparent 70%), linear-gradient(180deg, #0c0609, #1a0b10 60%, #26101a); }
.bnr-convoy .pb-art { background-image: repeating-linear-gradient(100deg, transparent 0 46px, rgba(255, 70, 85, .75) 46px 49px, transparent 49px 120px), repeating-linear-gradient(100deg, transparent 0 80px, rgba(255, 210, 150, .35) 80px 82px, transparent 82px 170px);
  -webkit-mask-image: linear-gradient(180deg, transparent 10%, #000 45%, #000 70%, transparent 95%); mask-image: linear-gradient(180deg, transparent 10%, #000 45%, #000 70%, transparent 95%); animation: bnr-streak 2.4s linear infinite; }
@keyframes bnr-streak { to { background-position: 240px 0, 340px 0; } }

/* Flammes : brasier qui monte du bas */
.bnr-fire { background: linear-gradient(0deg, #7f1d1d, #2a0a06 70%); }
.bnr-fire .pb-art { background: radial-gradient(ellipse 30% 70% at 18% 115%, #fde047, #f97316 35%, transparent 70%), radial-gradient(ellipse 35% 80% at 50% 120%, #fb923c, #dc2626 40%, transparent 72%), radial-gradient(ellipse 30% 70% at 82% 115%, #fde047, #ea580c 35%, transparent 70%);
  filter: blur(6px); animation: bnr-flame 2.2s ease-in-out infinite alternate; transform-origin: bottom; }
@keyframes bnr-flame { to { transform: scaleY(1.12) scaleX(1.03); filter: blur(8px) brightness(1.15); } }

/* Chrome : métal brossé avec reflet qui passe */
.bnr-clean { background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px), linear-gradient(180deg, #1e293b, #475569 45%, #94a3b8 70%, #334155); }
.bnr-clean .pb-glow { background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .55) 45%, transparent 60%); background-size: 250% 100%; animation: bnr-sheen 4.5s ease-in-out infinite; }
@keyframes bnr-sheen { from { background-position: 150% 0; } to { background-position: -100% 0; } }

/* Or : lingot avec reflet */
.bnr-gold { background: radial-gradient(ellipse 60% 80% at 70% 30%, rgba(254, 240, 138, .55), transparent 70%), linear-gradient(135deg, #2b1803, #854d0e 35%, #ca8a04 60%, #713f12); }
.bnr-gold .pb-glow { background: linear-gradient(105deg, transparent 30%, rgba(255, 247, 200, .6) 45%, transparent 60%); background-size: 250% 100%; animation: bnr-sheen 5s ease-in-out infinite; }
.bnr-gold .pb-ic { color: #fde68a; opacity: .22; }

/* Champion : rayons dorés derrière une couronne */
.bnr-champion { background: radial-gradient(circle at 82% 50%, rgba(253, 230, 138, .55), transparent 45%), linear-gradient(135deg, #140b02, #451a03 55%, #92400e); }
.bnr-champion .pb-art { background: repeating-conic-gradient(from 0deg at 82% 50%, rgba(253, 230, 138, .16) 0 5deg, transparent 5deg 15deg); animation: bnr-spin 40s linear infinite; transform-origin: 82% 50%; }
.bnr-champion .pb-ic { color: #fde68a; opacity: .35; right: 9%; }
@keyframes bnr-spin { to { transform: rotate(360deg); } }

/* Mythique : aurore rouge animée */
.bnr-myth { background: #12030a; }
.bnr-myth .pb-art { background: radial-gradient(ellipse 45% 80% at 20% 30%, rgba(239, 51, 64, .75), transparent 70%), radial-gradient(ellipse 40% 90% at 65% 70%, rgba(190, 18, 60, .7), transparent 70%), radial-gradient(ellipse 35% 70% at 90% 20%, rgba(251, 113, 133, .6), transparent 70%);
  filter: blur(10px) saturate(1.3); animation: bnr-aurora 8s ease-in-out infinite alternate; }
.bnr-myth .pb-glow { background: radial-gradient(1.2px 1.2px at 30% 40%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 75% 25%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 55% 65%, #ffe4e6 50%, transparent 51%); background-size: 180px 132px; opacity: .7; }
@keyframes bnr-aurora { to { transform: translateX(-6%) scale(1.08); filter: blur(12px) saturate(1.6) hue-rotate(-12deg); } }

/* Staff : ardoise, grille fine, éclair rouge */
.bnr-staff { background: linear-gradient(135deg, #070b14, #111827 55%, #1f2937); }
.bnr-staff .pb-art { background: linear-gradient(115deg, transparent 58%, rgba(225, 29, 42, .9) 58% 61%, transparent 61% 64%, rgba(225, 29, 42, .45) 64% 65.5%, transparent 65.5%),
  repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 22px), repeating-linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 22px); }
.bnr-staff .pb-ic { opacity: .16; }

@media (prefers-reduced-motion: reduce) { .pbanner * { animation: none !important; } }

/* Aperçus dans Mon espace */
.banners { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; gap: 10px !important; }
.bn-prev { position: relative; display: flex; align-items: flex-end; height: 76px; padding: 0 !important; border-radius: 12px; overflow: hidden; border: 2px solid var(--line) !important; background: var(--card-2) !important; transition: transform .15s, border-color .15s; }
.bn:hover .bn-prev { transform: translateY(-2px); }
.bn-prev .pbanner { height: 100%; border-radius: 0; }
.bn-prev .pbanner::after { background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, .65)); }
.bn-prev .pb-ic { font-size: 54px !important; }
.bn-prev b { position: relative; z-index: 5; padding: 6px 9px; font-size: 12.5px; color: #fff; text-shadow: 0 1px 3px #000; display: flex; align-items: center; gap: 5px; }
.bn-prev.bn-none { align-items: center; justify-content: center; border-style: dashed !important; }
.bn-prev.bn-none b { color: var(--muted); text-shadow: none; }
.bn input:checked + .bn-prev { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
.bn.locked .bn-prev { filter: grayscale(.9) brightness(.55); }
.bn.locked .bn-prev .pbanner * { animation: none; }
/* ─── Bannières : retouches ─── */
.pbanner::after { background: linear-gradient(180deg, transparent 58%, color-mix(in srgb, var(--card) 65%, transparent) 85%, var(--card)); }
.bnr-route .pb-art { left: 34%; right: 34%; top: 34%; box-shadow: inset 5px 0 0 rgba(229, 231, 235, .85), inset -5px 0 0 rgba(229, 231, 235, .85), 0 0 60px rgba(0, 0, 0, .7); }
.bnr-route .pb-glow { background: radial-gradient(ellipse 30% 40% at 50% 30%, rgba(251, 191, 36, .25), transparent 70%); }
/* Convoi : traînées de feux arrière qui défilent à l'horizontale */
.bnr-convoy { background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(239, 51, 64, .35), transparent 70%), linear-gradient(180deg, #06060b, #120910 60%, #1d0c15); }
.bnr-convoy .pb-art { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  background-image: linear-gradient(90deg, transparent, rgba(255, 60, 75, .95) 45%, transparent), linear-gradient(90deg, transparent, rgba(255, 220, 180, .8) 50%, transparent),
    linear-gradient(90deg, transparent, rgba(255, 60, 75, .7) 40%, transparent), linear-gradient(90deg, transparent, rgba(255, 220, 180, .55) 50%, transparent), linear-gradient(90deg, transparent, rgba(255, 60, 75, .6) 45%, transparent);
  background-size: 240px 3px, 170px 2px, 320px 2px, 130px 2px, 200px 3px; background-repeat: repeat-x;
  background-position: 0 40%, 60px 48%, 30px 56%, 150px 63%, 90px 33%; filter: drop-shadow(0 0 4px rgba(255, 60, 75, .9)); animation: bnr-trail 1.6s linear infinite; }
@keyframes bnr-trail { to { background-position: 240px 40%, 230px 48%, 350px 56%, 280px 63%, 290px 33%; } }
.bnr-convoy .pb-glow { background: none; }
/* Flammes : brasier plus visible + braises qui montent */
.bnr-fire { background: linear-gradient(180deg, #160402, #4a0d06 55%, #7c2d12); }
.bnr-fire .pb-art { background: radial-gradient(ellipse 22% 55% at 15% 85%, #fde047, #f97316 40%, transparent 72%), radial-gradient(ellipse 26% 65% at 42% 90%, #fdba74, #ea580c 38%, transparent 72%),
  radial-gradient(ellipse 22% 55% at 70% 85%, #fde047, #dc2626 42%, transparent 72%), radial-gradient(ellipse 18% 45% at 92% 88%, #fb923c, #b91c1c 40%, transparent 72%); filter: blur(5px); opacity: .95; }
.bnr-fire .pb-glow { background-image: radial-gradient(2px 2px at 20% 80%, #fde047 50%, transparent 51%), radial-gradient(1.5px 1.5px at 48% 70%, #fdba74 50%, transparent 51%), radial-gradient(2px 2px at 75% 85%, #fde047 50%, transparent 51%), radial-gradient(1.5px 1.5px at 62% 60%, #fff7ed 50%, transparent 51%);
  background-size: 220px 132px; animation: bnr-embers 3s linear infinite; }
@keyframes bnr-embers { from { background-position: 0 0; opacity: 1; } to { background-position: 30px -132px; opacity: .6; } }
.sw.clear span { display: grid; place-items: center; background: var(--card-2) !important; border: 2px dashed var(--line); color: var(--muted); font-size: 12px; }
.sw.clear:hover span { color: var(--accent); border-color: var(--accent); }
/* Champion : rayons doux, couche très grande (ses bords ne se voient jamais en tournant), fondu avec la distance */
.bnr-champion { background: radial-gradient(circle at 82% 50%, rgba(253, 230, 138, .5), rgba(245, 158, 11, .18) 28%, transparent 55%), linear-gradient(135deg, #140b02, #3b1704 55%, #7c2d12); }
.bnr-champion .pb-art { inset: -150%; transform-origin: 57.5% 50%; animation: bnr-spin 60s linear infinite;
  background: repeating-conic-gradient(from 0deg at 57.5% 50%, rgba(253, 230, 138, 0) 0deg, rgba(253, 230, 138, .2) 3deg, rgba(253, 230, 138, 0) 6deg, rgba(253, 230, 138, 0) 15deg);
  -webkit-mask-image: radial-gradient(circle at 57.5% 50%, #000 0, rgba(0, 0, 0, .55) 12%, transparent 26%); mask-image: radial-gradient(circle at 57.5% 50%, #000 0, rgba(0, 0, 0, .55) 12%, transparent 26%);
  filter: blur(.6px); will-change: transform; }
.bnr-champion .pb-glow { background: radial-gradient(circle at 82% 50%, rgba(255, 247, 214, .35), transparent 22%); }

/* ═══ Refonte UX 2026-10 : même langage que l'appli EROTF Tracker ═══
   Couleurs de sens, interrupteurs, messages typés, fenêtre de confirmation, menu « Plus », sous-onglets, sections d'admin */
:root { --ok-soft: rgba(34, 197, 94, .14); --red-soft: rgba(239, 68, 68, .14); --orange-soft: rgba(245, 158, 11, .16); --blue-soft: rgba(59, 130, 246, .14); --switch-off: #b8bfcc; }
:root[data-theme="dark"] { --switch-off: #33415f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --switch-off: #33415f; } }

/* Interrupteurs (au lieu des cases à cocher) */
.form label.check input[type=checkbox], .check-line input[type=checkbox], .push-topics input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 38px; height: 22px; margin: 0; padding: 0;
  border: 0; border-radius: 99px; background: var(--switch-off); cursor: pointer; transition: background-color .2s; }
.form label.check input[type=checkbox]::before, .check-line input[type=checkbox]::before, .push-topics input[type=checkbox]::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.form label.check input[type=checkbox]:checked, .check-line input[type=checkbox]:checked, .push-topics input[type=checkbox]:checked { background: var(--accent); }
.form label.check input[type=checkbox]:checked::before, .check-line input[type=checkbox]:checked::before, .push-topics input[type=checkbox]:checked::before { transform: translateX(16px); }
.form label.check input[type=checkbox]:focus-visible, .check-line input[type=checkbox]:focus-visible, .push-topics input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.form label.check input[type=checkbox]:disabled, .check-line input[type=checkbox]:disabled { opacity: .5; cursor: not-allowed; }
.check-line { gap: 12px; padding: 4px 0; }
.push-topics { gap: 10px; }
.push-topics label { gap: 12px; cursor: pointer; }
.switch-list { display: grid; gap: 12px; }

/* Messages en bas de l'écran : succès / info / attention / erreur */
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(460px, calc(100% - 32px)); pointer-events: none; }
.toasts .toast { position: static; left: auto; transform: none; max-width: none; width: 100%; display: flex; align-items: flex-start; gap: 10px; font-size: 14px; padding: 12px 16px; pointer-events: auto;
  border-left-color: var(--ok); animation: toast-in .25s ease both; transition: opacity .25s, transform .25s; }
.toasts .toast > .ic { margin-top: 3px; color: var(--ok); }
.toasts .toast.info { border-left-color: var(--blue); } .toasts .toast.info > .ic { color: var(--blue); }
.toasts .toast.warning { border-left-color: var(--orange); } .toasts .toast.warning > .ic { color: var(--orange); }
.toasts .toast.error { border-left-color: var(--red); } .toasts .toast.error > .ic { color: var(--red); }
.toasts .toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Fenêtre de confirmation */
.confirm-dlg { width: min(440px, calc(100% - 32px)); }
.confirm-dlg[open] { animation: dlg-in .2s ease both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.confirm-dlg .form { gap: 14px; }
.cd-head { display: flex; align-items: center; gap: 12px; }
.confirm-dlg .cd-head h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.cd-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: var(--blue-soft); color: var(--blue); }
.cd-ic.danger { background: var(--red-soft); color: var(--red); }
.cd-text { margin: 0; color: var(--muted); font-size: 14.5px; }
.cd-actions { justify-content: flex-end; }
.btn.danger:not(.ghost) { background: var(--red); box-shadow: 0 6px 16px rgba(220, 38, 38, .25); }
.btn.danger:not(.ghost):hover { background: var(--red); filter: brightness(.92); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; filter: none; }

/* Compte à rebours sobre */
.countdown strong { color: var(--text); }
.countdown .ic { color: var(--muted); }

/* Accueil : texte du bandeau plus lisible sur les photos */
.hero2-bg::after { background: linear-gradient(90deg, rgba(6, 10, 20, .95) 0%, rgba(6, 10, 20, .86) 34%, rgba(6, 10, 20, .5) 64%, rgba(6, 10, 20, .22) 100%),
  linear-gradient(0deg, rgba(6, 10, 20, .6) 0%, transparent 35%); }
.hero2-title, .hero2-sub, .hero2-text, .hero2-eyebrow { text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
@media (max-width: 700px) { .hero2-bg::after { background: linear-gradient(90deg, rgba(6, 10, 20, .92), rgba(6, 10, 20, .72)); } }

/* Menu « Plus » */
.nav-more { position: relative; display: flex; }
.nav-more-btn { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border: 0; border-radius: 10px; background: none;
  color: var(--text); opacity: .85; font: inherit; font-weight: 500; font-size: 13.5px; white-space: nowrap; cursor: pointer; transition: color .3s, opacity .3s, background-color .2s; }
.nav-more-btn .ic { color: var(--muted); transition: color .3s; }
.nav-more-btn .nm-chev { width: auto; font-size: 10px; transition: transform .2s; }
.nav-more.open .nm-chev { transform: rotate(180deg); }
.nav-more-btn:hover { opacity: 1; background: var(--accent-soft); }
.nav-more-btn.active { opacity: 1; color: #fff; font-weight: 700; }
.nav-more-btn.active:hover { background: transparent; }
.nav-more-btn.active .ic { color: #fff; }
.nav-more-list { display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; flex-direction: column; min-width: 210px; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.nav-more.open .nav-more-list { display: flex; }
.nav .nav-more-list a { height: 38px; padding: 0 12px; opacity: 1; font-size: 14px; }
.nav .nav-more-list a span.lbl { display: inline; }
.nav .nav-more-list a.active { color: var(--accent); background: var(--accent-soft); }
.nav .nav-more-list a.active .ic { color: var(--accent); }
@media (max-width: 1100px) { .nav-more-btn .lbl { display: none; } .nav-more-btn.active .lbl { display: inline; } }
@media (max-width: 760px) {
  .nav-more { display: contents; }
  .nav-more-btn { display: none; }
  .nav-more-list { display: flex; position: static; min-width: 0; margin-top: 6px; padding: 6px 0 0; background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .nav .nav-more-list a { height: auto; padding: 9px 10px; }
  .nav .nav-more-list a.active { background: var(--accent); color: #fff; }
  .nav .nav-more-list a.active .ic { color: #fff; }
}

/* Sous-onglets (Classement · Badges · Records, Livraisons · Trajets, En direct · Carte) */
.subnav-slot { padding-top: 22px; }
.subnav-slot:not([hidden]) + main.wrap { padding-top: 18px; }
.subnav { display: inline-flex; gap: 4px; max-width: 100%; padding: 4px; overflow-x: auto; scrollbar-width: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.subnav a:hover { color: var(--text); background: var(--card-2); text-decoration: none; }
.subnav a.on { background: var(--accent); color: #fff; }
body.tv .subnav-slot { display: none; }

/* Mon espace : séparation fiche / compte dans les onglets */
.ptab-sep { flex: none; align-self: stretch; width: 1px; margin: 6px 4px; background: var(--line); }
.me-p { margin: 0 0 12px; font-size: 14px; }

/* Administration : menu des sections à gauche */
.side-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.side-nav { display: grid; gap: 2px; padding: 8px; position: sticky; top: 84px; }
.side-nav button, .side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-weight: 600; font-size: 14px; text-align: left; cursor: pointer; }
.side-nav .ic { color: var(--muted); }
.side-nav button:hover, .side-nav a:hover { background: var(--card-2); text-decoration: none; }
.side-nav button.on { background: var(--accent); color: #fff; }
.side-nav button.on .ic { color: #fff; }
.side-nav a { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--muted); }
.side-nav a .ic:last-child { margin-left: auto; }
.side-pane { display: none; }
.side-pane.on { display: grid; }
.cfg-form h3 { margin: 8px 0 0; font-size: 12.5px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: var(--muted); }
.cfg-form .btn-row .grow { flex: 1; }
@media (max-width: 900px) {
  .side-layout { grid-template-columns: minmax(0, 1fr); }
  .side-nav { position: static; display: flex; overflow-x: auto; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav button, .side-nav a { flex: none; white-space: nowrap; }
  .side-nav a { margin-top: 0; padding-top: 10px; border-top: 0; border-radius: 10px; }
}
.side-pane > h2 { margin: 0; font-size: 18px; }
@media (max-width: 480px) {
  .topbar-inner { gap: 8px; }
  .user-menu summary { gap: 4px; padding-right: 4px; }
  .user-menu summary > .ic { display: none; }
}

/* ── Bannières en images + administration (bannières, rôles & accès, code de liaison) ── */
.form [hidden] { display: none !important; }
.pbanner.pb-img { background-position: center; background-size: cover; background-repeat: no-repeat; }
.bn-admin { display: grid; gap: 12px; }
.bn-row { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px 16px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-2); }
.bn-thumb { aspect-ratio: 4 / 1; border-radius: 10px; border: 1px solid var(--line); background: var(--card) center / cover no-repeat; }
.bn-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-content: start; }
.bn-acts { grid-column: 1 / -1; justify-content: flex-end; }
.bn-new-name { max-width: 280px; }
@media (max-width: 700px) { .bn-row { grid-template-columns: minmax(0, 1fr); } }
.rp-filter { max-width: 320px; }
.rp-block { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.rp-block h3 { margin: 0; font-size: 15px; }
.rp-hint { margin: 0; font-size: 13px; }
.rp-block .role-chip input:checked + span { background: var(--accent); border-color: var(--accent) !important; color: #fff; }
.rp-block .role-chip input:checked + span::before { content: "\2713  "; font-weight: 900; }
.rp-sel { font-size: 12.5px; color: var(--muted); }
.rp-sel b { color: var(--text); }
.pc-big { text-align: center; font-size: 34px; margin: 2px 0; }
.btn-row .grow { flex: 1; }

/* ── Barres de défilement des tableaux aux couleurs du site (fine, rouge EROTF) ── */
.table-wrap { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 75%, transparent) var(--card-2); }
.table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-track { background: var(--card-2); border-radius: 99px; }
.table-wrap::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 75%, transparent); border: 2px solid var(--card-2); border-radius: 99px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: var(--accent); }
/* Tableaux qui défilent : fondu sur le bord où il reste des colonnes (classes posées par app.js), la barre reste nette */
.table-wrap.more-l, .table-wrap.more-r { padding-bottom: 4px;
  -webkit-mask: var(--fade) top / 100% calc(100% - 12px) no-repeat, linear-gradient(#000, #000) bottom / 100% 12px no-repeat;
  mask: var(--fade) top / 100% calc(100% - 12px) no-repeat, linear-gradient(#000, #000) bottom / 100% 12px no-repeat; }
.table-wrap.more-r { --fade: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
.table-wrap.more-l { --fade: linear-gradient(90deg, transparent, #000 56px); }
.table-wrap.more-l.more-r { --fade: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
/* Convois : menu « Ajouter à mon agenda » */
.agenda-menu { position: relative; display: inline-block; }
.agenda-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.agenda-menu > summary::-webkit-details-marker { display: none; }
.agenda-menu > summary.agenda-link { color: var(--accent); font-weight: 600; }
.agenda-menu > summary.agenda-link:hover { text-decoration: underline; }
.agenda-menu .am-chev { font-size: .75em; width: auto; transition: transform .2s; }
.agenda-menu[open] .am-chev { transform: rotate(180deg); }
.agenda-list { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 250px; display: grid; padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.agenda-list a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); font-weight: 600; font-size: 14px; }
.agenda-list a:hover { background: var(--accent-soft); text-decoration: none; }
.agenda-list .ic { color: var(--accent); }
.page-head .agenda-list { left: auto; right: 0; }
/* Personnaliser : état de l'enregistrement automatique */
.profile-info [hidden] { display: none !important; }
.save-state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--red); }
.field-err { color: var(--red); font-weight: 600; }
/* Rôles & accès : connexion (autorisés / interdits) + testeur */
.rp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rp-col { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); }
.rp-col h4 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rp-col.allow h4 .ic { color: var(--ok); } .rp-col.deny h4 .ic { color: var(--red); }
.rp-col.allow .role-chip input:checked + span { background: var(--ok); border-color: var(--ok) !important; }
.rp-col.deny .role-chip input:checked + span { background: var(--red); border-color: var(--red) !important; }
.rp-test { display: grid; gap: 10px; margin-top: 4px; padding: 12px; border-radius: 12px; border: 1px dashed var(--line); }
.rp-result { padding: 10px 12px; border-radius: 10px; font-size: 14px; display: grid; gap: 8px; }
.rp-result.ok { background: var(--ok-soft); } .rp-result.no { background: var(--red-soft); }
.rp-result.ok .rp-verdict .ic { color: var(--ok); } .rp-result.no .rp-verdict .ic { color: var(--red); }
.rp-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rp-r { padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; }
.rp-r small { color: var(--muted); font-weight: 500; }
.rp-r.top.allow { border-color: var(--ok); } .rp-r.top.deny { border-color: var(--red); }
@media (max-width: 760px) { .rp-two { grid-template-columns: 1fr; } }
/* Appli & confidentialité d'un membre (propriétaire) */
.member-app { width: min(560px, calc(100% - 32px)); }
.member-app .form { gap: 12px; }
.ma-sec { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.ma-sec > b { display: flex; align-items: center; gap: 8px; }
.ma-sec p { margin: 0; font-size: 13px; }
.profile-share { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* Code appli envoyé en MP */
.cd-ic.ok { background: var(--ok-soft); color: var(--ok); }
.pc-miss { margin: 0; font-size: 13px; color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
/* Historique de l'administration */
.log-pane { display: none; gap: 12px; }
.log-pane.on { display: grid; }
.log-list { display: grid; }
.log-day { margin: 14px 0 4px; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.log-day:first-child { margin-top: 0; }
.log-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.log-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--muted); }
.log-row.sensitive .log-ic { background: var(--red-soft); color: var(--red); }
.log-body { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.log-body .muted { font-size: 13px; overflow-wrap: anywhere; }
.log-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; white-space: nowrap; }
.log-alert { color: var(--red); }
@media (max-width: 600px) { .log-row { grid-template-columns: 34px minmax(0, 1fr); } .log-meta { grid-column: 2; } }
/* Statistiques / Records : moins de blocs vides */
.hb-empty { margin: 0; font-size: 14px; }
.rec-sec:first-of-type { margin-top: 8px; }
@media (min-width: 1101px) { .xs-group .xs-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* Accueil : titres de la colonne de droite sur une ligne */
.home-side .section-head { flex-wrap: nowrap; }
.home-side .section-head h2 { white-space: nowrap; }
.home-side .section-head > a { white-space: nowrap; flex: none; }
.ma-sec > .btn { justify-self: start; }
/* Bandeau de page (Convois…) sur téléphone : bouton sous le titre, image plus discrète derrière le texte */
@media (max-width: 700px) {
  .banner { flex-direction: column; align-items: flex-start; min-height: 0; }
  .banner[style] { background: linear-gradient(0deg, var(--card) 0%, color-mix(in srgb, var(--card) 86%, transparent) 100%), var(--banner) center / cover no-repeat; }
}
/* 2FA requise pour l'administration */
.mfa-help { display: grid; justify-items: center; gap: 10px; text-align: center; }
.mfa-help > .ic, .mfa-help > .art { font-size: 34px; color: var(--accent); }
.mfa-steps { text-align: left; margin: 0; padding-left: 20px; display: grid; gap: 6px; max-width: 560px; }

/* ═══ Responsive et animations (2026-10-06) ═══ */
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 12px; text-decoration: none; }
html.no-scroll { overflow: hidden; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabbar, .sheet { display: none; }

/* Livraisons et chauffeurs : barres d'outils */
.dl-tools, .dr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; margin-bottom: 14px; }
.dl-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card-2); }
.dl-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dl-search .ic { color: var(--muted); }
.dl-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; padding: 10px 0; outline: none; }
.dl-tools select, .dr-tools select { font: inherit; color: var(--text); background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.dr-sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.dl-more { display: flex; justify-content: center; margin-top: 14px; }
.dl-more[hidden] { display: none; }

/* Détail d'une livraison : 3 blocs */
.dd-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.dd-sub .avatar { width: 26px; height: 26px; }
.dd-groups { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 14px; }
.dd-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.dd-dl dt { color: var(--muted); }
.dd-dl dd { margin: 0; font-weight: 700; text-align: right; }

/* Copilote : présentation pour les visiteurs */
.cop-feat { display: grid; gap: 8px; align-content: start; }
.cop-feat > .ic, .cop-feat > .art { font-size: 26px; color: var(--accent); }
.cop-cta { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cop-cta p { margin: 0; }

/* Visionneuse de photos */
.viewer { animation: fade-in .2s ease both; touch-action: pan-y; }
.viewer.out { opacity: 0; transition: opacity .18s; }
.viewer-fig { margin: 0; display: grid; place-items: center; max-width: 100%; max-height: 100%; }
.viewer-fig img { max-width: 100%; max-height: calc(100vh - 140px); border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); animation: zoom-in .25s cubic-bezier(.22, .9, .25, 1) both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(.96); } }
.photo-img { cursor: zoom-in; }
.gal-item { cursor: zoom-in; }

/* Animations : entrée des blocs en cascade, survols, boutons */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: no-preference) {
  main.page-in .page-head, main.page-in > .card, main.page-in .grid > *, main.page-in .section > .card { animation: rise .5s cubic-bezier(.22, .9, .25, 1) both; }
  main.page-in .grid > :nth-child(2) { animation-delay: 45ms; } main.page-in .grid > :nth-child(3) { animation-delay: 90ms; }
  main.page-in .grid > :nth-child(4) { animation-delay: 135ms; } main.page-in .grid > :nth-child(5) { animation-delay: 180ms; }
  main.page-in .grid > :nth-child(6) { animation-delay: 225ms; } main.page-in .grid > :nth-child(n+7) { animation-delay: 270ms; }
  .btn { transition: transform .12s ease, background-color .2s, box-shadow .2s, border-color .2s, color .2s; }
  .btn:active:not(:disabled) { transform: scale(.97); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  a.card, .dcard, a.rc, .gal-item, .nc { transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
  a.card:hover, .dcard:hover, a.rc:hover, .gal-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
}

/* Graphiques lisibles sur téléphone */
@media (max-width: 640px) {
  .mchart { height: auto; aspect-ratio: 560 / 200; }
  .mchart .ch-lbl, .mchart .mc-v { font-size: 19px; }
  .mchart .ch-lbl[text-anchor="end"] { font-size: 16px; }
}

/* Tableaux de livraisons → cartes sur téléphone */
@media (max-width: 640px) {
  .dl-table thead { display: none; }
  .dl-table, .dl-table tbody { display: block; }
  .dl-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .dl-table tr:last-child { border-bottom: 0; }
  .dl-table td { display: block; padding: 0 !important; border: 0 !important; background: none !important; text-align: left !important; white-space: nowrap; }
  .dl-table td.hide-sm { display: block !important; }
  .dl-table .c-driver { flex: 1 1 auto; min-width: 0; }
  .dl-table .c-mode { flex: none; margin-left: auto; }
  .dl-table .c-route { flex: 1 1 100%; font-weight: 700; font-size: 15px; white-space: normal; }
  .dl-table .c-cargo, .dl-table .c-dist, .dl-table .c-profit, .dl-table .c-date { flex: none; font-size: 13px; color: var(--muted); }
  .dl-table .c-cargo { max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
  .dl-table .c-dist::before, .dl-table .c-profit::before, .dl-table .c-date::before { content: "·"; margin-right: 10px; color: var(--line); }
  .dl-table tr:has(.c-driver) .c-route { order: 2; } .dl-table .c-cargo, .dl-table .c-dist, .dl-table .c-profit, .dl-table .c-date { order: 3; }
  .table-wrap:has(.dl-table) { overflow: visible; }
}

/* Chiffres clés plus compacts sur téléphone */
@media (max-width: 560px) {
  .kpi { flex-direction: row !important; align-items: center; gap: 12px !important; padding: 14px !important; }
  .kpi-icon { width: 40px; height: 40px; }
  .kpi-icon .ic { font-size: 17px; }
  .kpi-icon .art { width: 24px; height: 24px; }
  .kpi .label { font-size: 12.5px; }
  .kpi .value { font-size: 19px !important; }
  .kpi .sub { font-size: 11.5px; }
}

/* Téléphone : onglets en bas + menu complet */
@media (max-width: 760px) {
  .menu-btn, #theme-btn, .nav { display: none !important; }
  .topbar-inner { justify-content: space-between; }
  .search-btn { margin-left: auto; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--topbar); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { position: relative; display: grid; justify-items: center; gap: 3px; padding: 7px 2px 5px; border: 0; border-radius: 12px; background: none;
    color: var(--muted); font: inherit; font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tabbar .ic { font-size: 19px; width: auto; transition: transform .25s cubic-bezier(.22, .9, .25, 1), color .2s; }
  .tabbar .on { color: var(--accent); }
  .tabbar .on .ic { transform: translateY(-2px) scale(1.1); }
  .tabbar .on::before { content: ""; position: absolute; top: -6px; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--accent); animation: tab-in .3s ease both; }
  @keyframes tab-in { from { transform: scaleX(0); } }
  .tabbar a:active .ic, .tabbar button:active .ic { transform: scale(.9); }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .sheet:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 70; }
  .sheet-back { position: absolute; inset: 0; background: rgba(3, 6, 14, .55); opacity: 0; transition: opacity .28s; }
  .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; background: var(--card);
    border-radius: 22px 22px 0 0; border-top: 1px solid var(--line); padding: 6px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 50px rgba(0, 0, 0, .35);
    transform: translateY(100%); transition: transform .32s cubic-bezier(.22, .9, .25, 1); }
  .sheet.open .sheet-back { opacity: 1; }
  .sheet.open .sheet-panel { transform: none; }
  .sheet-grip { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 6px auto 10px; }
  .sheet-head { display: flex; align-items: center; gap: 8px; }
  .sheet-head b { font-size: 18px; }
  .sheet-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
  .sheet-panel h3 { margin: 18px 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .sheet-grid a { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line);
    color: var(--text); font-size: 12.5px; font-weight: 700; text-align: center; text-decoration: none; transition: transform .15s, border-color .15s; }
  .sheet-grid a .ic { font-size: 20px; color: var(--accent); }
  .sheet-grid a.on { border-color: var(--accent); background: var(--accent-soft); }
  .sheet-grid a:active { transform: scale(.96); }
  .sheet.open .sheet-grid a { animation: rise .35s cubic-bezier(.22, .9, .25, 1) both; }
  .sheet-foot { display: flex; justify-content: center; margin-top: 18px; }
  body.tv .tabbar { display: none; }
  body.tv { padding-bottom: 0; }
  .hero2-eyebrow { font-size: 11px; letter-spacing: 1.8px; }
  .page-head { margin-bottom: 16px; }
  .page-head > .btn-row, .page-head > .filters { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sheet-panel, .sheet-back { transition: none; }
  .sheet.open .sheet-grid a, .tabbar .on::before { animation: none; }
}
.sheet-head .grow { flex: 1; }
.dd-sub .who { display: inline-flex; align-items: center; gap: 8px; }
.dd-x::before { content: "·"; margin-right: 8px; color: var(--muted); }
@media (max-width: 640px) { .dd-sub .who { flex-basis: 100%; } .dd-sub .who + .dd-x::before { content: none; } #compact-btn { display: none; } }

/* Voyant du bot Discord (Administration) */
.bot-status { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line); background: var(--card); color: var(--muted, inherit); }
.bot-status .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.bot-status.on { color: #1f9d55; border-color: rgba(31, 157, 85, .35); }
.bot-status.off { color: #d93a3a; border-color: rgba(217, 58, 58, .4); }
.bot-status.on .dot { box-shadow: 0 0 0 0 rgba(31, 157, 85, .5); animation: botPulse 2s infinite; }
@keyframes botPulse { 70% { box-shadow: 0 0 0 7px rgba(31, 157, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 157, 85, 0); } }
@media (prefers-reduced-motion: reduce) { .bot-status.on .dot { animation: none; } }
