/* AutoParc - Inclick Access
   Design : typographie Geist auto-hébergée, navigation horizontale,
   palette tonale autour du bleu de marque #2FA4E7, modes clair / sombre. */

@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-var-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2026;
}
@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist-var-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-024F, U+1E00-1EFF, U+20AC;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/geistmono-var-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* neutres froids */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --ink: #101520;
  --muted: #5c6573;
  --line: #e3e7ed;
  --row-line: #edf0f5;
  --hover: #f4f7fb;

  /* gamme tonale du bleu de marque : profond pour les actions, vif pour les accents */
  --primary: #0f6fb2;
  --primary-dark: #0b5b93;
  --accent: #2fa4e7;
  --accent-soft: #e5f3fc;
  --accent-deep: #0d5d95;

  --ok: #178a52;
  --ok-soft: #e0f4e9;
  --warn: #96650f;
  --warn-soft: #fbf0d8;
  --danger: #bb2d24;
  --danger-soft: #fce6e4;
  --info: #22608f;
  --info-soft: #e3eef8;
  --chart-grid: #e8ecf2;

  --shadow: 0 1px 2px rgba(16, 21, 32, .05), 0 5px 18px rgba(16, 21, 32, .06);
  --shadow-lift: 0 4px 10px rgba(16, 21, 32, .09), 0 14px 34px rgba(16, 21, 32, .11);

  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Geist', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Geist Mono', Consolas, ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #0c0f15;
  --surface: #131822;
  --surface-2: #1a202c;
  --ink: #e7ebf1;
  --muted: #8b95a5;
  --line: #242c39;
  --row-line: #1f2632;
  --hover: #1b2230;

  --primary: #3badee;
  --primary-dark: #63c1f5;
  --accent: #3badee;
  --accent-soft: #14324e;
  --accent-deep: #9fd6f7;

  --ok: #4fc98a;
  --ok-soft: #123321;
  --warn: #e2b45f;
  --warn-soft: #33270f;
  --danger: #f0786f;
  --danger-soft: #3b1613;
  --info: #7fb9de;
  --info-soft: #14293c;
  --chart-grid: #222a37;

  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 22px rgba(0, 0, 0, .3);
  --shadow-lift: 0 6px 14px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.num { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }

h1, h2, h3 { margin: 0; font-weight: 630; letter-spacing: -0.015em; text-wrap: balance; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.brand-logo { height: 46px; width: auto; display: block; }
[data-theme="dark"] .brand-logo { filter: brightness(1.35) saturate(0.9); }

/* ---------- Connexion ---------- */
.login-screen {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1000px 560px at 88% -12%, var(--accent-soft) 0%, transparent 58%),
    radial-gradient(760px 430px at -12% 112%, var(--info-soft) 0%, transparent 55%),
    var(--bg);
  padding: 24px;
}
.login-panel {
  width: 414px; max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lift);
  padding: 34px;
}
.login-brand { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; margin-bottom: 24px; }
.login-brand .brand-logo { height: 66px; max-width: 100%; }
.login-brand .muted { font-size: 12.5px; }
.login-panel h1 { font-size: 23px; font-weight: 660; margin-bottom: 18px; }
.login-form label { display: block; margin-bottom: 14px; font-weight: 550; }
.login-form .input { margin-top: 6px; }
.login-captcha { margin: 4px 0 14px; }
.login-captcha .captcha-challenge { display: block; font-weight: 550; }
.login-captcha .captcha-challenge .input { margin-top: 6px; max-width: 120px; }
.form-error { color: var(--danger); min-height: 18px; margin: 0 0 10px; font-size: 13px; }
.login-hint { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.login-hint table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.login-hint td { padding: 3px 0; font-size: 12.5px; color: var(--muted); }
.login-hint td.num { text-align: right; color: var(--ink); }

/* ---------- Structure : barre latérale gauche + contenu ---------- */
.app { display: flex; height: 100dvh; overflow: hidden; }

.sidebar {
  width: 234px; flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
  /* Écrans courts (mobile en paysage) : la NAVIGATION défile en interne (voir
     .nav) et le bouton utilisateur reste épinglé en bas ; pas d'overflow ici,
     sinon le menu utilisateur (support / déconnexion) serait rogné. */
  min-height: 0;
  /* Au-dessus de la barre du haut (z-index 40) : le menu utilisateur qui
     s'ouvre vers le haut reste entièrement visible. */
  position: relative;
  z-index: 50;
}
.brand { padding: 2px 8px 20px; }
.brand .brand-logo { height: 46px; max-width: 100%; }
/* Logo d'agence (souvent plus « carré » que le logo MyFleetAccess) : un peu plus grand */
.brand .brand-logo.agency-logo { height: 54px; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; overflow-y: auto; }
.sidebar-foot, .brand { flex: none; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9.5px 11px;
  border: 0; background: none;
  border-radius: var(--radius-sm);
  font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  cursor: pointer; text-align: left; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 620;
}
.nav-ic { width: 19px; height: 19px; display: inline-flex; flex: none; opacity: .85; }
.nav-item.active .nav-ic { opacity: 1; }
.nav-ic svg { width: 100%; height: 100%; }
.nav-dot {
  margin-left: auto;
  min-width: 17px; height: 17px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--danger); color: #fff;
  border-radius: 9px; font-size: 10.5px; font-weight: 700;
}

.sidebar-foot { border-top: 1px solid var(--line); padding-top: 12px; }
.user-chip { display: flex; gap: 10px; align-items: center; padding: 0 4px; }
.user-meta { min-width: 0; }
.user-meta strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta .muted { font-size: 11.5px; }

.user-btn {
  border: 0; background: none; padding: 0;
  cursor: pointer;
  border-radius: 50%;
}
.user-btn .cli-avatar { width: 36px; height: 36px; border-radius: 50%; transition: box-shadow .15s; }
.user-btn:hover .cli-avatar { box-shadow: 0 0 0 3px var(--accent-soft); }
.user-menu { width: 250px; }
.user-menu-head { padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.user-menu-head strong { font-size: 13.5px; }
.user-menu-head .muted { font-size: 12px; }

.body-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 62px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.main { flex: 1; overflow-y: auto; padding: 24px 28px 44px; scroll-behavior: smooth; }
#view { max-width: 1560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Boutons, champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  background: var(--primary); color: #fff;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  font: inherit; font-weight: 560; font-size: 13.5px;
  cursor: pointer; text-decoration: none;
  transition: background .16s, border-color .16s, transform .07s, box-shadow .16s;
}
[data-theme="dark"] .btn { color: #0a1119; }
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn:active { transform: translateY(1px) scale(.99); box-shadow: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--hover); box-shadow: none; }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.btn.big { padding: 12px 24px; font-size: 14.5px; }
.btn.wide { width: 100%; }
.btn.cta { font-weight: 620; }
.btn { white-space: nowrap; }
.btn.wa { color: #128c4b; border-color: #35b26f66; }
[data-theme="dark"] .btn.wa { color: #4fc98a; }
.danger-text { color: var(--danger) !important; }
.link-btn {
  border: 0; background: none; padding: 0;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--accent-deep); cursor: pointer; text-transform: none; letter-spacing: 0;
}
.link-btn:hover { text-decoration: underline; }

.icon-btn {
  min-width: 38px; height: 38px; padding: 0 8px;
  display: inline-grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink); font-size: 18px;
  cursor: pointer;
  transition: background .15s, transform .07s;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.lang { font-size: 12px; font-weight: 700; font-family: var(--mono); }
.bell { position: relative; }
.notif-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 700;
  border-radius: 9px; border: 2px solid var(--surface);
}

.input {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit; font-size: 13.5px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.input.invalid, input.invalid, select.invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent);
  background: var(--danger-soft);
}
textarea.input { resize: vertical; }
.sel { width: auto; min-width: 160px; }
input[type="color"] {
  width: 52px; height: 38px; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer;
}
.color-field { display: flex; align-items: center; gap: 10px; }
.check-inline { display: flex; align-items: center; gap: 7px; margin-top: 7px; font-weight: 480; font-size: 12.5px; color: var(--muted); }
.check-inline input { width: 15px; height: 15px; accent-color: var(--primary); }
.check-inline label { cursor: pointer; }
.photo-preview { display: block; margin-top: 8px; }
.photo-preview img { height: 84px; border-radius: var(--radius-sm); border: 1px solid var(--line); }

.swatch {
  display: inline-block; width: 11px; height: 11px;
  border-radius: 3px; border: 1px solid var(--line);
  vertical-align: -1px;
}

/* ---------- Cartes, listes, tableaux ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 19px 21px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card-head h2 { font-size: 15.5px; }

.pill {
  padding: 2px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px; font-weight: 620;
  font-variant-numeric: tabular-nums;
}
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .input[type="search"] { max-width: 340px; }

.table-wrap { overflow-x: auto; margin: -4px; padding: 4px; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 9px 10px;
  font-size: 11px; font-weight: 620; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10.5px 10px; border-bottom: 1px solid var(--row-line); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr.no-click { cursor: default; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr:last-child td { border-bottom: 0; }

.cell-veh { display: flex; align-items: center; gap: 10px; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.neutral { background: var(--surface-2); color: var(--muted); }
.badge.muted-b { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
.badge.accent-b { background: var(--accent-soft); color: var(--accent-deep); }
.badge.float { position: absolute; top: 10px; right: 10px; }
.badge.wa-badge { background: #e7f8ee; color: #128c4b; font-size: 10px; padding: 2px 6px; }
[data-theme="dark"] .badge.wa-badge { background: #10301d; color: #4fc98a; }

.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--row-line);
}
.list-row:last-child { border-bottom: 0; }
.list-row.clickable { cursor: pointer; border-radius: var(--radius-sm); transition: background .12s; }
.list-row.clickable:hover { background: var(--hover); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.list-main strong { font-size: 13.5px; font-weight: 580; }
.list-main .muted { font-size: 12px; }
.rank {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  background: var(--surface-2); border-radius: 7px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.scroll-y { overflow-y: auto; }
.empty { color: var(--muted); padding: 18px 4px; margin: 0; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.kpi-grid.four { grid-template-columns: repeat(4, 1fr); }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 17px 14px;
  display: flex; flex-direction: column; gap: 3px;
  transition: transform .18s, box-shadow .18s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-value {
  font-size: 23px; font-weight: 680; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.kpi-value.sm { font-size: 17px; }
.kpi-sub { font-size: 11.5px; color: var(--muted); }
.kpi.accent { border-top: 3px solid var(--accent); }
.kpi.ok { border-top: 3px solid var(--ok); }
.kpi.danger { border-top: 3px solid var(--danger); }

.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.dash-cols.three { grid-template-columns: 1fr 1fr 1fr; }
.chart-wrap { height: 260px; }
.chart-wrap.big { height: 320px; }

/* Bande des prochains retours */
.returns-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}
.return-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: transform .15s, box-shadow .15s;
}
.return-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

