/* Rapports Igeo — styles de la page (thème clair/sombre par variables). */
*, *::before, *::after { box-sizing: border-box; }
button, input { font: inherit; color: inherit; }
img { display: block; }

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #1f6a86;
  --accent-text: #ffffff;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warn-bg: #fffaeb;
  --warn-text: #93370d;
  --ok-text: #15803d;
  /* En-tête du tableau : bleu pétrole institutionnel Igeo */
  --table-head-bg: #1f6a86;
  --table-head-text: #ffffff;
  --row-alt: #f8fafc;
  --row-open: #e8f2f6;
  /* Variables lues par js/ui/dropdown.js */
  --notion-bg: #ffffff;
  --notion-surface: #ffffff;
  --notion-surface-hover: #f1f5f9;
  --notion-border: #e2e8f0;
  --notion-text: #0f172a;
  --notion-text-muted: #64748b;
  --notion-accent: #1f6a86;
  --notion-tag-blue-bg: rgba(31, 106, 134, 0.12);
}
html.dark {
  color-scheme: dark;
  --bg: #111315;
  --surface: #1a1d20;
  --surface-2: #202427;
  --surface-hover: #262a2e;
  --border: #2e3338;
  --text: #e6e6e6;
  --text-muted: #9ba3ab;
  --accent: #4aa3c3;
  --accent-text: #0b1418;
  --danger: #ff8a7a;
  --danger-bg: rgba(255, 115, 105, 0.12);
  --warn-bg: rgba(235, 196, 70, 0.12);
  --warn-text: #f1c742;
  --ok-text: #4ade80;
  --table-head-bg: #1f6a86;
  --row-alt: #1e2124;
  --row-open: #1d3540;
  --notion-bg: #191919;
  --notion-surface: #202020;
  --notion-surface-hover: #262626;
  --notion-border: #2e3338;
  --notion-text: #e6e6e6;
  --notion-text-muted: #9b9a97;
  --notion-accent: #58a6ff;
  --notion-tag-blue-bg: rgba(82, 156, 202, 0.18);
}
html, body { height: 100%; }
body.eco-page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
}
.ms {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}
@keyframes scaleUp { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

/* ── Typographie & utilitaires d'épaisseur et contraste ── */
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }
.text-success { color: #16a34a !important; }
.text-danger { color: #dc2626 !important; }
.text-primary { color: #2563eb !important; }
.text-muted { color: var(--text-muted, #64748b) !important; }
.text-xs { font-size: 11px !important; }
.text-sm { font-size: 12px !important; }

.eco-shell { display: flex; flex-direction: column; height: 100%; }
.eco-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.eco-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.eco-topbar img { height: 28px; }
.eco-topbar .eco-title { font-weight: 700; font-size: 15px; }
.eco-topbar .eco-sub { color: var(--text-muted); font-size: 12px; }
.eco-topbar .eco-spacer { flex: 1; }
.eco-user { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; }

.eco-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.eco-btn:hover { background: var(--surface-hover); }
.eco-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.eco-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.eco-btn.primary:hover { filter: brightness(1.08); }
.eco-btn.ghost { border-color: transparent; background: transparent; }

.notion-modal-dropdown-trigger.eco-trigger {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
  background: var(--notion-surface, #fff); border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-size: 12px; color: var(--text); max-width: 100%;
}
.eco-trigger .eco-trigger-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eco-trigger .ms { font-size: 16px; color: var(--text-muted); }

.eco-input {
  height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 12px; min-width: 0;
}
.eco-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ── Connexion ── */
.eco-login { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.eco-login-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px;
}
.eco-login-card img { height: 40px; align-self: flex-start; }
.eco-login-card h1 { font-size: 20px; font-weight: 700; margin: 0; }
.eco-small { font-size: 12px; }
.eco-small a { color: var(--accent); font-weight: 600; text-decoration: none; }
.eco-small a:hover { text-decoration: underline; }
.eco-login-card p { margin: 0; color: var(--text-muted); line-height: 1.5; }
.eco-login-card .eco-btn.primary { height: 40px; justify-content: center; font-size: 13px; }
.eco-login-card details summary { cursor: pointer; color: var(--text-muted); font-size: 12px; }
.eco-token-row { display: flex; gap: 8px; margin-top: 8px; }
.eco-token-row .eco-input { flex: 1; }

.eco-alert { border-radius: 8px; padding: 8px 12px; font-size: 12px; line-height: 1.45; }
.eco-alert.error { background: var(--danger-bg); color: var(--danger); }
.eco-alert.warn { background: var(--warn-bg); color: var(--warn-text); }

/* ── Espace de travail ── */
.eco-workspace { flex: 1; display: flex; min-height: 0; position: relative; }
.eco-units {
  width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 12px; background: var(--surface); border-right: 1px solid var(--border); min-height: 0;
  position: relative;
  transition: width 0.18s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease, padding 0.18s ease;
}

/* ── Sidebar Redimensionnable, Pliable & Commutateur de vue ── */
.eco-workspace.sidebar-collapsed .eco-units {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-right: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}
.eco-workspace.sidebar-collapsed .eco-sidebar-resizer {
  display: none !important;
}
.eco-sidebar-resizer {
  width: 6px;
  margin: 0 -3px;
  cursor: col-resize;
  position: relative;
  z-index: 20;
  user-select: none;
  background: transparent;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.eco-sidebar-resizer:hover,
.eco-sidebar-resizer.is-resizing {
  background: var(--accent, #2563eb);
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
}
.eco-units-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}
.eco-units-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.eco-units-head-right {
  display: flex;
  align-items: center;
}
.eco-sidebar-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.eco-sidebar-collapse-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--accent);
}
.eco-sidebar-uncollapse-btn {
  /* En bas à gauche : ne recouvre plus le bouton de période de la barre d'outils. */
  position: fixed;
  bottom: 16px;
  left: 12px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  border-radius: 8px;
  background: var(--surface, #ffffff);
  color: var(--text, #1e293b);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.eco-sidebar-uncollapse-btn:hover {
  background: var(--surface-hover, #f1f5f9);
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
  transform: translateX(2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.2);
}
.eco-sidebar-uncollapse-btn .ms {
  font-size: 16px;
}

/* Commutateur de vue : Groupes vs Véhicules */
.eco-unit-view-switch {
  display: flex;
  background: var(--surface-2, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}
.eco-view-switch-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.eco-view-switch-btn .ms {
  font-size: 14px;
}
.eco-view-switch-btn:hover {
  color: var(--text, #1e293b);
}
.eco-view-switch-btn.active {
  background: var(--surface, #ffffff);
  color: var(--accent, #2563eb);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.dark .eco-unit-view-switch {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}
.dark .eco-view-switch-btn.active {
  background: var(--surface, #1e293b);
  color: #38bdf8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.dark .eco-sidebar-uncollapse-btn {
  background: #1e293b;
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.eco-units-head span.count { color: var(--text-muted); font-weight: 500; font-size: 12px; }
.eco-units-actions { display: flex; gap: 6px; }
.eco-units-actions .eco-btn { flex: 1; justify-content: center; height: 28px; }
.eco-units-actions .eco-btn.eco-btn-icon { flex: 0 0 28px; width: 28px; padding: 0; }
.eco-units-actions .eco-btn.eco-btn-icon .ms { font-size: 16px; }
.eco-unit-list { flex: 1; overflow-y: auto; min-height: 0; margin: 0 -4px; }
.eco-unit {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer;
  font-size: 12px;
}
.eco-unit:hover { background: var(--surface-hover); }
.eco-unit input { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.eco-unit .eco-unit-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eco-unit .eco-unit-plate { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.eco-unit-fuel-tag { display: inline-flex; align-items: center; margin-left: auto; flex-shrink: 0; }

/* ── Filtre de compatibilité carburant dans la barre latérale ── */
.eco-filter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.eco-filter-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}
.eco-filter-card.active {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.35);
}
.eco-filter-card-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
}
.eco-filter-card.active .eco-filter-card-left {
  color: #16a34a;
}
.eco-filter-card input[type="checkbox"] {
  accent-color: #16a34a;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* ── Menu Accordéon des groupes dans la barre latérale ── */
.eco-group-accordion {
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.eco-group-accordion-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  user-select: none;
  transition: background 0.12s ease;
}
.eco-group-accordion-head:hover {
  background: var(--surface-hover);
}
.eco-group-chevron {
  font-size: 16px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.eco-group-icon {
  font-size: 15px;
  color: var(--accent);
}
.eco-group-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.eco-group-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--border);
  color: var(--text-muted);
}
.eco-group-badge.has-selected {
  background: rgba(37, 99, 235, 0.15);
  color: #2563eb;
}
.eco-group-check {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.eco-group-accordion-body {
  padding: 2px 4px 4px 10px;
  max-height: 380px;
  overflow-y: auto;
}
.eco-group-accordion-body.hidden {
  display: none;
}

.eco-report { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.eco-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.eco-toolbar .eco-sep { flex: 1; }
.eco-custom-range { display: inline-flex; align-items: center; gap: 6px; }
.eco-custom-range .eco-input { width: 178px; }
.eco-status { padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.eco-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-muted); }
.eco-summary b { color: var(--text); font-weight: 700; }
.eco-progress { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.eco-progress > div { height: 100%; background: var(--accent); transition: width 0.2s; }

.eco-report-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 0 16px 8px;
}
.eco-report-head h2 { margin: 0; font-size: 18px; font-weight: 500; }
.eco-report-head .eco-period { color: var(--text-muted); font-size: 13px; }

.eco-table-wrap { flex: 1; min-height: 0; overflow: auto; margin: 0 16px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
table.eco-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-weight: 500;
  width: max-content;
  min-width: 100%;
  color: var(--text, #0f172a);
}
.eco-table > thead > tr > th {
  position: sticky; top: 0; z-index: 2; background: var(--table-head-bg); color: var(--table-head-text);
  font-weight: 700; text-align: center; padding: 10px 8px; line-height: 1.3; vertical-align: middle;
  font-size: 12px;
  letter-spacing: 0.01em;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}
.eco-table > tbody > tr > td {
  padding: 8px 8px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--border);
  line-height: 1.4;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text, #0f172a);
}
.eco-table > tbody > tr > td.left { text-align: left; }
.eco-table > thead > tr > th:first-child, .eco-table > tbody > tr.trip > td:first-child { position: sticky; left: 0; z-index: 1; }
.eco-table > thead > tr > th:first-child { z-index: 3; }
.eco-table > tbody > tr.trip { cursor: pointer; }
.eco-table > tbody > tr.trip > td { background: var(--surface); }
.eco-table > tbody > tr.trip.alt > td { background: var(--row-alt); }
.eco-table > tbody > tr.trip:hover > td { background: var(--surface-hover); }
.eco-table > tbody > tr.trip.open > td { background: var(--row-open); }
.eco-caret { font-size: 16px; color: var(--text-muted); margin-right: 2px; }
.eco-table > tbody > tr.detail > td { background: var(--surface-2); padding: 0; text-align: left; }
.eco-detail { position: sticky; left: 0; max-width: min(1200px, calc(100vw - 340px)); padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.eco-detail h4 { margin: 8px 0 2px; font-size: 12px; font-weight: 700; }
.eco-detail h4:first-child { margin-top: 0; }
.eco-detail table { border-collapse: collapse; font-size: 11px; width: 100%; }
.eco-detail th { text-align: left; color: var(--text-muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.eco-detail td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.eco-detail a { color: var(--accent); text-decoration: underline; }
.eco-empty { padding: 40px 16px; text-align: center; color: var(--text-muted); }
.eco-more { display: flex; justify-content: center; padding: 10px; }

@media (max-width: 860px) {
  .eco-workspace { flex-direction: column; overflow-y: auto; }
  .eco-units { width: auto; border-right: none; border-bottom: 1px solid var(--border); max-height: 42vh; }
  .eco-report { min-height: 70vh; }
  .eco-detail { max-width: calc(100vw - 48px); }
  .eco-topbar .eco-sub { display: none; }
}

/* ── Bouton Thème (Clair / Sombre) ── */
.eco-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}
.eco-theme-btn:hover {
  background: var(--surface-hover);
  color: var(--accent);
  border-color: var(--accent);
}
.eco-theme-btn .ms {
  font-size: 19px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.eco-theme-btn:hover .ms {
  transform: rotate(18deg) scale(1.08);
}
.eco-theme-btn:active .ms {
  transform: scale(0.92);
}

/* ── Langue ── */
.eco-lang { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.eco-lang button { border: 0; background: var(--surface); padding: 5px 9px; font-size: 11px; font-weight: 700; cursor: pointer; color: var(--text-muted); }
.eco-lang button.is-active { background: var(--accent); color: var(--accent-text); }
.eco-topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ── Tableau : en-têtes larges pour les colonnes de texte ── */
.eco-table > thead > tr > th.wide { min-width: 160px; }
.eco-empty-small { padding: 16px; }

/* ── Détail d'un trajet ── */
.eco-detail-note { margin: 0; color: var(--text-muted); }
.eco-detail-scroll { overflow-x: auto; }
.eco-chips { min-width: 220px; }
.eco-chip {
  display: inline-block; margin: 1px 3px 1px 0; padding: 1px 6px; border-radius: 10px;
  background: var(--surface-hover); border: 1px solid var(--border); font-size: 10px; white-space: nowrap;
}

/* ── Menus Notion (js/notion_dropdown.js) ── */
.notion-dropdown-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeInBackdrop 0.18s ease-out;
  transition: opacity 0.18s ease-out;
}
.notion-dropdown-backdrop.is-closing {
  opacity: 0;
}
@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.notion-dropdown-menu {
  position: fixed; z-index: 99999; display: flex; flex-direction: column;
  background: var(--notion-surface); color: var(--notion-text);
  border: 1px solid var(--notion-border); border-radius: 12px; padding: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); font-size: 12px; user-select: none;
  animation: scaleUp 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.notion-dropdown-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.notion-dropdown-mobile-header { display: none; }
.notion-dropdown-topline { display: flex; align-items: center; justify-content: space-between; }
.notion-dropdown-close-btn {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--notion-text-muted); padding: 4px; border-radius: 6px;
}
.notion-dropdown-close-btn:hover { background: var(--notion-surface-hover); color: var(--notion-text); }
.notion-dropdown-close-btn .ms { font-size: 18px; }

.notion-dropdown-title {
  padding: 6px 10px; margin-bottom: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--notion-text-muted); border-bottom: 1px solid var(--notion-border);
}
.notion-dropdown-search { position: relative; display: flex; align-items: center; padding: 4px; margin-bottom: 4px; }
.notion-dropdown-search .ms { position: absolute; left: 12px; font-size: 15px; opacity: 0.5; pointer-events: none; }
.notion-dropdown-search input {
  width: 100%; border-radius: 8px; padding: 6px 10px 6px 30px; font-size: 12px;
  background: var(--notion-bg); border: 1px solid var(--notion-border); color: var(--notion-text); outline: none;
}
.notion-dropdown-search input:focus { border-color: var(--notion-accent); }
.notion-dropdown-list { flex: 1; overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.notion-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer;
}
.notion-dropdown-item:hover { background: var(--notion-surface-hover); }
/* Combo : ligne « ajouter » (texte recherché sans correspondance) */
.notion-dropdown-item.notion-dropdown-creer { color: var(--accent); font-weight: 600; border-top: 1px dashed var(--border); border-radius: 0 0 8px 8px; }
.notion-dropdown-item.notion-dropdown-creer:first-child { border-top: 0; border-radius: 8px; }
.notion-dropdown-item.is-selected { background: var(--notion-tag-blue-bg); color: var(--notion-accent); font-weight: 700; }
.notion-dropdown-item.is-disabled { opacity: 0.4; pointer-events: none; }
.notion-dropdown-item .ms { font-size: 16px; opacity: 0.75; }
.notion-dropdown-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notion-dropdown-badge {
  padding: 1px 6px; border-radius: 10px; font-size: 10px; background: var(--notion-surface-hover); color: var(--notion-text-muted);
}
.notion-dropdown-check { margin-left: auto; }
.notion-dropdown-empty { padding: 14px; text-align: center; opacity: 0.6; }
.notion-dropdown-group {
  padding: 8px 10px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--notion-text-muted);
}

@media (max-width: 640px) {
  .notion-dropdown-menu.is-mobile {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    max-height: 84vh !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 8px 14px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28) !important;
    animation: slideUpSheet 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    border-bottom: none !important;
    box-sizing: border-box !important;
  }
  .notion-dropdown-menu.is-mobile .notion-dropdown-mobile-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px 0 8px;
    touch-action: none;
    cursor: grab;
  }
  .notion-dropdown-menu.is-mobile .notion-dropdown-handle {
    width: 44px;
    height: 4px;
    border-radius: 2px;
    background: var(--notion-border);
    opacity: 0.85;
  }
  .notion-dropdown-menu.is-mobile .notion-dropdown-topline {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--notion-border);
    margin-bottom: 6px;
  }
  .notion-dropdown-menu.is-mobile .notion-dropdown-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
  }
  .notion-dropdown-menu.is-mobile .notion-dropdown-title {
    margin-bottom: 0;
    border-bottom: none;
    padding: 0 4px;
    font-size: 11px;
    flex: 1;
  }
  .notion-dropdown-menu.is-mobile .notion-dropdown-item {
    padding: 11px 12px;
    font-size: 13.5px;
    border-radius: 10px;
    min-height: 44px;
    box-sizing: border-box;
  }
  .notion-dropdown-menu.is-mobile .notion-dropdown-search {
    padding: 6px 0;
  }
  .notion-dropdown-menu.is-mobile .notion-dropdown-search input {
    font-size: 14px;
    padding: 9px 12px 9px 34px;
  }
}

/* ── Sélecteur de colonnes (js/column_picker.js) ── */
.column-picker-presets { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 4px 4px; }
.column-picker-preset {
  border: 1px solid var(--notion-border); background: var(--notion-bg); border-radius: 6px;
  padding: 3px 8px; font-size: 11px; cursor: pointer;
}
.column-picker-preset:hover { border-color: var(--notion-accent); color: var(--notion-accent); }
.column-picker-item { padding: 5px 10px; }
.column-picker-item input, .column-picker-stat input { accent-color: var(--accent); margin: 0; }
.column-picker-hint { padding: 4px 10px 8px; color: var(--notion-text-muted); font-style: italic; }
.column-picker-sensor { display: flex; flex-direction: column; gap: 3px; padding: 5px 10px; border-radius: 8px; }
.column-picker-sensor:hover { background: var(--notion-surface-hover); }
.column-picker-sensor-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-picker-stats { display: flex; flex-wrap: wrap; gap: 4px; }
.column-picker-stat {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--notion-border); font-size: 10px;
}
.column-picker-stat.is-on { border-color: var(--notion-accent); color: var(--notion-accent); background: var(--notion-tag-blue-bg); }
.column-picker-footer { padding: 6px 10px 2px; border-top: 1px solid var(--notion-border); margin-top: 4px; color: var(--notion-text-muted); }
.column-picker-footer.is-warning { color: var(--danger); }

/* ── Sélecteur de rapport dans la barre latérale ── */
.eco-report-selector {
  display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.eco-report-selector-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted);
}
.eco-report-selector-head .badge {
  background: rgba(31, 106, 134, 0.12); color: var(--accent); padding: 1px 6px;
  border-radius: 10px; font-weight: 700;
}
.eco-report-card {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
  transition: all 0.15s ease;
}
.eco-report-card:hover {
  background: var(--surface-hover); border-color: var(--accent);
}
.eco-report-card-icon {
  width: 30px; height: 30px; border-radius: 6px; background: var(--accent);
  color: var(--accent-text); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.eco-report-card-icon .ms { font-size: 18px; }
.eco-report-card-info { flex: 1; min-width: 0; }
.eco-report-card-title {
  font-weight: 700; font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eco-report-card-desc {
  font-size: 10px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.eco-report-card-caret { color: var(--text-muted); }

/* ── Grille KPI de synthèse ── */
.eco-kpi-grid {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 0 16px 12px;
}
.eco-kpi-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03); min-width: 130px;
}
.eco-kpi-icon {
  width: 28px; height: 28px; border-radius: 6px; background: rgba(31, 106, 134, 0.1);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.eco-kpi-icon .ms { font-size: 16px; }
.eco-kpi-content { display: flex; flex-direction: column; }
.eco-kpi-val { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.eco-kpi-lbl { font-size: 10px; color: var(--text-muted); font-weight: 500; }

/* ── Badges de tableau ── */
.eco-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px;
  border-radius: 10px; font-size: 10px; font-weight: 600; white-space: nowrap;
}
.eco-badge.trip { background: rgba(31, 106, 134, 0.12); color: var(--accent); }
.eco-badge.stop { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }
.eco-badge.danger { background: var(--danger-bg); color: var(--danger); }
.eco-badge.warn { background: var(--warn-bg); color: var(--warn-text); }

/* ── Vue interactive V13 · Rapport journalier (Adaptation Securysat 1:1 aux couleurs Igeo) ── */
.v13-view {
  display: flex; flex-direction: column; gap: 16px; padding: 0 16px 20px;
}
.v13-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.v13-toolbar-label {
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-muted);
}
.v13-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.v13-day-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 11px; color: var(--text);
  cursor: pointer; transition: all 0.15s ease;
}
.v13-day-pill:hover { background: var(--surface-hover); border-color: var(--accent); }
.v13-day-pill.active {
  background: var(--accent); color: var(--accent-text); border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(31, 106, 134, 0.25);
}
.v13-pill-badge {
  background: rgba(255, 255, 255, 0.2); padding: 1px 6px; border-radius: 10px; font-size: 10px; font-weight: 700;
}
.v13-day-pill:not(.active) .v13-pill-badge {
  background: rgba(31, 106, 134, 0.1); color: var(--accent);
}

/* ── Hero 2 colonnes officiel Securysat (39% Fiche gauche / 59% Carte droite) ── */
.v13-hero-row {
  display: grid;
  grid-template-columns: 39% 59%;
  gap: 2%;
  align-items: stretch;
}
@media (max-width: 960px) {
  .v13-hero-row { grid-template-columns: 1fr; gap: 16px; }
}

/* Panneau Gauche (Fiche Journalière Securysat) */
.v13-panel-left {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
  min-width: 0;
  overflow: hidden;
}
.v13-panel-title {
  text-align: center; font-size: 13.5px; font-weight: 800; color: var(--text);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v13-panel-title u { text-decoration: underline; text-underline-offset: 3px; }
.v13-panel-date {
  text-align: center; font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 6px;
}
.v13-panel-map-toggle {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; font-size: 11px;
  color: var(--text); margin-bottom: 4px;
}
.v13-panel-map-toggle label {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
}
.v13-panel-map-toggle input { cursor: pointer; accent-color: var(--accent); }
.v13-fields-btn {
  padding: 2px 8px !important;
  height: 24px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
  border: 1px solid var(--border) !important;
  background: var(--surface-2) !important;
}
.v13-fields-btn:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.v13-panel-disclaimer {
  text-align: center; font-size: 10px; color: var(--text-muted); font-style: italic; margin-bottom: 10px;
}
.v13-info-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  font-size: 11px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
@media (max-width: 680px) {
  .v13-info-column { grid-template-columns: 1fr; }
}
.v13-info-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.v13-info-row b {
  color: var(--text); font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.v13-info-row span {
  color: var(--text);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.v13-info-row .highlight { font-weight: 700; color: var(--accent); }

/* Panneau Droite (Carte Leaflet) */
.v13-map-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
}
.v13-map-head {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.v13-map-actions { display: flex; align-items: center; gap: 6px; }
.v13-map-container { flex: 1; min-height: 340px; width: 100%; background: #e5e7eb; }
.v13-map-fullscreen {
  position: fixed !important; top: 0; left: 0; width: 100vw !important; height: 100vh !important;
  z-index: 99999; border-radius: 0 !important;
}
.v13-map-fullscreen .v13-map-container { height: calc(100vh - 44px) !important; }

/* ── Frise chronologique d'activité 0h - 24h (Timeline) ── */
.v13-timeline-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.v13-timeline-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
  font-size: 11px; font-weight: 700; color: var(--text);
}
.v13-timeline-legend {
  display: flex; align-items: center; gap: 12px; font-size: 10px; color: var(--text-muted);
}
.v13-legend-item { display: flex; align-items: center; gap: 4px; }
.v13-legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.v13-legend-dot.trip { background: var(--accent); }
.v13-legend-dot.stop { background: #f59e0b; }
.v13-legend-dot.idle { background: #ea580c; }

.v13-timeline-track {
  position: relative; height: 32px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden; margin-bottom: 6px;
}
.v13-timeline-segment {
  position: absolute; top: 0; height: 100%; cursor: pointer; transition: opacity 0.15s ease;
}
.v13-timeline-segment:hover { opacity: 0.85; filter: brightness(1.1); }
.v13-timeline-segment.trip { background: var(--accent); }
.v13-timeline-segment.stop { background: #f59e0b; }
.v13-timeline-segment.idle { background: #ea580c; }
.v13-timeline-ticks {
  display: flex; justify-content: space-between; font-size: 9px; font-family: monospace;
  color: var(--text-muted); padding: 0 2px;
}

/* ── Tableau des trajets de la journée (V03 Rapport trajets) ── */
.v13-trips-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.v13-table-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.v13-trip-row { cursor: pointer; transition: background 0.12s ease; }
.v13-trip-row:hover { background: var(--surface-hover); }
.v13-trip-row.active {
  background: rgba(31, 106, 134, 0.12) !important; border-left: 3px solid var(--accent);
}
html.dark .v13-trip-row.active {
  background: rgba(74, 163, 195, 0.18) !important;
}

/* Tracés et Marqueurs Leaflet — White Outline Dynamique O(1) */
path.igeo-route-outline {
  stroke-width: var(--igeo-outline-w, 5.9px);
}
path.igeo-route-outline.is-highlighted {
  stroke-width: var(--igeo-outline-hi-w, 9.1px);
}
path.igeo-route-line {
  stroke-width: var(--igeo-route-w, 3.5px);
}
path.igeo-route-line.is-highlighted {
  stroke-width: var(--igeo-route-hi-w, 5px);
}

.v13-custom-marker, .v20-custom-pin { display: flex; align-items: center; justify-content: center; }
.igeo-map-pin-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: scale(var(--igeo-icon-scale, 1));
  transform-origin: 50% 92%;
  transition: transform 0.15s ease;
  will-change: transform;
}
.igeo-map-pin-icon img,
.igeo-map-pin-icon svg {
  display: block;
  pointer-events: none;
  overflow: visible;
}
.igeo-map-pin-icon .igeo-icon-outline,
.igeo-map-pin-icon .igeo-pin-outline,
.igeo-map-pin-icon .igeo-flag-outline {
  stroke-width: var(--igeo-icon-outline-w, 7.2px);
  transition: stroke-width 0.12s ease;
}
.igeo-map-pin-icon .igeo-icon-keyline,
.igeo-map-pin-icon .igeo-pin-shadow,
.igeo-map-pin-icon .igeo-flag-shadow {
  stroke-width: var(--igeo-icon-keyline-w, 9px);
  transition: stroke-width 0.12s ease;
}
.igeo-map-pin-icon:hover {
  transform: scale(calc(var(--igeo-icon-scale, 1) * 1.15));
}
/* Position du véhicule au survol des graphiques V20 : centrée, non cliquable, sans effet de survol */
.igeo-map-pin-icon.igeo-map-vehicule { transform-origin: 50% 50%; cursor: default; pointer-events: none; transition: none; }
.igeo-map-pin-icon.igeo-map-vehicule:hover { transform: scale(var(--igeo-icon-scale, 1)); }
.v20-position-vehicule { pointer-events: none; }
.v13-stop-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  color: #2563eb;
  border: var(--igeo-stop-border, 2.3px) solid #2563eb;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 var(--igeo-stop-ring, 3px) #ffffff,
    0 0 0 calc(var(--igeo-stop-ring, 3px) + 1.1px) rgba(15, 23, 42, 0.28),
    0 3px 7px rgba(15, 23, 42, 0.38);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: pointer;
  user-select: none;
  transform: scale(var(--igeo-icon-scale, 1));
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.12s ease;
}
.v13-stop-badge:hover {
  transform: scale(calc(var(--igeo-icon-scale, 1) * 1.18));
  background: #2563eb;
  color: #ffffff;
  border-color: #ffffff;
}
.v20-event-pin-badge {
  width: 34px;
  height: 34px;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--igeo-stop-border, 2.3px) solid #ffffff;
  box-shadow:
    0 0 0 var(--igeo-stop-ring, 2.8px) #ffffff,
    0 0 0 calc(var(--igeo-stop-ring, 2.8px) + 1.1px) rgba(15, 23, 42, 0.28),
    0 3px 10px rgba(15, 23, 42, 0.42);
  transform: scale(var(--igeo-icon-scale, 1));
  transition: transform 0.15s ease, box-shadow 0.12s ease;
}
.v20-event-pin-badge:hover {
  transform: scale(calc(var(--igeo-icon-scale, 1) * 1.14));
}
.v13-pin-circle {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 0 0 var(--igeo-stop-ring, 2.5px) #ffffff, 0 2px 6px rgba(0, 0, 0, 0.35); border: 2px solid #ffffff;
}
.v13-pin-circle.start { width: 26px; height: 26px; background: #10b981; }
.v13-pin-circle.end { width: 26px; height: 26px; background: #ef4444; }
.v13-pin-circle.stop { width: 20px; height: 20px; background: #f59e0b; }
.v13-map-popup { font-family: inherit; font-size: 11px; line-height: 1.4; color: #1e293b; }

.v13-multiday-details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.v13-multiday-summary {
  display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--accent); cursor: pointer;
}

/* ── Améliorations Leaflet en mode sombre ── */
/* Carte sombre (thème sombre, Paramètres › Carte, lieux et adresses ; ui/fonds_carte.js) :
   fonds Plan et OSM assombris, Satellite intact. Même filtre que RnFondsCarte.FILTRE_SOMBRE. */
html.dark:not(.rn-carte-claire) .rn-fond-plan,
html.dark:not(.rn-carte-claire) .rn-fond-osm {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.9) saturate(0.85);
}
html.dark:not(.rn-carte-claire) .leaflet-container { background: #1f2329; }

html.dark .leaflet-popup-content-wrapper,
html.dark .leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
}
html.dark .v13-map-popup {
  color: var(--text);
}
html.dark .v13-map-popup .text-muted {
  color: var(--text-muted);
}
html.dark .leaflet-bar a {
  background-color: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
html.dark .leaflet-bar a:hover {
  background-color: var(--surface-hover);
  color: var(--accent);
}
html.dark .leaflet-control-layers {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
html.dark .leaflet-control-layers-expanded {
  background: var(--surface);
  color: var(--text);
}
html.dark .leaflet-control-attribution {
  background: rgba(26, 29, 32, 0.8) !important;
  color: var(--text-muted) !important;
}
html.dark .leaflet-control-attribution a {
  color: var(--accent) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RAPPORT V20 · GESTION CARBURANT & ÉNERGIE (F03, F04, V35, COURBE 5MIN)
   ═══════════════════════════════════════════════════════════════════════════════ */
.v20-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px;
}

/* ── Barre de sélection des véhicules (Pills) ── */
.v20-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.v20-pills-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.v20-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.v20-veh-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.v20-veh-pill:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}
.v20-veh-pill.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(31, 106, 134, 0.3);
}
.v20-veh-pill .v20-pill-badge {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 800;
}
.v20-veh-pill.active .v20-pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ── Carte Graphique de niveau de cuve ── */
.v20-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.v20-chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.v20-chart-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.v20-chart-vehicle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(31, 106, 134, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}
html.dark .v20-chart-vehicle-badge {
  background: rgba(74, 163, 195, 0.15);
  color: var(--accent);
}
.v20-chart-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.v20-chart-actions-left {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.v20-chart-actions-right {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.v20-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
}
.v20-icon-btn:hover {
  background: var(--bg-card, #ffffff);
  color: var(--accent, #1f6a86);
  border-color: var(--accent, #1f6a86);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
html.dark .v20-icon-btn {
  background: rgba(255, 255, 255, 0.05);
}
html.dark .v20-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent, #4aa3c3);
  border-color: var(--accent, #4aa3c3);
}

.v20-source-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-hover, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
html.dark .v20-source-toggle {
  background: rgba(255, 255, 255, 0.05);
}
.v20-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.v20-source-btn:hover {
  color: var(--text);
}
.v20-source-btn.active {
  background: var(--bg-card, #ffffff);
  color: var(--accent, #1f6a86);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
html.dark .v20-source-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent, #4aa3c3);
}
.v20-mini-spinner {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: v20-spin-anim 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes v20-spin-anim {
  to { transform: rotate(360deg); }
}

.v20-mode-selector {
  display: inline-flex;
  align-items: center;
  background: var(--bg-hover, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
html.dark .v20-mode-selector {
  background: rgba(255, 255, 255, 0.05);
}
.v20-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.v20-mode-btn:hover {
  color: var(--text);
}
.v20-mode-btn.active {
  background: var(--bg-card, #ffffff);
  color: var(--accent, #1f6a86);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
html.dark .v20-mode-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent, #4aa3c3);
}

.v20-interval-slider-card {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  background: var(--bg-hover, #f1f5f9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  min-width: 175px;
}
html.dark .v20-interval-slider-card {
  background: rgba(255, 255, 255, 0.05);
}
.v20-interval-slider-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.v20-interval-slider-title {
  font-weight: 600;
  color: var(--text-muted);
}
.v20-interval-pill {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}
html.dark .v20-interval-pill {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
.v20-interval-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.v20-slider-limit {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
}
.v20-range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: var(--border, #cbd5e1);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
  margin: 0;
}
.v20-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.v20-range-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.v20-range-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
html.dark .v20-range-input {
  background: rgba(255, 255, 255, 0.15);
}
html.dark .v20-range-input::-webkit-slider-thumb {
  background: #38bdf8;
  border-color: #0f172a;
}

.v20-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.v20-zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card, #ffffff);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.v20-zoom-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text);
}
html.dark .v20-zoom-btn {
  background: rgba(255, 255, 255, 0.05);
}
html.dark .v20-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.v20-hud-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 7px 14px;
  background: var(--bg-hover, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text);
  min-height: 34px;
}
html.dark .v20-hud-bar {
  background: rgba(255, 255, 255, 0.04);
}
.v20-hud-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.v20-hud-item .ms {
  font-size: 14px;
}
.v20-hud-item.fuel {
  font-weight: 700;
  color: var(--accent, #1f6a86);
}
.v20-hud-item.addr {
  max-width: 440px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}
.v20-zoom-brush {
  fill: rgba(37, 99, 235, 0.18);
  stroke: #2563eb;
  stroke-width: 1px;
  stroke-dasharray: 2,2;
}

/* Légende du graphique */
.v20-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
.v20-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.v20-legend-line {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}
.v20-legend-line.raw {
  background: #f59e0b;
  height: 0;
  border-top: 2px dashed #f59e0b;
}
.v20-legend-line.filtered {
  background: #2563eb;
}
.v20-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.v20-legend-dot.refuel {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}
.v20-legend-dot.theft {
  background: #dc2626;
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* ── Ligne Trajet Interactive & Sélection V35 ── */
.v20-trip-row {
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.v20-trip-row:hover {
  background: rgba(56, 189, 248, 0.08) !important;
}
.v20-trip-row.selected {
  background: rgba(56, 189, 248, 0.16) !important;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #0284c7;
}
html.dark .v20-trip-row.selected {
  background: rgba(56, 189, 248, 0.22) !important;
  box-shadow: inset 3px 0 0 #38bdf8;
}

/* ── Badge chip de trajet sélectionné ── */
.v20-trip-highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #0284c7;
  margin-left: 8px;
}
html.dark .v20-trip-highlight-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}
.v20-chip-clear {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 0;
  opacity: 0.7;
}
.v20-chip-clear:hover {
  opacity: 1;
}

/* ── Masque d'assombrissement du graphe ── */
.v20-chart-dim-mask {
  transition: opacity 0.25s ease;
}

/* ── Pleins / siphonnages sur la courbe : bande légère, segment coloré, pastille compacte ── */
.v20-event-band { stroke: none; transition: fill 0.15s ease; }
.v20-event-band.refuel { fill: rgba(22, 163, 74, 0.07); }
.v20-event-band.theft { fill: rgba(220, 38, 38, 0.07); }
.v20-event-band.manual { fill: rgba(124, 58, 237, 0.07); }
.v20-event-group:hover .v20-event-band.refuel { fill: rgba(22, 163, 74, 0.14); }
.v20-event-group:hover .v20-event-band.theft { fill: rgba(220, 38, 38, 0.14); }
.v20-event-group:hover .v20-event-band.manual { fill: rgba(124, 58, 237, 0.14); }

.v20-event-curve-highlight {
  fill: none;
  stroke-width: 2.6px;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.v20-event-curve-highlight.refuel { stroke: #16a34a; }
.v20-event-curve-highlight.theft { stroke: #dc2626; }
.v20-event-curve-highlight.manual { stroke: #7c3aed; }

.v20-event-pill-badge { cursor: pointer; }
.v20-event-pill-badge rect { transition: fill 0.12s ease; filter: drop-shadow(0 1px 1.5px rgba(15, 23, 42, 0.12)); }
.v20-event-pill-badge.refuel:hover rect { fill: #f0fdf4; }
.v20-event-pill-badge.theft:hover rect { fill: #fef2f2; }
.v20-event-pill-badge.manual:hover rect { fill: #f5f3ff; }
.v20-event-pill-badge text { pointer-events: none; }

/* Poignées de début / fin (mode édition) : couleur de l'événement (--v20-poignee). */
.v20-band-resize-handle { cursor: ew-resize; user-select: none; touch-action: none; }
.v20-band-resize-handle line { transition: stroke-opacity 0.12s ease, stroke-width 0.12s ease; }
.v20-band-resize-handle .v20-handle-grip { opacity: 0.75; transition: opacity 0.12s ease; }
.v20-event-group:hover .v20-band-resize-handle .v20-handle-grip { opacity: 1; }
.v20-band-resize-handle:hover line,
.v20-band-resize-handle.active line { stroke-opacity: 1; stroke-width: 2.5; }
.v20-band-resize-handle:hover .v20-handle-grip,
.v20-band-resize-handle.active .v20-handle-grip { opacity: 1; fill: var(--v20-poignee, #7c3aed); }
.v20-event-group.edition .v20-event-band.refuel { fill: rgba(22, 163, 74, 0.11); }
.v20-event-group.edition .v20-event-band.theft { fill: rgba(220, 38, 38, 0.11); }
.v20-event-group.edition .v20-event-band.manual { fill: rgba(124, 58, 237, 0.11); }
.v20-reset-ajustement { cursor: pointer; }
.v20-reset-ajustement:hover circle { fill: #fffbeb; }
.v20-bandeau-edition {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 2px 0 6px; padding: 5px 10px; border-radius: 6px;
  background: rgba(37, 99, 235, 0.06); border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--text-muted); font-size: 11.5px;
}
.v20-bandeau-edition .ms { font-size: 15px; color: var(--accent, #2563eb); }

/* ── Synchronisation bidirectionnelle : ligne de tableau ciblée ── */
.eco-table tr.v20-row-focused {
  background: rgba(37, 99, 235, 0.16) !important;
  outline: 2px solid #2563eb;
  transition: all 0.35s ease;
}
html.dark .eco-table tr.v20-row-focused {
  background: rgba(59, 130, 246, 0.25) !important;
  outline-color: #60a5fa;
}
.v20-table-interactive tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}
.v20-table-interactive tbody tr:hover {
  background: rgba(37, 99, 235, 0.08);
}

.v20-svg-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 4px;
}
.v20-svg-chart {
  width: 100%;
  height: auto;
  max-height: 290px;
  display: block;
}

/* ══════════════════════════════════════════════════════════════════════════
   HABILLAGE MODERNE TYPE MYGEOTAB · LES 4 COURBES CHRONOLOGIQUES SYNCHRONISÉES
   ══════════════════════════════════════════════════════════════════════════ */
.v20-charts-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
  position: relative;
}

/* ── Mode Grille Hybride 2 colonnes (Niveau carburant pleine largeur, 4 secondaires en 2x2) ── */
.v20-charts-stack.layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.v20-charts-stack.layout-grid #v20-card-level {
  grid-column: 1 / -1;
}
.v20-charts-stack.layout-grid .v20-zoom-banner {
  grid-column: 1 / -1;
}
@media (max-width: 960px) {
  .v20-charts-stack.layout-grid {
    grid-template-columns: 1fr;
  }
}

.v20-geotab-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  padding: 12px 16px 8px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.v20-geotab-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}
html.dark .v20-geotab-card {
  background: var(--surface, #1e293b);
  border-color: var(--border, #334155);
}
html.dark .v20-geotab-card:hover {
  border-color: #475569;
}

.v20-geotab-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}
.v20-geotab-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text, #1e293b);
  letter-spacing: -0.01em;
}
.v20-geotab-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.v20-geotab-stat {
  font-size: 13.5px;
  font-weight: 800;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}
html.dark .v20-geotab-stat {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.25);
}

.v20-geotab-btn-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border, #e2e8f0);
  background: transparent;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}
.v20-geotab-btn-icon:hover {
  background: var(--bg-hover, #f1f5f9);
  color: var(--text, #0f172a);
}
html.dark .v20-geotab-btn-icon {
  border-color: #334155;
  color: #94a3b8;
}
html.dark .v20-geotab-btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}
#v20-mode-edition[aria-pressed="true"] {
  background: var(--accent, #2563eb);
  border-color: var(--accent, #2563eb);
  color: #ffffff;
}

/* Pastilles et poignées des événements V20 en thème sombre */
html.dark .v20-event-pill-badge rect,
html.dark .v20-reset-ajustement circle,
html.dark .v20-band-resize-handle .v20-handle-grip { fill: #0f172a; }
html.dark .v20-event-pill-badge.refuel:hover rect { fill: rgba(22, 163, 74, 0.18); }
html.dark .v20-event-pill-badge.theft:hover rect { fill: rgba(220, 38, 38, 0.18); }
html.dark .v20-event-pill-badge.manual:hover rect { fill: rgba(124, 58, 237, 0.2); }
html.dark .v20-event-pill-badge text { filter: brightness(1.35); }

/* Légendes cliquables des graphiques V20 : élément masqué = barré et grisé */
.v20-legende-puce {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.v20-legende-puce:hover {
  background: var(--surface-hover, #f1f5f9);
  border-color: var(--border, #e2e8f0);
}
.v20-legende-puce:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 1px;
}
.v20-legende-puce.masquee {
  opacity: 0.45;
  text-decoration: line-through;
}

/* Callouts et Badges Min / Max ancrés sur la courbe (Style Capture 1) */
.v20-callout-rect {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
}

/* Infobulle Unifiée Haute Précision - Format Compact HUD */
.v20-unified-tooltip {
  position: fixed;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.5);
  font-size: 10px;
  pointer-events: none;
  z-index: 100;
  backdrop-filter: blur(8px);
  min-width: 185px;
  max-width: 215px;
  transition: opacity 0.12s ease;
}
.v20-unified-tooltip-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
  margin-bottom: 5px;
}
.v20-unified-tooltip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin-bottom: 5px;
}
.v20-unified-tooltip-row {
  display: flex;
  flex-direction: column;
}
.v20-unified-tooltip-lbl {
  font-size: 8px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.1;
}
.v20-unified-tooltip-val {
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
  line-height: 1.2;
}
.v20-unified-tooltip-footer {
  font-size: 8.5px;
  color: #cbd5e1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.v20-pill-mini-orange {
  font-size: 8.5px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 0 4px;
  border-radius: 4px;
  margin-left: auto;
}


/* ── Widget Dynamique : Modèle de Répartition du Carburant ── */
.v20-breakdown-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}
html.dark .v20-breakdown-card {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}
.v20-breakdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.v20-breakdown-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #0f172a);
}
.v20-breakdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}
html.dark .v20-breakdown-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
.v20-breakdown-layout {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.v20-donut-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.v20-donut-svg {
  transform: rotate(-90deg);
  width: 140px;
  height: 140px;
}
.v20-donut-circle-bg {
  fill: none;
  stroke: var(--border, #e2e8f0);
  stroke-width: 14;
  opacity: 0.5;
}
html.dark .v20-donut-circle-bg {
  stroke: rgba(255, 255, 255, 0.08);
}
.v20-donut-seg {
  fill: none;
  stroke-width: 14;
  transition: stroke-dasharray 0.4s ease, stroke-dashoffset 0.4s ease;
}
.v20-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.v20-donut-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--text, #0f172a);
  line-height: 1.1;
}
.v20-donut-lbl {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #64748b);
  margin-top: 2px;
}
.v20-breakdown-metrics {
  flex: 1;
  min-width: 280px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.v20-metric-card {
  background: var(--surface-2, rgba(248, 250, 252, 0.8));
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
html.dark .v20-metric-card {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(255, 255, 255, 0.06);
}
.v20-metric-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}
.v20-metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}
.v20-metric-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.v20-metric-vol {
  font-size: 16px;
  font-weight: 800;
  color: var(--text, #0f172a);
}
.v20-metric-sub {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}
.v20-comparison-bar {
  width: 100%;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
}
html.dark .v20-comparison-bar {
  border-color: rgba(255, 255, 255, 0.08);
}
.v20-comparison-tags {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.v20-comparison-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.v20-comparison-delta {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
}
.v20-comparison-delta.positive {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}
.v20-comparison-delta.highlight {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}
html.dark .v20-comparison-delta.highlight {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

/* ── Cartes Accordéons (F03, F04, V35, Synthèse Flotte) ── */
.v20-accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.v20-accordion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.v20-accordion-head:hover {
  background: var(--surface-hover);
}
.v20-accordion-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
}
.v20-accordion-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.v20-chevron {
  font-size: 20px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.v20-chevron.collapsed {
  transform: rotate(-90deg);
}
.v20-accordion-body {
  padding: 14px;
  overflow-x: auto;
}
/* Vue de côté (carte ouverte) : les tableaux tiennent dans la colonne restante au lieu de
   déborder ; le texte passe à la ligne et la police se resserre. */
.v20-split-wrapper.has-side-map:not(.collapsed-map) .v20-accordion-body { padding: 8px; }
.v20-split-wrapper.has-side-map:not(.collapsed-map) .v20-main-col table.eco-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}
.v20-split-wrapper.has-side-map:not(.collapsed-map) .v20-main-col .eco-table > thead > tr > th,
.v20-split-wrapper.has-side-map:not(.collapsed-map) .v20-main-col .eco-table > tbody > tr > td {
  padding: 6px 5px;
  font-size: 11px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.v20-split-wrapper.has-side-map:not(.collapsed-map) .v20-main-col .eco-table .v20-badge,
.v20-split-wrapper.has-side-map:not(.collapsed-map) .v20-main-col .eco-table [class*="pill"] {
  white-space: normal;
}
.v20-accordion-body.hidden {
  display: none;
}

/* Badges d'état */
.v20-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
}
.v20-badge.success {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}
.v20-badge.danger {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}
.v20-badge.info {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}
.v20-badge.neutral {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-muted);
}
.v20-badge.warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.v20-empty-message {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── Survol interactif de la courbe (Crosshair & Tooltip) ── */
.v20-chart-container {
  position: relative;
  width: 100%;
}
.v20-tooltip {
  position: absolute;
  top: 10px;
  right: 14px;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.16);
  z-index: 100;
  transition: opacity 0.1s ease;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.v20-tooltip-title {
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.v20-tooltip-fuel {
  font-size: 14px;
  font-weight: 800;
  color: #38bdf8;
  margin-bottom: 2px;
}
.v20-tooltip-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 3px;
  display: inline-block;
}
.v20-tooltip-status.normal { background: rgba(59, 130, 246, 0.25); color: #bfdbfe; }
.v20-tooltip-status.plein { background: rgba(34, 197, 94, 0.3); color: #86efac; }
.v20-tooltip-status.theft { background: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.v20-tooltip-hint {
  font-size: 9.5px;
  color: #94a3b8;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 3px;
}

/* ── Split Layout Vue de Côté (Table à gauche, Carte à droite) ── */
.v20-split-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.v20-main-col {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: flex 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.v20-split-wrapper.has-side-map .v20-main-col {
  flex: 1 1 52%;
  max-width: 52%;
}

.v20-split-wrapper.has-side-map.wide-map .v20-main-col {
  flex: 1 1 35%;
  max-width: 35%;
}

.v20-split-wrapper.has-side-map.collapsed-map .v20-main-col {
  flex: 1 1 100%;
  max-width: 100%;
}

/* ── Panneau rétractable Mini-carte Leaflet (Vue de côté) ── */
.v20-minimap-card {
  position: sticky;
  top: 12px;
  flex: 0 0 47%;
  width: 47%;
  height: calc(100vh - 84px);
  max-height: calc(100vh - 84px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: visible; /* Pour laisser dépasser le bouton circulaire de split */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: flex 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.v20-split-wrapper.has-side-map.wide-map .v20-minimap-card {
  flex: 0 0 64%;
  width: 64%;
}

.v20-split-wrapper.has-side-map.collapsed-map .v20-minimap-card {
  flex: 0 0 0%;
  width: 0;
  min-width: 0;
  padding: 0;
  border: none;
  opacity: 0;
  pointer-events: none;
}

.v20-minimap-card.hidden {
  display: none !important;
}

.v20-minimap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}

.v20-minimap-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
}

.v20-minimap-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  flex: 1;
  min-width: 0;
}

.v20-minimap-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.v20-minimap-tag.v20-addr-tag {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

.v20-minimap-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.v20-minimap-container {
  flex: 1 1 auto;
  width: 100%;
  height: 100% !important;
  min-height: 250px;
  background: #e2e8f0;
  border-radius: 0 0 12px 12px;
}

/* ── Bouton circulaire de toggle / split (identique à la capture) ── */
.v20-split-toggle-btn {
  position: absolute;
  bottom: 24px;
  left: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1010;
  transition: transform 0.2s ease, background 0.2s ease;
}

.v20-split-toggle-btn:hover {
  background: #1d4ed8;
  transform: scale(1.08);
}

.v20-split-toggle-btn .ms {
  font-size: 20px;
  line-height: 1;
}

.v20-trip-row.selected,
.v20-event-row.selected,
.v20-event-row.v20-row-focused {
  background: rgba(37, 99, 235, 0.08) !important;
  outline: 1px solid rgba(37, 99, 235, 0.28);
}

@media (max-width: 900px) {
  .v20-split-wrapper {
    flex-direction: column;
  }
  .v20-split-wrapper.has-side-map .v20-main-col {
    max-width: 100%;
    flex: 1 1 100%;
  }
  .v20-minimap-card {
    position: relative;
    top: 0;
    width: 100%;
    height: 380px;
    max-height: 380px;
  }
  .v20-split-toggle-btn {
    display: none;
  }
}

/* ── Sidebar Tiroir Droite : Paramètres Carburant & Filtres Avancés ── */
.v20-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.v20-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.v20-settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 390px;
  max-width: 92vw;
  background: var(--surface, #ffffff);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  pointer-events: none;
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
}
.v20-settings-drawer.open {
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
}

.v20-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface-2, #f8fafc);
  border-bottom: 1px solid var(--border);
}
.v20-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.v20-drawer-title .ms {
  font-size: 20px;
}
#v20-close-drawer {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
#v20-close-drawer:hover {
  background: var(--bg-hover, rgba(0, 0, 0, 0.06));
  color: var(--text);
}

.v20-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.v20-drawer-section {
  background: var(--bg-hover, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
html.dark .v20-drawer-section {
  background: rgba(255, 255, 255, 0.03);
}

.v20-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.v20-section-head .ms {
  font-size: 16px;
}

.v20-field-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.v20-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.v20-field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.v20-field-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #1f6a86);
  background: rgba(31, 106, 134, 0.1);
  padding: 1px 7px;
  border-radius: 10px;
}

.v20-range-input {
  width: 100%;
  accent-color: var(--accent, #1f6a86);
  cursor: pointer;
  height: 6px;
}

.v20-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
}
.v20-toggle-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

.v20-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}
.v20-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.v20-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border, #cbd5e1);
  transition: 0.25s;
  border-radius: 20px;
}
.v20-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}
.v20-switch input:checked + .v20-slider {
  background-color: var(--accent, #1f6a86);
}
.v20-switch input:checked + .v20-slider:before {
  transform: translateX(18px);
}

.v20-drawer-foot {
  padding: 14px 20px;
  background: var(--surface-2, #f8fafc);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.v20-drawer-foot button {
  flex: 1;
}

/* Lignes annulées et badges de consolidation */
.v20-row-canceled {
  opacity: 0.55;
  background: rgba(100, 116, 139, 0.05) !important;
}
.v20-badge.canceled {
  background: rgba(100, 116, 139, 0.16);
  color: var(--text-muted);
  border: 1px dashed var(--border);
}
.v20-badge.merged {
  background: rgba(14, 165, 233, 0.14);
  color: #0284c7;
  cursor: help;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PR01 · AUDIT DES PERTES RÉSEAU (STYLES COMPLETS & ADAPTATIFS)
   ═══════════════════════════════════════════════════════════════════════════════ */
.pr01-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.pr01-lazy-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-hover, #f1f5f9);
  border: 1px dashed var(--border, #cbd5e1);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted, #64748b);
  animation: fadeIn 0.2s ease-in;
}
.pr01-lazy-bar-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pr01-lazy-bar.pret {
  border-style: solid;
  color: var(--text);
}
html.dark .pr01-lazy-bar {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}
html.dark .pr01-lazy-bar.pret {
  color: var(--text);
}

.pr01-toolbar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pr01-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pr01-filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pr01-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pr01-filter-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.pr01-filter-btn.active {
  background: var(--surface-2);
  border-color: var(--text-muted);
  color: var(--text);
}

.pr01-search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
  max-width: 340px;
  flex: 1;
}

.pr01-search-icon {
  position: absolute;
  left: 9px;
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.pr01-search-input {
  width: 100%;
  padding: 6px 30px 6px 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
}

.pr01-search-input:focus {
  border-color: var(--accent);
}

.pr01-search-clear {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
}

/* Sections du rapport PR01 (Haut = Hors ligne, Principal = Résolus) */
.pr01-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.pr01-section-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: 11px;
  border-top-right-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pr01-section-header.primary {
  background: var(--surface-2);
  border-bottom-color: var(--border);
}

.pr01-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pr01-section-title-wrap h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.pr01-section-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.pr01-tiers-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.pr01-tier-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: visible;
  background: var(--surface);
}

.pr01-tier-head {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
  color: var(--text);
}

.pr01-tier-name {
  font-weight: 700;
  font-size: 12px;
}

.pr01-tier-counter {
  font-size: 11px;
  color: var(--text-muted);
}

/* En-tête figé : chaque tableau défile dans sa propre zone (hauteur limitée à l'écran), les
   colonnes larges défilent sur le côté sans sortir de la carte et l'en-tête reste visible. */
.pr01-table-wrapper {
  overflow: auto;
  max-height: calc(100vh - 240px);
  min-height: 0;
}
/* Tableaux imbriqués (client déplié) : pas de seconde zone de défilement, en-tête non figé */
.pr01-client-detail .pr01-table-wrapper {
  overflow: visible;
  max-height: none;
}
.pr01-client-detail .pr01-table th {
  position: static;
  box-shadow: none;
}

.pr01-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11.5px;
}

.pr01-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.pr01-table-client-vehicules th {
  position: static;
  box-shadow: none;
}

.pr01-table th.left, .pr01-table td.left {
  text-align: left;
}

.pr01-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  color: var(--text);
}

.pr01-table tr.alt td {
  background: var(--row-alt, rgba(0, 0, 0, 0.015));
}

.pr01-table tr:hover td {
  background: var(--surface-hover);
}

.pr01-table tfoot td {
  background: var(--surface-2);
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
}

.pr01-table:not(.pr01-table-client-vehicules) > tbody > tr:last-child > td {
  border-bottom: 0;
}
.pr01-table:not(.pr01-table-client-vehicules) > tbody > tr:last-child > td:first-child {
  border-bottom-left-radius: 11px;
}
.pr01-table:not(.pr01-table-client-vehicules) > tbody > tr:last-child > td:last-child {
  border-bottom-right-radius: 11px;
}

.pr01-tier-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface);
}

.pr01-loc-text {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Modale de carte Leaflet */
.pr01-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
  padding: 16px;
}

.pr01-modal-card {
  background: var(--surface);
  border-radius: 12px;
  width: 100%;
  max-width: 720px;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.pr01-modal-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
}

.pr01-modal-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.pr01-modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.pr01-modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.pr01-modal-body {
  padding: 16px;
}

/* PR01 · bascule du regroupement et vue « par véhicule et journée » */
.pr01-group-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.pr01-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.pr01-group-btn + .pr01-group-btn {
  border-left: 1px solid var(--border);
}

.pr01-group-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.pr01-group-btn.active {
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
}

.pr01-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pr01-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.pr01-link-btn:hover {
  color: var(--accent);
}

.pr01-vehicles-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.pr01-vehicle-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.pr01-vehicle-head {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.pr01-vehicle-head:hover {
  background: var(--surface-hover);
}

.pr01-vehicle-chevron {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.15s;
}

.pr01-vehicle-card.collapsed .pr01-vehicle-chevron {
  transform: rotate(-90deg);
}

.pr01-vehicle-card.collapsed .pr01-vehicle-head {
  border-bottom: 0;
}

.pr01-vehicle-card.collapsed .pr01-vehicle-body {
  display: none;
}

.pr01-vehicle-name {
  font-weight: 700;
  color: var(--text);
}

.pr01-vehicle-plate {
  color: var(--text-muted);
}

.pr01-vehicle-group {
  color: var(--text-muted);
}

.pr01-vehicle-stats {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.pr01-vehicle-stat {
  color: var(--text-muted);
  font-size: 11.5px;
}

.pr01-vehicle-stat strong {
  color: var(--text);
}

.pr01-table tr.pr01-day-row td {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text);
  padding-top: 7px;
  padding-bottom: 7px;
}

.pr01-table tr.pr01-day-row td .ms {
  font-size: 14px;
  vertical-align: -2px;
  color: var(--text-muted);
}

.pr01-table tr.pr01-subtotal-row td {
  font-size: 11.5px;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
}

.pr01-table tr.pr01-subtotal-row td strong {
  color: var(--text);
}

.pr01-table tr.pr01-total-row td {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border-top: 2px solid var(--border);
}

/* PR01 · suivi des véhicules en perte réseau (pastille et fenêtre) */

/* PR01 · vue « Par client » */
.pr01-kpi-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; padding: 12px 14px; }
.pr01-kpi-carte { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface); }
.pr01-kpi-valeur { font-size: 22px; font-weight: 800; line-height: 1.1; }
.pr01-kpi-titre { font-size: 12px; font-weight: 700; color: var(--text); margin-top: 2px; }
.pr01-kpi-detail { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pr01-clients-info { padding: 6px 14px 10px; font-size: 12px; color: var(--text-muted); }
.pr01-table-clients td, .pr01-table-clients th { text-align: center; }
.pr01-table-clients td.left, .pr01-table-clients th.left { text-align: left; }
.pr01-table-clients td.right { text-align: right; }
.pr01-client-row { cursor: pointer; }
.pr01-client-row:hover td { background: var(--surface-hover); }
.pr01-client-chevron { font-size: 18px; vertical-align: middle; margin-right: 4px; transition: transform 0.15s ease; color: var(--text-muted); }
.pr01-client-row.ouvert .pr01-client-chevron { transform: rotate(90deg); }
.pr01-client-detail > td { background: var(--surface-2, var(--row-alt)); padding: 10px 12px 14px !important; text-align: left !important; }
.pr01-table-client-vehicules { background: var(--surface); }
/* PR01 sobre : texte seul (gris pour le secondaire), actions dans les menus « ⋯ » et « Actions » */
.pr01-muet { color: var(--text-muted); }
.pr01-filter-tabs[hidden] { display: none; }
/* Modèles d'e-mail et de SMS (aperçu de la demande, fenêtre SMS, Paramètres) */
.pr01-modele { margin: 10px 0; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.pr01-modele > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text); }
.pr01-modele[open] > summary { margin-bottom: 8px; }
.pr01-modele-variables { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 8px; font-size: 11.5px; }
.pr01-modele-champs { display: grid; gap: 6px; }
.pr01-modele-champ textarea { width: 100%; resize: vertical; font-size: 12.5px; }
.pr01-section-compte { font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.pr01-menu-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer;
}
.pr01-menu-btn .ms { font-size: 18px; }
.pr01-menu-btn:hover, .pr01-menu-btn:focus-visible { border-color: var(--border); background: var(--surface); color: var(--text); }
.pr01-menu-btn:disabled { opacity: 0.5; cursor: default; }
.pr01-actions-btn {
  display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 6px 0 12px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer;
}
.pr01-actions-btn .ms { font-size: 18px; color: var(--text-muted); }
.pr01-actions-btn:hover { background: var(--surface-hover); }
.pr01-client-entete { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; flex-wrap: wrap; }
.pr01-contact-ligne { font-size: 12px; color: var(--text); min-width: 0; }
.pr01-onglets { display: flex; gap: 18px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.pr01-onglet {
  padding: 6px 0; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none;
  font-size: 12px; font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.pr01-onglet:hover { color: var(--text); }
.pr01-onglet.actif { color: var(--text); border-bottom-color: var(--text); }
.pr01-journal-ligne { cursor: pointer; }
.pr01-table-journal td { vertical-align: top; }
.pr01-journal-card { max-width: 760px; }
.pr01-journal-champs { display: grid; gap: 6px; margin-bottom: 12px; font-size: 12.5px; }
.pr01-journal-champ { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 10px; }
.pr01-journal-champ > span:last-child { overflow-wrap: anywhere; }
.pr01-table td .pr01-client-sous { font-weight: 400; }
/* Première colonne (client, véhicule) sur une ligne : tableaux larges défilant horizontalement */
.pr01-table-clients > tbody > tr.pr01-client-row > td:first-child,
.pr01-table-active td:first-child,
.pr01-table-client-vehicules td:first-child { white-space: nowrap; }
@media (max-width: 640px) {
  .pr01-journal-champ { grid-template-columns: 1fr; gap: 2px; }
}
/* Suivi des clients (pr01_kanban.js) : colonnes neutres, cartes en texte, gras pour le nom seul */
.pr01-kanban {
  display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 10px;
  padding: 14px 16px 16px; overflow-x: auto; align-items: start;
}
.pr01-kanban-colonne {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; min-width: 0; min-height: 120px;
}
.pr01-kanban-colonne.cible { outline: 2px dashed var(--text-muted); outline-offset: -2px; }
.pr01-kanban-titre { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.pr01-kanban-cartes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pr01-kanban-carte {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 8px 8px 10px; font-size: 12px; cursor: grab;
}
.pr01-kanban-carte.choisie { border-color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--text-muted); }
.pr01-kanban-carte.glisse { opacity: 0.5; }
.pr01-kanban-carte-tete { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 2px; }
.pr01-kanban-nom {
  flex: 1; min-width: 0; padding: 2px 0; border: 0; background: none; text-align: left; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--text); overflow-wrap: anywhere;
}
.pr01-kanban-nom:hover { text-decoration: underline; }
.pr01-kanban-nom:focus-visible, .pr01-kanban-plus:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 3px; }
.pr01-kanban-ligne { line-height: 1.4; overflow-wrap: anywhere; }
.pr01-kanban-vide { font-size: 12px; padding: 4px 0; }
.pr01-kanban-plus { margin-top: 8px; font-size: 12px; }
.pr01-kanban-detail-section { margin-top: 16px; }
.pr01-kanban-detail-section h3:focus { outline: none; }
.pr01-kanban-detail-section h3:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.pr01-kanban-detail { padding: 12px 16px 16px; overflow-x: auto; }
.pr01-kanban-note { max-width: 520px; }
.pr01-kanban-note textarea { width: 100%; resize: vertical; }
.pr01-kanban-note-actions { display: flex; gap: 8px; margin-top: 12px; }
.pr01-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (max-width: 700px) {
  .pr01-kanban { grid-template-columns: 1fr; padding: 12px; }
  .pr01-kanban-colonne { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pr01-kanban-carte { transition: none; }
}
/* Contact client (pr01_contacts.js) : formulaire */
.pr01-contact-card { max-width: 560px; }
.pr01-contact-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-bottom: 10px; }
.pr01-contact-champ { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); }
.pr01-contact-champ small { min-height: 14px; font-size: 11px; color: var(--text-muted); }
.pr01-contact-champ .eco-input.invalide { border-color: var(--danger); }
.pr01-contact-case { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 12px; color: var(--text); }
@media (max-width: 560px) { .pr01-contact-grille { grid-template-columns: 1fr; } }
/* Aperçu de la demande client (pr01_demande.js) */
.pr01-dem-card { max-width: 760px; width: 100%; }
.pr01-dem-champs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.pr01-dem-champ { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.pr01-dem-puces { margin-left: 60px; }
.pr01-dem-corps { width: 100%; height: 380px; border: 1px solid var(--border); border-radius: 8px; background: #ffffff; margin: 4px 0 8px; }
@media (max-width: 560px) { .pr01-dem-champ { grid-template-columns: 1fr; } .pr01-dem-puces { margin-left: 0; } .pr01-dem-corps { height: 300px; } }
.pr01-client-sous { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pr01-zero { color: var(--text-muted); opacity: 0.55; }

/* PR01 · position au retour du signal (colonne « Position au retour ») */

/* PR01 · motif et note par coupure (colonne « Motif / Note ») */

.notion-modal-dropdown-trigger.eco-trigger.pr01-motif-declencheur {
  width: 100%;
  margin-bottom: 6px;
}

.pr01-motif-declencheur .eco-trigger-label {
  flex: 1;
  text-align: left;
}

/* SMS au client (colonne « SMS » et Paramètres › SMS › Mode test) */

.pr01-sms-test-etat {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
}

.pr01-sms-test-etat.actif {
  color: var(--warn-text);
}

.pr01-sms-test-etat .ms {
  font-size: 16px;
}

.pr01-suivi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--suivi, #64748b);
  flex-shrink: 0;
}

.pr01-suivi-card {
  max-width: 760px;
  max-height: calc(100vh - 32px);
}

.pr01-suivi-sous {
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}

.pr01-suivi-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pr01-suivi-contexte {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 11.5px;
  color: var(--text-muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.pr01-suivi-contexte a {
  color: var(--accent);
}

/* Fenêtre « Suivi du véhicule » : 1. Situation actuelle, 2. Cause de la coupure (blocs distincts) */
.pr01-suivi-bloc { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px 12px; margin: 0 0 12px; }
.pr01-suivi-bloc > h4.pr01-suivi-label { margin-top: 0; }
.pr01-suivi-bloc > h4.pr01-suivi-label .pr01-muet { text-transform: none; letter-spacing: normal; font-weight: 400; }
.pr01-suivi-radios { display: grid; gap: 4px; margin: 4px 0 8px; }
.pr01-suivi-radio { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text); cursor: pointer; padding: 3px 0; }
.pr01-suivi-radio input { margin-top: 2px; accent-color: var(--text); }
.pr01-suivi-radio input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.pr01-suivi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  margin-top: 6px;
}

.pr01-suivi-choix {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pr01-suivi-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pr01-suivi-option.active {
  border-color: var(--suivi);
  background: color-mix(in srgb, var(--suivi) 14%, transparent);
  color: var(--suivi);
}

.pr01-suivi-texte {
  width: 100%;
  height: auto;
  padding: 8px 10px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
}

.pr01-suivi-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pr01-suivi-msg {
  font-size: 12px;
  font-weight: 600;
}

.pr01-suivi-msg.ok {
  color: #15803d;
}

.pr01-suivi-msg.err {
  color: #b91c1c;
}

.pr01-suivi-interne {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 4px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pr01-suivi-info {
  font-size: 11.5px;
  color: var(--text-muted);
}

.pr01-suivi-hist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text);
}

.pr01-suivi-hist li {
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-2);
}

.pr01-suivi-hist li.vide {
  color: var(--text-muted);
  background: transparent;
}

.pr01-suivi-hist-date {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-muted);
}

.pr01-suivi-champ {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.pr01-suivi-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pr01-suivi-contact {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
}

.pr01-suivi-contact:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pr01-suivi-contact.active {
  background: var(--accent, #1d4ed8);
  color: #fff;
  border-color: var(--accent, #1d4ed8);
}

/* Adaptations Dark Mode pour PR01 */

html.dark .pr01-table th, html.dark .pr01-table tfoot td {
  background: var(--surface-2);
  border-color: var(--border);
}

html.dark .pr01-table td {
  border-color: var(--border);
}

html.dark .pr01-toolbar-card {
  background: var(--surface);
  border-color: var(--border);
}

html.dark .pr01-search-input {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

/* ── Barre de progression style YouTube en haut d'écran ── */
.eco-yt-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #2563eb, #60a5fa);
  box-shadow: 0 0 10px #3b82f6, 0 0 5px #60a5fa;
  z-index: 99999;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  pointer-events: none;
  opacity: 0;
}
.eco-yt-progress-bar.loading {
  opacity: 1;
}
.eco-yt-progress-bar.done {
  width: 100% !important;
  opacity: 0;
}

/* ── Skeleton Loader UI Shimmer ── */
@keyframes ecoShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.eco-skeleton {
  background: linear-gradient(90deg, var(--border, #e2e8f0) 25%, var(--surface-hover, #f1f5f9) 50%, var(--border, #e2e8f0) 75%);
  background-size: 200% 100%;
  animation: ecoShimmer 1.5s infinite;
  border-radius: 6px;
  display: inline-block;
}
.eco-skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 14px;
}
.eco-skeleton-chart {
  height: 260px;
  width: 100%;
  border-radius: 8px;
}
.eco-skeleton-table {
  width: 100%;
}
.eco-skeleton-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

/* ── Menu utilisateur Wialon Topbar ── */
.wialon-user-menu-container {
  position: relative;
  display: inline-block;
}
.wialon-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px 0 6px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.wialon-user-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}
.wialon-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wialon-user-avatar.lg {
  width: 38px;
  height: 38px;
}
.wialon-user-avatar .ms {
  font-size: 15px;
}
.wialon-user-avatar.lg .ms {
  font-size: 24px;
}
.wialon-user-caret {
  font-size: 18px;
  color: var(--text-muted);
}
.wialon-user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  z-index: 10000;
  animation: scaleUp 0.12s ease-out;
}
.wialon-user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 10px;
}
.wialon-user-info {
  overflow: hidden;
}
.wialon-user-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wialon-user-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.wialon-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}
.wialon-dropdown-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 16px 4px;
}
.wialon-dropdown-item {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}
.wialon-dropdown-item:hover {
  background: var(--surface-hover);
}
.wialon-dropdown-item.danger {
  color: #dc2626;
}
.wialon-dropdown-item.danger:hover {
  background: rgba(220, 38, 38, 0.08);
}
.wialon-dropdown-pill {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-hover, #f1f5f9);
  color: var(--text-muted);
}
.wialon-lang-switcher {
  display: flex;
  flex-direction: column;
  padding: 2px 8px;
  gap: 2px;
}
.wialon-lang-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.wialon-lang-btn:hover {
  background: var(--surface-hover);
}
.wialon-lang-btn.active {
  font-weight: 700;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
}
.wialon-lang-btn .check {
  font-size: 16px;
  color: var(--accent);
}

/* ── Panneau de réglages carburant dans la Sidebar ── */
.sidebar-fuel-card {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.sidebar-fuel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface);
  user-select: none;
}
.sidebar-fuel-head:hover {
  background: var(--surface-hover);
}
.sidebar-fuel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
}
.sidebar-fuel-body {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sidebar-fuel-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-fuel-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.sidebar-export-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text);
}
.sidebar-export-checklist label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.sidebar-export-checklist input[type="checkbox"] {
  accent-color: var(--accent);
}

/* ── Tiroir latéral d'enregistrement de plein réel (Drawer) ── */
.v20-real-refuel-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 99990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.v20-real-refuel-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.v20-real-refuel-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 99995;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.v20-real-refuel-drawer.open {
  right: 0;
}
.v20-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.v20-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.v20-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.v20-drawer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.v20-drawer-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.v20-drawer-field input, .v20-drawer-field select, .v20-drawer-field textarea {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  box-sizing: border-box;
}
.v20-drawer-field textarea {
  height: 60px;
  padding: 6px 10px;
  resize: vertical;
}
.v20-drawer-foot {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}




/* ═══ Drawer « Paramètres des rapports » (js/settings_drawer.js) ═══ */
.rs-backdrop {
  position: fixed; inset: 0; z-index: 1999;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.rs-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }
.rs-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2000;
  width: 460px; max-width: 94vw; display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  border-left: 1px solid var(--border); box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
  transform: translateX(100%); visibility: hidden; pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
}
.rs-drawer.open { transform: translateX(0); visibility: visible; pointer-events: auto; }
.rs-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.rs-head-icon { color: var(--accent); font-size: 22px; }
.rs-head-text { flex: 1; min-width: 0; }
.rs-title { font-size: 15px; font-weight: 700; }
.rs-sub { margin-top: 3px; }
.rs-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer;
}
.rs-icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.rs-icon-btn.sm { width: 26px; height: 26px; }
.rs-icon-btn.sm .ms { font-size: 16px; }
.rs-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; border: 1px solid var(--border); color: var(--text-muted); background: var(--surface);
}
.rs-pill .ms { font-size: 14px; }
.rs-pill.shared { color: var(--accent); border-color: var(--accent); background: var(--notion-tag-blue-bg); }
.rs-pill.current { color: var(--accent); border-color: var(--accent); font-size: 10px; padding: 1px 7px; }
.rs-label .rs-pill.global { margin-left: 6px; padding: 0 7px; font-size: 10px; vertical-align: 1px; color: var(--accent); border-color: var(--accent); background: var(--notion-tag-blue-bg); }
.rs-label .rs-pill.global .ms { font-size: 12px; }
.rs-search { position: relative; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.rs-search .ms { position: absolute; left: 26px; top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--text-muted); pointer-events: none; }
.rs-search input {
  width: 100%; height: 34px; padding: 0 10px 0 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 12px; outline: none;
}
.rs-search input:focus { border-color: var(--accent); }
.rs-body { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.rs-cat {
  padding: 12px 4px 6px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
}
.rs-empty { padding: 24px 8px; text-align: center; color: var(--text-muted); }
.rs-report { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); overflow: hidden; }
.rs-report.open { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.rs-report-head {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: transparent; border: 0; cursor: pointer; text-align: left; color: var(--text);
}
.rs-report-head:hover { background: var(--surface-hover); }
.rs-report-icon { color: var(--accent); }
.rs-report-title { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-chevron { color: var(--text-muted); }
.rs-report-body { padding: 4px 12px 12px; border-top: 1px solid var(--border); background: var(--surface-2); }
.rs-meta { padding: 8px 2px 0; font-size: 11px; color: var(--text-muted); }
.rs-rerun {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: var(--warn-bg); color: var(--warn-text); font-size: 12px;
}
.rs-rerun span:nth-child(2) { flex: 1; }
.rs-rerun .eco-btn { height: 28px; }
.rs-section { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.rs-section-title { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.rs-section-title .ms { font-size: 17px; color: var(--accent); }
.rs-section-hint { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; line-height: 1.4; }
.rs-field { display: block; padding: 7px 0; border-top: 1px dashed var(--border); }
.rs-section-title + .rs-field, .rs-section-hint + .rs-field { border-top: 0; }
.rs-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.rs-hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.rs-input-row { display: flex; align-items: center; gap: 8px; }
.rs-number { width: 120px; }
.rs-text { width: 100%; }
textarea.rs-text { height: auto; min-height: 88px; padding-top: 8px; padding-bottom: 8px; font-family: inherit; line-height: 1.4; resize: vertical; box-sizing: border-box; }
.rs-unit { font-size: 11px; color: var(--text-muted); }
.rs-select { width: 100%; justify-content: flex-start; }
.rs-select .eco-trigger-label { flex: 1; text-align: left; }
.rs-color { width: 40px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; }
.rs-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.rs-switch-text { flex: 1; min-width: 0; }
.rs-switch-text .rs-label { margin-bottom: 0; }
.rs-switch { position: relative; flex-shrink: 0; width: 38px; height: 20px; }
.rs-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rs-switch-track { position: absolute; inset: 0; border-radius: 20px; background: var(--border); transition: background 0.2s; }
.rs-switch-track::before {
  content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.rs-switch input:checked + .rs-switch-track { background: var(--accent); }
.rs-switch input:checked + .rs-switch-track::before { transform: translateX(18px); }
.rs-switch input:focus-visible + .rs-switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.rs-range-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rs-range-head .rs-label { margin-bottom: 0; }
.rs-range-val {
  font-size: 11px; font-weight: 700; color: var(--accent); padding: 1px 8px; border-radius: 999px;
  background: var(--notion-tag-blue-bg); white-space: nowrap;
}
.rs-range { width: 100%; margin-top: 6px; accent-color: var(--accent); cursor: pointer; }
.rs-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.rs-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 11px; cursor: pointer;
}
.rs-chip .ms { font-size: 14px; }
.rs-chip.on { border-color: var(--accent); color: var(--accent); background: var(--notion-tag-blue-bg); font-weight: 600; }
/* Liste réordonnable (chapitres du PDF, colonnes des tableaux) : poignée + interrupteur */
.rs-ordre { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rs-ordre-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 4px;
  background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12px;
}
.rs-ordre-item:last-child { border-bottom: none; }
.rs-ordre-item.off .rs-ordre-label { color: var(--text-muted); text-decoration: line-through; }
.rs-ordre-item.glisse { opacity: 0.55; background: var(--surface-hover); }
.rs-ordre-poignee {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
  border: none; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: grab; touch-action: none;
}
.rs-ordre-poignee:hover { background: var(--surface-hover); color: var(--text); }
.rs-ordre-poignee:active { cursor: grabbing; }
.rs-ordre-poignee:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rs-ordre-poignee .ms { font-size: 18px; }
.rs-ordre-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rs-ordre-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-ordre-sous { font-size: 10px; color: var(--text-muted); }
.rs-tableau { border: 1px solid var(--border); border-radius: 8px; padding: 0; overflow: hidden; }
.rs-tableau .rs-ordre { margin: 0; border: none; border-top: 1px solid var(--border); border-radius: 0; }
.rs-tableau-head {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: none;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-align: left;
}
.rs-tableau-head:hover { background: var(--surface-hover); }
.rs-tableau-head .ms { font-size: 16px; color: var(--text-muted); }
.rs-tableau-titre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-table-wrap { overflow-x: auto; margin: 4px 0; border: 1px solid var(--border); border-radius: 8px; }
.rs-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.rs-table th {
  padding: 5px 6px; text-align: left; font-size: 10px; font-weight: 700; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.rs-table td { padding: 2px 3px; border-bottom: 1px solid var(--border); }
.rs-table tr:last-child td { border-bottom: 0; }
.rs-table-empty { text-align: center; color: var(--text-muted); padding: 8px !important; }
.rs-table-del { width: 30px; text-align: center; }
.rs-cell {
  width: 100%; min-width: 48px; height: 26px; padding: 0 6px; border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: var(--text); font-size: 11px;
}
.rs-cell:hover { border-color: var(--border); }
.rs-cell:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.rs-cell-select {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 2px; width: 100%; min-width: 90px; height: 26px;
  padding: 0 4px 0 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text);
  font-size: 11px; cursor: pointer; white-space: nowrap;
}
.rs-cell-select .ms { font-size: 15px; color: var(--text-muted); }
.rs-table-add { height: 28px; margin-top: 2px; }
.rs-info-body { font-size: 12px; }
.rs-info-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 4px; }
.rs-info-table th, .rs-info-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.rs-info-table th { font-size: 10px; color: var(--text-muted); font-weight: 700; background: var(--surface-2); }
.rs-info-unit { margin-top: 8px; font-weight: 700; font-size: 12px; }
.rs-warn { color: var(--warn-text); background: var(--warn-bg); border-radius: 6px; padding: 4px 8px; margin-top: 4px; font-size: 11px; }
.rs-columns .notion-dropdown-list { max-height: 360px; overflow-y: auto; }
.column-picker-inline { display: flex; flex-direction: column; }
.column-picker-inline .column-picker-presets { padding: 0 0 4px; }
.column-picker-inline .notion-dropdown-search { padding: 4px 0; }
.column-picker-inline .notion-dropdown-search .ms { left: 8px; }
.rs-report-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.rs-foot {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 10px 12px;
  background: var(--surface-2); border-top: 1px solid var(--border);
}
.rs-save { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.rs-save.saved { color: #16a34a; }
.rs-save.error { color: var(--danger); }
.eco-settings-badge {
  padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 700;
  background: var(--notion-tag-blue-bg); color: var(--accent);
}
.eco-rerun-banner { display: flex; align-items: center; gap: 8px; }
.eco-rerun-banner span:nth-child(2) { flex: 1; }
@media (max-width: 520px) {
  .rs-drawer { width: 100vw; max-width: 100vw; }
  .rs-number { width: 100%; }
}
/* Calcul pas à pas des scores (détail d'un trajet EC04) */
.eco-score-breakdown th { text-align: left; white-space: nowrap; width: 130px; color: var(--text-muted); font-weight: 600; }
.eco-score-breakdown td { text-align: left; }

/* ── Carte interactive des infractions (EC04, détail d'un trajet) ───────────── */
.ci { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.ci-puces { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ci-puce {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--ci-c); background: var(--surface); color: var(--ci-c);
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.ci-puce .ms { font-size: 15px; }
.ci-puce .ci-nb { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--ci-c); color: #fff; font-size: 11px; text-align: center; }
.ci-puce.masque { opacity: 0.45; text-decoration: line-through; border-style: dashed; }
.ci-puce:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ci-aide { font-size: 11px; color: var(--text-muted); }
.ci-carte { height: 340px; width: 100%; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ci-marqueur-wrap { background: none; border: none; }
.ci-marqueur {
  display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ci-c); color: #fff; font-size: 11px; font-weight: 800; font-family: Inter, system-ui, sans-serif;
  border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(15, 23, 42, 0.45); transition: transform 0.12s ease; cursor: pointer;
}
.ci-marqueur-wrap.ci-survol .ci-marqueur, .ci-marqueur-wrap.ci-actif .ci-marqueur { transform: scale(1.35); }
.ci-marqueur-wrap.ci-actif { z-index: 2500 !important; }
.ci-marqueur-wrap.ci-actif .ci-marqueur { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ci-c) 35%, transparent), 0 1px 4px rgba(15, 23, 42, 0.45); }
.ci-frise { position: relative; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 4px 6px 2px; }
.ci-frise:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ci-svg { display: block; width: 100%; height: 96px; cursor: crosshair; }
.ci-base { stroke: var(--border); stroke-width: 1; }
.ci-axe { font-size: 10px; fill: var(--text-muted); font-family: Inter, system-ui, sans-serif; }
.ci-vitesse { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.ci-limite { fill: none; stroke: #ef4444; stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.7; vector-effect: non-scaling-stroke; }
.ci-repere { cursor: pointer; }
.ci-repere .ci-trait { stroke: var(--ci-c); stroke-width: 1.4; vector-effect: non-scaling-stroke; opacity: 0.75; }
.ci-repere .ci-bande { fill: var(--ci-c); opacity: 0.16; }
.ci-repere .ci-rond { fill: var(--ci-c); stroke: var(--surface); stroke-width: 1.5; }
.ci-repere .ci-num { fill: #fff; font-size: 8px; font-weight: 800; font-family: Inter, system-ui, sans-serif; pointer-events: none; }
.ci-repere.ci-survol .ci-trait, .ci-repere.ci-actif .ci-trait { stroke-width: 3; opacity: 1; }
.ci-repere.ci-actif .ci-rond { stroke: var(--text); }
.ci-curseur { stroke: var(--text); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ci-info { min-height: 16px; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 0 2px 2px; }
.ci-num-ligne {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px;
  border-radius: 999px; background: var(--ci-c); color: #fff; font-size: 11px; font-weight: 800;
}
.ci-table tr[data-infraction] { cursor: pointer; }
.ci-table tr.ci-survol td { background: var(--surface-hover); }
.ci-table tr.ci-actif td { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* ── EC04 : tableau + carte côte à côte, frise de la période en bas ─────────── */
.eco-table-wrap.ec-vue-active { overflow: hidden; display: flex; flex-direction: column; }
.ec-haut { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 40%); }
.ec-table { min-height: 0; overflow: auto; border-right: 1px solid var(--border); }
.ec-carte { min-height: 0; height: 100%; }
.ec-frise { flex: 0 0 auto; max-height: 42vh; overflow-y: auto; border-top: 1px solid var(--border); background: var(--surface); padding: 6px 10px 4px; }
@media (max-width: 1100px) {
  .ec-haut { grid-template-columns: 1fr; grid-template-rows: 280px minmax(0, 1fr); }
  .ec-carte { order: -1; border-bottom: 1px solid var(--border); }
  .ec-table { border-right: none; }
}
.ec-table tr.trip.ev-survol td { background: var(--surface-hover); }
.ec-table tr.trip.ev-actif td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ec-table tr.trip.ev-actif td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.ev-point {
  display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ci-c); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.45); color: #fff; cursor: pointer;
}
.ev-point .ms { font-size: 12px; line-height: 1; }
.ev-duree-curseur { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--text-muted); }
.ev-duree-curseur .ms { font-size: 16px; }
.ev-duree-range { width: 110px; accent-color: var(--accent); }
.ev-duree-val { min-width: 52px; color: var(--text); }
.eco-table-wrap.ec-vue-active.ec-carte-large .ec-haut { grid-template-columns: minmax(0, 1fr) minmax(400px, 55%); }
.ev-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 4px; }
.ev-titre { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.ev-titre .ms { font-size: 18px; color: var(--accent); }
.ev-puces { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ev-plage { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text); }
.ev-aide { font-size: 11px; font-weight: 400; color: var(--text-muted); }
.ev-corps { position: relative; user-select: none; }
.ev-ligne { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; border-bottom: 1px dashed var(--border); }
.ev-nom { font-size: 11px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; }
.ev-svg { display: block; width: 100%; height: 40px; cursor: crosshair; }
.ev-axe { display: block; width: calc(100% - 120px); height: 18px; }
.ev-graduation { font-size: 10px; fill: var(--text-muted); font-family: Inter, system-ui, sans-serif; }
.ev-base { stroke: var(--border); stroke-width: 1; }
.ev-trajet { fill: var(--accent); fill-opacity: 0.07; cursor: pointer; }
.ev-trajet.ev-survol { fill-opacity: 0.16; }
.ev-trajet.ev-actif { fill-opacity: 0.22; stroke: var(--accent); stroke-width: 1; }
.ev-vitesse { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linejoin: round; }
.ev-vitesse-aire { fill: var(--accent); fill-opacity: 0.12; stroke: none; }
.ev-evt { cursor: pointer; }
.ev-evt line { stroke: var(--ci-c); stroke-width: 1.4; opacity: 0.8; }
.ev-evt circle { fill: var(--ci-c); stroke: var(--surface); stroke-width: 1.2; }
.ev-evt:hover line, .ev-evt.ev-actif line { stroke-width: 3; opacity: 1; }
.ev-evt.ev-actif circle { stroke: var(--text); stroke-width: 1.5; }
.ev-curseur { position: absolute; top: 0; bottom: 18px; width: 0; border-left: 1px dashed var(--text); pointer-events: none; }
.ev-selection { position: absolute; top: 0; bottom: 18px; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 1px solid var(--accent); pointer-events: none; }
.ev-info { min-height: 16px; font-size: 11px; font-weight: 600; color: var(--text-muted); padding-top: 2px; }
.ev-zoom { display: inline-flex; align-items: center; gap: 8px; }
.ev-zoom:empty { display: none; }
.ev-zoom-txt { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--accent); }
.ev-zoom-txt .ms { font-size: 16px; }
.ev-compact { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; }
.ev-separateur { stroke: var(--text-muted); stroke-width: 1.2; stroke-dasharray: 2 2; }
.ev-compact { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); cursor: pointer; }
.ev-separateur { stroke: var(--text-muted); stroke-width: 1.2; stroke-dasharray: 2 2; }
.ev-lecture { display: inline-flex; align-items: center; gap: 6px; }
.ev-play {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: none; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
}
.ev-play .ms { font-size: 20px; }
.ev-play:hover { filter: brightness(1.1); }
.ev-play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ev-durees { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.ev-duree { border: none; background: var(--surface); color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 700; padding: 3px 8px; cursor: pointer; }
.ev-duree + .ev-duree { border-left: 1px solid var(--border); }
.ev-duree.on { background: var(--accent); color: #fff; }
.ev-duree:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ec-table tr.detail > td { padding: 0; }
.ec-table tr.detail > td > .eco-detail { position: sticky; left: 0; width: var(--ec-largeur, 100%); box-sizing: border-box; }
.ev-camera { position: relative; display: inline-flex; }
.ev-camera-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.ev-camera-btn[aria-expanded="true"], .ev-camera-btn:hover { color: var(--accent); border-color: var(--accent); }
.ev-camera-btn .ms { font-size: 18px; }
.ev-camera-panneau {
  position: fixed; z-index: 5000; width: 320px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.ev-camera-panneau[hidden] { display: none; }
.ev-camera-titre { font-size: 12px; font-weight: 700; color: var(--text); }
.ev-camera-ligne { display: grid; grid-template-columns: 1fr 110px 56px; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.ev-camera-ligne input { width: 100%; accent-color: var(--accent); }
.ev-camera-ligne b { color: var(--text); text-align: right; }
.ev-camera-apercu { font-size: 10px; color: var(--text-muted); line-height: 1.4; }
.ev-camera-defaut { align-self: flex-start; }
.ev-camera-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; color: var(--text); cursor: pointer; }

/* ── Export MP4 de la lecture (ui/video_lecture.js) ─────────────────────────── */
.ev-mp4 {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.ev-mp4 .ms { font-size: 17px; color: var(--accent); }
.ev-mp4:hover { border-color: var(--accent); color: var(--accent); }
.ev-mp4:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Vue 3D de la lecture (ui/carte_3d.js) : bouton de la frise et carte MapLibre posée sur la carte
   Leaflet (au-dessus des tracés et marqueurs, sous les boutons de zoom et de fond). */
.ev-3d {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.ev-3d .ms { font-size: 17px; color: var(--accent); }
.ev-3d:hover { border-color: var(--accent); color: var(--accent); }
.ev-3d.actif { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.ev-3d.actif .ms { color: #ffffff; }
.ev-3d:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* maplibre-gl.css (chargé après) met position: relative sur .maplibregl-map : sélecteur plus précis. */
.ev-carte-3d, .ev-carte-3d.maplibregl-map { position: absolute; inset: 0; z-index: 690; }

/* ── Lecture avancée HT01 (ui/lecture_focus.js) : aperçu, ralenti sur les événements ─────────── */
.ev-apercu {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.ev-apercu .ms { font-size: 17px; color: var(--accent); }
.ev-apercu:hover { border-color: var(--accent); color: var(--accent); }
.ev-apercu.actif { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.ev-apercu.actif .ms { color: #ffffff; }
.ev-apercu:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ev-camera-panneau { overflow-y: auto; }
.ev-lect-titre { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.ev-lect-titre .ms { font-size: 16px; color: var(--accent); }
.ev-lect-types { display: flex; flex-wrap: wrap; gap: 4px; }
.ev-lect-types .ci-puce { font-size: 11px; }
.ev-lect-types .ci-puce:disabled { cursor: default; opacity: 0.35; }
/* Calque au-dessus de la carte (et de la vue 3D), sous les boutons de zoom et de fond. */
.ev-hud { position: absolute; inset: 0; z-index: 695; pointer-events: none; overflow: hidden; }
.ev-hud-vignette {
  position: absolute; inset: 0; opacity: 0;
  box-shadow: inset 0 0 0 3px var(--ci-c, var(--accent)), inset 0 0 80px color-mix(in srgb, var(--ci-c, var(--accent)) 45%, transparent);
}
.ev-hud-carte {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; width: max-content; min-width: 240px; max-width: calc(100% - 110px);
  padding: 8px 14px 10px 8px; border-radius: 12px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(6px); animation: ev-hud-entree 0.22s ease-out;
}
.ev-hud-carte[hidden] { display: none; }
.ev-hud-icone {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ci-c); color: #ffffff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--ci-c) 25%, transparent);
}
.ev-hud-icone .ms { font-size: 20px; }
.ev-hud-textes { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ev-hud-textes b { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-hud-textes span { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-hud-mesure { flex: 0 0 auto; margin-left: auto; padding-left: 8px; display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.ev-hud-mesure b { font-size: 19px; font-weight: 800; line-height: 1.05; color: var(--text); }
.ev-hud-mesure small { font-size: 10px; font-weight: 600; color: var(--text-muted); }
.ev-hud-mesure.depasse b { color: #dc2626; }
.ev-hud-barre { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 3px; border-radius: 999px; background: var(--surface-hover); overflow: hidden; }
.ev-hud-barre > span { display: block; height: 100%; width: 0; background: var(--accent); }
.ev-hud-rythme {
  position: absolute; left: 10px; bottom: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px;
  border-radius: 999px; background: rgba(15, 23, 42, 0.74); color: #ffffff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.ev-hud-rythme[hidden] { display: none; }
.ev-hud-rythme .ms { font-size: 16px; }
.ev-hud-rythme.ev-ralenti { background: var(--ci-c, var(--accent)); }
.ev-pulse-wrap { background: none; border: none; pointer-events: none; }
.ev-pulse { position: relative; display: block; width: 72px; height: 72px; }
.ev-pulse i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--ci-c); background: color-mix(in srgb, var(--ci-c) 14%, transparent); opacity: 0; animation: ev-pulse 1.4s ease-out infinite; }
.ev-pulse i + i { animation-delay: 0.7s; }
.ci-marqueur-wrap.ev-lecture-actif { z-index: 2600 !important; }
.ev-pop { animation: ev-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes ev-pulse { from { transform: scale(0.25); opacity: 0.95; } to { transform: scale(1); opacity: 0; } }
@keyframes ev-pop { from { transform: scale(0); } 60% { transform: scale(1.3); } to { transform: scale(1); } }
@keyframes ev-hud-entree { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) {
  .ev-pulse i, .ev-pop, .ev-hud-carte { animation: none; }
  .ev-pulse i { opacity: 0.7; transform: scale(0.6); }
}
.ev-carte-3d .maplibregl-ctrl-bottom-right { margin-bottom: 18px; }
.vl-panneau { width: 340px; }
.vl-info { font-size: 11px; color: var(--text-muted); }
.vl-ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 600; color: var(--text); }
.vl-choix { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.vl-choix button { border: none; background: var(--surface); color: var(--text-muted); font: inherit; font-size: 11px; font-weight: 700; padding: 4px 8px; cursor: pointer; display: inline-flex; align-items: center; }
.vl-choix button + button { border-left: 1px solid var(--border); }
.vl-choix button .ms { font-size: 16px; }
.vl-choix button.on { background: var(--accent); color: #fff; }
.vl-choix button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.vl-estimation { font-size: 11px; color: var(--text-muted); }
.vl-progres { display: flex; flex-direction: column; gap: 4px; }
.vl-progres[hidden] { display: none; }
.vl-barre { height: 6px; border-radius: 999px; background: var(--surface-hover); overflow: hidden; }
.vl-barre-in { height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }
.vl-progres-txt { font-size: 11px; font-weight: 600; color: var(--text); word-break: break-all; }
.vl-actions { display: flex; gap: 8px; }

/* Logo Securysat (img/securysat_large.svg) dans la barre du haut, séparé du titre du rapport */
.eco-topbar img.eco-topbar-logo { height: 26px; width: auto; flex-shrink: 0; }
.eco-topbar .eco-topbar-titres { padding-left: 12px; border-left: 1px solid var(--border); min-width: 0; }
@media (max-width: 640px) { .eco-topbar img.eco-topbar-logo { height: 20px; } }

/* V20 · position GPS du véhicule sous « Station-service / Emplacement » (plein manuel) */
.v20-drawer-position {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
  margin-top: 6px; font-size: 11.5px; color: var(--text-muted);
}
.v20-drawer-position:empty { display: none; }
.v20-drawer-position .ms { font-size: 15px; color: var(--accent, #2563eb); }
.v20-drawer-position a { color: var(--accent, #2563eb); font-weight: 600; }
.v20-drawer-reprendre {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 6px; padding: 2px 8px; font-size: 11px; cursor: pointer;
}
.v20-drawer-reprendre:hover { background: var(--surface-hover); }
.v20-drawer-aide { margin: -4px 0 4px; font-size: 11.5px; color: var(--text-muted); }
.v20-drawer-aide:empty { display: none; }

/* V20 · événement signalé « défaut capteur » : gris, hors des totaux */
.v20-badge-defaut { background: rgba(100, 116, 139, 0.12); color: #475569; border: 1px solid rgba(100, 116, 139, 0.3); font-weight: 700; }
.v20-event-band.defaut { fill: rgba(100, 116, 139, 0.07); }
.v20-event-group:hover .v20-event-band.defaut { fill: rgba(100, 116, 139, 0.14); }
.v20-event-curve-highlight.defaut { stroke: #64748b; stroke-dasharray: 4 3; }
.v20-event-pill-badge.defaut:hover rect { fill: #f1f5f9; }
html.dark .v20-badge-defaut { color: #cbd5e1; }

/* V20 · taux de correction des pleins (au-dessus du tableau F03) */
.v20-taux-correction { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 8px; padding: 6px 10px; border-radius: 6px;
  background: rgba(217, 119, 6, 0.06); border: 1px solid rgba(217, 119, 6, 0.22); font-size: 12px; line-height: 1.45; }
.v20-taux-correction .ms { font-size: 16px; color: #d97706; margin-top: 1px; }
.v20-taux-correction .text-muted { font-size: 11.5px; }

/* ═══ Composants du noyau (dialogue, messages, tiroir, courbe) ═══════════════════════════
   Couleurs par défaut des courbes : chaque site peut les redéfinir dans sa surcouche. */
:root {
  --serie-1: var(--accent);
  --statut-bon: #0ca30c;
  --statut-critique: #d03b3b;
}
.rn-tableau { width: 100%; border-collapse: collapse; font-size: 12px; }
.rn-tableau th, .rn-tableau td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.rn-tableau th { color: var(--text-muted); font-weight: 600; }
.rn-note { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 0; }
/* ── Courbe temporelle (graphique_ligne.js) ──────────────────────────────── */
.rn-courbe { position: relative; margin: 0; }
.rn-courbe-titre { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.rn-courbe-svg { display: block; overflow: visible; outline: none; }
.rn-courbe-svg:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
.rn-courbe-grille { stroke: var(--border); stroke-width: 1; }
.rn-courbe-axe { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rn-courbe-ligne { fill: none; stroke: var(--serie-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rn-courbe-voile { fill: var(--serie-1); opacity: 0.1; stroke: none; }
.rn-courbe-trou { stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 3 4; fill: none; }
.rn-courbe-isole { fill: var(--serie-1); }
.rn-courbe-reticule { stroke: var(--text-muted); stroke-width: 1; }
.rn-courbe-point { fill: var(--serie-1); stroke: var(--surface); stroke-width: 2; }
.rn-courbe-repere circle { stroke: var(--surface); stroke-width: 2; }
.rn-courbe-repere.plein circle { fill: var(--statut-bon); }
.rn-courbe-repere.vol circle { fill: var(--statut-critique); }
.rn-courbe-bulle {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 8px; box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12); display: flex; flex-direction: column;
  font-size: 12px; min-width: 120px;
}
.rn-courbe-bulle strong { font-size: 13px; color: var(--text); }
.rn-courbe-bulle span { color: var(--text-muted); }
.rn-courbe-cle { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.rn-courbe-cle-item { display: inline-flex; align-items: center; gap: 4px; }
.rn-courbe-cle-item .ms { font-size: 16px; }
.rn-courbe-cle-item.plein .ms { color: var(--statut-bon); }
.rn-courbe-cle-item.vol .ms { color: var(--statut-critique); }
.rn-courbe-tableau { margin-top: 8px; font-size: 12px; }
.rn-courbe-tableau summary { cursor: pointer; color: var(--text-muted); }
.rn-courbe-tableau table { margin-top: 6px; max-width: 420px; }

.eco-btn.danger { border-color: var(--danger); color: var(--danger); }
/* Tiroir latéral (ui/tiroir.js) : contenu défilant ; zones sur toute la hauteur. */
.rn-tiroir-corps { flex: 1; min-height: 0; overflow: auto; padding: 12px 16px; }
/* ── Dialogue de confirmation et messages (ui/dialogue.js) ─────────── */
.rn-dialogue-fond { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); }
.rn-dialogue { width: min(420px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); padding: 16px 18px; }
.rn-dialogue h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; }
.rn-dialogue h3 .ms { color: var(--accent); }
.rn-dialogue p { margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.rn-dialogue-actions { display: flex; justify-content: flex-end; gap: 8px; }
.eco-btn.primary.danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.rn-dialogue:has(.danger) h3 .ms { color: var(--danger); }
.rn-messages { position: fixed; right: 16px; bottom: 16px; z-index: 3001; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.rn-message { display: flex; align-items: flex-start; gap: 8px; padding: 10px 10px 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); animation: rn-message-entree 0.18s ease-out; }
.rn-message > .ms { font-size: 18px; color: var(--accent); }
.rn-message.error > .ms { color: var(--danger); }
.rn-message.warn > .ms { color: var(--warn-text); }
.rn-message-texte { flex: 1; min-width: 0; overflow-wrap: anywhere; padding-top: 1px; }
@keyframes rn-message-entree { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }


/* ── Onglets segmentés (communs) ─────────────────────────────────────────── */
.rn-segments { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.rn-segments button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; background: var(--surface); color: var(--text-muted); font: inherit; font-size: 13px; cursor: pointer; }
.rn-segments button + button { border-left: 1px solid var(--border); }
.rn-segments button .ms { font-size: 18px; }
.rn-segments button.actif { background: var(--surface-hover); color: var(--accent); font-weight: 600; }

/* ── TL01 Tournées & livraisons ─────────────────────────────────────────── */
.tl-barre { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.tl-titre { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; color: var(--accent); }
.tl-titre .ms { font-size: 18px; }
.tl-barre > [data-tl-zones] { margin-left: auto; }
.tl-modif { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--warn-text); }
.tl-modif + [data-tl-zones] { margin-left: 0; }
.tl-detail-carte { height: 340px; margin: 8px 0 10px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rn-tiroir .ze-corps { min-height: calc(100vh - 170px); }
.rn-tiroir .ze-carte { min-height: calc(100vh - 170px); }
.rn-tiroir .ze-liste { max-height: calc(100vh - 170px); }
.ze-astuce { font-size: 12px; color: var(--text-muted); }
.tl-contenu { padding: 12px 16px 24px; }
.tl-entite, .tl-bloc { margin-bottom: 20px; }
.tl-entite h3, .tl-bloc h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 8px 0; }
.tl-entite h3 .ms, .tl-bloc h3 .ms { color: var(--accent); }
.tl-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.tl-tuile { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.tl-tuile .ms { font-size: 18px; color: var(--accent); }
.tl-tuile b { font-size: 16px; }
.tl-tuile small { color: var(--text-muted); font-size: 11px; }
.tl .eco-table { width: 100%; }
.tl-tournees tr.trip { cursor: pointer; }
.tl-detail { padding: 8px 4px; }
.tl-detail-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.tl-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #fff; background: var(--c); }
.tl-statut { font-size: 12px; font-weight: 600; }
.tl-statut.ouverte { color: var(--danger); }
.tl-statut.coupee, .tl-statut.changementChauffeur { color: var(--warn-text); }
.tl-alerte { color: var(--danger); font-size: 16px; vertical-align: middle; }
.tl-actions { white-space: nowrap; }
.tl-actions a { color: var(--accent); vertical-align: middle; }
.tl-alertes { margin: 0; padding-left: 18px; font-size: 13px; }
.tl-alertes li { margin: 3px 0; }

/* ── Éditeur de zones ───────────────────────────────────────────────────── */
.ze { position: relative; }
.ze-barre { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.ze-barre .eco-btn.on { outline: 2px solid var(--accent); }
.ze-lecture { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 13px; margin-right: 8px; }
.ze-corps { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; min-height: 520px; }
.ze-carte { min-height: 520px; border: 1px solid var(--border); border-radius: 8px; }
.ze-carte.ze-viseur, .ze-carte.ze-viseur .leaflet-interactive { cursor: crosshair; }
.ze-liste { display: flex; flex-direction: column; gap: 6px; max-height: 620px; min-width: 0; }
.ze-filtres { display: flex; flex-direction: column; gap: 6px; }
.ze-compte { font-size: 12px; color: var(--text-muted); }
.ze-items { overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.ze-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--border); cursor: pointer; }
.ze-item:hover { background: var(--surface-hover); }
.ze-pastille { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ze-item-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ze-item-texte b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ze-item-texte small { font-size: 11px; color: var(--text-muted); }
.ze-panneau { position: absolute; top: 48px; left: 12px; z-index: 1000; width: min(380px, calc(100% - 24px)); max-height: 80%; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); }
.ze-form { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; font-size: 13px; }
.ze-form-titre { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 14px; }
.ze-form-titre .ms { font-size: 18px; color: var(--accent); }
.ze-form .rs-field:first-of-type { border-top: 0; }
.ze-form .eco-input { width: 100%; box-sizing: border-box; }
.ze-coord { font-variant-numeric: tabular-nums; }
.ze-check { display: flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; }
.ze-form-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--border); margin-top: 4px; }
.ze-declencheur { width: 100%; min-width: 0; }
.ze-filtres .ze-declencheur { height: 32px; }
.ze-corr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.ze-corr-ligne { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; color: var(--text-muted); }
.ze-type { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.ze-type .ze-declencheur { width: auto; max-width: 170px; }
.ze-apercu { font-size: 12px; }
.ze-table td, .ze-table th { font-size: 11px; padding: 3px 5px; }
.ze-num span { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center;
  color: var(--accent-text, #fff); font-size: 11px; font-weight: 700; border: 2px solid var(--surface, #fff); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
/* ── Éditeur de zones : ajouts (types, lignes, vitesses, polygones, configuration) ── */
.eco-btn.sm { padding: 4px 8px; font-size: 12px; min-height: 28px; }
.rn-tiroir .ze-tiroir, .ze-tiroir { padding: 12px 14px; }
.ze-onglets { margin-bottom: 0; }
.ze-compte-choix { width: auto; max-width: 320px; }
.ze-item.inactif { opacity: 0.55; }
.ze-role { margin: -2px 0 4px; }
.ze-saisie { display: flex; gap: 4px; align-items: center; }
.ze-saisie .eco-input { flex: 1; }
.ze-details { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 6px; }
.ze-details > summary { display: flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; font-size: 13px; padding: 4px 0; list-style: none; }
.ze-details > summary::-webkit-details-marker { display: none; }
.ze-details > summary .ms { font-size: 18px; color: var(--accent); }
.ze-limites { width: 100%; margin: 4px 0; }
.ze-limites input { width: 90px; }
.ze-orpheline td { color: var(--danger); }
.ze-actions-poly { border-top: 0; padding-top: 4px; margin-top: 0; }
.ze-groupes { display: flex; flex-direction: column; gap: 2px; max-height: 160px; overflow: auto; }
.ze-sommet span { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-text, #fff); font-size: 9px; font-weight: 700; border: 2px solid var(--surface, #fff); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.ze-config { padding-top: 8px; }
/* Les blocs à display explicite (grid, flex) ne respectent pas seuls l'attribut hidden. */
.ze [hidden], .zc [hidden] { display: none !important; }

.zc { display: flex; flex-direction: column; gap: 10px; }
.zc-onglets { flex-wrap: wrap; }
.zc-liste { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.zc-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.zc-nom { flex: 1 1 180px; min-width: 140px; }
.zc-mots { flex: 2 1 240px; min-width: 160px; }
.zc-role { width: auto; min-width: 180px; }
.zc-couleur { width: 34px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.zc-ordre { display: inline-flex; gap: 2px; margin-left: auto; }
.zc-sous { flex-basis: 100%; }
.zc-vitesses { display: flex; flex-wrap: wrap; gap: 6px; }
.zc-vitesse { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--text-muted); }
.zc-vitesse input { width: 84px; }
.zc-orpheline { color: var(--danger); }
.zc-groupes { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.zc-puce { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 8px; border-radius: 12px; background: var(--surface-hover); font-size: 12px; }
.zc-puce button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--text-muted); display: inline-flex; }
.zc-puce button .ms { font-size: 14px; }
.zc-info { font-size: 12px; color: var(--text-muted); }
.zc-titre { margin: 12px 0 4px; font-size: 13px; }
.zc-apercu details { padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.zc-apercu-liste { font-size: 12px; color: var(--text-muted); padding: 4px 0 4px 12px; }
.zc-actions { position: sticky; bottom: 0; background: var(--surface); }

/* ── AB01 Arrivées des bus / VZ01 Survitesse par zone ─────────────────────── */
.zr-barre { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.zr-titre { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; color: var(--accent); }
.zr-titre .ms { font-size: 18px; }
.zr-barre .zr-espace { margin-left: auto; }
.zr-contenu { padding: 12px 16px 24px; }
.zr-jour { margin-bottom: 22px; }
.zr-jour > h3, .zr-section > h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; padding: 8px 12px; border-radius: 8px;
  background: var(--surface-hover); color: var(--accent); text-transform: uppercase; letter-spacing: 0.02em; }
.zr-section { margin-bottom: 18px; }
.zr-auteur { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.zr .eco-table { width: 100%; }
.zr-groupe td { background: var(--surface-hover); font-weight: 600; }
.zr-ligne-cell .eco-trigger { width: auto; min-width: 150px; height: 28px; font-size: 12px; }
.zr-badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; background: var(--surface-hover); color: var(--accent); margin-left: 4px; }
.zr-badge.warn { color: var(--warn-text); }
.zr-badge.danger { color: var(--danger); }
.zr-inconnue { color: var(--warn-text); }
.zr-avertissements { margin: 0 0 12px; padding-left: 18px; font-size: 13px; color: var(--warn-text); }
.zr-episodes td { font-size: 12px; color: var(--text-muted); }
.zr-vmax { font-weight: 700; color: var(--danger); }
.zr-vide { color: var(--text-muted); font-style: italic; padding: 6px 2px; }
@media (max-width: 760px) {
  .ze-corps { grid-template-columns: 1fr; }
  .ze-carte { min-height: 360px; }
  .ze-liste { max-height: 360px; }
  .ze-corr { grid-template-columns: 1fr; }
}
