@charset "UTF-8";
/* ============================================================
   FollowCabs — supervision design system
   Background:  #2D3433 (deep slate)  /  #80818B (mid steel)
   Accent:      #e0692f (orange)
   Status:      green / orange / red for cabin occupancy
   ============================================================ */

:root {
  --bg-0: #1c2120;
  --bg-1: #2D3433;
  --bg-2: #3a4241;
  --bg-3: #4b5453;
  --steel: #80818B;
  --steel-2: #a89ea8;
  --line:  #182b2d;
  --line-2: rgba(255,255,255,0.08);
  --text:  #efefef;
  --text-dim: #ececec;
  --text-faint: #ececec;
  --accent: #e0692f;
  --accent-dim: #893810;
  --accent-glow: rgba(255, 90, 7, 0.25);

  --ok:   #5fbf6a;   /* vide */
  --mid:  #e8a13c;   /* à moitié */
  --bad:  #d9483b;   /* plein */

  /* Couleurs de graphiques (lues par supervision.jsx au chargement) */
  --c-kwh:       #ffec59;
  --c-ref-pa:    #ffea0096;
  --c-tick:      #dfe0e4;
  --c-grid:      rgba(255,255,255,0.05);
  --c-border:    rgba(255,255,255,0.10);
  --c-tip-bg:    #1c2120;
  --c-tip-title: #dfe0e4;
  --c-tip-body:  #f0f1f3;
  --c-legend:    #f0f1f3;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ── Mode clair ─────────────────────────────────────────────────────────────── */
html[data-theme="light"] {
  --bg-0: #e4e7e9;
  --bg-1: #eef0f2;
  --bg-2: #ffffff;
  --bg-3: #dfdfdf;
  --steel: #5c6370;
  --steel-2: #8a909a;
  --line:  #c4cace;
  --line-2: rgba(0,0,0,0.08);
  --text:  #111827;
  --text-dim: #374151;
  --text-faint: #6b7280;
  --accent: #e0692f;
  --accent-dim: #b8521f;
  --accent-glow: rgba(224,105,47,0.20);
  --mid:  #b87316;
  --ok:   #2e8c38;

  /* Couleurs de graphiques — version foncée pour lisibilité sur fond clair */
  --c-kwh:       #8a6000;
  --c-ref-pa:    #8a600090;
  --c-tick:      #374151;
  --c-grid:      rgba(0,0,0,0.06);
  --c-border:    rgba(0,0,0,0.12);
  --c-tip-bg:    #f5f6f8;
  --c-tip-title: #374151;
  --c-tip-body:  #111827;
  --c-legend:    #374151;
}

/* ── Backgrounds hardcodés → version claire ─────────────────────────────────── */
html[data-theme="light"] .topbar                       { background: var(--bg-2); }
html[data-theme="light"] .map-page                     { background: linear-gradient(135deg, #d6dde2 0%, #e6eaed 100%); }
html[data-theme="light"] .map-legend                   { background: rgba(255,255,255,0.96); }
html[data-theme="light"] .map-hint                     { background: rgba(220,226,230,0.92); }
html[data-theme="light"] .stat-card                    { background: rgba(255,255,255,0.94); }
html[data-theme="light"] .speed-panel                  { background: rgba(255,255,255,0.96); }
html[data-theme="light"] .speed-bar__track             { background: rgba(0,0,0,0.12); }
html[data-theme="light"] .panel__head                  { background: var(--bg-3); }
html[data-theme="light"] .log-row                      { border-bottom-color: rgba(0,0,0,0.06); }
html[data-theme="light"] .supervision-toolbar          { background: var(--bg-2); }
html[data-theme="light"] .indic-panel--cost            { background: linear-gradient(135deg, var(--bg-2) 30%, rgba(0,135,149,0.05) 100%); border-color: rgba(0,135,149,0.18); box-shadow: none; }
html[data-theme="light"] .indic-cost-bar               { background: rgba(0,0,0,0.08); }
html[data-theme="light"] .conso-wrap                   { background: rgba(0,0,0,0.02); }
html[data-theme="light"] .map-view-toggle              { background: rgba(255,255,255,0.94); }
html[data-theme="light"] .apparatus-card               { background: var(--bg-2); }
html[data-theme="light"] .apparatus-card__img-gradient { background: linear-gradient(to top, rgba(230,234,237,0.9) 0%, transparent 100%); }
html[data-theme="light"] .dash-action-bar              { background: var(--bg-0); }

/* ── Textes blancs/gris clair → version foncée ──────────────────────────────── */
html[data-theme="light"] .chart-card__title            { color: var(--text); }
html[data-theme="light"] .chl-item                     { color: var(--text-dim); }
html[data-theme="light"] .indic-chip__unit             { color: var(--text-dim); }
html[data-theme="light"] .indic-cost-currency          { color: var(--text-dim); }
html[data-theme="light"] .indic-cost-prix__label       { color: var(--text-dim); }
html[data-theme="light"] .indic-cost-item__label       { color: var(--text-dim); }

/* ── Dropdown export ─────────────────────────────────────────────────────────── */
html[data-theme="light"] .export-dropdown              { background: var(--bg-2); border-color: var(--line); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
html[data-theme="light"] .export-dropdown__item        { color: var(--text-dim); }
html[data-theme="light"] .export-dropdown__item:hover  { background: var(--bg-3); color: var(--text); }

/* ── Login : reste toujours en mode sombre ──────────────────────────────────── */
html[data-theme="light"] .login {
  --bg-0: #1c2120; --bg-1: #2D3433; --bg-2: #3a4241; --bg-3: #4b5453;
  --steel: #80818B; --steel-2: #a89ea8;
  --line: #182b2d; --line-2: rgba(255,255,255,0.08);
  --text: #efefef; --text-dim: #ececec; --text-faint: #ececec;
}
html[data-theme="light"] .login__title,
html[data-theme="light"] .login__form h2,
html[data-theme="light"] .login__kicker,
html[data-theme="light"] .login__sub,
html[data-theme="light"] .login__form p { color: #efefef; }

/* ── Textes supplémentaires et corrections mode clair ────────────────────────── */
html[data-theme="light"] .indic-fill-item__cap { color: var(--text-dim); }
html[data-theme="light"] .login__error         { color: #b02a1e; }
/* gradient text : ré-appliquer background-clip pour éviter le carré solide */
html[data-theme="light"] .indic-num-gradient {
  background: linear-gradient(to top right, #005e6a 40%, #007e8c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-1);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: var(--app-height, 100vh);
}

#root {
  height: var(--app-height, 100vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }

/* ===== Login ============================================== */

.login {
  height: var(--app-height, 100vh);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--bg-1);
}

.login__art {
  position: relative;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(224, 106, 47, 0.493), transparent 65%),
    linear-gradient(160deg, #1c2120 0%, #2D3433 55%, #535c5b 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px;
}

.login__art::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(254, 249, 249, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(254, 249, 249, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  mask-image: radial-gradient(70% 70% at 30% 50%, #000 30%, transparent 80%);
}

.brand {
  display: flex; align-items: center; gap: 16px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative; z-index: 2;
}
.brand__logo {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #1c2120;
  font-weight: 800;
  font-size: 26px;
  box-shadow: 0 0 0 5px rgba(224,105,47,0.15);
}
.brand__name { font-size: 27px; }
.brand__name span { color: var(--accent); }

.login__hero {
  position: relative; z-index: 2;
  max-width: 520px;
}
.login__kicker {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 22px;
}
.login__title {
  font-size: 55px;
  line-height: 1.05;
  margin: 0 0 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.login__title em {
  font-style: normal; color: var(--accent);
}
.login__sub {
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1.55;
  text-align: justify;
}

.login__meta {
  position: relative; z-index: 2;
  display: flex; gap: 32px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.login__meta b { color: var(--text); font-weight: 600; }

.login__form-wrap {
  display: grid; place-items: center;
  padding: 56px;
  background: var(--bg-1);
}
.login__form {
  width: 100%;
  max-width: 520px;
}
.login__form h2 {
  font-size: 33px; margin: 0 0 8px;
  font-weight: 600;
}
.login__form p.lead {
  margin: 0 0 36px;
  color: var(--text-dim);
  font-size: 18px;
}

.field { margin-bottom: 22px; }
.field label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.field input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  border: none;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
  transition: transform .08s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled {
  background: var(--bg-2) !important;
  color: var(--text-faint) !important;
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none; /* ceinture + bretelles : bloque aussi tout listener pointerdown/up/leave */
}
.btn:disabled:active { transform: none; }

.btn--primary {
  width: 100%;
  background: var(--accent);
  color: #1c2120;
}
.btn--primary:hover { background: #f07a3e; }

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn--ghost:hover { background: var(--bg-2); }

.btn--block { width: 100%; justify-content: center; }

.login__footer {
  margin-top: 28px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
}
.login__footer a { color: var(--accent); text-decoration: none; }

.login__error {
  background: rgba(217,72,59,0.1);
  border: 1px solid rgba(217,72,59,0.35);
  color: #f0a39b;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  margin-bottom: 20px;
}

/* ===== Topbar shared ====================================== */

.topbar {
  height: 80px;
  display: flex; align-items: center;
  padding: 0 20px;
  background: #1f2524;
  border-bottom: 1px solid var(--line);
  gap: 0;
}
.topbar__right {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.topbar__brand {
  display: flex; align-items: center; gap: 14px;
  font-weight: 600;
}
.topbar__brand .brand__logo {
  width: 40px; height: 40px; border-radius: 10px; font-size: 16px;
  box-shadow: 0 0 0 4px rgba(224,105,47,0.12);
}
.topbar__brand .brand__name { font-size: 20px; }
.topbar__divider { width: 1px; height: 32px; background: var(--line); }
.topbar__crumb {
  display: flex; align-items: center; gap: 30px;
  color: var(--text-dim);
  font-size: 19px;
}
.topbar__crumb b { color: var(--text); font-weight: 600; }
.topbar__crumb .accent { color: var(--accent); }
.topbar__spacer { flex: 1; }
.topbar__datetime {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-family: var(--mono); line-height: 1.2; flex-shrink: 0;
}
.topbar__date {
  font-size: 16px; color: var(--text-dim);
  letter-spacing: 0.04em; text-transform: capitalize;
}
.topbar__time {
  font-size: 19px; color: var(--text);
  font-weight: 600; letter-spacing: 0.06em;
}
.topbar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 7px;
  background: var(--bg-2);
  border-radius: 999px;
  cursor: pointer;
}
.topbar__user:hover { background: var(--bg-3); }
.topbar__user .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent);
  color: #1c2120;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.topbar__user-info { display: flex; flex-direction: column; line-height: 1.2; }
.topbar__user-name { font-size: 16px; }
.topbar__user-role {
  font-size: 11px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.topbar__user-logout {
  display: none;
  background: none; border: none;
  color: var(--bad); font-size: 16px;
  cursor: pointer; padding: 0; white-space: nowrap;
}
.topbar__user:hover .topbar__user-info { display: none; }
.topbar__user:hover .topbar__user-logout { display: block; }
.topbar__support {
  background: transparent; border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 6px;
  color: var(--text-dim); font-family: var(--mono); font-size: 16px;
  letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.topbar__support:hover { color: var(--accent); border-color: var(--accent); background: rgba(224,105,47,0.08); }
.topbar__back {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 14px;
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.topbar__back:hover { color: var(--accent); border-color: var(--accent); background: rgba(224,105,47,0.08); }

/* ── Theme toggle switch ────────────────────────────────────────────────────── */
.theme-toggle {
  display: flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 999px;
  color: var(--text-dim); cursor: pointer;
  transition: border-color .2s, background .2s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); background: rgba(224,105,47,0.06); }
.theme-toggle__track {
  position: relative; width: 34px; height: 18px;
  background: var(--bg-3); border-radius: 999px;
  transition: background .25s;
}
.theme-toggle--light .theme-toggle__track { background: #9fced2; }
.theme-toggle__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--steel); transition: transform .25s, background .25s;
}
.theme-toggle--light .theme-toggle__thumb {
  transform: translateX(16px); background: #008590;
}
.theme-toggle__icon { font-size: 14px; line-height: 1; }

/* ===== Map page =========================================== */

.map-page {
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(80% 60% at 50% 30%, #34403e 0%, #2D3433 55%, #1c2120 100%);
  position: relative;
  overflow: hidden;
}
.map-canvas { width: 100%; height: 100%; display: block; }
.map-legend {
  position: absolute;
  top: 20px; left: 20px;
  background: rgba(28,33,32,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: clamp(10px, 1.5vw, 20px) clamp(12px, 1.8vw, 24px);
  width: clamp(190px, 22vw, 300px);
}
.map-legend h3 {
  margin: 0 0 6px; font-size: clamp(14px, 1.6vw, 18px); font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.map-legend .h-meta {
  font-family: var(--mono); font-size: clamp(10px, 1.1vw, 13px);
  color: var(--text-faint); letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: clamp(8px, 1.2vw, 14px);
}
.map-legend ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: clamp(6px, 1vw, 12px); }
.map-legend li { display: flex; align-items: center; gap: clamp(8px, 1.2vw, 14px); font-size: clamp(14px, 1.6vw, 18px); color: var(--text-dim); }
.map-legend li .swatch { width: 12px; height: 12px; border-radius: 2px; }
.map-legend li.active { color: var(--text); }
.map-legend li.active .swatch { box-shadow: 0 0 0 2px var(--accent-glow); }

.map-hint {
  position: absolute;
  bottom: 24px; left: 60%; transform: translateX(-50%);
  background: rgba(102, 110, 108, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}
.map-hint span { color: var(--accent); }

.map-stats {
  position: absolute;
  top: 20px; right: 20px;
  display: flex; gap: 10px;
}
.stat-card {
  background: rgba(28,33,32,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-width: 120px;
}
.stat-card .label {
  font-family: var(--mono); font-size: 10px;
  color: var(--text-faint); letter-spacing: 0.12em; text-transform: uppercase;
}
.stat-card .value { font-size: 20px; font-weight: 600; margin-top: 2px; }
.stat-card .value.accent { color: var(--accent); }

/* ===== Dashboard ========================================== */

.dash {
  flex: 1;
  min-height: 0;
  display: grid;
  background: var(--bg-1);
  overflow: hidden;
}

.dash-action-bar {
  display: flex;
  align-items: center;
  padding: 5px 20px;
  background: #1c2120;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  gap: 10px;
  flex-shrink: 0;
  position: relative;
}

.dash-resize-handle {
  position: absolute;
  bottom: -5px;
  left: 0; right: 0;
  height: 10px;
  cursor: ns-resize;
  z-index: 10;
}
.dash-resize-handle::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 4px;
  background: var(--steel);
  border-radius: 2px;
  opacity: 0.3;
  transition: opacity .15s;
}
.dash-resize-handle:hover::after { opacity: 0.7; }

.line-region {
  position: relative;
  display: grid; place-items: center;
  background:
    radial-gradient(60% 60% at 50% 50%, rgba(255,255,255,0.03), transparent 70%),
    var(--bg-1);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.line-wrap {
  width: min(1480px, 96%);
  position: relative;
}

.line-svg { width: 100%; display: block; overflow: visible; }

/* speed control */
.speed-panel {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28,33,32,0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 16px 4px;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.speed-bar {
  display: flex; align-items: center; gap: 14px;
}
.speed-bar__label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-faint); font-family: var(--mono); white-space: nowrap;
}
.speed-bar__val {
  font-family: var(--mono); font-size: 16px; white-space: nowrap;
  color: var(--text-dim);
}
.speed-bar__val b { font-size: 18px; }
.speed-bar__track {
  position: relative; width: 200px; height: 2px;
  background: rgba(255,255,255,0.15); border-radius: 1px; flex-shrink: 0;
}
.speed-bar__dot {
  position: absolute; top: 50%;
  width: 14px; height: 14px; border-radius: 50%;
  transform: translate(-50%, -50%);
}
.speed-bar__max {
  font-size: 11px; color: var(--text-faint); font-family: var(--mono); white-space: nowrap;
}

.speed-panel input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg-3);
  border-radius: 999px;
  outline: none;
}
.speed-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-glow);
  cursor: pointer;
}
.speed-panel input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border: none;
  background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.station-cap {
  position: absolute;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  width: 110px; height: 200px;
  top: 50%; transform: translateY(-50%);
}
.station-cap.left { left: -8px; border-radius: 110px 8px 8px 110px; }
.station-cap.right { right: -8px; border-radius: 8px 110px 110px 8px; }
.station-cap .code { font-family: var(--font); font-size: 14px; color: var(--accent); letter-spacing: 0.1em; }
.station-cap .name { font-size: 11px; color: var(--text-dim); margin-top: 4px; letter-spacing: 0.06em; }
.station-cap .alt { font-family: var(--font); font-size: 10px; color: var(--text-faint); margin-top: 6px; }

/* bottom dashboard region */
.bottom-region {
  display: grid;
  grid-template-columns: 1.05fr 1.15fr 0.28fr;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}
.panel {
  background: var(--bg-1);
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.panel + .panel { border-left: 1px solid var(--line); }

.panel__head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #25292a;
}
.panel__head h4 {
  margin: 0; font-size: 18px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text);
  font-weight: 600;
}
.panel__head .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(224,105,47,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(224,105,47,0); }
  100% { box-shadow: 0 0 0 0 rgba(224,105,47,0); }
}
.panel__head .spacer { flex: 1; }
.panel__head .chip {
  font-family: var(--font); font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.panel__head .chip b { color: var(--accent); }

.panel__body {
  flex: 1; overflow: auto;
  min-height: 0;
}
.panel__body::-webkit-scrollbar { width: 8px; height: 8px; }
.panel__body::-webkit-scrollbar-track { background: transparent; }
.panel__body::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 4px; }
.panel__body::-webkit-scrollbar-thumb:hover { background: var(--steel); }

/* cabin grid (left panel) */
.cabin-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 14px 18px;
}
.cabin-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 13px;
  display: flex; flex-direction: column; gap: 5px;
  transition: transform .15s, border-color .15s;
  position: relative;
}
.cabin-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cabin-card__dog {
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.cabin-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.cabin-card--clickable { cursor: pointer; }
.cabin-card.s-ok  { border-left-color: var(--ok); }
.cabin-card.s-mid { border-left-color: var(--mid); }
.cabin-card.s-bad { border-left-color: var(--bad); }
.cabin-card.s-gone { border-left-color: var(--line); opacity: 0.45; }
.cabin-card .id { font-weight: 700; font-size: 18px; color: var(--text); }
.id__circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px;
  font-size: 14px;
  border: 1px solid var(--text-faint);
  border-radius: 50%;
}
.cabin-card .row { display: flex; justify-content: space-between; color: var(--text-dim); font-size: 15px}
.cabin-card .row .val { color: var(--text); }
.cabin-card .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px;
}

/* log feed (right panel) */
.log-feed {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 0;
}
.log-row {
  display: grid;
  grid-template-columns: 90px 42px 150px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
  color: var(--text-dim);
}
.log-row .t { color: var(--text-faint); font-size: 18px; }
.log-row .cab { color: var(--accent); font-weight: 600; font-size: 18px; }
.log-row .occ {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 18px;
}
.log-row .occ .dot { width: 8px; height: 8px; border-radius: 50%; }
.log-row.s-ok  .occ .dot { background: var(--ok); }
.log-row.s-mid .occ .dot { background: var(--mid); }
.log-row.s-bad .occ .dot { background: var(--bad); }
.log-row.s-ok  .occ { color: var(--ok); }
.log-row.s-mid .occ { color: var(--mid); }
.log-row.s-bad .occ { color: var(--bad); }
.log-row .msg { color: var(--text); font-family: var(--font); font-size: 17px; white-space: nowrap; }

/* occupancy summary */
.occ-summary {
  display: grid;
  grid-template-columns: 1.8fr 0.8fr 0.8fr 0.8fr;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.occ-cell {
  background: var(--bg-0);
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.occ-cell .l {
  font-family: var(--mono); font-size: 17px;
  color: var(--text-faint); letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 2px;
}
.occ-sub { display: flex; flex-direction: column; gap: 3px; }
.occ-sub__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.occ-sub__row--global {
  border-top: 1px dashed var(--line);
  padding-top: 4px;
  margin-top: 2px;
}
.occ-sub__dir {
  font-family: var(--mono); font-size: 16px;
  color: var(--text-faint); letter-spacing: 0.06em;
}
.occ-sub__row--global .occ-sub__dir { color: var(--text-dim); }
.occ-cell .v { font-size: 16px; font-weight: 700; }
.occ-sub__row--global .v { font-size: 18px; }
.occ-cell.ok .v  { color: var(--ok); }
.occ-cell.mid .v { color: var(--mid); }
.occ-cell.bad .v { color: var(--bad); }
.occ-cell.tot .v { color: var(--accent); }

/* cabin SVG element */
.cab {
  cursor: pointer;
  transition: filter .2s;
}
.cab:hover { filter: brightness(1.15); }
.cab-rect { stroke: rgba(0,0,0,0.4); stroke-width: 1; }
.cab--highlight { filter: brightness(1.2) drop-shadow(0 0 8px rgba(255,255,255,0.9)); }
.cab--highlight .cab-rect { stroke: #ffffff; stroke-width: 3px; }
.cab-label {
  font-family: var(--font);
  fill: #1c2120;
  font-weight: 700;
  text-anchor: middle;
}

.pylon-circle {
  fill: var(--bg-2);
  stroke: var(--steel);
  stroke-width: 3;
}
.pylon-label {
  font-family: var(--font);
  font-size: 22px;
  fill: #80818B;
  text-anchor: middle;
}
.cable-line {
  stroke: var(--steel);
  stroke-width: 3;
  fill: none;
}

.direction-arrow {
  fill: var(--accent);
  opacity: 0.7;
}
.direction-label {
  font-family: var(--mono);
  font-size: 26px;
  fill: var(--accent);
  letter-spacing: 0.12em;
}

/* log feed split (col gauche journal / col droite débit) */
.panel__body.log-split {
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.log-split__left  { overflow: auto; min-height: 0; border-right: 1px solid var(--line); }
.log-split__right { overflow: hidden; min-height: 0; }

/* débit passagers */
.debit-panel-wrap {
  flex-shrink: 0;
  border-top: 2px solid var(--line);
}
.debit-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-0);
  border: none; border-bottom: 1px solid var(--line-2);
  color: var(--text-dim);
  font-family: var(--mono); font-size: 18px; letter-spacing: 0.12em; text-transform: uppercase;
  cursor: pointer;
}
.debit-toggle:hover { background: var(--bg-1); color: var(--accent); }
.debit-toggle__arrow { font-size: 9px; opacity: 0.6; }
.debit-panel {
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  align-items: start;
  flex-shrink: 0;
  background: var(--line);
  border-top: none;
}
.debit-section {
  background: var(--bg-0);
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 5px;
}
.debit-section__title {
  font-family: var(--mono); font-size: 18px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2px;
}
.debit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}
.debit-row--global {
  border-top: 1px dashed var(--line);
  padding-top: 6px;
  margin-top: 2px;
}
.debit-label {
  font-family: var(--mono); font-size: 16px;
  color: var(--text-dim); letter-spacing: 0.06em;
}
.debit-val {
  font-family: var(--font); font-size: 18px;
  font-weight: 700; color: var(--text);
}
.debit-row--global .debit-val { font-size: 18px; color: var(--accent); }

/* ===== Panneau Énergie (3e colonne bas) =================== */

.energy-values {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.energy-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  flex: 1;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--bg-3);
}

.energy-row--tension   { border-left-color: #008694; }
.energy-row--courant   { border-left-color: #008694; }
.energy-row--puissance { border-left-color: #008694; }

.energy-row__label {
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.energy-row__value {
  font-family: var(--font);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.energy-row__value .unit {
  font-size: 11px;
  color: var(--text-faint);
  margin-left: 4px;
}

.energy-supervision-btn {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

/* ===== Page supervision (graphiques) ====================== */

.supervision-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  overflow: hidden;
}

.supervision-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: #1f2524;
  flex-shrink: 0;
}

.supervision-toolbar__title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 600;
  flex-shrink: 0;
}

.supervision-toolbar__ranges {
  display: flex;
  gap: 8px;
}

.range-btn {
  background: transparent;
  border: 1px solid var(--line);
  padding: 7px 18px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.range-btn:hover { background: var(--bg-2); color: var(--text); }
.range-btn.active {
  background: rgba(224,105,47,0.15);
  border-color: rgba(224,105,47,0.45);
  color: var(--accent);
}

.supervision-charts {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  background: transparent;
  min-height: 0;
  padding: 0 12px 12px;
}

.chart-card {
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.chart-card--wide {
  grid-column: 1 / -1;
}

.chart-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  flex-shrink: 0;
}

.chart-card__title {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f8f9fb;
  font-weight: 600;
}

.chart-card__unit {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
}

.chart-card__body {
  flex: 1;
  padding: 10px 14px 14px;
  position: relative;
  min-height: 0;
}

/* ── Supervision v2 — onglets & composants ────────────────────────────────── */

.sv-tabs { display: flex; gap: 4px; }

.sv-tab {
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.sv-tab:hover { background: var(--bg-2); color: var(--text); }
.sv-tab.active {
  background: rgba(224,105,47,0.12);
  border-color: rgba(224,105,47,0.35);
  color: var(--accent);
}

/* Conteneur de section */
.sv-section {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Barre de contrôles au-dessus du graphique */
.sv-section-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-1);
  flex-shrink: 0;
}

.sv-spacer { flex: 1; }

/* Toggles de séries */
.sv-toggles { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.sv-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  transition: color .15s;
}
.sv-toggle:hover { color: var(--text); }
.sv-toggle input[type="checkbox"] { display: none; }

.sv-toggle__swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  transition: opacity .15s;
}

/* Granularité */
.sv-gran { display: flex; gap: 6px; }

/* Sélecteur de plage de dates */
.sv-daterange {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sv-daterange__label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}
.sv-date-input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.sv-date-input:focus { border-color: var(--accent); }
.sv-date-input::-webkit-calendar-picker-indicator { filter: invert(0.5); cursor: pointer; }

/* Badge puissance live */
.sv-live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  padding: 3px 12px;
  background: rgba(95,191,106,0.08);
  border: 1px solid rgba(95,191,106,0.25);
  border-radius: 999px;
}
.sv-live-badge b { color: var(--ok); }

/* KPI cards */
.sv-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  flex-shrink: 0;
}
.sv-kpi {
  background: var(--bg-0);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sv-kpi__label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.sv-kpi__value {
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
}
.sv-kpi__unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 3px;
}
.sv-kpi__sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Placeholder chargement */
.sv-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.12em;
}

/* Variantes de grille pour supervision-charts */
.supervision-charts.sv-single {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.supervision-charts.sv-2col {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

/* ── Onglet Consommation ────────────────────────────────────── */

.conso-wrap {
  flex: 1;
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(255,255,255,0.04);
}

.conso-top-row {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  gap: 1px;
}

.conso-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-1);
}

.conso-block--full {
  flex: none;
  width: 100%;
}

.conso-block__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.conso-block__title {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.conso-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  min-width: 7px;
  min-height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 1.6s infinite;
  flex-shrink: 0;
  align-self: center;
  vertical-align: middle;
}

.conso-kpi-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 14px;
  background: transparent;
}

.conso-kpi-card {
  flex: 1;
  background: var(--bg-0);
  padding: 7px 12px 8px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--ck, var(--line));
  border-radius: 5px;
  display: grid;
  grid-template-areas: "label val" "max max";
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 3px;
  min-width: 0;
}

.conso-kpi__label {
  grid-area: label;
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ck, var(--text-faint));
  font-weight: 700;
  white-space: nowrap;
}

.conso-kpi__val {
  grid-area: val;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}

.conso-kpi__unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
}

.conso-kpi__max {
  grid-area: max;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conso-kpi-row--compact .conso-kpi-card {
  flex: none;
  width: calc(12.5% - 6px);
}

.conso-kpi__max-time {
  color: var(--text-dim);
}

.conso-chart-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-0);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.conso-time-sel {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.conso-zoom-reset {
  position: absolute;
  top: -8px;
  left: 8px;
  background: rgba(0,135,149,0.15);
  border: 1px solid rgba(0,135,149,0.55);
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  z-index: 2;
}
.conso-zoom-reset:hover { background: rgba(0,135,149,0.3); color: var(--accent); border-color: var(--accent); }

.chart-btn-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  min-height: 30px;
  flex-shrink: 0;
  z-index: 2;
}
.chart-btn-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Légende HTML inline (dans chart-btn-group) ────────────────────────────── */
.chart-html-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  flex: 1;
  overflow: hidden;
  padding: 4px 8px;
}
.chl-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 17px;
  color: #f0f1f3;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: opacity 0.15s;
}
.chl-item--off { opacity: 0.32; }
.chl-item:hover { opacity: 0.75; }
.chl-item--off:hover { opacity: 0.55; }
.chl-line {
  display: inline-block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  flex-shrink: 0;
}
.chl-rect {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex-shrink: 0;
}
.conso-expand-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,135,149,0.15);
  border: 1px solid rgba(0,135,149,0.55);
  color: var(--text-dim);
  font-size: 16px;
  width: 30px; height: 30px;
  border-radius: 4px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1;
  pointer-events: all;
}
.conso-expand-btn:hover { background: rgba(0,135,149,0.3); color: var(--accent); border-color: var(--accent); }
.conso-fullscreen-overlay {
  position: fixed; inset: 0; background: var(--bg-1); z-index: 200;
  display: flex; flex-direction: column;
}
.conso-fullscreen-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.conso-fullscreen-close {
  background: rgba(0,135,149,0.15); border: 1px solid rgba(0,135,149,0.55);
  color: var(--text-dim); font-family: var(--mono); font-size: 13px;
  padding: 6px 14px; border-radius: 4px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.conso-fullscreen-close:hover { background: rgba(0,135,149,0.3); color: var(--accent); }
.conso-fullscreen-chart { flex: 1; min-height: 0; position: relative; padding: 14px; }
.chart-btn-group .conso-zoom-reset {
  position: static;
}
.chart-btn-label {
  width: auto !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  font-family: var(--mono) !important;
  letter-spacing: 0.07em !important;
}

/* Menu déroulant export */
.export-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #1c2120;
  border: 1px solid rgba(0,135,149,0.4);
  border-radius: 4px;
  z-index: 200;
  min-width: 90px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.export-dropdown__item {
  display: block;
  width: 100%;
  padding: 7px 12px;
  text-align: left;
  background: transparent;
  border: none;
  color: #e8e9ec;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: background 0.12s;
}
.export-dropdown__item:hover { background: rgba(0,135,149,0.18); color: var(--accent); }

.conso-chart-area {
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 10px 14px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0 14px 14px;
}
.conso-chart-area canvas { cursor: grab; position: relative; z-index: 1; }
.conso-chart-area canvas:active { cursor: grabbing; }

/* ── Corrélation — graphiques personnalisés ─────────────────────────────── */

.corr-graphs-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 14px 14px;
  gap: 8px;
}

