/* IACHECK V1 — design system dashboard. Même palette que la landing (light corporate). */
:root {
  --bg: #fbfcfe;
  --bg-raised: #f2f5fa;
  --bg-card: #ffffff;
  --bg-hover: #eef2f9;
  --line: #e4e9f2;
  --text: #0c1220;
  --text-dim: #5b6676;
  --accent: #2f6bff;
  --accent-ink: #1d49c4;
  --accent-soft: rgba(47, 107, 255, .1);
  --ok: #0bbf8a;
  --ok-soft: rgba(11, 191, 138, .12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, .12);
  --bad: #dc2626;
  --bad-soft: rgba(220, 38, 38, .1);
  --info: #6366f1;
  --info-soft: rgba(99, 102, 241, .12);
  --radius: 14px;
  --radius-sm: 9px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", var(--font);
  --shadow-sm: 0 1px 2px rgba(12, 18, 32, .05), 0 4px 14px rgba(12, 18, 32, .05);
  --shadow: 0 20px 55px rgba(18, 36, 84, .12);

  /* Alias — anciennement thème clair dédié (login, modales) ; tout le dashboard est clair désormais */
  --light-bg: var(--bg);
  --light-card: var(--bg-card);
  --light-line: var(--line);
  --light-text: var(--text);
  --light-dim: var(--text-dim);
  --light-raised: var(--bg-raised);

  /* Illustration guide de prise de photo */
  --guide-body: #d8deea;
  --guide-line: #98a3b8;
  --guide-glass: #aecdfb;
  --guide-cam: var(--accent);
}

:root[dir="rtl"] { direction: rtl; }

* { box-sizing: border-box; margin: 0; }
html { color-scheme: light; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 560px at 88% -8%, rgba(47, 107, 255, .07), transparent 60%),
    radial-gradient(820px 460px at -8% 108%, rgba(11, 191, 138, .05), transparent 55%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
}
h1, h2, h3 { font-family: var(--font-display); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---- Layout ---- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-raised);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  font-weight: 800; letter-spacing: .14em; font-size: 15px;
  padding: 4px 12px 18px; display: flex; align-items: center; gap: 8px;
}
.sidebar__brand em { font-style: normal; color: var(--accent); }
.sidebar__brand small { color: var(--text-dim); font-weight: 500; letter-spacing: .02em; }
.sidebar__logo { width: 26px; height: 26px; border-radius: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-weight: 500; transition: .15s;
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.sidebar__spacer { flex: 1; }
.sidebar__user {
  border-top: 1px solid var(--line); margin-top: 6px; padding: 14px 12px; font-size: 13px;
  display: flex; align-items: center; gap: 10px; background: none; border-inline: 0; border-bottom: 0;
  color: inherit; text-align: start; width: 100%; border-radius: var(--radius-sm); transition: background .15s;
}
.sidebar__user:hover { background: var(--bg-hover); }
.sidebar__user-txt { display: flex; flex-direction: column; overflow: hidden; }
.sidebar__user-txt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-txt span { color: var(--text-dim); font-size: 12px; }
.sidebar__footer { padding: 10px 12px 2px; font-size: 11px; color: var(--text-dim); line-height: 1.6; }

/* ---- Langue ---- */
.lang-switch { display: flex; gap: 4px; padding: 4px 12px 10px; }
.lang-switch--side { justify-content: flex-start; }
.lang-btn {
  background: var(--bg-raised); border: 1px solid var(--line); color: var(--text-dim);
  padding: 5px 10px; border-radius: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
}
.lang-btn--on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ---- Icônes (SVG sobres, remplacent tout emoji) ---- */
.icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; vertical-align: -3px; }
.icon svg { display: block; }

/* ---- Avatars ---- */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar--fallback {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; border-radius: 50%; flex-shrink: 0;
}

/* ---- Notifications ---- */
.notif-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  margin-inline-start: auto;
}
.notif-item { display: block; cursor: pointer; }
.notif-item--unread { background: var(--accent-soft); border-radius: var(--radius-sm); margin: 0 -10px; padding: 13px 10px; }
.notif-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-inline-end: 7px; }