/* ---------- Entrées animées ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.anim-in { animation: riseIn .45s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(var(--d, 0) * 70ms); }

/* ---------- Carrousel véhicules ---------- */
.carousel-nav { display: flex; gap: 6px; }
.carousel {
  display: flex; gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
}
.veh-card {
  width: 262px; flex: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--surface);
}
.veh-card.lift { transition: transform .2s, box-shadow .2s; }
.veh-card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.veh-visual {
  position: relative;
  height: 132px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #17293f, #33506f);
  overflow: hidden;
}
.veh-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.veh-card.lift:hover .veh-visual img { transform: scale(1.06); }
.veh-glyph { width: 110px; height: 56px; opacity: .95; }
.veh-glyph svg { width: 100%; height: 100%; }
.veh-body { padding: 12px 14px 14px; }
.veh-title strong { display: block; font-size: 14px; font-weight: 600; }
.veh-title .muted { font-size: 11.5px; }
.veh-specs { display: flex; gap: 6px; flex-wrap: wrap; margin: 9px 0 11px; }
.veh-specs span {
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 11.5px; color: var(--muted); font-weight: 480;
}
.veh-foot { display: flex; align-items: center; justify-content: space-between; }
.price { font-weight: 680; font-size: 15.5px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 450; }

.veh-avatar {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #22354d, #46617f);
}
.veh-avatar.sm { width: 34px; height: 34px; font-size: 11px; border-radius: 8px; }
.veh-avatar.photo img { width: 100%; height: 100%; object-fit: cover; }
.cli-avatar {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 700; font-size: 11.5px;
  border-radius: 10px;
}
.cli-avatar.lg { width: 44px; height: 44px; font-size: 14px; }
.cli-avatar.avatar-warn { background: var(--warn-soft); color: var(--warn); }
.cli-avatar.avatar-danger { background: var(--danger-soft); color: var(--danger); }
.row-blacklist td { opacity: .75; }

/* Filtres par période + champs de date compacts */
.period-bar { margin-top: -8px; }
.date-mini { max-width: 170px; }
.risk-box {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px;
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
  border-radius: var(--radius-sm);
}
.risk-box .muted { font-size: 11.5px; }
.danger-check { color: var(--danger); font-weight: 600; }
.danger-check input { accent-color: var(--danger); }

/* ---------- Alertes ---------- */
.alert-ic { width: 20px; height: 20px; flex: none; color: var(--muted); }
.alert-ic svg { width: 100%; height: 100%; }
.alert-ic.big { width: 28px; height: 28px; }
.alert-danger .alert-ic, .alert-ic.alert-danger { color: var(--danger); }
.alert-warn .alert-ic, .alert-ic.alert-warn { color: var(--warn); }
.alert-info .alert-ic, .alert-ic.alert-info { color: var(--info); }