.corr-graphs-toolbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.corr-add-btn {
  background: var(--bg-0);
  border: 1px dashed var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 5px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  opacity: 0.8;
}
.corr-add-btn:hover { background: rgba(0,135,149,0.12); opacity: 1; }

.corr-graphs-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
}
.corr-graphs-grid--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.corr-graphs-grid--2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.corr-graph-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  min-height: 0;
}

.corr-graph-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--bg-0);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.corr-graph-selects {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  flex-wrap: wrap;
}

.corr-axis-lbl {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  flex-shrink: 0;
}

.corr-select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.corr-select:focus { outline: 1px solid var(--accent); }

.corr-r-badges {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.corr-r-badge {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}
.corr-r-qual { font-size: 10px; font-weight: 400; opacity: 0.8; }

.corr-y-add {
  background: transparent;
  border: 1px dashed var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.corr-y-add:hover { background: rgba(0,135,149,0.12); }

.corr-y-remove {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1;
}
.corr-y-remove:hover { color: #e53935; background: rgba(229,57,53,0.1); }

.corr-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  line-height: 1;
}
.corr-remove-btn:hover { color: #e53935; background: rgba(229,57,53,0.1); }

.corr-graph-area {
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 8px 12px 10px;
}
.corr-graph-area canvas { cursor: crosshair; }

/* ── Indicateurs d'exploitation ─────────────────────────────────────────── */

.indic-section {
  padding: 0 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.indic-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  flex-shrink: 0;
  margin-bottom: -14px;
}

.indic-period-sel {
  display: flex;
  align-items: center;
  gap: 8px;
}

.indic-view-switch {
  position: relative;
  display: flex;
  background: var(--bg-0);
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 2px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.indic-view-switch__cursor {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc(50% - 2px);
  background: #008795;
  border-radius: 999px;
  transition: left 0.22s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

.indic-view-switch--right .indic-view-switch__cursor {
  left: 50%;
}

.indic-view-switch__label {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 20px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  transition: color 0.18s;
  white-space: nowrap;
}

.indic-view-switch:not(.indic-view-switch--right) .indic-view-switch__label:first-of-type,
.indic-view-switch--right .indic-view-switch__label:last-of-type {
  color: #fff;
  font-weight: 600;
}
html[data-theme="light"] .indic-view-switch__label { color: #fff; }
html[data-theme="light"] .indic-view-switch:not(.indic-view-switch--right) .indic-view-switch__label:first-of-type,
html[data-theme="light"] .indic-view-switch--right .indic-view-switch__label:last-of-type {
  color: #fff;
  font-weight: 600;
}

.indic-charts-inline {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.indic-month-sel { min-width: 170px; }

.indic-period-chip {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.indic-chips-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.indic-chip {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.indic-chip__label {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.indic-chip__value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.indic-chip__value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.indic-chip__unit {
  font-family: var(--mono);
  font-size: 19px;
  color: #dfe0e4;
}

.indic-main-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.indic-panel {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.indic-panel--cost {
  background: linear-gradient(135deg, #252e2d 30%, rgba(0, 135, 149, 0.18) 100%);
  border-color: rgba(0, 135, 149, 0.30);
  box-shadow: inset 0 0 40px rgba(0, 135, 149, 0.06);
}

.indic-panel__title {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.indic-cost-big {
  display: flex;
  align-items: baseline;
  gap: 12px;
  line-height: 1;
}

.indic-cost-big > span:first-child {
  font-size: 52px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
}

.indic-cost-currency {
  font-size: 28px;
  font-weight: 400;
  color: #dfe0e4;
}

.indic-cost-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.indic-cost-bar__fill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.indic-cost-prix {
  display: flex;
  align-items: center;
  gap: 12px;
}

.indic-cost-prix__label {
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #dfe0e4;
  white-space: nowrap;
}

.indic-cost-prix__val {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: border-color 0.15s, background 0.15s;
}
.indic-cost-prix__val:hover { border-color: var(--accent); background: rgba(0,135,149,0.07); }

.indic-cost-prix__edit-hint { font-size: 15px; opacity: 0.35; margin-left: 4px; }

.indic-cost-prix__edit { display: flex; align-items: center; }

.indic-cost-breakdown {
  display: flex;
  gap: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.indic-cost-item { display: flex; flex-direction: column; gap: 4px; }

.indic-cost-item__label {
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #dfe0e4;
}

.indic-cost-item__val { font-size: 36px; font-weight: 700; color: var(--text); }

.indic-fill-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.indic-fill-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.indic-fill-item:last-child { border-bottom: none; }

.indic-fill-item__dir {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.indic-fill-item__right {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.indic-fill-item__val { font-size: 34px; font-weight: 700; line-height: 1; }

.indic-fill-item__cap { font-family: var(--mono); font-size: 20px; color: #dfe0e4; }

.indic-fill-item__pct {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--accent);
  margin-left: auto;
}

.indic-stops-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  margin-top: auto;
  margin-bottom: 10px;
  border-top: 1px solid var(--line);
}

.indic-stops-row__label {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.indic-stops-row__val { font-size: 28px; font-weight: 700; }

.indic-num-gradient {
  background: linear-gradient(to top right, #008795 40%, #d8eef0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Bouton graphiques */
.indic-graphs-btn-wrap {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.indic-graphs-btn {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 18px;
  letter-spacing: 0.05em;
}

/* Overlay graphiques indicateurs */
.indic-charts-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
}

.indic-charts-overlay__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.indic-charts-overlay__title {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.indic-charts-overlay__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px 20px;
}

/* Graphique indicateurs */
.indic-chart-panel {
  flex: 1;
  min-height: 0;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px 14px;
  display: flex;
  flex-direction: column;
}

.indic-chart-title {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text);
}

.indic-chart-area {
  flex: 1;
  min-height: 0;
  position: relative;
}

/* ── Page Données de référence ───────────────────────────────────────────── */
.ref-page {
  flex: 1; overflow-y: auto; padding: 32px 40px;
  display: flex; flex-direction: column; align-items: flex-start;
}
.ref-back-btn { margin-bottom: 24px; }
.ref-page__content {
  max-width: 740px; width: 100%;
  display: flex; flex-direction: column; gap: 30px;
}
.ref-page__content--wide { max-width: 1080px; }
.ref-main-row { display: flex; gap: 32px; align-items: flex-start; flex-wrap: wrap; }
.ref-main-col { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 30px; }
.ref-existing-col { flex: 1 1 300px; min-width: 260px; max-width: 340px; }
.ref-title { font-size: 30px; font-weight: 600; margin: 0; color: var(--text); }
.ref-config-banner {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 18px;
  background: rgba(224,105,47,0.08);
  border: 1px solid rgba(224,105,47,0.35);
  border-radius: var(--radius-md);
}
.ref-config-banner__label {
  font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--text-faint); font-family: var(--mono);
}
.ref-config-banner__vals { display: flex; align-items: baseline; gap: 10px; font-size: 17px; color: var(--text); }
.ref-config-banner__vals strong { color: var(--accent); font-family: var(--mono); font-size: 20px; }
.ref-config-banner__sep { color: var(--text-faint); }
.ref-config-banner p { margin: 0; color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.ref-instructions { display: flex; flex-direction: column; gap: 10px; }
.ref-instructions p { margin: 0; color: var(--text-dim); font-size: 15px; line-height: 1.65; }
.ref-instructions strong { color: var(--text); }
.ref-section-label {
  font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--text-faint); font-family: var(--mono); margin-bottom: 12px;
}
.ref-speed-section { display: flex; flex-direction: column; }
.ref-speed-btns { display: flex; gap: 12px; }
.ref-speed-btn {
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 28px; min-width: 88px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-md); cursor: pointer; position: relative;
  transition: border-color .15s, background .15s;
}
.ref-speed-btn:hover { border-color: var(--accent); background: var(--bg-3); }
.ref-speed-btn.active { border-color: var(--accent); background: rgba(224,105,47,0.12); }
.ref-speed-btn.saved { border-color: #5fbf6a; }
.ref-speed-val { font-size: 30px; font-weight: 700; font-family: var(--mono); color: var(--text); line-height: 1; }
.ref-speed-unit { font-size: 12px; color: var(--text-faint); font-family: var(--mono); margin-top: 5px; }
.ref-speed-check { position: absolute; top: 7px; right: 9px; color: #5fbf6a; font-size: 14px; }
.ref-timer-section { display: flex; flex-direction: column; gap: 8px; }
.ref-timer-label { font-size: 14px; color: var(--text-dim); font-family: var(--mono); }
.ref-timer-ready { color: #5fbf6a; font-size: 14px; font-family: var(--mono); }
.ref-save-btn { max-width: 400px; font-size: 15px; }

.ref-existing-panel {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 20px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.ref-existing-panel__empty { margin: 0; color: var(--text-faint); font-size: 14px; font-style: italic; line-height: 1.5; }
.ref-existing-panel__date { font-size: 13px; color: var(--text-dim); font-family: var(--mono); }
.ref-existing-panel__table { width: 100%; border-collapse: collapse; }
.ref-existing-panel__table td {
  padding: 7px 0; font-size: 14px; color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ref-existing-panel__table tr:last-child td { border-bottom: none; }
.ref-existing-panel__table td:last-child {
  text-align: right; font-family: var(--mono); font-weight: 600; color: var(--text);
}
.ref-existing-panel__del { align-self: flex-start; }
.ref-save-btn:disabled { opacity: 0.38; cursor: not-allowed; }

/* ── Bouton Paramètres (plus grand) ─────────────────────────────────────── */
.btn--param {
  padding: 12px 24px !important;
  font-size: 16px !important;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ── Page Paramètres — onglets ───────────────────────────────────────────── */
.param-tabs-bar {
  display: flex; gap: 4px; margin-bottom: 28px;
  border-bottom: 1px solid var(--line); padding-bottom: 0;
}
.param-tab-btn {
  background: none; border: none; padding: 13px 28px; cursor: pointer;
  font-size: 20px; font-family: inherit; color: var(--text-dim);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.param-tab-btn:hover { color: var(--text); }
.param-tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Sections de paramètres ─────────────────────────────────────────────── */
.param-section {
  display: flex; flex-direction: column; gap: 22px;
  max-width: 1100px; width: 100%;
}
.param-section--wide {
  max-width: none;
  align-self: stretch;
}
.param-desc { margin: 0; color: var(--text-dim); font-size: 19px; line-height: 1.6; }

/* ── Tableau historique ─────────────────────────────────────────────────── */
.param-table {
  width: 100%; border-collapse: collapse;
}
.param-table th {
  text-align: left; padding: 10px 18px;
  font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint); font-family: var(--mono);
  border-bottom: 1px solid var(--line);
}
.param-table td {
  padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-family: var(--mono); font-size: 16px; color: var(--text-dim);
}
.param-table tr:last-child td { border-bottom: none; }
.param-active {
  color: #5fbf6a; font-size: 14px; font-weight: 600; letter-spacing: 0.05em;
}
.param-delete-btn {
  background: none; border: none; cursor: pointer; padding: 5px 10px;
  color: var(--text-faint); font-size: 16px; border-radius: 4px;
  transition: color .15s, background .15s;
}
.param-delete-btn:hover { color: #d9483b; background: rgba(217,72,59,0.12); }

/* ── Plan d'évacuation — équipes par débit ──────────────────────────────── */
.evac-equipe-block {
  min-width: 260px;
}
.evac-equipe-block__title {
  font-size: 16px; font-weight: 600; color: var(--text);
  margin-bottom: 10px;
}
.evac-equipe-row--clickable { cursor: pointer; }
.evac-equipe-row--clickable:hover td { background: rgba(255,255,255,0.03); }
.evac-equipe-row--sel td { background: rgba(224,105,47,0.10); }

/* ── Formulaire d'ajout ─────────────────────────────────────────────────── */
.param-form {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 26px 36px;
  display: flex; flex-direction: column; gap: 18px;
}
.param-form-row {
  display: flex; align-items: center; gap: 22px;
}
.param-label {
  min-width: 150px; font-size: 16px; color: var(--text-dim);
}
.param-radio-group {
  display: flex; flex-direction: column; gap: 12px;
}
.param-radio {
  display: flex; align-items: center; gap: 12px;
  font-size: 16px; color: var(--text-dim); cursor: pointer;
}
.param-radio input[type="radio"] { accent-color: var(--accent); width: 19px; height: 19px; }

/* Inputs et selects agrandis dans les formulaires paramètres */
.param-form .sv-date-input,
.param-form input[type="text"],
.param-form input[type="number"],
.param-form textarea,
.param-form select {
  font-size: 15px;
  padding: 8px 12px;
}
.param-form .ref-input {
  font-size: 15px !important;
  padding: 8px 12px !important;
}
/* Bouton "Ajouter" dans les formulaires paramètres */
.param-form .btn,
.param-form button:not(.param-delete-btn) {
  font-size: 15px;
  padding: 9px 22px;
}

/* ── Écran de blocage backend (connexion PostgreSQL en cours/coupée) ────── */
.backend-status-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.backend-status-overlay p {
  color: #efefef; font-size: 18px; text-align: center; max-width: 480px;
  padding: 24px 32px; background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.12); border-radius: var(--radius-md);
}

/* ── Onglet Caméras — vue live + overlay ROI ────────────────────────────── */
.camera-panels {
  display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start;
  justify-content: center; width: 100%;
}
.camera-panel {
  flex: 1 1 480px; min-width: 380px; max-width: calc(50% - 14px);
}
.camera-live-wrap {
  position: relative; width: 100%;
  background: #000; border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--line);
}
.camera-live-img { display: block; width: 100%; height: auto; }
.camera-live-placeholder {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16/9; color: var(--text-faint); font-size: 15px;
}
.camera-roi-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
}

/* ── Support Modal ────────────────────────────────────────────────────────── */

.support-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.support-modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.support-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.support-modal__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.support-modal__close {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.support-modal__close:hover { color: var(--text); background: var(--bg-2); }

.support-form {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.support-from-info {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: 5px;
  border-left: 3px solid var(--accent);
}

.support-field { display: flex; flex-direction: column; gap: 6px; }

.support-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.support-input, .support-textarea {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s;
  resize: vertical;
}
.support-input:focus, .support-textarea:focus { border-color: var(--accent); }

.support-file-input { display: none; }

.support-file-label { display: inline-flex; align-items: center; cursor: pointer; }

.support-file-btn {
  display: inline-block;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-dim);
  transition: border-color .15s, color .15s;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-file-label:hover .support-file-btn { border-color: var(--accent); color: var(--text); }

.support-file-remove {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 4px;
}
.support-file-remove:hover { color: #e53935; background: rgba(229,57,53,0.1); }

.support-screenshot-wrap { display: flex; flex-direction: column; gap: 10px; }
.support-capture-btn { align-self: flex-start; }

.support-screenshot-preview {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.support-screenshot-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  object-position: top;
}
.support-screenshot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--bg-2);
}

.support-screenshot-remove {
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.support-screenshot-remove:hover { color: #e53935; background: rgba(229,57,53,0.1); }

.support-screenshot-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  padding: 6px 10px;
  background: rgba(224,105,47,0.08);
  border: 1px solid rgba(224,105,47,0.2);
  border-radius: 5px;
  line-height: 1.5;
}

.support-error {
  color: #e05050;
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 12px;
  background: rgba(224,80,80,0.1);
  border: 1px solid rgba(224,80,80,0.25);
  border-radius: 5px;
}

.support-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.support-sent {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.support-sent__icon {
  font-size: 52px;
  color: #5fbf6a;
  margin-bottom: 12px;
}
.support-sent__msg {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.support-sent__sub {
  font-size: 14px;
  color: var(--text-faint);
  margin-top: 8px;
}

/* ===== Map / List view toggle ======================================== */
.map-view-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  background: rgba(28,33,32,0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  cursor: pointer;
  user-select: none;
}

.map-toggle__cursor {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: var(--accent);
  border-radius: 999px;
  transition: left 0.22s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}

.map-view-toggle--right .map-toggle__cursor {
  left: 50%;
}

.map-toggle__label {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 24px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  transition: color 0.18s;
  white-space: nowrap;
}

.map-view-toggle:not(.map-view-toggle--right) .map-toggle__label:first-of-type,
.map-view-toggle--right .map-toggle__label:last-of-type {
  color: #fff;
  font-weight: 600;
}

/* ===== Apparatus list view =========================================== */
.apparatus-list-view {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 28px 36px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.apparatus-list-view::-webkit-scrollbar { width: 6px; }
.apparatus-list-view::-webkit-scrollbar-track { background: transparent; }
.apparatus-list-view::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 3px; }

.apparatus-list-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
}
.apparatus-list-header h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
}
.apparatus-list-header span {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.apparatus-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.apparatus-card {
  position: relative;
  background: rgba(28,33,32,0.9);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, filter 0.2s;
  filter: grayscale(85%);
}
.apparatus-card:not(.apparatus-card--supervised)::after {
  content: 'Supervision non activée';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.52);
  color: rgba(255,255,255,0.8);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 10;
  border-radius: var(--radius-lg);
}
.apparatus-card:not(.apparatus-card--supervised):hover::after {
  opacity: 1;
}
.apparatus-card:hover {
  border-color: rgba(128,129,139,0.55);
  box-shadow: 0 6px 32px rgba(0,0,0,0.5);
  filter: grayscale(85%);
}
.apparatus-card--supervised {
  cursor: pointer;
  filter: none;
  border-color: rgba(224,105,47,0.45);
  box-shadow:
    0 0 0 1px rgba(224,105,47,0.25),
    0 0 18px 2px rgba(224,105,47,0.22),
    0 0 40px 6px rgba(224,105,47,0.10);
}
.apparatus-card--supervised:hover {
  filter: none;
  border-color: rgba(224,105,47,0.75);
  box-shadow:
    0 0 0 1px rgba(224,105,47,0.45),
    0 0 24px 4px rgba(224,105,47,0.35),
    0 6px 32px rgba(0,0,0,0.5);
}

.apparatus-card__img-wrap {
  position: relative;
  width: 100%;
  height: 230px;
  background: var(--bg-2);
  overflow: hidden;
}
.apparatus-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s;
}
.apparatus-card:hover .apparatus-card__img-wrap img {
  transform: scale(1.04);
}
.apparatus-card__img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-0) 100%);
  color: var(--bg-3);
}
.apparatus-card__img-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 70px;
  background: linear-gradient(to top, rgba(28,33,32,0.9) 0%, transparent 100%);
  pointer-events: none;
}

/* Effet mosaïque coin bas-gauche */
.apparatus-card__img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 140px;
  height: 100px;
  background:
    repeating-conic-gradient(
      rgba(224, 105, 47, 0.32) 0% 25%,
      rgba(230, 236, 235, 0.797)   0% 50%
    ) 0 0 / 7px 7px;
  -webkit-mask: radial-gradient(ellipse 130% 115% at 0% 100%, black 15%, transparent 65%);
  mask:          radial-gradient(ellipse 130% 115% at 0% 100%, black 15%, transparent 65%);
  pointer-events: none;
  z-index: 1;
}

.apparatus-card__type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  z-index: 2;
}
.apparatus-card__type-badge.supervised {
  background: rgba(224,105,47,0.22);
  border: 1px solid rgba(224,105,47,0.55);
  color: var(--accent);
}
.apparatus-card__type-badge.unsupervised {
  background: rgba(128,129,139,0.22);
  border: 1px solid rgba(128,129,139,0.45);
  color: var(--steel-2);
}

.apparatus-card__body {
  padding: 12px 18px 16px;
}

/* Layout deux colonnes pour les cartes supervisées */
.apparatus-card__body-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.apparatus-card__info {
  flex: 1;
  min-width: 0;
}

/* Stats temps réel (droite) */
.apparatus-card__rt-stats {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
  flex-shrink: 0;
  text-align: right;
  padding-left: 16px;
  margin-left: 16px;
  border-left: 1px solid var(--line);
}
.apparatus-card__rt-label {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.apparatus-card__rt-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.apparatus-card__rt-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 3px;
}

.apparatus-card__ref {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}
.apparatus-card__name {
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dénivelés */
.apparatus-card__elevations {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: nowrap;
}
.apparatus-card__elev-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.apparatus-card__elev-item svg {
  opacity: 0.55;
  flex-shrink: 0;
}
.apparatus-card__elev-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.apparatus-card__elev-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.apparatus-card__footer {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 18px;
}
.apparatus-card__footer svg {
  flex-shrink: 0;
  opacity: 0.65;
  width: 22px;
  height: 22px;
}

/* ── Calendrier tarif kWh ──────────────────────────────────────────────────── */
.tarif-cal {
  margin: 4px 0 8px;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tarif-cal--scroll {
  max-height: calc(100vh - 340px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.tarif-cal--scroll::-webkit-scrollbar { width: 6px; }
.tarif-cal--scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.tarif-cal--scroll::-webkit-scrollbar-track { background: transparent; }
.tarif-cal__year-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 32px;
}
.tarif-cal__year-row {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-bottom: 32px;
}
.tarif-cal__year-lbl {
  flex-shrink: 0;
  width: 72px;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text-2);
  padding-right: 16px;
  text-align: right;
  line-height: 1;
  padding-bottom: 5px;
}
.tarif-cal__year-spacer {
  flex-shrink: 0;
  width: 72px;
}
.tarif-cal__track-row {
  display: flex;
  align-items: stretch;
}
.tarif-cal__track-row--ho {
  margin-top: 8px;
}
.tarif-cal__header {
  flex: 1;
  position: relative;
  height: 26px;
  margin-bottom: 4px;
}
.tarif-cal__month-lbl {
  position: absolute;
  bottom: -26px;
  transform: translateX(-50%);
  font-size: 15px;
  font-family: var(--mono);
  color: var(--text-faint);
  white-space: nowrap;
  pointer-events: none;
}
.tarif-cal__track {
  flex: 1;
  position: relative;
  height: 116px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: visible;
}
.tarif-cal__track--sm {
  height: 72px;
}
.tarif-cal__grid-ln {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--line-2);
  pointer-events: none;
}
.tarif-cal__now {
  position: absolute;
  top: -14px;
  bottom: -6px;
  width: 2px;
  background: var(--accent);
  opacity: 0.75;
  pointer-events: none;
  z-index: 8;
}
.tarif-cal__now-lbl {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--mono);
  color: var(--accent);
  white-space: nowrap;
}
.tarif-cal__bar {
  position: absolute;
  top: 7px;
  height: calc(100% - 14px);
  border-radius: 8px;
  display: flex;
  align-items: stretch;
  cursor: pointer;
  opacity: 0.86;
  transition: opacity 0.14s, box-shadow 0.14s;
  min-width: 28px;
  z-index: 2;
}
.tarif-cal__bar:hover { opacity: 1; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }
.tarif-cal__bar--sel  { opacity: 1; box-shadow: 0 0 0 2px rgba(255,255,255,0.55), 0 4px 16px rgba(0,0,0,0.4); }
.tarif-cal__hnd {
  flex-shrink: 0;
  width: 14px;
  cursor: ew-resize;
  background: rgba(0,0,0,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
}
.tarif-cal__hnd--l { border-radius: 8px 0 0 8px; }
.tarif-cal__hnd--r { border-radius: 0 8px 8px 0; }
.tarif-cal__hnd--l::after { content: '\22EE'; }
.tarif-cal__hnd--r::after { content: '\22EE'; }
.tarif-cal__hnd--open { background: rgba(0,0,0,0.10); }
.tarif-cal__hnd--open::after { content: '\2192'; font-size: 15px; }
.tarif-cal__bar-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 8px;
  overflow: hidden;
  pointer-events: none;
  min-width: 0;
}
.tarif-cal__bar-price {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
  white-space: nowrap;
}
.tarif-cal__bar-dates {
  font-size: 14px;
  font-family: var(--mono);
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
}
.tarif-cal__bar-comment {
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.tarif-cal__del {
  position: absolute;
  top: 6px;
  right: 18px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.42);
  color: #fff;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.14s;
  z-index: 5;
  padding: 0;
  line-height: 1;
}
.tarif-cal__bar:hover .tarif-cal__del,
.tarif-cal__bar--sel  .tarif-cal__del { opacity: 1; }
.tarif-cal__form {
  border-top: 1px solid var(--line-2);
  padding-top: 20px;
  margin-top: 16px;
}

/* ── Champ en erreur (shake + bordure rouge) ─────────────────────────────── */
.input--error {
  border-color: #ef4444 !important;
  animation: input-shake 0.35s ease;
}
@keyframes input-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60%  { transform: translateX(-6px); }
  40%, 80%  { transform: translateX(6px); }
}

/* ── Modal personnalisée ─────────────────────────────────────────────────── */
.app-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.app-modal {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 28px 32px 24px;
  min-width: 320px;
  max-width: 440px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.app-modal__msg {
  font-size: 16px;
  color: var(--text-1);
  line-height: 1.55;
}
.app-modal__btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Modale photo cabine (clic sur la ligne ou le Parc de cabines) ─────────── */
.cabin-photo-modal {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  width: min(560px, 92vw);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.cabin-photo-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.cabin-photo-modal__close {
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}
.cabin-photo-modal__close:hover { color: var(--text); }
.cabin-photo-modal__body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  background: var(--bg-2);
}
.cabin-photo-modal__body img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.cabin-photo-modal__empty {
  padding: 60px 20px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* ── Onglet Contacts ─────────────────────────────────────────────────────── */
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
  max-width: 520px;
}
.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  gap: 12px;
}
.contact-info { display: flex; flex-direction: column; gap: 3px; }
.contact-email { font-size: 17px; font-family: var(--mono); color: var(--text-1); }
.contact-nom   { font-size: 13px; color: var(--text-2); }
.email-suggestion-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-family: var(--mono);
  cursor: pointer;
  width: fit-content;
  transition: background 0.12s;
}
.email-suggestion-chip:hover { background: rgba(var(--accent-rgb, 99,102,241), 0.10); }
.form-error-msg { font-size: 12px; color: #ef4444; }

/* ================================================================
   RESPONSIVE — mobile & tablette
   Le reste de la feuille de style visait un poste fixe (aucune media
   query avant cet ajout). Priorité donnée à la page Supervision
   (graphiques), qui reste consultée depuis un téléphone ; le reste du
   site (topbar, connexion, carte, listes) est aussi rendu utilisable.
   ================================================================ */

/* Le survol n'existe pas au tactile : le nom d'utilisateur et le bouton
   de déconnexion du topbar ne doivent pas dépendre d'un hover qui
   n'arrivera jamais sur téléphone/tablette. */
@media (hover: none) {
  .topbar__user-info { display: flex !important; }
  .topbar__user-logout { display: inline-block !important; margin-left: 8px; }
}

@media (max-width: 860px) {

  /* ── Topbar (partagée par toutes les pages) ──────────────────── */
  .topbar {
    height: auto;
    min-height: 52px;
    padding: 6px 10px;
    flex-wrap: wrap;
    row-gap: 4px;
  }
  .topbar__back { padding: 5px 10px; font-size: 13px; }
  .topbar__brand { gap: 8px; }
  .topbar__brand img { display: none; }
  .topbar__brand .brand__logo { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
  .topbar__brand .brand__name { font-size: 15px; }
  .topbar__divider { display: none; }
  .topbar__crumb {
    order: 5;
    width: 100%;
    font-size: 13px;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .topbar__crumb img { height: 38px !important; margin-left: 0 !important; }
  .topbar__datetime { display: none; }
  /* Le contenu (toggle thème + support + avatar/nom/déconnexion) ne tient
     pas sur la même ligne que le logo une fois le survol désactivé (cf.
     règle @media (hover:none) ci-dessus) : on le passe sur sa propre ligne
     plutôt que de le laisser déborder hors de l'écran. */
  .topbar__right {
    order: 4;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 6px;
  }
  .topbar__support { padding: 6px 10px; font-size: 12px; }
  .topbar__user { padding: 4px 8px 4px 4px; }
  .topbar__user .avatar { width: 28px; height: 28px; font-size: 12px; }
  .topbar__user-name { font-size: 13px; }
  .topbar__user-role { font-size: 10px; }

  /* ── Connexion ────────────────────────────────────────────────── */
  .login { grid-template-columns: 1fr; }
  .login__art { display: none; }
  .login__form-wrap { padding: 28px 20px; }

  /* ── Fiche appareil : schéma de ligne ─────────────────────────────
     La hauteur de .line-region venait d'une ligne de grille en pixels
     fixée par le JS (redimensionnement desktop) ; sur téléphone elle
     écrasait le schéma à quelques dizaines de pixels et les boutons
     positionnés en absolu (Retour / Paramètres / Plan d'évacuation /
     Graphiques de supervision) se retrouvaient superposés dessus. On
     repasse toute la page en flux normal + défilement, et on redonne
     de la place au schéma. */
  .dash {
    grid-template-rows: auto auto auto !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .line-region {
    height: auto;
    min-height: 420px;
    padding: 96px 10px 74px;
  }
  .dash-back-btn { top: 8px !important; left: 8px !important; }
  .dash-params-btn { top: 8px !important; right: 8px !important; }
  .dash-back-btn .topbar__back,
  .dash-params-btn .btn--param { font-size: 12px; padding: 6px 10px; }
  .speed-panel { top: 48px !important; padding: 6px 12px 4px; }
  .speed-bar { gap: 8px; }
  .speed-bar__track { width: 110px; }
  .speed-bar__label, .speed-bar__val, .speed-bar__max { font-size: 10px; }
  .speed-bar__val b { font-size: 13px; }
  /* Boutons du bas : en pleine largeur, côte à côte, plutôt qu'empilés
     en colonne dans le coin (trop petits pour être fiables au tactile). */
  .dash-actions-col {
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    flex-direction: row !important;
    gap: 8px !important;
  }
  .dash-actions-col .btn--param { flex: 1; font-size: 12px; padding: 9px 8px; white-space: nowrap; }
  .dash-action-bar { padding: 6px 14px; font-size: 12px; }

  /* ── Supervision : onglets & barres de filtres ───────────────── */
  .supervision-toolbar { flex-wrap: wrap; gap: 10px; padding: 8px 12px; }
  .sv-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .sv-tab { display: inline-block; font-size: 13px; padding: 7px 14px; }
  .sv-section-bar { padding: 10px 12px; gap: 8px; }
  .sv-daterange { flex-wrap: wrap; row-gap: 6px; }
  .sv-kpi-row { grid-template-columns: repeat(2, 1fr); }

  /* ── Graphiques (onglets Indicateurs vue "Graphiques" et Fréquentation) ── */
  .indic-charts-inline,
  .indic-charts-overlay__body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .indic-chart-panel { flex: none; min-height: 320px; }
  .indic-chart-title { font-size: 14px; }

  .supervision-charts {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(300px, auto);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .chart-card--wide { grid-column: 1; }
  .chart-card__title { font-size: 13px; }

  /* ── Onglet Consommation ─────────────────────────────────────── */
  .conso-wrap { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .conso-top-row { flex-direction: column; }
  .conso-block { flex: none; min-height: 380px; }
  .conso-block__title { font-size: 15px; }
  .conso-kpi-row { flex-wrap: wrap; row-gap: 6px; }
  .conso-kpi-card { flex: 1 1 45%; }
  .conso-kpi-row--compact .conso-kpi-card { width: calc(50% - 4px); }
  .conso-kpi__label, .conso-kpi__val { font-size: 13px; }
  .chl-item { font-size: 12px; }
  .conso-chart-area { margin: 0 8px 10px; padding: 8px 8px 10px; }

  /* ── Onglet Indicateurs — vue "Données" ───────────────────────── */
  .indic-topbar { flex-wrap: wrap; row-gap: 8px; }
  .indic-period-chip { font-size: 14px; }
  .indic-chips-row { grid-template-columns: 1fr; }
  .indic-chip__label { font-size: 14px; }
  .indic-chip__value { font-size: 28px; }
  .indic-main-row { grid-template-columns: 1fr; }
  .indic-panel { padding: 16px 18px; }
  .indic-cost-breakdown { flex-wrap: wrap; gap: 20px; }

  /* ── Carte / accueil ──────────────────────────────────────────── */
  .bottom-region {
    grid-template-columns: 1fr;
    grid-auto-rows: minmax(220px, auto);
    overflow-y: auto;
  }
  .panel + .panel { border-left: none; border-top: 1px solid var(--line); }
  .cabin-grid { grid-template-columns: repeat(2, 1fr); }
  .occ-summary { grid-template-columns: repeat(2, 1fr); }
  .log-row { grid-template-columns: 62px 30px 78px 1fr; gap: 6px; font-size: 11px; }
  .log-row .msg { white-space: normal; }
  .panel__body.log-split { grid-template-columns: 1fr; }
  .log-split__left { border-right: none; border-bottom: 1px solid var(--line); }
  .debit-panel { grid-template-columns: 1fr; }

  /* ── Listes / pages de référence ─────────────────────────────── */
  .apparatus-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .apparatus-list-view { padding: 18px; }
  .apparatus-list-header { flex-wrap: wrap; }
  .ref-page { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .apparatus-grid { grid-template-columns: 1fr; }
  .cabin-grid { grid-template-columns: 1fr; }
  .occ-summary { grid-template-columns: 1fr; }
  .conso-kpi-card { flex: 1 1 100%; }
  .conso-kpi-row--compact .conso-kpi-card { width: 100%; }
  .indic-fill-item__right { flex-wrap: wrap; }
}