.main { padding: 28px 34px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 750; letter-spacing: -.01em; }
.page-head p { color: var(--text-dim); font-size: 14px; }

/* ---- Transition de page (chaque navigation) ---- */
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-enter { animation: page-in .38s cubic-bezier(.16,1,.3,1); }
@media (prefers-reduced-motion: reduce) { .page-enter { animation: none; } }

/* ---- Entrée en cascade pour grilles de cartes ---- */
@keyframes card-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.stagger-in { animation: card-in .42s cubic-bezier(.16,1,.3,1) backwards; }
@media (prefers-reduced-motion: reduce) { .stagger-in { animation: none; } }

/* ---- Barre de recherche / filtre (véhicule, VIN, métier) ---- */
.search-bar {
  display: flex; align-items: center; gap: 10px; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 14px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-bar .icon { color: var(--text-dim); }
.search-input {
  border: 0; outline: none; background: none; flex: 1; min-width: 140px; font-size: 14.5px; color: var(--text);
}
.search-input::placeholder { color: var(--text-dim); }
.search-bar select { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; background: var(--bg-card); color: var(--text); font-size: 13.5px; }

/* ---- Grille de cartes véhicule (cliquables, animées) ---- */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.vehicle-card {
  display: block; background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, border-color .25s;
  color: inherit;
}
.vehicle-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.vehicle-card__top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.vehicle-card__title { font-weight: 700; font-size: 15px; }
.vehicle-card__code { color: var(--text-dim); font-size: 12.5px; font-family: monospace; }
.vehicle-card__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-dim); margin-top: 10px; }
.vehicle-card__meta span b { color: var(--text); font-weight: 600; }