/* ---------- Menus déroulants ---------- */
.menu-anchor { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 282px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 6px;
  display: none;
  z-index: 50;
}
.menu.open { display: block; animation: riseIn .22s cubic-bezier(.16, 1, .3, 1) both; }
.menu.wide-menu { width: 432px; }
.menu-head {
  padding: 8px 10px 6px;
  font-size: 11px; font-weight: 620; color: var(--muted);
  text-transform: uppercase; letter-spacing: .07em;
  display: flex; align-items: center; gap: 8px;
}
.menu-item {
  display: block; width: 100%;
  padding: 9px 10px;
  border: 0; background: none;
  border-radius: var(--radius-sm);
  font: inherit; font-size: 13.5px; color: var(--ink);
  text-align: left; cursor: pointer;
  transition: background .12s;
}
.menu-item:hover { background: var(--hover); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

.notif-row {
  display: flex; gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: background .12s;
}
.notif-row:hover { background: var(--hover); }
.notif-row > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.notif-row .badge { align-self: flex-start; }
.notif-row strong { font-size: 13px; font-weight: 580; }
.notif-row .muted { font-size: 12px; }
.notif-row.unread::after {
  content: '';
  position: absolute; top: 14px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.notif-row.read { opacity: .6; }

/* ---------- Modales ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 15, 26, .52);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 5vh 20px;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-box {
  width: 780px; max-width: 100%;
  max-height: 88vh; overflow-y: auto;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(8, 15, 26, .45);
  padding: 24px 26px;
  animation: riseIn .3s cubic-bezier(.16, 1, .3, 1) both;
}
.modal-photo { margin: -24px -26px 18px; height: 210px; overflow: hidden; border-radius: 16px 16px 0 0; }
.modal-photo img { width: 100%; height: 100%; object-fit: cover; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.modal-head h2 { font-size: 17.5px; }
.modal-actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
}
.detail-grid > div { display: flex; flex-direction: column; gap: 1px; padding: 7px 0; border-bottom: 1px solid var(--row-line); }
.dt { font-size: 11px; color: var(--muted); font-weight: 540; text-transform: uppercase; letter-spacing: .05em; }
.dd { font-size: 13.5px; font-weight: 520; }
.note {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.note.warn-note { border-left: 3px solid var(--warn); }
.note.danger-note { background: var(--danger-soft); border-left: 3px solid var(--danger); color: var(--danger); font-weight: 600; }
.sub { font-size: 12px; margin: 20px 0 8px; color: var(--muted); font-weight: 620; text-transform: uppercase; letter-spacing: .07em; }

/* ---------- Formulaires ---------- */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 550; color: var(--ink); }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid .modal-actions { grid-column: 1 / -1; }

.res-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.res-layout > .card:last-child { grid-column: 1 / -1; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg-btn {
  padding: 7px 14px;
  border: 0; background: none;
  border-radius: 6px;
  font: inherit; font-weight: 540; font-size: 13px; color: var(--muted);
  cursor: pointer;
  transition: background .14s, color .14s;
}
.seg.small .seg-btn { padding: 5px 11px; font-size: 12px; }
.seg-btn.active { background: var(--surface); color: var(--ink); font-weight: 620; box-shadow: 0 1px 4px rgba(16, 21, 32, .16); }

/* Sélecteur niveau d'essence en barres */
.fuel-picker { display: flex; align-items: flex-end; gap: 5px; padding: 6px 0 2px; }
.fuel-bar {
  width: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background .12s, transform .12s, border-color .12s;
}
.fuel-bar:nth-child(1) { height: 14px; } .fuel-bar:nth-child(2) { height: 18px; }
.fuel-bar:nth-child(3) { height: 22px; } .fuel-bar:nth-child(4) { height: 26px; }
.fuel-bar:nth-child(5) { height: 30px; } .fuel-bar:nth-child(6) { height: 34px; }
.fuel-bar:nth-child(7) { height: 38px; } .fuel-bar:nth-child(8) { height: 42px; }
.fuel-bar:hover { transform: translateY(-2px); }
.fuel-bar.on { background: var(--accent); border-color: var(--accent); }
.fuel-val { margin-left: 8px; font-weight: 700; }
.fuel-mini { display: inline-flex; gap: 2px; align-items: flex-end; vertical-align: middle; margin-right: 4px; }
.fuel-mini i { width: 5px; background: var(--line); border-radius: 1px; display: inline-block; }
.fuel-mini i:nth-child(1) { height: 5px; } .fuel-mini i:nth-child(2) { height: 7px; }
.fuel-mini i:nth-child(3) { height: 9px; } .fuel-mini i:nth-child(4) { height: 11px; }
.fuel-mini i:nth-child(5) { height: 13px; } .fuel-mini i:nth-child(6) { height: 15px; }
.fuel-mini i:nth-child(7) { height: 17px; } .fuel-mini i:nth-child(8) { height: 19px; }
.fuel-mini i.on { background: var(--accent); }

.total-box {
  margin-top: 16px;
  padding: 15px 17px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-sm);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.total-box > div { display: flex; flex-direction: column; gap: 2px; }
.total-box span { font-size: 11px; color: var(--muted); font-weight: 540; text-transform: uppercase; letter-spacing: .05em; }
.total-box strong { font-size: 15.5px; font-weight: 680; font-variant-numeric: tabular-nums; }
.total-box .grand strong { font-size: 20px; color: var(--accent-deep); }

/* ---------- Rapports ---------- */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.report-card h2 { font-size: 15.5px; }
.report-card .muted { font-size: 12.5px; }
.report-kpis { display: flex; gap: 28px; margin: 16px 0 18px; }
.report-kpis > div { display: flex; flex-direction: column; gap: 3px; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
}
.toast {
  padding: 11px 16px;
  background: #101724; color: #eaf1f9;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 480;
  box-shadow: var(--shadow-lift);
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  max-width: 380px;
}
[data-theme="dark"] .toast { background: #e7ebf1; color: #101724; }
.toast.show { opacity: 1; transform: none; }
.toast.warn { background: #7a4d08; color: #fff; }

/* ---------- Date picker (flatpickr) ---------- */
.flatpickr-calendar {
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
  background: var(--surface);
  font-family: var(--font);
  overflow: hidden;
}
.flatpickr-months {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  padding: 8px 0 6px;
  border-radius: 14px 14px 0 0;
}
.flatpickr-months .flatpickr-month,
.flatpickr-months .flatpickr-prev-month, .flatpickr-months .flatpickr-next-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year { color: #fff !important; fill: #fff !important; }
.flatpickr-current-month .flatpickr-monthDropdown-months { background: transparent; font-weight: 700; }
.flatpickr-current-month .flatpickr-monthDropdown-months option { color: #101520; }
.flatpickr-months .flatpickr-prev-month:hover svg, .flatpickr-months .flatpickr-next-month:hover svg { fill: #d9f0ff !important; }
.flatpickr-weekdays { background: var(--surface); margin-top: 4px; }
span.flatpickr-weekday { color: var(--muted); font-weight: 620; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.flatpickr-day {
  color: var(--ink);
  border-radius: 9px;
  font-weight: 480;
  border: 0;
  transition: background .12s;
}
.flatpickr-day:hover { background: var(--accent-soft); border-color: transparent; }
.flatpickr-day.today { border: 1px solid var(--accent); background: transparent; }
.flatpickr-day.selected, .flatpickr-day.selected:hover {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 40%, transparent);
}
.flatpickr-day.flatpickr-disabled, .flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
  color: color-mix(in srgb, var(--muted) 45%, transparent);
}
.flatpickr-day.flatpickr-disabled { text-decoration: line-through; }
.flatpickr-calendar.arrowTop::before, .flatpickr-calendar.arrowTop::after { border-bottom-color: var(--primary); }
.flatpickr-calendar.arrowBottom::before, .flatpickr-calendar.arrowBottom::after { border-top-color: var(--surface); }
[data-theme="dark"] .flatpickr-day.selected { color: #0a1119; }

/* ---------- Réactif ---------- */
@media (max-width: 1280px) {
  #exportLabel { display: none; }
}
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-cols, .dash-cols.three { grid-template-columns: 1fr; }
  .res-layout { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}
/* Bouton menu (hamburger) et fond du tiroir : cachés sur bureau */
.menu-btn { display: none; }
.side-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 15, 26, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  z-index: 110;
}
body.nav-open .side-backdrop { opacity: 1; pointer-events: auto; }

/* Tablette : barre latérale resserrée, contenus plus compacts */
@media (max-width: 1024px) {
  .sidebar { width: 208px; padding: 14px 10px 12px; }
  .main { padding: 18px 18px 36px; }
  .topbar { padding: 0 18px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile : la barre latérale devient un tiroir ouvert par le bouton menu */
@media (max-width: 820px) {
  .menu-btn { display: inline-grid; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 272px; max-width: 84vw;
    transform: translateX(-105%);
    transition: transform .25s cubic-bezier(.16, 1, .3, 1);
    z-index: 120;
    padding: 18px 12px 14px;
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lift); }

  .topbar { padding: 0 12px; gap: 8px; height: 58px; }
  .topbar h1 { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .topbar-actions { gap: 6px; }
  .main { padding: 12px 12px 32px; }
  #view { gap: 12px; }

  /* cibles tactiles confortables */
  .btn, .icon-btn { min-height: 40px; }
  .nav-item { padding: 11px; min-height: 42px; }
  .table td { padding: 12px 10px; }

  /* barres d'outils : la recherche prend toute la largeur disponible */
  .toolbar .input[type="search"] { max-width: none; flex: 1 1 160px; }
  .toolbar .sel { flex: 1 1 40%; min-width: 0; }

  /* menus déroulants : jamais plus larges que l'écran */
  .menu, .menu.wide-menu, .menu.user-menu { width: min(432px, calc(100vw - 24px)); }

  /* tableaux : défilement horizontal fluide plutôt qu'écrasement des colonnes */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table { min-width: 720px; }

  /* modales quasi plein écran */
  .modal-overlay { padding: 3vh 8px; }
  .modal-box { padding: 18px 14px; border-radius: 14px; }
  .modal-photo { margin: -18px -14px 14px; height: 160px; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid.four { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 19px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .total-box { grid-template-columns: 1fr 1fr; }
  .returns-strip { grid-template-columns: 1fr; }
  .carousel .veh-card { width: 236px; }
  .chart-wrap.big { height: 240px; }
  .report-kpis { flex-wrap: wrap; gap: 14px; }
  .card { padding: 15px 14px; }
}

/* Très petits écrans : thème et langue passent dans le menu du profil */
@media (max-width: 560px) {
  #langBtn, #themeBtn { display: none; }
  .fuel-bar { width: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Profil dans la barre latérale ---------- */
.side-user {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 9px;
  border: 0; background: none;
  border-radius: var(--radius-sm);
  font: inherit; text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.side-user:hover { background: var(--hover); }
.side-user .user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.side-user .user-meta strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .user-meta .muted { font-size: 11.5px; }
.side-user .chev { color: var(--muted); flex: none; }

/* Menus ancrés vers le haut (pied de barre latérale) ou alignés à gauche (cartes) */
.menu.menu-up { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; }
.menu.menu-left { left: 0; right: auto; }


/* ================================================================
   CALQUE D'ÉLÉVATION PREMIUM « Aurora » (high-end-visual-design)
   Profondeur haptique, dégradés d'accent bleu→cyan, verre dépoli,
   motion à ressort. N'altère aucune structure : apparence seule.
   Pour revenir en arrière, supprimer tout ce bloc.
   ================================================================ */

:root {
  --grad-primary: linear-gradient(135deg, #0e5f9c 0%, #1e8ac9 100%);
  --grad-accent: linear-gradient(135deg, #2fa4e7 0%, #22d3ee 100%);
  --ease-spring: cubic-bezier(.32, .72, 0, 1);
  --shadow: 0 1px 2px rgba(16, 33, 60, .05), 0 10px 26px -8px rgba(16, 33, 60, .12);
  --shadow-lift: 0 2px 6px rgba(16, 33, 60, .08), 0 24px 50px -14px rgba(16, 46, 90, .24);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .7);
}
[data-theme="dark"] {
  --grad-primary: linear-gradient(135deg, #2fa4e7 0%, #5fc0f5 100%);
  --grad-accent: linear-gradient(135deg, #3badee 0%, #4fd6e8 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px -8px rgba(0, 0, 0, .5);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .5), 0 28px 56px -14px rgba(0, 0, 0, .62);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* Voile aurora fixe derrière le contenu qui défile (aucun repaint : background local) */
.main {
  background:
    radial-gradient(1200px 620px at 100% -6%, color-mix(in srgb, var(--accent) 11%, transparent) 0%, transparent 56%),
    radial-gradient(1020px 560px at -8% 6%, color-mix(in srgb, #22d3ee 9%, transparent) 0%, transparent 52%),
    var(--bg);
}

/* Barre du haut : verre dépoli translucide */
.topbar {
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}

/* Barre latérale : surface translucide, item actif en dégradé + liseré */
.sidebar {
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
}
.nav-item { border-radius: 11px; transition: background .25s var(--ease-spring), color .25s var(--ease-spring); }
.nav-item.active { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-deep); position: relative; }
.nav-item.active::before {
  content: ''; position: absolute; left: 3px; top: 22%; bottom: 22%;
  width: 3px; border-radius: 3px; background: var(--grad-accent);
}

/* Cartes : double-biseau (ombre teintée + liseré interne haut), coins premium */
.card, .kpi {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  box-shadow: var(--shadow), var(--hi);
  border-radius: 18px;
}
.card { transition: transform .4s var(--ease-spring), box-shadow .4s var(--ease-spring); }

/* KPI : barre d'accent dégradée en haut + halo au survol */
.kpi { position: relative; overflow: hidden; transition: transform .4s var(--ease-spring), box-shadow .4s var(--ease-spring); }
.kpi::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad-accent); opacity: .5;
}
.kpi.accent, .kpi.ok, .kpi.danger { border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent); }
.kpi.accent::before { opacity: 1; }
.kpi.ok::before { background: linear-gradient(135deg, var(--ok), #34d399); opacity: 1; }
.kpi.danger::before { background: linear-gradient(135deg, var(--danger), #fb7185); opacity: 1; }
.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift), var(--hi), 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}
.kpi-value { font-size: 25px; letter-spacing: -0.035em; }

/* Boutons : dégradé premium, ressort à la pression, halo maîtrisé */
.btn {
  background: var(--grad-primary); border-color: transparent; border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 4px 12px -4px color-mix(in srgb, var(--primary) 45%, transparent);
  transition: transform .25s var(--ease-spring), box-shadow .25s var(--ease-spring), filter .25s var(--ease-spring);
}
.btn:hover {
  filter: brightness(1.06) saturate(1.05); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 9px 24px -6px color-mix(in srgb, var(--primary) 55%, transparent);
}
.btn:active { transform: translateY(0) scale(.97); }
.btn.ghost { background: var(--surface); box-shadow: var(--shadow); }
.btn.ghost:hover { background: var(--hover); filter: none; box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.btn.cta { border-radius: 999px; padding-left: 18px; padding-right: 18px; }
.btn.wa { background: linear-gradient(135deg, #0f9d58, #22c55e); color: #fff; }

.icon-btn { border-radius: 11px; transition: background .22s var(--ease-spring), transform .22s var(--ease-spring), box-shadow .22s var(--ease-spring); }
.icon-btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

/* Champs : coins doux */
.input { border-radius: 11px; }

/* Menus + modales : verre dépoli */
.menu {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(20px);
  -webkit-backdrop-filter: saturate(1.4) blur(20px);
  border-color: color-mix(in srgb, var(--line) 66%, transparent);
  border-radius: 16px;
}
.modal-box {
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  box-shadow: var(--shadow-lift), var(--hi);
  border-radius: 22px;
}
.modal-overlay { background: color-mix(in srgb, #081019 55%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* Avatars client : pastille dégradée de marque (sauf états risque / blacklist) */
.cli-avatar:not(.avatar-warn):not(.avatar-danger) { background: var(--grad-accent); color: #fff; }
[data-theme="dark"] .cli-avatar:not(.avatar-warn):not(.avatar-danger) { color: #06202e; }

/* Léger relief sur les pastilles */
.pill { box-shadow: var(--hi); }

/* Entrée : fondu ascendant avec micro-flou (motion premium) */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.anim-in { animation: riseIn .6s var(--ease-spring) both; animation-delay: calc(var(--d, 0) * 65ms); }

/* Carrousel + tuiles : ressort au survol, coins premium */
.veh-card { border-radius: 18px; }
.veh-card.lift { transition: transform .4s var(--ease-spring), box-shadow .4s var(--ease-spring); }
.return-tile { transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease-spring); }

@media (prefers-reduced-motion: reduce) {
  @keyframes riseIn { from { opacity: 0; } to { opacity: 1; } }
}

/* Contraste AA garanti du texte blanc sur boutons (extrémité claire assombrie) */
:root { --grad-primary: linear-gradient(135deg, #0d5992 0%, #1878b0 100%); }

/* Perf : barre latérale en surface pleine (pas de flou sur grande zone) */
.sidebar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* CTA « button-in-button » : libellé + flèche dans un cercle imbriqué (tension kinétique) */
.btn.cta { gap: 4px; padding-right: 5px; }
.btn.cta .cta-label { padding-left: 6px; }
.btn.cta .cta-orb {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  transition: transform .3s var(--ease-spring), background .3s var(--ease-spring);
}
[data-theme="dark"] .btn.cta .cta-orb { background: rgba(6, 17, 25, .22); color: #06202e; }
.btn.cta:hover .cta-orb { transform: rotate(90deg) scale(1.06); background: rgba(255, 255, 255, .28); }
[data-theme="dark"] .btn.cta:hover .cta-orb { background: rgba(6, 17, 25, .3); }

/* CTA : hauteur ajustée pour s'insérer proprement dans la barre du haut (~42px) */
.btn.cta { padding-top: 6px; padding-bottom: 6px; }
.btn.cta .cta-orb { width: 26px; height: 26px; }

/* Réaffirme le dégradé clair des boutons en mode sombre (texte foncé lisible) — doit rester le DERNIER */
[data-theme="dark"] { --grad-primary: linear-gradient(135deg, #2fa4e7 0%, #5fc0f5 100%); }

/* Correctif empilement : la barre du haut (et ses menus) doit passer AU-DESSUS du contenu */
.topbar { position: relative; z-index: 40; }
.menu { z-index: 60; }

/* ===== Ajustements MyFleetAccess (8 juil.) ===== */
/* Alternative accessible des graphiques : tableau masqué visuellement */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* Menus du header (notifications / export / profil) : opaques, sans transparence ni flou */
.menu { background: var(--surface) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
/* Thème et langue restent accessibles dans la barre du haut, même sur petit écran */
@media (max-width: 560px) { #langBtn, #themeBtn { display: inline-grid !important; } }

/* Correctif responsive : permet aux cartes en grille/flex de rétrécir sous la largeur
   de leur contenu (sinon une table large gonfle la carte et déborde) → la table défile en interne */
#view > *, .dash-cols > *, .res-layout > * { min-width: 0; }
.card { min-width: 0; }

/* ===== Modale des abonnements (quota + tarifs) ===== */
.modal-box.modal-xl { width: 1060px; }
.quota-ic { color: var(--warn); display: inline-flex; }
.billing-seg { margin: 2px 0 16px; }
.billing-seg .seg-btn { display: inline-flex; align-items: center; gap: 7px; }
.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; margin-top: 4px; }
.plan-card {
  position: relative;
  display: flex; flex-direction: column; gap: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 18px 18px;
  background: var(--surface);
  box-shadow: var(--shadow), var(--hi);
}
.plan-card.popular {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent), var(--shadow-lift), var(--hi);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 55%);
}
.plan-pop {
  position: absolute; top: 14px; right: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--grad-accent); color: #fff;
  font-size: 11px; font-weight: 700;
}
[data-theme="dark"] .plan-pop { color: #06202e; }
.plan-card h3 { font-size: 19px; }
.plan-desc { font-size: 12.5px; min-height: 34px; margin: 0; }
.plan-price { display: flex; align-items: baseline; gap: 2px; }
.plan-price .cur { font-size: 20px; font-weight: 660; }
.plan-price .amount { font-size: 38px; font-weight: 740; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.plan-price .per { color: var(--muted); font-size: 14px; margin-left: 2px; }
.plan-note { font-size: 12px; }
.plan-feats { list-style: none; margin: 12px 0 16px; padding: 12px 0 0; border-top: 1px solid var(--row-line); display: flex; flex-direction: column; gap: 9px; flex: 1; }
.plan-feats li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; }
.plan-feats .chk {
  width: 19px; height: 19px; flex: none; margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center;
}
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; filter: none !important; }
@media (max-width: 900px) {
  .plans-grid { grid-template-columns: 1fr; }
  .modal-box.modal-xl { width: 100%; }
  .plan-desc { min-height: 0; }
}

/* ===== Confirmations, facture, contraintes images, menus mobiles centrés ===== */
.confirm-overlay { z-index: 160; align-items: center; }
.confirm-box { width: 470px; }
.btn.btn-danger { background: linear-gradient(135deg, #b3261e, #d9534f); border-color: transparent; color: #fff; }
/* Contrôles natifs (calendriers de secours, selects, scrollbars) au thème */
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
/* Champ fichier : zone de clic limitée au composant, note rouge dessous */
.form-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 550; color: var(--ink); }
.file-input { cursor: pointer; }
.img-hint { color: var(--danger); font-size: 11.5px; font-weight: 500; }
/* Facture d'abonnement (espace client) */
.invoice-box {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; margin-top: 10px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
/* Menus notifications / export centrés à l'écran sur mobile */
@media (max-width: 820px) {
  #notifMenu, #exportMenu {
    position: fixed; left: 50%; top: 68px;
    transform: translateX(-50%);
    width: min(432px, calc(100vw - 20px));
    max-height: 72vh; overflow-y: auto;
  }
  #notifMenu.open, #exportMenu.open { animation: none; }
  .confirm-box { width: 100%; }
}

/* Topbar mobile compacte : le bouton « Réserver » devient une pastille « + »
   et « Exporter » passe en icône seule, pour que la cloche de notifications
   reste entièrement visible et que le titre de page garde de la place.
   (Bloc en FIN de fichier : il doit l'emporter sur la couche visuelle .btn.cta.) */
@media (max-width: 560px) {
  .btn.cta { padding: 4px; gap: 0; min-height: 34px; }
  .btn.cta .cta-label { display: none; }
  .btn.cta .cta-orb { width: 26px; height: 26px; }
  #exportBtn { padding: 6px 9px; min-height: 36px; }
  #exportBtn #exportLabel { display: none; }
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar-actions { gap: 5px; flex: none; }
  .icon-btn { min-height: 36px; }
  /* le badge de notifications reste dans l'écran */
  .notif-badge { right: -2px; top: -2px; }
}

/* ===== Calendrier des locations : timeline horizontale (style ClickUp) ===== */
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-label { min-width: 128px; text-align: center; font-size: 14px; text-transform: capitalize; }
/* Conteneur défilant de gauche à droite : tout le mois sur UNE ligne */
.tl-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); scrollbar-width: thin; }
.tl { position: relative; }
/* En-tête : jour de la semaine au-dessus de la date, colonnes côte à côte */
.tl-head { display: grid; background: var(--bg); border-bottom: 1px solid var(--line); }
.tl-day { display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 0 5px; border-right: 1px solid var(--line); }
.tl-day:last-child { border-right: none; }
.tl-day.we { background: rgba(125, 135, 150, .10); }
.tl-dow { font-style: normal; font-size: 10px; font-weight: 600; color: var(--muted); text-transform: capitalize; }
.tl-num { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--ink);
  display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; }
.tl-day.today .tl-num { background: var(--accent); color: #fff; }
.tl-day.today .tl-dow { color: var(--accent); }
/* Corps : pistes de barres continues, colonnes-jours dessinées en fond.
   Hauteur généreuse pour une lecture confortable (barres sur deux lignes). */
.tl-body { position: relative; display: grid; row-gap: 6px; padding: 12px 0 14px; min-height: 190px;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-position: -1px 0; }
/* Repère « aujourd'hui » : trait vertical rouge sur toute la hauteur */
.tl-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #e25246;
  opacity: .65; pointer-events: none; z-index: 1; }
.cal-bar { position: relative; z-index: 2; border: none; cursor: pointer; margin: 0 3px; padding: 3px 10px;
  height: 36px; font-size: 11px; font-weight: 600; font-family: inherit; color: #fff; border-radius: 11px;
  overflow: hidden; white-space: nowrap; text-align: left; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  box-shadow: 0 1px 3px rgba(10, 20, 35, .22); transition: transform .12s, box-shadow .12s, filter .12s; }
.cal-bar-l1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; }
.cal-bar-l1 strong { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.cal-bar-plate { flex: none; font-size: 9.5px; font-weight: 700; letter-spacing: .4px;
  background: rgba(255, 255, 255, .22); border-radius: 4px; padding: 0 4px; line-height: 13px; }
.cal-bar-l2 { font-size: 10px; font-weight: 600; opacity: .9; overflow: hidden; text-overflow: ellipsis; }
/* La barre « répond » au survol / focus (lift) */
.cal-bar:hover, .cal-bar:focus-visible { filter: brightness(1.08); transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(10, 20, 35, .3); outline: 2px solid rgba(255, 255, 255, .55); outline-offset: -2px; }
.cal-bar.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.cal-bar.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }

/* Tuile « taux d'occupation » du mois affiché (sous le bouton Aujourd'hui) */
.cal-occ { display: flex; justify-content: flex-end; margin: 2px 0 10px; }
.cal-occ-tile { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); max-width: 100%; }
.cal-occ-label { font-size: 12px; color: var(--muted); text-transform: none; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.cal-occ-meter { flex: none; width: 120px; height: 6px; border-radius: 3px;
  background: var(--accent-soft, rgba(47, 164, 231, .18)); overflow: hidden; }
.cal-occ-meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent);
  transition: width .4s ease; }
.cal-occ-value { font-size: 15px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.cal-occ-value span { font-size: 11px; font-weight: 600; color: var(--muted); }

/* Info-bulle riche des locations (suit le pointeur, thème clair/sombre) */
.tl-tip { position: fixed; z-index: 300; min-width: 220px; max-width: 300px; padding: 11px 13px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 11px;
  box-shadow: 0 10px 28px rgba(8, 14, 24, .22), 0 2px 6px rgba(8, 14, 24, .14);
  font-size: 12px; pointer-events: none; }
.tl-tip-head { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.tl-tip-key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.tl-tip-status { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.tl-tip-id { margin-left: auto; color: var(--muted); font-size: 11px; }
.tl-tip-veh { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.tl-tip-veh strong { font-size: 14px; }
.tl-tip-plate { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; line-height: 15px; }
.tl-tip-row { display: flex; align-items: baseline; gap: 10px; padding: 2.5px 0; }
.tl-tip-label { flex: none; width: 64px; color: var(--muted); font-size: 11px; }
.tl-tip-value { min-width: 0; }
strong.tl-tip-value { font-weight: 650; }
.tl-tip-hint { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 10.5px; }
.cal-bar.st-en_cours { background: linear-gradient(135deg, #2fa4e7, #2f7fd6); }
.cal-bar.st-a_venir { background: linear-gradient(135deg, #f0a92e, #db8e26); }
.cal-bar.st-retard { background: linear-gradient(135deg, #e25246, #c93a30); }
.cal-bar.st-terminee { background: linear-gradient(135deg, #3bb273, #2c9560); }
.cal-legend { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.cal-key { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.cal-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-dot.st-a_venir { background: #f0a92e; }
.cal-dot.st-en_cours { background: #2fa4e7; }
.cal-dot.st-retard { background: #e25246; }
.cal-dot.st-terminee { background: #3bb273; }
@media (max-width: 700px) {
  .cal-bar { font-size: 10px; padding: 0 4px; }
  .cal-label { min-width: 0; }
}

/* ===== Photos de profil (utilisateurs et clients) ===== */
.cli-avatar { overflow: hidden; }
.cli-avatar img, .u-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.u-avatar { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
  background: var(--grad-accent); color: #fff; flex: none; }
[data-theme="dark"] .u-avatar { color: #06202e; }
.photo-preview.round img { border-radius: 50%; width: 64px; height: 64px; object-fit: cover; }

/* ===== Documents clients (preuves, pièces, visa…) ===== */
.doc-box { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; }
.doc-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.doc-field:last-child { border-bottom: none; }
.doc-name { flex: 1 1 180px; font-size: 13px; font-weight: 600; }
.doc-input { font-size: 12px; max-width: 220px; }
.doc-list { border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; margin-bottom: 8px; }
.doc-lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(8, 12, 20, .78);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.doc-lightbox figure { margin: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; max-width: min(860px, 94vw); }
.doc-lightbox figcaption { color: #fff; font-weight: 600; }
.doc-lightbox img { max-width: 100%; max-height: 78vh; border-radius: 10px; background: #fff; }

/* ===== Formulaires : montée en gamme visuelle ===== */
.form-grid { gap: 14px 18px; }
.form-grid label, .form-grid .form-field > span:first-child {
  font-size: 12px; font-weight: 640; color: var(--muted); letter-spacing: .015em;
}
.form-grid label { gap: 6px; }
.input {
  padding: 10px 12px; border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:hover:not(:focus) { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
textarea.input { min-height: 64px; }

/* Sélecteurs : chevron bleu personnalisé */
select.input {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fa4e7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}

/* Cases à cocher et boutons radio aux couleurs de l'application */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.check-inline { display: inline-flex; align-items: center; gap: 7px; margin-top: 7px; font-size: 12.5px; color: var(--ink); font-weight: 500; }
.check-inline label { cursor: pointer; }

/* Champs fichier : bouton de sélection assorti */
.file-input { padding: 8px 10px; cursor: pointer; }
.file-input::file-selector-button {
  font: inherit; font-size: 12px; font-weight: 640;
  color: var(--accent-deep); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 8px; padding: 6px 12px; margin-right: 10px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.file-input::file-selector-button:hover { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }

/* Champs date (flatpickr) : icône calendrier bleue, curseur main */
.fp-alt, .date-input, .date-mini {
  padding-right: 34px !important; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fa4e7' stroke-width='1.9' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4m8-4v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px;
}

/* ===== Listes déroulantes au thème bleu / blanc (composant .ds) ===== */
.ds { position: relative; display: block; width: 100%; }
/* Le <select> natif reste présent (FormData, validation) mais invisible */
.ds-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; pointer-events: none; appearance: none; -webkit-appearance: none;
  background: none !important; border: 0 !important; padding: 0 !important;
}
.ds-btn {
  display: flex; align-items: center; gap: 8px;
  text-align: left; cursor: pointer; font: inherit; font-size: 13.5px;
  padding-right: 34px !important; position: relative;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fa4e7' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 14px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.ds-btn .ds-val { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-btn.placeholder .ds-val { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.ds-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.ds-btn:focus-visible, .ds-btn.open {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.ds-btn.open { background-color: var(--surface); }
.ds-btn:disabled { opacity: .6; cursor: not-allowed; }
/* Le panneau vit dans <body> : jamais rogné par une modale qui défile */
.ds-panel {
  position: fixed; z-index: 400;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  padding: 5px;
  overflow-y: auto; overscroll-behavior: contain;
  animation: riseIn .16s cubic-bezier(.16, 1, .3, 1) both;
  scrollbar-width: thin;
}
.ds-opt {
  padding: 8px 11px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .12s, color .12s;
}
.ds-opt:hover, .ds-opt.hi { background: var(--accent-soft); color: var(--accent-deep); }
.ds-opt.sel {
  background: var(--grad-accent, var(--accent)); color: #fff; font-weight: 620;
}
[data-theme="dark"] .ds-opt.sel { color: #06202e; }
.ds-opt.sel::after {
  content: '✓'; float: right; margin-left: 10px; font-weight: 700;
}
.ds-opt.off { opacity: .45; cursor: not-allowed; }
.ds-opt.off:hover { background: none; color: var(--ink); }
/* Barre d'outils : les listes gardent leur largeur automatique */
.toolbar .ds, .card-head .ds { width: auto; }
.toolbar .ds .ds-btn, .card-head .ds .ds-btn { min-width: 150px; }

/* Miniature de profil cliquable (photo en grand, comme WhatsApp) */
.cli-avatar.zoomable { cursor: zoom-in; transition: transform .15s, box-shadow .15s; }
.cli-avatar.zoomable:hover { transform: scale(1.06); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ===== Badge « Licence PSV » (toutes les visualisations de voitures) ===== */
.badge.psv {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  font-weight: 700; letter-spacing: .02em;
}
[data-theme="dark"] .badge.psv { color: #7fd0ff; }
.badge.float-l { position: absolute; top: 10px; left: 10px; }
/* Dans une barre du calendrier / info-bulle : version compacte */
.tl-tip .badge.psv { font-size: 9.5px; padding: 1px 6px; }

/* ===== Bandeau permanent « période d'essai » (haut de l'application) ===== */
.trial-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 13px; font-weight: 550;
  flex: none; position: relative; z-index: 35;
}
.trial-banner .trial-ic { flex: none; font-size: 15px; }
.trial-banner .trial-txt { flex: 1 1 auto; min-width: 0; }
.trial-banner .btn { flex: none; }
.trial-banner.expired {
  background: var(--danger-soft);
  color: var(--danger);
  border-bottom-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
[data-theme="dark"] .trial-banner { color: #8fd4ff; }
[data-theme="dark"] .trial-banner.expired { color: #ff9d94; }
@media (max-width: 700px) {
  .trial-banner { flex-wrap: wrap; font-size: 12px; padding: 8px 12px; }
}

/* ===== Modale des abonnements : tenir dans la fenêtre, jamais de défilement
   horizontal (mobile et tablette) ===== */
/* Les modales défilent verticalement seulement : plus de barre latérale */
.modal-box { overflow-x: hidden; }
/* minmax(0, 1fr) : les colonnes peuvent devenir plus étroites que leur contenu,
   sinon un libellé long élargit la grille au-delà de la modale. */
.plans-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.plan-card { min-width: 0; }
/* Les textes longs se coupent proprement au lieu de pousser la colonne */
.plan-card h3, .plan-desc, .plan-note, .plan-feats li, .plan-feats li span { overflow-wrap: break-word; min-width: 0; }
.plan-price { flex-wrap: wrap; }
.plan-price .amount { font-size: clamp(26px, 3.2vw, 38px); }
/* Bascule mensuel / annuel : passe à la ligne au lieu de déborder */
.billing-seg { flex-wrap: wrap; max-width: 100%; }
.billing-seg .seg-btn { white-space: normal; }

/* Tablette portrait / paysage étroit : deux colonnes lisibles, puis une seule */
@media (max-width: 1100px) {
  .plan-card { padding: 18px 14px 16px; }
  .plan-desc { min-height: 0; }
}
@media (max-width: 900px) {
  .plans-grid { grid-template-columns: 1fr; }
  .modal-box.modal-xl { width: 100%; }
  .plan-card { padding: 18px 16px 16px; }
}
@media (max-width: 560px) {
  .billing-seg { display: flex; }
  .billing-seg .seg-btn { flex: 1 1 auto; text-align: center; padding: 8px 10px; font-size: 12px; }
  .plan-price .amount { font-size: 32px; }
}


/* ================================================================
   IDENTITÉ VISUELLE — d'après la maquette de référence
   Vert forêt profond sur fond gris-vert très clair, cartes à grand
   rayon, barre latérale en sections, profil en barre du haut,
   graphiques à barres en pilules et jauge circulaire.
   Ce bloc est le DERNIER de la feuille : il prime sur les calques
   précédents. Pour revenir en arrière, le supprimer entièrement.
   ================================================================ */

:root {
  --bg: #eff1ef;
  --surface: #ffffff;
  --surface-2: #f4f6f4;
  --ink: #121714;
  --muted: #5c665f;
  --line: #e3e7e4;
  --row-line: #eef1ef;
  --hover: #f4f7f5;

  --accent: #15663d;          /* vert forêt : aplat + texte blanc */
  --accent-2: #43a06b;        /* vert clair : second niveau des graphiques */
  --accent-ink: #ffffff;
  --accent-soft: #e6f0ea;
  --accent-deep: #0e4a2b;
  --primary: #15663d;
  --primary-dark: #0f5231;

  --grad-primary: linear-gradient(135deg, #177144 0%, #125a35 100%);
  --grad-accent: linear-gradient(135deg, #2b8b57 0%, #15663d 100%);

  --chart-grid: #e8ebe9;
  --shadow: 0 1px 2px rgba(16, 26, 21, .04), 0 6px 20px rgba(16, 26, 21, .06);
  --shadow-lift: 0 6px 16px rgba(16, 26, 21, .09), 0 20px 44px rgba(16, 26, 21, .12);

  --radius: 20px;
  --radius-sm: 12px;
}

[data-theme="dark"] {
  --bg: #0d100e;
  --surface: #161a18;
  --surface-2: #1e2320;
  --ink: #eef2ef;
  --muted: #8b958f;
  --line: #272d29;
  --row-line: #222724;
  --hover: #1f2522;

  --accent: #2f9d64;
  --accent-2: #58c489;
  --accent-ink: #06170e;
  --accent-soft: #12291d;
  --accent-deep: #7fd3a5;
  --primary: #2f9d64;
  --primary-dark: #38b374;

  --grad-primary: linear-gradient(135deg, #2f9d64 0%, #238853 100%);
  --grad-accent: linear-gradient(135deg, #58c489 0%, #2f9d64 100%);

  --chart-grid: #262c29;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 8px 26px rgba(0, 0, 0, .38);
  --shadow-lift: 0 8px 18px rgba(0, 0, 0, .5), 0 22px 48px rgba(0, 0, 0, .42);
}

/* ---- Actions ---- */
.btn {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  border-radius: 999px; font-weight: 600;
}
[data-theme="dark"] .btn { color: var(--accent-ink); }
.btn:hover {
  background: var(--primary-dark); border-color: var(--primary-dark);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); box-shadow: none; }
.btn.danger-text { color: var(--danger); }
.btn.big { padding: 13px 26px; }
.icon-btn { border-radius: 999px; }

/* ---- Barre latérale : sections, repère vert sur l'onglet actif ---- */
.sidebar { background: var(--surface); }
.nav { gap: 2px; }
.nav-section {
  display: block; margin: 16px 0 6px; padding: 0 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); opacity: .75;
}
.nav-section:first-child { margin-top: 2px; }
.nav-item { border-radius: 10px; padding: 10px 12px; position: relative; }
.nav-item.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 660; }
.nav-item.active::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item.active .nav-ic { opacity: 1; color: var(--accent); }
.nav-txt { flex: 1 1 auto; text-align: left; }

/* ---- Carte d'abonnement en pied de barre latérale ---- */
.sidebar-foot { border-top: none; padding-top: 8px; }
.side-card {
  display: flex; flex-direction: column; gap: 3px;
  background: #14181a; color: #f2f5f3;
  border-radius: 16px; padding: 14px 15px 15px;
}
.side-card.hidden { display: none; }
.side-card-label { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .6; }
.side-card-title { font-size: 15px; font-weight: 660; }
.side-card-sub { font-size: 11.5px; opacity: .68; margin-bottom: 9px; }
.side-card .btn { padding: 7px 12px; font-size: 12px; }

/* ---- Barre du haut : profil photo + nom + e-mail ---- */
.topbar-spacer { flex: 1 1 auto; }
.top-user {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 999px;
  font: inherit; color: var(--ink); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.top-user:hover { background: var(--hover); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.top-user .cli-avatar { width: 34px; height: 34px; flex: none; }
.top-user .user-meta { display: flex; flex-direction: column; line-height: 1.25; text-align: left; min-width: 0; }
.top-user .user-meta strong { font-size: 13px; font-weight: 640; }
.top-user .user-meta .muted { font-size: 11px; }
.top-user .chev { color: var(--muted); flex: none; }
.menu.menu-left { right: 0; left: auto; }
@media (max-width: 900px) {
  .top-user .user-meta { display: none; }
  .top-user { padding: 4px; }
}

/* ---- En-tête de page : titre, sous-titre, actions ---- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin: 0 0 18px;
}
.page-head-txt { min-width: 0; }
.page-head h1 { font-size: 30px; font-weight: 720; letter-spacing: -0.035em; margin: 0; line-height: 1.15; }
.page-sub { margin: 5px 0 0; font-size: 13.5px; color: var(--muted); max-width: 62ch; }
.page-actions { display: flex; align-items: center; gap: 9px; flex: none; }
@media (max-width: 700px) {
  .page-head h1 { font-size: 23px; }
  .page-sub { font-size: 12.5px; }
}

/* ---- Indicateurs : première carte pleine, pastille d'accès, badge ---- */
.kpi { border-radius: var(--radius); padding: 17px 18px 15px; gap: 8px; }
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 12.5px; font-weight: 560; }
.kpi-go {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.kpi-go svg { width: 11px; height: 11px; }
.kpi[data-kpi-go] { cursor: pointer; }
.kpi[data-kpi-go]:hover .kpi-go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kpi-value { font-size: 30px; font-weight: 720; letter-spacing: -0.045em; line-height: 1.05; }
.kpi-value.sm { font-size: 19px; }
.kpi-cur { font-style: normal; font-size: .44em; font-weight: 600; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.kpi-delta { font-size: 11.5px; color: var(--muted); }
.kpi::before { display: none; }
.kpi.accent, .kpi.ok, .kpi.danger, .kpi.featured { border-top: 1px solid var(--line); }
/* Carte mise en avant : aplat vert, texte blanc (comme la maquette) */
.kpi.featured { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kpi.featured .kpi-label,
.kpi.featured .kpi-delta,
.kpi.featured .kpi-cur { color: color-mix(in srgb, var(--accent-ink) 92%, transparent); }
.kpi.featured .kpi-go { border-color: color-mix(in srgb, var(--accent-ink) 40%, transparent); color: var(--accent-ink); }
.kpi.featured:hover .kpi-go { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }

/* ---- Rangée analytique : graphique large + jauge ---- */
.dash-cols.analytics { display: grid; grid-template-columns: 1.9fr 1fr; gap: 14px; align-items: stretch; }
@media (max-width: 1100px) { .dash-cols.analytics { grid-template-columns: 1fr; } }

/* Graphique à barres en pilules */
.wk-chart { width: 100%; height: 210px; display: block; margin-top: 4px; overflow: visible; }
.wk-bar.on { fill: var(--accent); }
.wk-bar.on.today { fill: var(--accent-2); }
.wk-bar.off { fill: url(#wkHatch); }
.wk-hatch-line { stroke: var(--line); }
.wk-lbl { fill: var(--muted); font-size: 13px; font-weight: 600; font-family: var(--font); }
.wk-total { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }

/* Jauge circulaire d'occupation */
.gauge-card { display: flex; flex-direction: column; }
.gauge-wrap { display: grid; place-items: center; flex: 1 1 auto; }
.gauge { width: 100%; max-width: 230px; height: auto; }
.gauge-track { stroke: url(#gaHatch); }
.gauge-fill { stroke: var(--accent); }
.gauge-pct { fill: var(--ink); font-size: 34px; font-weight: 720; letter-spacing: -0.04em; font-family: var(--font); }
.gauge-cap { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.gauge-legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.gl-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.gl-dot.rented { background: var(--accent); }
.gl-dot.free { background: var(--accent-2); }
.gl-dot.maint { background: var(--warn); }

/* ---- Cartes, champs, focus ---- */
.card { border-radius: var(--radius); }
.input, select.input, .ds-btn { border-radius: 12px; }
.input:focus, .ds-btn:focus-visible, .ds-btn.open {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.seg { border-radius: 999px; padding: 4px; background: var(--surface-2); }
.seg-btn { border-radius: 999px; }
.seg-btn.active { background: var(--accent); color: var(--accent-ink); font-weight: 640; box-shadow: none; }

/* ---- Lisibilité sur les aplats verts ---- */
.ds-opt.sel, [data-theme="dark"] .ds-opt.sel { color: var(--accent-ink); }
.cli-avatar:not(.avatar-warn):not(.avatar-danger),
[data-theme="dark"] .cli-avatar:not(.avatar-warn):not(.avatar-danger),
.u-avatar, [data-theme="dark"] .u-avatar { color: var(--accent-ink); }
.tl-day.today .tl-num { background: var(--accent); color: var(--accent-ink); }
.badge.psv { color: var(--accent-deep); }

/* ================================================================
   ÉCRAN DE CONNEXION — mosaïque d'écrans en fond, carte flottante
   Le décor reprend les composants réels du tableau de bord, teintés
   dans le vert de la marque et inclinés. Purement décoratif.
   ================================================================ */

.login-screen {
  position: relative; overflow: hidden;
  justify-content: flex-start;
  padding: 24px clamp(24px, 7vw, 96px);
  background:
    radial-gradient(1200px 700px at 78% -10%, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 60%),
    var(--accent-deep);
}
[data-theme="dark"] .login-screen { background: radial-gradient(1200px 700px at 78% -10%, color-mix(in srgb, var(--accent) 26%, transparent) 0%, transparent 60%), #07120c; }

/* Voile dégradé : la carte reste lisible au-dessus du décor */
.login-screen::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg,
    var(--accent-deep) 0%,
    color-mix(in srgb, var(--accent-deep) 88%, transparent) 30%,
    color-mix(in srgb, var(--accent-deep) 42%, transparent) 58%,
    transparent 88%);
}
[data-theme="dark"] .login-screen::after {
  background: linear-gradient(100deg, #07120c 0%, rgba(7, 18, 12, .88) 30%, rgba(7, 18, 12, .45) 58%, transparent 88%);
}

.login-panel { position: relative; z-index: 2; }
.login-back { color: var(--muted); }

/* ---- Le décor ---- */
.login-art {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
  opacity: .5;
}
.la-plane {
  position: absolute; top: 50%; left: 50%;
  width: max(1680px, 122vw);
  transform: translate(-50%, -50%) rotate(-21deg);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px;
  align-content: start;
}
.la-col { display: flex; flex-direction: column; gap: 20px; }
.la-col:nth-child(2) { margin-top: -130px; }
.la-col:nth-child(3) { margin-top: -250px; }
.la-col:nth-child(4) { margin-top: -90px; }
.la-col:nth-child(5) { margin-top: -300px; }

.la-card {
  background: #fff; border-radius: 14px; padding: 13px 13px 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
  display: flex; flex-direction: column; gap: 9px;
}
.la-t { font-size: 10.5px; font-weight: 640; color: #1b2620; letter-spacing: -0.01em; }
.la-card.gauge { align-items: center; }

.la-kpi {
  background: #fff; border-radius: 14px; padding: 14px 13px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
  display: flex; flex-direction: column; gap: 5px;
}
.la-kpi-l { font-size: 9.5px; color: #6b7570; font-weight: 550; }
.la-kpi-v { font-size: 21px; font-weight: 720; letter-spacing: -0.045em; color: #121714; }

.la-chart { width: 100%; height: 62px; }
.la-bar { fill: #cfe0d6; }
.la-bar.hi { fill: #15663d; }

.la-gauge { width: 112px; height: 112px; }
.la-g-track { fill: none; stroke: #e7ece9; stroke-width: 13; }
.la-g-fill {
  fill: none; stroke: #15663d; stroke-width: 13; stroke-linecap: round;
  stroke-dasharray: 208 289;
}
.la-g-txt { fill: #121714; font-size: 27px; font-weight: 720; font-family: var(--font); }

.la-tl { display: flex; flex-direction: column; gap: 6px; }
.la-tl-row { display: flex; align-items: center; gap: 7px; }
.la-tl-lbl { width: 30px; height: 6px; border-radius: 3px; background: #e7ece9; flex: none; }
.la-tl-bar { height: 9px; border-radius: 5px; background: #15663d; opacity: .82; }
.la-tl-row:nth-child(even) .la-tl-bar { background: #43a06b; }

.la-rows { display: flex; flex-direction: column; gap: 8px; }
.la-row { display: flex; align-items: center; gap: 8px; }
.la-dot { width: 14px; height: 14px; border-radius: 50%; background: #e6f0ea; flex: none; }
.la-line { height: 6px; border-radius: 3px; background: #e7ece9; }
.la-row:nth-child(3n) .la-dot { background: #15663d; opacity: .3; }

/* Carte de connexion sur fond sombre : on garde le panneau clair */
@media (max-width: 900px) {
  .login-screen { justify-content: center; padding: 24px; }
  .login-art { opacity: .28; }
  .la-plane { transform: translate(-50%, -50%) rotate(-19deg) scale(.55); }
}
@media (max-width: 560px) {
  .la-plane { transform: translate(-50%, -50%) rotate(-19deg) scale(.34); }
}
/* ================================================================
   PAGE D'ACCUEIL PUBLIQUE (#landing)
   Système de design repris du projet InclickAccess :
     nuit / forêt / menthe / brume, boutons pilule, surtitre en
     capitales espacées, et médias encadrés à voile dégradé.
   Les jetons sont portés par .landing : le thème de l'application
   n'est pas touché.
   ================================================================ */

.landing {
  --nuit: #0B2019;
  --foret: #12352A;
  --menthe: #3DD68C;
  --menthe-encre: #0A6B45;
  --brume: #EAF7F1;
  --ardoise: #33413C;

  --lp-fond: #ffffff;
  --lp-encre: var(--nuit);
  --lp-doux: var(--ardoise);
  --lp-filet: rgba(11, 32, 25, .09);
  --lp-carte: #ffffff;

  --r-btn: 999px;
  --r-card: 14px;
  --r-media: 18px;
  --om-carte: 0 4px 16px rgba(11, 32, 25, .06);
  --om-carte-h: 0 14px 32px rgba(11, 32, 25, .12);
  --om-douce: 0 18px 44px rgba(11, 32, 25, .14);

  min-height: 100vh;
  background: var(--lp-fond);
  color: var(--lp-encre);
}
[data-theme="dark"] .landing {
  --nuit: #061511;
  --foret: #0F2A22;
  --menthe: #4FE39B;
  --menthe-encre: #4FE39B;
  --brume: #10261F;
  --ardoise: rgba(232, 245, 239, .76);

  --lp-fond: #071A14;
  --lp-encre: #E8F5EF;
  --lp-doux: var(--ardoise);
  --lp-filet: rgba(79, 227, 155, .16);
  --lp-carte: #0F2A22;

  --om-carte: 0 4px 16px rgba(0, 0, 0, .4);
  --om-carte-h: 0 14px 32px rgba(0, 0, 0, .5);
  --om-douce: 0 18px 44px rgba(0, 0, 0, .5);
}
.landing.hidden { display: none; }

.lp-wrap { max-width: 71.25rem; margin: 0 auto; padding: 0 1.5rem; }

/* ---- Boutons ---- */
.lp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: var(--r-btn);
  font: inherit; font-size: .9375rem; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.lp-btn.sm { padding: .55rem 1.05rem; font-size: .875rem; }
.lp-btn.wide { width: 100%; }
.lp-btn.primary { background: var(--menthe); color: var(--nuit); }
.lp-btn.primary:hover { transform: translateY(-1px); background: #34C47E; box-shadow: 0 8px 20px rgba(61, 214, 140, .32); }
.lp-btn.primary:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.lp-btn.ghost-dark {
  color: #fff; background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .18);
  padding: .55rem 1.2rem .55rem .55rem;
}
.lp-btn.ghost-dark:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .16); }
.lp-btn-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border-radius: 999px; flex: none;
  background: var(--menthe); color: var(--nuit);
}
.lp-btn.ghost {
  background: transparent; color: var(--lp-encre); border-color: var(--lp-filet);
}
.lp-btn.ghost:hover { background: var(--brume); transform: translateY(-1px); }

/* ---- Surtitre ---- */
.lp-eyebrow {
  display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .9rem;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: .6875rem; font-weight: 500; letter-spacing: .12em;
  text-transform: uppercase; color: var(--menthe-encre);
}
.lp-eyebrow.on-dark { color: var(--menthe); }

/* ---- Titres ---- */
.lp-h2 {
  margin: 0; font-size: 1.6875rem; font-weight: 800;
  line-height: 1.22; letter-spacing: -.025em; color: var(--lp-encre);
}
.lp-h2.on-dark { color: #fff; }
.lp-h3 { margin: 0 0 .6rem; font-size: 1.25rem; font-weight: 750; letter-spacing: -.02em; }
.lp-sub { margin: .7rem 0 0; max-width: 66ch; font-size: .9375rem; line-height: 1.65; color: var(--lp-doux); }
.lp-p { margin: 0 0 1rem; font-size: .9375rem; line-height: 1.7; color: var(--lp-doux); }
.lp-p.on-dark { color: rgba(255, 255, 255, .72); max-width: 46ch; }

.lp-section { padding: 3.5rem 0; }
.lp-section.lp-alt { background: var(--brume); }

/* ---- Barre supérieure ---- */
.lp-nav { position: sticky; top: 0; z-index: 30; background: var(--nuit); }
.lp-nav-in {
  max-width: 71.25rem; margin: 0 auto; padding: .85rem 1.5rem;
  display: flex; align-items: center; gap: .55rem;
}
.lp-nav .brand-logo { height: 30px; width: auto; }
.lp-nav .icon-btn {
  background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff;
}
.lp-nav .icon-btn:hover { background: rgba(255, 255, 255, .16); }

/* ---- Bandeau d'accroche ---- */
.lp-hero { background: var(--nuit); padding: 3.5rem 0 7rem; }
.lp-hero h1 {
  margin: 0; max-width: 18ch; color: #fff;
  font-size: clamp(2.25rem, 5vw, 3.4rem); font-weight: 800;
  line-height: 1.1; letter-spacing: -.032em;
}
.lp-lead {
  margin: 1.15rem 0 0; max-width: 60ch;
  font-size: 1rem; line-height: 1.7; color: rgba(255, 255, 255, .72);
}
.lp-cta { margin-top: 1.9rem; display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---- Médias encadrés (le motif central de la référence) ---- */
.lp-media {
  position: relative; margin: 0; overflow: hidden;
  border-radius: var(--r-media);
  border: 1px solid var(--lp-filet);
  box-shadow: 0 8px 32px rgba(11, 32, 25, .1);
  background: linear-gradient(135deg, var(--brume) 0%, color-mix(in srgb, var(--menthe) 26%, var(--brume)) 100%);
}
.lp-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.lp-media-voile {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(4, 31, 24, .28) 0%, transparent 45%);
}
.lp-media.empty img { display: none; }
.lp-media.empty::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 32% 34%, color-mix(in srgb, var(--menthe) 34%, transparent) 0%, transparent 44%),
    radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--menthe-encre) 30%, transparent) 0%, transparent 46%);
}
.lp-media.banniere { aspect-ratio: 21 / 9; box-shadow: var(--om-douce); }
.lp-media.portrait { aspect-ratio: 4 / 5; }
@media (min-width: 900px) { .lp-media.banniere { aspect-ratio: 3 / 1; } }

/* Bannière en débord sur le bandeau nuit */
.lp-banniere { margin-top: -5rem; position: relative; z-index: 2; }

/* ---- Bandeau de repères ---- */
.lp-stats {
  margin: 1.6rem 0 0; padding: 1.15rem 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem;
  border-top: 1px solid var(--lp-filet); border-bottom: 1px solid var(--lp-filet);
}
.lp-stats > div { text-align: center; }
.lp-stats > div + div { border-left: 1px solid var(--lp-filet); }
.lp-stats dt {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: .6875rem; font-weight: 500; letter-spacing: .11em;
  text-transform: uppercase; color: var(--menthe-encre);
}
.lp-stats dd { margin: .4rem 0 0; font-size: .95rem; font-weight: 650; letter-spacing: -.015em; }

/* ---- Cartes d'atouts ---- */
.lp-grid { margin-top: 2.2rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.lp-card {
  background: var(--lp-carte); border: 1px solid var(--lp-filet);
  border-radius: var(--r-card); padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: var(--om-carte); transition: transform .2s ease, box-shadow .2s ease;
}
.lp-card:hover { transform: translateY(-3px); box-shadow: var(--om-carte-h); }
.lp-ic {
  width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center;
  background: var(--brume); color: var(--menthe-encre);
}
.lp-ic svg { width: 1.3rem; height: 1.3rem; }
.lp-card h3 { margin: .95rem 0 .45rem; font-size: 1rem; font-weight: 680; letter-spacing: -.02em; }
.lp-card p { margin: 0; font-size: .875rem; line-height: 1.62; color: var(--lp-doux); }

/* ---- Listes à puces cochées ---- */
.lp-puces { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.lp-puces li { position: relative; padding-left: 1.7rem; font-size: .9rem; line-height: 1.55; }
.lp-puces li::before {
  content: ''; position: absolute; left: 0; top: .15rem;
  width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--brume);
}
.lp-puces li::after {
  content: ''; position: absolute; left: .3rem; top: .43rem;
  width: .38rem; height: .22rem; transform: rotate(-45deg);
  border-left: 2px solid var(--menthe-encre); border-bottom: 2px solid var(--menthe-encre);
}

/* ---- Blocs image / texte en vis-à-vis ---- */
.lp-splits .lp-split {
  margin-top: 2.6rem;
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 2.2rem; align-items: center;
}
.lp-splits .lp-split.inverse .lp-media { order: 2; }
.lp-split-txt { min-width: 0; }
.lp-split .lp-media { max-width: 26rem; width: 100%; }
.lp-splits .lp-split.inverse .lp-media { justify-self: end; }

/* Apparition à l'entrée dans l'écran */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s cubic-bezier(.22, 1, .36, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Entrée du bandeau (CSS et non JS : une animation JS peut rester bloquée
   quand la fenêtre n'a pas le focus, et le titre resterait invisible) */
.rise { animation: lpRise .5s cubic-bezier(.22, 1, .36, 1) both; }
.rise-1 { animation-delay: 60ms; }
.rise-2 { animation-delay: 130ms; }
.rise-3 { animation-delay: 200ms; }
.rise-4 { animation-delay: 280ms; }
@keyframes lpRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

/* ---- Formules ---- */
.lp-plans { margin-top: 2.2rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: stretch; }
.lp-plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--lp-carte); border: 1px solid var(--lp-filet);
  border-radius: var(--r-card); padding: 1.6rem 1.4rem 1.4rem; box-shadow: var(--om-carte);
}
.lp-plan.featured { background: var(--nuit); border-color: var(--nuit); color: #fff; box-shadow: var(--om-douce); }
.lp-plan-tag {
  position: absolute; top: 1rem; right: 1.1rem; padding: .25rem .65rem; border-radius: 999px;
  background: var(--menthe); color: var(--nuit);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: .625rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
}
.lp-plan h3 {
  margin: 0; font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: .75rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--menthe-encre);
}
.lp-plan.featured h3 { color: var(--menthe); }
.lp-price { display: flex; align-items: baseline; gap: .15rem; margin-top: .75rem; }
.lp-price .cur { font-size: 1.2rem; font-weight: 650; }
.lp-price .amount { font-size: 2.85rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.lp-price .per { font-size: .875rem; font-weight: 550; color: var(--lp-doux); }
.lp-plan.featured .lp-price .per, .lp-plan.featured .lp-plan-note { color: rgba(255, 255, 255, .66); }
.lp-plan-note { display: block; margin-top: .3rem; font-size: .75rem; color: var(--lp-doux); }
.lp-plan .lp-puces { margin: 1.25rem 0 1.4rem; flex: 1 1 auto; }
.lp-plan.featured .lp-puces li::before { background: rgba(255, 255, 255, .14); }
.lp-plan.featured .lp-puces li::after { border-color: var(--menthe); }

/* ---- Bandeau de demande de compte ---- */
.lp-band-contact { background: var(--nuit); padding: 3.5rem 0; }
.lp-contact { display: grid; grid-template-columns: .95fr 1.15fr; gap: 2.4rem; align-items: start; }
.lp-form-txt .lp-btn { margin-top: 1.4rem; }

.lp-form {
  background: var(--lp-carte); border: 1px solid var(--lp-filet);
  border-radius: var(--r-media); padding: 1.6rem 1.5rem 1.4rem; box-shadow: var(--om-douce);
}
.lp-form .form-grid { gap: .9rem 1rem; }
.lp-form .input:focus, .lp-form .ds-btn.open, .lp-form .ds-btn:focus-visible {
  border-color: var(--menthe-encre);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--menthe-encre) 22%, transparent);
}
.lp-form-actions { margin-top: 1.1rem; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.lp-form-note { font-size: .8125rem; color: var(--lp-doux); }
.lp-form-msg { margin: .9rem 0 0; font-size: .875rem; line-height: 1.5; color: var(--lp-doux); min-height: 1.2em; }
.lp-form-msg.erreur { color: var(--danger); font-weight: 550; }
.lp-form-msg.succes { color: var(--menthe-encre); font-weight: 600; }

/* Champ piège anti-robot : hors écran, jamais visible ni tabulable */
.lp-piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Pied de page ---- */
.lp-foot { background: var(--foret); color: rgba(255, 255, 255, .72); padding: 2.4rem 0 1.6rem; }
.lp-foot-in { display: flex; flex-direction: column; align-items: center; gap: .55rem; text-align: center; }
.lp-foot .brand-logo { height: 26px; width: auto; }
.lp-foot p { margin: 0; font-size: .875rem; }
.lp-foot-links { display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center; margin-top: .35rem; }
.lp-foot-links a, .lp-foot-links .link-btn { font-size: .875rem; color: #fff; text-decoration: none; font-weight: 550; }
.lp-foot-links a:hover, .lp-foot-links .link-btn:hover { color: var(--menthe); text-decoration: underline; }
.lp-copy { font-size: .75rem; margin-top: .5rem; }

/* ---- Adaptations écran ---- */
@media (max-width: 1000px) {
  .lp-grid, .lp-plans { grid-template-columns: repeat(2, 1fr); }
  .lp-contact { grid-template-columns: 1fr; gap: 1.6rem; }
  .lp-splits .lp-split { grid-template-columns: 1fr; gap: 1.4rem; }
  .lp-splits .lp-split.inverse .lp-media { order: 0; justify-self: start; }
  .lp-split .lp-media { max-width: 22rem; }
}
@media (max-width: 700px) {
  .lp-hero { padding: 2.4rem 0 5.5rem; }
  .lp-section { padding: 2.6rem 0; }
  .lp-grid, .lp-plans { grid-template-columns: 1fr; }
  .lp-banniere { margin-top: -4rem; }
  .lp-stats { grid-template-columns: 1fr; padding: .4rem 0; }
  .lp-stats > div { padding: .75rem 0; }
  .lp-stats > div + div { border-left: none; border-top: 1px solid var(--lp-filet); }
  .lp-cta .lp-btn { width: 100%; }
  .lp-form { padding: 1.2rem 1.05rem 1.05rem; }
  .lp-form-actions .lp-btn { width: 100%; }
  .lp-band-contact { padding: 2.6rem 0; }
}
@media (max-width: 420px) {
  .lp-nav .brand-logo { height: 26px; }
  .lp-nav-in { gap: .4rem; padding: .7rem 1rem; }
  .lp-price .amount { font-size: 2.35rem; }
}

/* Retour à l'accueil depuis l'écran de connexion */
.login-back { display: block; margin: 16px auto 0; font-size: 13px; color: var(--muted); font-weight: 550; }
.login-back:hover { color: var(--accent); }

/* Logos déclinés : blanc sur les fonds sombres, vert sur l'écran de connexion.
   La retouche de luminosité du thème sombre ne doit pas les délaver. */
.lp-nav .brand-logo, .lp-foot .brand-logo,
[data-theme="dark"] .lp-nav .brand-logo, [data-theme="dark"] .lp-foot .brand-logo { filter: none; }
[data-theme="dark"] .login-brand .brand-logo { filter: brightness(1.75) saturate(1.1); }

/* ================================================================
   VISUEL DU TABLEAU DE BORD (bannière de la page d'accueil)
   Dessiné à 1200x400 puis mis à l'échelle de son cadre par JS.
   Une capture réelle déposée en img/lp-dashboard.png le recouvre.
   ================================================================ */
.lp-media.dashboard { background: #f2f5f3; }
.lp-media.dashboard .lp-media-voile {
  background:
    linear-gradient(to top, rgba(4, 31, 24, .34) 0%, rgba(4, 31, 24, .06) 38%, transparent 62%),
    linear-gradient(to right, rgba(11, 32, 25, .10) 0%, transparent 26%);
}
/* Specificite superieure a .lp-media img, sinon la capture absente s affiche en alt */
.lp-media img.dv-shot { display: none; position: absolute; inset: 0; z-index: 2; }
.lp-media img.dv-shot.ok { display: block; }

.dv {
  position: absolute; top: 0; left: 0;
  width: 1200px; height: 400px;
  transform-origin: 0 0;
  display: flex; background: #eff1ef;
  font-family: var(--font); color: #121714;
  --dv-vert: #15663d; --dv-clair: #43a06b; --dv-trait: #e3e7e4; --dv-doux: #6b7570;
}

/* Rail de navigation */
.dv-rail {
  width: 196px; flex: none; background: #fff; border-right: 1px solid var(--dv-trait);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 3px;
}
.dv-brand { padding: 0 6px 14px; }
.dv-brand img { height: 26px; width: auto; display: block; }
.dv-nav {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px;
  font-size: 12.5px; font-weight: 550; color: var(--dv-doux);
}
.dv-nav i { width: 15px; height: 15px; border-radius: 4px; background: #e7ece9; flex: none; }
.dv-nav.on { background: #e6f0ea; color: #0e4a2b; font-weight: 660; }
.dv-nav.on i { background: var(--dv-vert); }

/* Zone principale */
.dv-main { flex: 1 1 auto; min-width: 0; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.dv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.dv-top strong { display: block; font-size: 21px; font-weight: 720; letter-spacing: -.03em; }
.dv-top span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--dv-doux); }
.dv-btn {
  flex: none; padding: 8px 15px; border-radius: 999px;
  background: var(--dv-vert); color: #fff; font-size: 12px; font-weight: 620;
}

.dv-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dv-kpi {
  background: #fff; border: 1px solid var(--dv-trait); border-radius: 14px;
  padding: 11px 13px 10px; display: flex; flex-direction: column; gap: 4px;
}
.dv-kpi-l { font-size: 11px; color: var(--dv-doux); font-weight: 550; }
.dv-kpi-v { font-size: 22px; font-weight: 720; letter-spacing: -.045em; }
.dv-kpi-v i { font-style: normal; font-size: .45em; font-weight: 600; color: var(--dv-doux); margin-left: 3px; }
.dv-kpi.on { background: var(--dv-vert); border-color: var(--dv-vert); color: #fff; }
.dv-kpi.on .dv-kpi-l { color: rgba(255, 255, 255, .78); }

.dv-cols { display: grid; grid-template-columns: 1.35fr .75fr 1.15fr; gap: 10px; flex: 1 1 auto; min-height: 0; }
.dv-card {
  background: #fff; border: 1px solid var(--dv-trait); border-radius: 14px;
  padding: 11px 13px; display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
.dv-t { font-size: 11.5px; font-weight: 620; letter-spacing: -.01em; }

.dv-chart { flex: 1 1 auto; display: flex; align-items: flex-end; gap: 8px; min-height: 0; }
.dv-bar {
  position: relative; flex: 1 1 0; border-radius: 7px 7px 3px 3px;
  background: #cfe0d6; min-height: 8px;
}
.dv-bar.hi { background: var(--dv-vert); }
.dv-bar em {
  position: absolute; left: 0; right: 0; bottom: -15px; text-align: center;
  font-style: normal; font-size: 9.5px; font-weight: 600; color: var(--dv-doux);
}
.dv-chart { padding-bottom: 16px; }

.dv-gauge-card { align-items: center; }
.dv-gauge { width: 118px; height: 118px; margin-top: 2px; }
.dv-g-track { fill: none; stroke: #e7ece9; stroke-width: 13; }
.dv-g-fill { fill: none; stroke: var(--dv-vert); stroke-width: 13; stroke-linecap: round; stroke-dasharray: 208 289; }
.dv-g-txt { fill: #121714; font-size: 25px; font-weight: 720; font-family: var(--font); }

.dv-cal .dv-tl { display: flex; flex-direction: column; gap: 7px; padding-top: 2px; }
.dv-tl-row { display: block; }
.dv-tl-bar {
  display: block; height: 20px; border-radius: 6px; background: var(--dv-vert);
  color: #fff; font-size: 9.5px; font-weight: 600; line-height: 20px;
  padding: 0 7px; overflow: hidden; white-space: nowrap;
}
.dv-tl-bar.s1 { background: var(--dv-clair); }
.dv-tl-bar.s2 { background: #0e4a2b; }

/* Thème sombre : le visuel reste clair, c'est une « capture » du produit. */
[data-theme="dark"] .lp-media.dashboard { background: #f2f5f3; }


/* ================================================================
   HARMONISATION DU BAS DE PAGE AVEC LE NOUVEAU DESIGN
   Ces composants (cartes, listes, calendrier, vignettes véhicule)
   sont partagés par toutes les pages : la retouche vaut partout,
   pas seulement sur le tableau de bord.
   ================================================================ */

/* ---- Titres de carte : repère vert, graisse et interlettrage alignés ---- */
.card-head { margin-bottom: 16px; }
.card-head h2 {
  position: relative; padding-left: 12px;
  font-size: 16px; font-weight: 700; letter-spacing: -.022em;
}
.card-head h2::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 15px; border-radius: 2px; background: var(--accent);
}

/* ---- Lignes de liste : plus d'air, survol arrondi ---- */
.list-row { padding: 11px 8px; border-radius: 10px; }
.list-row + .list-row { border-top: 1px solid var(--row-line); }
.list-row { border-bottom: 0; }
.list-main strong { font-size: 13.5px; font-weight: 620; letter-spacing: -.012em; }
.list-row.clickable:hover { background: var(--accent-soft); }

/* ---- Rang : pastille ronde verte ---- */
.rank {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 12px; font-weight: 700;
}

/* ---- Journal d'activité : type à droite, message lisible ---- */
.act-row { align-items: flex-start; gap: 12px; }
.act-row .list-main strong { font-weight: 560; line-height: 1.45; }
.act-row .badge { flex: none; margin-top: 1px; }

/* ---- Vignette véhicule : le dégradé bleu nuit passe au vert forêt ---- */
.veh-visual { background: linear-gradient(135deg, #0e4a2b, #1d7a4b); }
[data-theme="dark"] .veh-visual { background: linear-gradient(135deg, #0d2b1d, #17553a); }
.veh-glyph { color: rgba(255, 255, 255, .82); }

/* ---- Calendrier des locations : plus de bleu résiduel ----
   Les statuts restent distinguables : vert = en cours, ambre = à venir,
   rouge = en retard, gris = terminée (volontairement en retrait). */
.cal-bar.st-en_cours { background: linear-gradient(135deg, #1d7a4b, #15663d); }
.cal-bar.st-terminee { background: linear-gradient(135deg, #98a5a0, #7f8d87); }
.cal-dot.st-en_cours { background: #1d7a4b; }
.cal-dot.st-terminee { background: #98a5a0; }
[data-theme="dark"] .cal-bar.st-en_cours { background: linear-gradient(135deg, #2f9d64, #248152); }
[data-theme="dark"] .cal-bar.st-terminee { background: linear-gradient(135deg, #6b7570, #58625d); }
[data-theme="dark"] .cal-dot.st-en_cours { background: #2f9d64; }
[data-theme="dark"] .cal-dot.st-terminee { background: #6b7570; }
.tl-scroll { border-radius: 14px; }
.cal-key { font-size: 11.5px; }

/* ---- Pastille de comptage ---- */
.pill { border-radius: 999px; font-weight: 650; }

/* ---- Cartes : même rayon que la page d'accueil ---- */
.card { border-radius: var(--radius); }