/* ---- Sections de formulaire groupées (fiche véhicule complète) ---- */
.form-section { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.form-section__title {
  font-size: 11.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.form-section__title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- Parcours véhicule (deux phases séparées : Transport / Gestion de parc) ---- */
.journey-phase { margin-bottom: 22px; }
.journey-phase__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.journey-phase__badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 4px 11px; border-radius: 99px; color: #fff;
}
.journey-phase__badge--transport { background: linear-gradient(90deg, #6366f1, #4338ca); }
.journey-phase__badge--parc { background: linear-gradient(90deg, var(--ok), #0a9e73); }
/* ---- Stepper à points connectés (parcours véhicule) — cliquable, popup d'explication ---- */
.journey-stepper { display: flex; align-items: flex-start; overflow-x: auto; padding: 10px 2px 6px; gap: 0; -webkit-overflow-scrolling: touch; }
.journey-dot-wrap {
  display: flex; flex-direction: column; align-items: center; flex: 1 0 92px; min-width: 92px;
  position: relative; background: none; border: 0; padding: 0 4px; font: inherit; color: inherit;
}
.journey-dot-wrap[data-clickable="true"] { cursor: pointer; }
.journey-dot-wrap:not(:last-child)::after {
  content: ""; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0;
}
.journey-dot-wrap--done:not(:last-child)::after { background: var(--ok); }
.journey-dot {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; z-index: 1; flex-shrink: 0;
  font-size: 11px; font-weight: 700; color: var(--text-dim); transition: background .25s, border-color .25s, box-shadow .25s;
}
.journey-dot-wrap--done .journey-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.journey-dot-wrap--current .journey-dot { background: var(--accent); border-color: var(--accent); color: #fff; animation: journey-pulse 1.8s infinite; }
.journey-dot-wrap[data-clickable="true"]:hover .journey-dot { transform: scale(1.12); box-shadow: var(--shadow-sm); }
.journey-dot-wrap__label { margin-top: 7px; font-size: 11px; text-align: center; color: var(--text-dim); line-height: 1.3; }
.journey-dot-wrap--done .journey-dot-wrap__label, .journey-dot-wrap--current .journey-dot-wrap__label { color: var(--text); font-weight: 600; }
@keyframes journey-pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); } 50% { box-shadow: 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .journey-dot-wrap--current .journey-dot { animation: none; } }

/* ---- Carte dashboard cliquable ---- */
.stat--clickable { cursor: pointer; }
.stat--clickable:hover { border-color: var(--accent-soft); }

/* ---- Popup d'explication (contenu court, sur les steppers/cartes) ---- */
.explain-popup { max-width: 360px; }
.explain-popup dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin-top: 10px; }
.explain-popup dt { color: var(--text-dim); font-size: 12.5px; }
.explain-popup dd { font-size: 12.5px; font-weight: 600; }

/* ---- Cards / stats ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 17px; position: relative; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat::after { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-ink) 70%); }
.stat__icon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 16px; margin-bottom: 12px;
}
.stat__value { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--text-dim); font-size: 13px; margin-top: 3px; }
.stat--ok::after { background: linear-gradient(90deg, var(--ok), #0a9e73 70%); }
.stat--ok .stat__icon { background: var(--ok-soft); color: var(--ok); }
.stat--warn::after { background: linear-gradient(90deg, var(--warn), #b45f04 70%); }
.stat--warn .stat__icon { background: var(--warn-soft); color: var(--warn); }
.stat--bad::after { background: linear-gradient(90deg, var(--bad), #a91d1d 70%); }
.stat--bad .stat__icon { background: var(--bad-soft); color: var(--bad); }

.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
.card h2, .card h3 { font-size: 16px; margin-bottom: 14px; font-weight: 700; }

/* ---- Charts (SVG, sans dépendance) ---- */
.chart-row { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.donut { flex-shrink: 0; }
.donut circle.donut__seg {
  transition: stroke-dasharray 1s cubic-bezier(.16,1,.3,1), stroke 0.3s;
  transform-origin: 50% 50%;
}
.donut__center { font-family: var(--font-display); }
.donut__center-value { font-size: 22px; font-weight: 700; fill: var(--text); }
.donut__center-label { font-size: 9.5px; fill: var(--text-dim); }
.chart-legend { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 180px; }
.chart-legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chart-legend b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }

.barlist { display: flex; flex-direction: column; gap: 12px; }
.barlist__row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.barlist__track { height: 8px; border-radius: 99px; background: var(--bg-raised); overflow: hidden; }
.barlist__fill { height: 100%; border-radius: 99px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-ink)); transition: width 1s cubic-bezier(.16,1,.3,1); }
.barlist__count { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 12.5px; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
th, td { text-align: left; padding: 12px 16px; }
thead th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); }
tbody tr { border-bottom: 1px solid var(--line); transition: background .12s; }
tbody tr:last-child { border-bottom: 0; }
tbody tr.row-click { cursor: pointer; }
tbody tr.row-click:hover { background: var(--bg-hover); }
tbody tr.row--alert { background: var(--bad-bg, rgba(220, 38, 38, .08)); }

.link-chip { font-weight: 600; }
.link-chip:hover { text-decoration: underline; }

.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 14px; }
.overview-chip { display: flex; flex-direction: column; gap: 3px; }
.overview-chip__label { font-size: 11.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.overview-chip__value { font-size: 15px; font-weight: 600; }

/* ---- Planificateur : calendrier mensuel ---- */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid--head { margin-bottom: 6px; }
.cal-cell__head { font-size: 11.5px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; text-align: center; padding-bottom: 4px; }
.cal-cell {
  min-height: 84px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 6px; display: flex; flex-direction: column; gap: 3px; background: var(--bg-raised);
}
.cal-cell--empty { border: none; background: none; }
.cal-cell__num { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.cal-chip {
  display: block; font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft);
  color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-chip--more { background: none; color: var(--text-dim); }
@media (max-width: 768px) {
  .cal-cell { min-height: 56px; }
  .cal-cell__head { font-size: 10px; }
}

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge--accent { background: var(--accent-soft); color: var(--accent); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--info { background: var(--info-soft); color: var(--info); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: 0;
  padding: 9px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  transition: .15s; text-decoration: none;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn--outline { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--ghost { background: transparent; color: var(--text-dim); }
.btn--ghost:hover { color: var(--text); }
.btn--danger { background: var(--bad); }
.btn--ok { background: var(--ok); color: #06251a; }
.btn--icon { padding: 6px 10px; }
.btn--sm { padding: 6px 12px; font-size: 13px; }

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select, textarea {
  background: var(--bg-raised); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 84px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .field--full { grid-column: 1 / -1; }
form footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---- Photos ---- */
.pos-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-bottom: 8px; }
.pos-slot {
  background: var(--bg-raised); border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--text-dim); padding: 10px 6px 8px; display: flex; flex-direction: column; gap: 4px; align-items: center;
  transition: .15s;
}
.pos-slot:hover { border-color: var(--accent); color: var(--accent); }
.pos-slot__name { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.pos-guide { width: 44px; height: 55px; display: block; }
.pos-guide svg { width: 100%; height: 100%; }
.picker-hint { font-size: 12px; color: var(--text-dim); margin: 4px 0 4px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.photo-cell { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; }
.photo-cell--edit { cursor: default; }
.photo-cell__doc { display: grid; place-items: center; width: 100%; height: 100%; font-size: 28px; background: var(--bg-raised); }
.photo-cell__tag {
  position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.65); color: #fff;
  padding: 2px 7px; border-radius: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
}
.photo-cell__remove {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff; border: 0; font-size: 11px; line-height: 1; z-index: 3;
}

/* Points de dégât posés sur une photo */
.marker-layer { position: absolute; inset: 0; cursor: crosshair; z-index: 2; }
.marker {
  position: absolute; width: 22px; height: 22px; margin-left: -11px; margin-top: -11px;
  border-radius: 50%; background: var(--bad); color: #fff; border: 2px solid #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.4); z-index: 4; cursor: pointer;
}
.marker--ro { pointer-events: none; }

/* ---- Timeline ---- */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-card); border: 3px solid var(--accent);
}
.timeline__title { font-weight: 650; font-size: 14px; }
.timeline__meta { color: var(--text-dim); font-size: 12.5px; }

/* ---- Stepper (workflow) ---- */
.stepper { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 22px; }
.step {
  display: flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; background: var(--bg-raised); color: var(--text-dim); border: 1px solid var(--line);
}
.step--done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.step--current { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ---- Divers ---- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast {
  background: var(--bg-card); border: 1px solid var(--line); border-left: 3px solid var(--ok);
  padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow);
  animation: slide-in .25s cubic-bezier(.16,1,.3,1); max-width: 380px; font-size: 14px;
}
.toast--err { border-left-color: var(--bad); }
.toast--warn { border-left-color: var(--warn); }
.toast--out { opacity: 0; transform: translateX(12px); transition: .4s; }
@keyframes slide-in { from { opacity: 0; transform: translateY(10px); } }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(4, 6, 9, .72); backdrop-filter: blur(4px);
  display: grid; place-items: center; z-index: 80; padding: 20px; overflow-y: auto;
}
.modal {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  width: min(520px, 100%); box-shadow: var(--shadow); animation: pop .22s cubic-bezier(.16,1,.3,1);
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.modal--wide { width: min(760px, 100%); }
.modal__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 0; }
.modal__body { padding: 16px 22px 22px; overflow-y: auto; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }

/* Modale claire — ajout véhicule, comptes, profil */
.modal--light {
  background: var(--light-card); border-color: var(--light-line); color: var(--light-text);
}
.modal--light .field__label { color: var(--light-dim); }
.modal--light input[type="text"], .modal--light input[type="email"], .modal--light input[type="password"],
.modal--light input[type="date"], .modal--light input[type="number"], .modal--light select, .modal--light textarea {
  background: var(--light-raised); border-color: var(--light-line); color: var(--light-text);
}
.modal--light .btn--outline { border-color: var(--light-line); color: var(--light-text); }
.modal--light .btn--ghost { color: var(--light-dim); }
.modal--light .pos-slot, .modal--light .photo-cell__doc { background: var(--light-raised); }
.modal--light .picker-hint, .modal--light p { color: var(--light-dim); }

.radio-row { display: flex; gap: 18px; margin-bottom: 14px; font-size: 13.5px; }
.radio-opt { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-opt input { width: auto; }

.spinner { display: flex; align-items: center; gap: 10px; color: var(--text-dim); padding: 30px 0; justify-content: center; }
.spinner__dot { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { color: var(--text-dim); text-align: center; padding: 34px 10px; font-size: 14px; }

.damage-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.damage-list li {
  display: flex; align-items: center; gap: 10px; background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 13px; font-size: 13.5px;
}
.damage-list li .grow { flex: 1; }

/* ---- Login (fond clair) ---- */
.login-wrap--light {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 460px at 15% -10%, rgba(47, 107, 255, .09), transparent 60%),
    radial-gradient(700px 420px at 100% 100%, rgba(11, 191, 138, .06), transparent 60%),
    var(--light-bg);
}
.login--light {
  width: min(420px, 100%); background: var(--light-card); border: 1px solid var(--light-line); color: var(--light-text);
  border-radius: 18px; padding: 38px 34px; box-shadow: 0 20px 60px rgba(16, 19, 28, .12); position: relative; overflow: hidden;
}
.login--light::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.login__logo { width: 56px; height: 56px; margin-bottom: 14px; }
.login--light > p { color: var(--light-dim); font-size: 14px; margin-bottom: 24px; }
.login--light .field__label { color: var(--light-dim); }
.login--light input[type="email"], .login--light input[type="password"] {
  background: var(--light-raised); border: 1px solid var(--light-line); color: var(--light-text);
}
.login__brand { margin-top: 20px; font-size: 11.5px; color: var(--light-dim); text-align: center; letter-spacing: .03em; }

.mail-item { border-bottom: 1px solid var(--line); padding: 13px 2px; }
.mail-item:last-child { border-bottom: 0; }
.mail-item__head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.mail-item__body { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar__spacer, .sidebar__user span { display: none; }
  .main { padding: 20px 16px 50px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---- Assistant IA flottant ---- */
.assistant-fab {
  position: fixed; inset-inline-end: 22px; bottom: 22px; z-index: 60;
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  color: #fff; display: grid; place-items: center; box-shadow: var(--shadow);
  transition: transform .15s;
}
.assistant-fab:hover { transform: translateY(-2px) scale(1.03); }

.assistant-panel {
  position: fixed; inset-inline-end: 22px; bottom: 84px; z-index: 60;
  width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: calc(100vh - 120px);
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.assistant-panel--hidden { display: none; }
.assistant-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13.5px;
}
.assistant-panel__head > span { display: flex; align-items: center; gap: 8px; }

.assistant-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.assistant-msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.assistant-msg--user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 3px; }
.assistant-msg--assistant { align-self: flex-start; background: var(--bg-raised); color: var(--text); border-bottom-left-radius: 3px; }
.assistant-msg--pending { color: var(--text-dim); font-style: italic; }

.assistant-input-row { display: flex; align-items: flex-end; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.assistant-input {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; font: inherit; font-size: 13px; max-height: 120px; background: var(--bg);
}
.assistant-icon-btn {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-raised); color: var(--text-dim); display: grid; place-items: center; cursor: pointer; transition: .15s;
}
.assistant-icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.assistant-icon-btn--on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.assistant-icon-btn--send { background: var(--accent); color: #fff; border-color: var(--accent); }
.assistant-icon-btn--send:hover { background: var(--accent-ink); color: #fff; }

@media (max-width: 480px) {
  .assistant-panel { inset-inline: 12px; width: auto; bottom: 78px; }
  .assistant-fab { inset-inline-end: 16px; bottom: 16px; }
}
