/* ==========================================================================
   FleetXP — design system
   Un seul fichier, aucune dépendance (hors police d'icônes Tabler).
   ========================================================================== */

/* L'attribut hidden l'emporte toujours (sinon .btn, .outbox… l'écrasent). */
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Tokens */
:root {
  --brand:        #0b5cff;
  --brand-dark:   #0844c2;
  --brand-soft:   #e8f0ff;

  --bg:           #f4f6fb;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --surface-3:    #eef2f9;
  --border:       #e2e8f2;
  --border-strong:#cbd5e6;

  --text:         #0f172a;
  --text-2:       #334155;
  --muted:        #64748b;
  --muted-2:      #94a3b8;

  --blue:   #0b5cff;
  --green:  #059669;
  --amber:  #d97706;
  --red:    #dc2626;
  --violet: #7c3aed;
  --slate:  #64748b;
  --teal:   #0d9488;

  --blue-bg:   #e8f0ff;
  --green-bg:  #e6f6f0;
  --amber-bg:  #fdf3e3;
  --red-bg:    #fdeaea;
  --violet-bg: #f1eafd;
  --slate-bg:  #eef2f7;
  --teal-bg:   #e3f5f2;

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 4px 16px rgba(15, 23, 42, .07);
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, .13);

  --sidebar-w: 268px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:           #0a0f1c;
    --surface:      #111827;
    --surface-2:    #161f33;
    --surface-3:    #1c2740;
    --border:       #23304d;
    --border-strong:#33405f;

    --text:    #e8edf7;
    --text-2:  #c3cddf;
    --muted:   #93a1bb;
    --muted-2: #6b7a96;

    --brand-soft: #14264d;
    --blue-bg:   #14264d;
    --green-bg:  #0d2f27;
    --amber-bg:  #34260f;
    --red-bg:    #3a1620;
    --violet-bg: #241b45;
    --slate-bg:  #1c2740;
    --teal-bg:   #0d2b2b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 4px 18px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --bg:           #0a0f1c;
  --surface:      #111827;
  --surface-2:    #161f33;
  --surface-3:    #1c2740;
  --border:       #23304d;
  --border-strong:#33405f;
  --text:    #e8edf7;
  --text-2:  #c3cddf;
  --muted:   #93a1bb;
  --muted-2: #6b7a96;
  --brand-soft: #14264d;
  --blue-bg:   #14264d;
  --green-bg:  #0d2f27;
  --amber-bg:  #34260f;
  --red-bg:    #3a1620;
  --violet-bg: #241b45;
  --slate-bg:  #1c2740;
  --teal-bg:   #0d2b2b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow:    0 4px 18px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}

/* ------------------------------------------------------------------ Base */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: .95rem; }
p  { margin: 0; }
a  { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .86em; background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }

::selection { background: var(--brand); color: #fff; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.eyebrow {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}

/* ------------------------------------------------------------- Application */
body.app { display: flex; min-height: 100vh; }

.shell {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  margin-left: var(--sidebar-w);
}

/* --------------------------------------------------------------- Sidebar */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 60;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo {
  display: block; font-size: 1.32rem; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(120deg, var(--brand), #22c1ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sidebar-brand small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.nav-group { margin-bottom: 2px; }
.nav-group > summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: .84rem; font-weight: 600; color: var(--text-2);
  list-style: none; user-select: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  content: "\ea5f"; font-family: "tabler-icons" !important; margin-left: auto;
  font-size: .95rem; color: var(--muted-2); transition: transform .18s;
}
.nav-group[open] > summary::after { transform: rotate(180deg); }
.nav-group > summary:hover { background: var(--surface-2); }
.nav-group > summary i { font-size: 1.05rem; color: var(--brand); }
.nav-tag {
  font-style: normal; font-size: .6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; background: var(--amber-bg); color: var(--amber);
  padding: 1px 6px; border-radius: 20px;
}

.nav-group ul { list-style: none; margin: 2px 0 8px; padding: 0 0 0 14px; border-left: 1px solid var(--border); margin-left: 20px; }
.nav-group li a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: .84rem; text-decoration: none;
}
.nav-group li a i { font-size: .95rem; }
.nav-group li a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-group li a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.sidebar-foot { padding: 12px 14px 16px; border-top: 1px solid var(--border); }
.plan-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px;
}
.plan-chip i { font-size: 1.1rem; color: var(--brand); }
.plan-chip b { display: block; font-size: .8rem; }
.plan-chip small { color: var(--muted); font-size: .7rem; }
.version { display: block; margin-top: 9px; font-size: .66rem; color: var(--muted-2); text-align: center; }

/* ---------------------------------------------------------------- Topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: .95rem; }
.topbar-title i { color: var(--brand); font-size: 1.15rem; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); cursor: pointer; font-size: 1.05rem; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--brand); text-decoration: none; }
.burger { display: none; }

.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 6px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #22c1ff);
  color: #fff; font-size: .74rem; font-weight: 700; letter-spacing: .02em;
}
.user-meta b { display: block; font-size: .81rem; line-height: 1.2; }
.user-meta small { color: var(--muted); font-size: .68rem; }

/* ------------------------------------------------------------------ Main */
.main { flex: 1; padding: 26px 26px 40px; max-width: 1560px; width: 100%; }

.app-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 26px 24px; color: var(--muted-2); font-size: .72rem;
  border-top: 1px solid var(--border);
}

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-head-copy p { color: var(--muted); font-size: .88rem; margin-top: 4px; max-width: 70ch; }
.page-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Panels */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 18px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 15px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.panel-hint { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.panel-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.panel-body { padding: 18px; }
.panel-body > :last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------- Grids */
.grid { display: grid; gap: 14px; margin-bottom: 18px; }
.grid-auto  { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-2     { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3     { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4     { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-wide  { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .grid-wide { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ Indicateurs */
.stat {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 1.15rem;
}
.stat-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.stat-label { font-size: .78rem; color: var(--muted); margin-top: 1px; }
.stat-hint  { font-size: .72rem; color: var(--muted-2); margin-top: 5px; }
.stat-body  { min-width: 0; }

.stat.tone-blue   .stat-icon { background: var(--blue-bg);   color: var(--blue); }
.stat.tone-green  .stat-icon { background: var(--green-bg);  color: var(--green); }
.stat.tone-amber  .stat-icon { background: var(--amber-bg);  color: var(--amber); }
.stat.tone-red    .stat-icon { background: var(--red-bg);    color: var(--red); }
.stat.tone-violet .stat-icon { background: var(--violet-bg); color: var(--violet); }
.stat.tone-slate  .stat-icon { background: var(--slate-bg);  color: var(--slate); }
.stat.tone-teal   .stat-icon { background: var(--teal-bg);   color: var(--teal); }

/* --------------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 20px;
  font-size: .71rem; font-weight: 650; white-space: nowrap;
}
.badge i { font-size: .85rem; }
.badge.tone-blue   { background: var(--blue-bg);   color: var(--blue); }
.badge.tone-green  { background: var(--green-bg);  color: var(--green); }
.badge.tone-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge.tone-red    { background: var(--red-bg);    color: var(--red); }
.badge.tone-violet { background: var(--violet-bg); color: var(--violet); }
.badge.tone-slate  { background: var(--slate-bg);  color: var(--slate); }
.badge.tone-teal   { background: var(--teal-bg);   color: var(--teal); }

/* --------------------------------------------------------------- Alertes */
.alert {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 15px; border-radius: var(--radius-sm);
  border: 1px solid transparent; margin-bottom: 14px; font-size: .87rem;
}
.alert i { font-size: 1.15rem; flex: none; margin-top: 1px; }
.alert-ok   { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 22%, transparent); }
.alert-warn { background: var(--amber-bg); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 22%, transparent); }
.alert-err  { background: var(--red-bg);   color: var(--red);   border-color: color-mix(in srgb, var(--red) 22%, transparent); }
.alert-info { background: var(--blue-bg);  color: var(--blue);  border-color: color-mix(in srgb, var(--blue) 22%, transparent); }
.alert b { font-weight: 700; }

/* --------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: .83rem; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.btn i { font-size: 1rem; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, var(--border)); }
.btn.danger:hover { background: var(--red-bg); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { background: #047857; color: #fff; }
.btn.icon { width: 34px; height: 34px; padding: 0; }
.btn.block { width: 100%; }
.btn.small { padding: 5px 10px; font-size: .76rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.inline-form { display: inline-block; }

/* ------------------------------------------------------------ Formulaires */
.field { display: block; margin-bottom: 13px; }
.field-label { display: block; font-size: .76rem; font-weight: 650; color: var(--text-2); margin-bottom: 5px; }
.field-hint { display: block; margin-top: 4px; font-size: .71rem; color: var(--muted-2); }

.input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: .87rem;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
textarea.input { resize: vertical; min-height: 74px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: .83rem; padding: 6px 0; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }

.filters { display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin-bottom: 0; min-width: 150px; }

/* --------------------------------------------------------------- Tableaux */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.table th {
  text-align: left; padding: 9px 12px; white-space: nowrap;
  font-size: .69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table .ta-right, .table td.ta-right { text-align: right; }
.table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 650; }
.table .muted { color: var(--muted); }
.table .actions { display: flex; gap: 5px; justify-content: flex-end; }
.table tr.row-warn { background: color-mix(in srgb, var(--amber) 7%, transparent); }
.table tr.row-danger { background: color-mix(in srgb, var(--red) 7%, transparent); }

/* -------------------------------------------------------------- Vide/état */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 42px 20px; text-align: center; color: var(--muted);
}
.empty-state i { font-size: 2.1rem; color: var(--muted-2); }
.empty-state p { font-size: .87rem; max-width: 46ch; }

/* ------------------------------------------------------------- Progression */
.pbar { margin: 8px 0; }
.pbar-meta { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); margin-bottom: 5px; }
.pbar-meta b { color: var(--text); }
.pbar-track { height: 8px; border-radius: 20px; background: var(--surface-3); overflow: hidden; }
.pbar-fill { height: 100%; border-radius: 20px; transition: width .4s ease; }
.pbar-fill.tone-blue   { background: linear-gradient(90deg, var(--brand), #22c1ff); }
.pbar-fill.tone-green  { background: linear-gradient(90deg, var(--green), #34d399); }
.pbar-fill.tone-amber  { background: linear-gradient(90deg, var(--amber), #fbbf24); }
.pbar-fill.tone-red    { background: linear-gradient(90deg, var(--red), #f87171); }
.pbar-fill.tone-violet { background: linear-gradient(90deg, var(--violet), #a78bfa); }
.pbar-fill.tone-slate  { background: var(--slate); }

/* ------------------------------------------------------------- Graphiques */
.chart-scroll { overflow-x: auto; padding-bottom: 4px; }
.chart-bars { width: 100%; min-width: 340px; height: 210px; }
.chart-bars .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart-bars .bar { fill: var(--brand); }
.chart-bars .bar.over { fill: var(--amber); }
.chart-bars .bar-value { font-size: 9.5px; fill: var(--muted); font-weight: 600; }
.chart-bars .bar-label { font-size: 9.5px; fill: var(--muted-2); }
.chart-bars .limit-line { stroke: var(--red); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.chart-bars .limit-text { font-size: 9.5px; fill: var(--red); font-weight: 600; }

.seg-bar { display: flex; height: 13px; border-radius: 20px; overflow: hidden; background: var(--surface-3); }
.seg { height: 100%; }
.seg.tone-blue { background: var(--blue); } .seg.tone-green { background: var(--green); }
.seg.tone-amber { background: var(--amber); } .seg.tone-red { background: var(--red); }
.seg.tone-violet { background: var(--violet); } .seg.tone-slate { background: var(--slate); }
.seg.tone-teal { background: var(--teal); }
.seg-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: .78rem; color: var(--muted); }
.seg-item { display: inline-flex; align-items: center; gap: 6px; }
.seg-item b { color: var(--text); font-weight: 650; }
.seg-item em { font-style: normal; color: var(--muted-2); font-size: .72rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.tone-blue { background: var(--blue); } .dot.tone-green { background: var(--green); }
.dot.tone-amber { background: var(--amber); } .dot.tone-red { background: var(--red); }
.dot.tone-violet { background: var(--violet); } .dot.tone-slate { background: var(--slate); }
.dot.tone-teal { background: var(--teal); }

.gauge { width: 130px; height: 130px; margin: 0 auto; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .gauge-track { fill: none; stroke: var(--surface-3); stroke-width: 11; }
.gauge .gauge-fill { fill: none; stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.gauge.tone-blue  .gauge-fill { stroke: var(--brand); }
.gauge.tone-green .gauge-fill { stroke: var(--green); }
.gauge.tone-amber .gauge-fill { stroke: var(--amber); }
.gauge.tone-red   .gauge-fill { stroke: var(--red); }
.gauge .gauge-value, .gauge .gauge-label { transform: rotate(90deg); transform-origin: 65px 65px; }
.gauge .gauge-value { font-size: 21px; font-weight: 700; fill: var(--text); }
.gauge .gauge-label { font-size: 9.5px; fill: var(--muted); }

/* ------------------------------------------------------------------ Faits */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 18px; margin: 0; }
.facts dt { font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: .92rem; font-weight: 620; }

/* ---------------------------------------------------------------- Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.timeline li:last-child { border-bottom: none; }
.timeline li > i {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: .95rem;
  background: var(--slate-bg); color: var(--slate);
}
.timeline li.tone-blue > i   { background: var(--blue-bg);   color: var(--blue); }
.timeline li.tone-green > i  { background: var(--green-bg);  color: var(--green); }
.timeline li.tone-amber > i  { background: var(--amber-bg);  color: var(--amber); }
.timeline li.tone-red > i    { background: var(--red-bg);    color: var(--red); }
.timeline li.tone-violet > i { background: var(--violet-bg); color: var(--violet); }
.timeline li > div { flex: 1; min-width: 0; }
.timeline b { display: block; font-size: .85rem; font-weight: 620; }
.timeline span { display: block; font-size: .78rem; color: var(--muted); }
.timeline time { font-size: .72rem; color: var(--muted-2); white-space: nowrap; }

/* ------------------------------------------------------------------ Photos */
.photo-thumb {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; padding: 4px; cursor: pointer;
}
.photo-thumb img { width: 54px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.photo-thumb span { font-size: .62rem; color: var(--muted); }
.photo-thumb:hover { border-color: var(--brand); }
.photo-missing {
  display: inline-grid; place-items: center; width: 40px; height: 34px;
  border-radius: 8px; border: 1px dashed var(--border-strong); color: var(--muted-2);
}

.photo-viewer {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6, 10, 20, .9);
  display: grid; place-items: center; padding: 28px;
}
.photo-viewer[hidden] { display: none; }
.photo-viewer figure { margin: 0; max-width: 96vw; max-height: 88vh; text-align: center; }
.photo-viewer img { max-width: 100%; max-height: 80vh; border-radius: 12px; box-shadow: var(--shadow-lg); }
.photo-viewer figcaption { color: #e2e8f0; font-size: .84rem; margin-top: 10px; }
.pv-close {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 1.2rem; cursor: pointer;
}

/* ------------------------------------------------------------- Feuille de route */
.roadmap { margin-bottom: 18px; }
.roadmap-head {
  display: flex; align-items: center; gap: 15px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.roadmap-icon {
  width: 48px; height: 48px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 1.4rem;
  background: var(--brand-soft); color: var(--brand);
}
.roadmap-head > div { flex: 1; min-width: 220px; }
.roadmap-head p { color: var(--muted); font-size: .85rem; margin-top: 3px; }
.roadmap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.roadmap-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.roadmap-card h3 { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin-bottom: 10px; }
.roadmap-card h3 i { color: var(--brand); }
.roadmap-card ul { list-style: none; margin: 0; padding: 0; }
.roadmap-card li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .82rem; color: var(--text-2); padding: 5px 0;
}
.roadmap-card li i { color: var(--muted-2); font-size: .95rem; margin-top: 1px; }
.roadmap-card li.done { color: var(--muted); }
.roadmap-card li.done i { color: var(--green); }

/* ------------------------------------------------------------- Module bloqué */
.locked-card {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.locked-card > i { font-size: 2.2rem; color: var(--amber); }
.locked-card p { margin-bottom: 8px; color: var(--text-2); font-size: .9rem; }
.locked-actions { margin-top: 14px; }

/* ---------------------------------------------------------------- Cartes ad hoc */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; padding: 22px 24px; margin-bottom: 18px;
  border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(125deg, #0b2a6b 0%, var(--brand) 55%, #22a7ff 100%);
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 1.5rem; }
.hero p { color: rgba(255, 255, 255, .82); font-size: .88rem; margin-top: 5px; }
.hero .eyebrow { color: rgba(255, 255, 255, .72); }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hero-meta span {
  background: rgba(255, 255, 255, .16); border-radius: 20px;
  padding: 3px 11px; font-size: .74rem; font-weight: 600;
}
.hero .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .28); color: #fff; }
.hero .btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile {
  display: flex; gap: 11px; align-items: center; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 15px; color: var(--text);
}
.tile:hover { border-color: var(--brand); text-decoration: none; box-shadow: var(--shadow-sm); }
.tile i { font-size: 1.3rem; color: var(--brand); }
.tile b { display: block; font-size: .86rem; }
.tile small { color: var(--muted); font-size: .73rem; }

.split-list { list-style: none; margin: 0; padding: 0; }
.split-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .85rem;
}
.split-list li:last-child { border-bottom: none; }
.split-list b { font-weight: 650; font-variant-numeric: tabular-nums; }
.split-list .total { border-top: 2px solid var(--border-strong); padding-top: 11px; font-size: .95rem; }

/* ----------------------------------------------------------------- Planning */
.planning { overflow-x: auto; }
.planning table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: .78rem; }
.planning th, .planning td { border: 1px solid var(--border); padding: 0; height: 34px; }
.planning th { background: var(--surface-2); font-weight: 650; font-size: .68rem; color: var(--muted); padding: 6px 8px; text-align: center; }
.planning th.veh { text-align: left; min-width: 190px; position: sticky; left: 0; z-index: 2; }
.planning td.veh { padding: 6px 10px; font-weight: 600; background: var(--surface); position: sticky; left: 0; z-index: 1; }
.planning td.weekend { background: var(--surface-2); }
.planning .slot { display: block; height: 100%; border-radius: 4px; }
.planning .slot.loc  { background: var(--brand); }
.planning .slot.mis  { background: var(--violet); }
.planning .slot.mnt  { background: var(--amber); }
.planning-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: .76rem; color: var(--muted); }

/* ------------------------------------------------------------ Authentification */
body.auth { display: block; background: var(--bg); }
.auth-split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

.auth-pitch {
  padding: 54px 52px; color: #fff;
  background: linear-gradient(150deg, #061634 0%, #0b3ea8 48%, #0b5cff 100%);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-brand { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 26px; }
.auth-pitch h1 { font-size: 2.15rem; max-width: 16ch; margin-bottom: 14px; }
.auth-pitch p { color: rgba(255, 255, 255, .8); max-width: 48ch; font-size: .95rem; }
.auth-modules { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; max-width: 540px; }
.auth-modules li {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 20px; padding: 5px 12px; font-size: .76rem; color: rgba(255, 255, 255, .6);
}
.auth-modules li.on { background: rgba(255, 255, 255, .2); color: #fff; border-color: rgba(255, 255, 255, .32); }
.auth-pitch footer { margin-top: auto; padding-top: 40px; font-size: .74rem; color: rgba(255, 255, 255, .55); }

.auth-form-wrap { display: grid; place-items: center; padding: 34px 22px; }
/* Téléphone : un bandeau compact à la marque, le formulaire tout de suite dessous.
   (Placé après .auth-pitch, sinon sa règle de base l'emporte.) */
@media (max-width: 940px) {
  .auth-split { grid-template-columns: 1fr; min-height: 0; }
  .auth-pitch { padding: calc(16px + env(safe-area-inset-top, 0px)) 22px 16px; }
  .auth-brand { margin: 0; font-size: 1.4rem; }
  .auth-pitch h1, .auth-pitch p, .auth-modules, .auth-pitch footer { display: none; }
  .auth-form-wrap { place-items: start center; padding: 26px 22px 34px; }
}
.auth-card { width: 100%; max-width: 430px; }
.auth-card h2 { font-size: 1.5rem; }
.auth-sub { color: var(--muted); font-size: .87rem; margin: 4px 0 22px; }
.auth-demo { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.auth-demo-title { display: block; font-size: .74rem; color: var(--muted); margin-bottom: 11px; }
.auth-demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 7px; }
.demo-account {
  display: flex; align-items: center; gap: 9px; text-align: left;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; padding: 8px 10px; cursor: pointer; font: inherit; color: var(--text);
}
.demo-account:hover { border-color: var(--brand); background: var(--surface-2); }
.demo-account i { font-size: 1.1rem; color: var(--brand); flex: none; }
.demo-account b { display: block; font-size: .76rem; }
.demo-account small { color: var(--muted); font-size: .67rem; }

/* ------------------------------------------------------------------ Erreurs */
body.errorpage { display: grid; place-items: center; min-height: 100vh; padding: 26px; }
.error-card {
  max-width: 520px; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 42px 36px; box-shadow: var(--shadow);
}
.error-code { font-size: 3.4rem; font-weight: 800; color: var(--brand); letter-spacing: -.04em; }
.error-card h1 { margin: 6px 0 10px; }
.error-card p { color: var(--muted); font-size: .9rem; }
.error-actions { display: flex; gap: 9px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }

/* -------------------------------------------------------------- Responsive */
@media (max-width: 1080px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .shell { margin-left: 0; }
  .burger { display: inline-flex; }
  .main { padding: 20px 16px 34px; }
  .topbar { padding: 10px 16px; }
  .user-meta { display: none; }
}
@media (max-width: 620px) {
  h1 { font-size: 1.32rem; }
  .page-head { align-items: flex-start; }
  .stat-value { font-size: 1.25rem; }
  .hero { padding: 18px; }
}

body.nav-open::after {
  content: ""; position: fixed; inset: 0; z-index: 55;
  background: rgba(8, 12, 24, .45);
}
@media (min-width: 1081px) { body.nav-open::after { display: none; } }

/* ------------------------------------------- Application installée, hors ligne */
.outbox {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 60; width: min(560px, calc(100% - 32px));
  display: grid; gap: 6px; padding: 10px 12px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .9rem;
}
.outbox.is-offline { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.outbox-row { display: flex; align-items: center; gap: 10px; }
.outbox-row > .ti { font-size: 1.2rem; color: var(--brand); flex: none; }
.outbox.is-offline .outbox-row > .ti { color: var(--amber); }
.outbox-row > span { flex: 1; min-width: 0; }
.outbox-row .btn { flex: none; }
.outbox-row .ti-alert-circle { color: var(--red) !important; }
.outbox-row .ti-circle-check { color: var(--green) !important; }
.auth-install { margin-top: 10px; }
.auth-install-hint { margin: 10px 0 0; font-size: .88rem; color: var(--muted); text-align: center; }
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top, 0px); }
}

/* ----------------------------------------------------------------- Impression */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --border: #d5dae3; }
  body.app { display: block; background: #fff; }
  .sidebar, .topbar, .app-foot, .no-print, .photo-viewer, .page-head-actions, .panel-actions, .filters { display: none !important; }
  .shell { margin-left: 0; }
  .main { padding: 0; max-width: none; }
  .panel { break-inside: avoid; box-shadow: none; border-color: #d5dae3; margin-bottom: 12px; }
  .stat, .roadmap-card { break-inside: avoid; }
  .table { font-size: 10.5pt; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 12mm; }
}

/* ------------------------------------------------ Journal de mission compact */
.mission-journal-table .table {
  min-width: 1180px;
  table-layout: fixed;
  font-size: .78rem;
}
.mission-journal-table .table th {
  padding: 8px 8px;
  font-size: .63rem;
  letter-spacing: .035em;
}
.mission-journal-table .table td {
  padding: 8px 8px;
  line-height: 1.28;
  vertical-align: top;
}
.mission-journal-table .table th:nth-child(1),
.mission-journal-table .table td:nth-child(1) { width: 88px; }
.mission-journal-table .table th:nth-child(2),
.mission-journal-table .table td:nth-child(2) { width: 92px; }
.mission-journal-table .table th:nth-child(3),
.mission-journal-table .table td:nth-child(3) { width: 145px; }
.mission-journal-table .table th:nth-child(4),
.mission-journal-table .table td:nth-child(4) { width: 215px; }
.mission-journal-table .table th:nth-child(5),
.mission-journal-table .table td:nth-child(5) { width: 112px; }
.mission-journal-table .table th:nth-child(6),
.mission-journal-table .table td:nth-child(6) { width: 82px; }
.mission-journal-table .table th:nth-child(7),
.mission-journal-table .table td:nth-child(7) { width: 88px; }
.mission-journal-table .table th:nth-child(8),
.mission-journal-table .table td:nth-child(8) { width: 132px; }
.mission-journal-table .table th:nth-child(9),
.mission-journal-table .table td:nth-child(9) { width: 92px; }
.mission-journal-table .table th:nth-child(10),
.mission-journal-table .table td:nth-child(10) { width: 86px; }
.mission-journal-table .photo-thumb { padding: 3px; margin: 0 2px 2px 0; }
.mission-journal-table .photo-thumb img { width: 46px; height: 34px; }
.mission-journal-table .photo-thumb span { font-size: .56rem; }
.mission-journal-table .btn.small { padding: 5px 7px; font-size: .68rem; }

.mission-fuel-table .table {
  min-width: 820px;
  font-size: .79rem;
}
.mission-fuel-table .table th { font-size: .64rem; padding: 8px 10px; }
.mission-fuel-table .table td { padding: 8px 10px; vertical-align: top; line-height: 1.3; }
.mission-fuel-table .table th:nth-child(1), .mission-fuel-table .table td:nth-child(1) { width: 105px; }
.mission-fuel-table .table th:nth-child(2), .mission-fuel-table .table td:nth-child(2) { min-width: 230px; }
.mission-fuel-table .table th:nth-child(3), .mission-fuel-table .table td:nth-child(3) { width: 110px; }
.mission-fuel-table .table th:nth-child(4), .mission-fuel-table .table td:nth-child(4) { width: 125px; }
.mission-fuel-table .table th:nth-child(5), .mission-fuel-table .table td:nth-child(5) { width: 185px; }
.mission-fuel-table .table th:nth-child(6), .mission-fuel-table .table td:nth-child(6) { width: 90px; }
.mission-fuel-table .photo-thumb img { width: 46px; height: 34px; }
.mission-fuel-table .photo-thumb span { font-size: .56rem; }

@media (max-width: 760px) {
  .mission-journal-table .table { font-size: .74rem; }
  .mission-fuel-table .table { font-size: .75rem; }
}

/* Journal mission — socle FleetXP 1108 */
.mission-journal-table,.mission-fuel-table{overflow-x:auto}.mission-journal-table table{min-width:1180px;table-layout:fixed;font-size:12.5px;line-height:1.35}.mission-journal-table th{font-size:11px;white-space:nowrap;padding:9px 7px}.mission-journal-table td{padding:9px 7px;vertical-align:middle}.mission-journal-table th:nth-child(1){width:82px}.mission-journal-table th:nth-child(2){width:104px}.mission-journal-table th:nth-child(3){width:145px}.mission-journal-table th:nth-child(4){width:225px}.mission-journal-table th:nth-child(5){width:125px}.mission-journal-table th:nth-child(6){width:82px}.mission-journal-table th:nth-child(7){width:88px}.mission-journal-table th:nth-child(8){width:108px}.mission-journal-table th:nth-child(9){width:94px}.mission-journal-table .photo,.mission-fuel-table .photo{width:38px;height:38px;object-fit:cover}.mission-fuel-table table{min-width:850px;font-size:12.5px}.fuel-checkin-line{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:12px;padding:12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}.fx-bars{display:grid;gap:7px;max-height:330px;overflow:auto}.fx-bar-row{display:grid;grid-template-columns:44px 1fr 70px;gap:8px;align-items:center;font-size:12px}.fx-bar-row>div{height:8px;border-radius:99px;background:var(--surface-2);overflow:hidden}.fx-bar-row i{display:block;height:100%;background:currentColor;border-radius:99px}.fx-bar-row b{text-align:right;font-size:11px}

/* Journal de mission — finition UX 12/08 */
.mission-journal-table{overflow-x:auto}
.mission-journal-table table{min-width:1160px;table-layout:fixed;font-size:13px;line-height:1.35}
.mission-journal-table th{font-size:11.5px;letter-spacing:.01em;white-space:nowrap;padding:9px 8px}
.mission-journal-table td{padding:9px 8px;vertical-align:middle}
.mission-journal-table th:nth-child(1),.mission-journal-table td:nth-child(1){width:82px}
.mission-journal-table th:nth-child(2),.mission-journal-table td:nth-child(2){width:106px}
.mission-journal-table th:nth-child(3),.mission-journal-table td:nth-child(3){width:145px}
.mission-journal-table th:nth-child(4),.mission-journal-table td:nth-child(4){width:238px}
.mission-journal-table th:nth-child(5),.mission-journal-table td:nth-child(5){width:125px}
.mission-journal-table th:nth-child(6),.mission-journal-table td:nth-child(6){width:82px}
.mission-journal-table th:nth-child(7),.mission-journal-table td:nth-child(7){width:90px}
.mission-journal-table th:nth-child(8),.mission-journal-table td:nth-child(8){width:104px}
.mission-journal-table th:nth-child(9),.mission-journal-table td:nth-child(9){width:90px}
.mission-journal-table th:nth-child(10),.mission-journal-table td:nth-child(10){width:86px}
.mission-journal-table .photo,.mission-fuel-table .photo,.fuel-point0 .photo{width:38px;height:38px;object-fit:cover;border-radius:7px}

.fuel-mission-strip{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin-bottom:12px}
.fuel-mission-strip>div{border:1px solid var(--border);border-radius:12px;background:var(--surface-2);padding:10px 12px;min-width:0}
.fuel-mission-strip span,.fuel-mission-strip small{display:block;color:var(--muted);font-size:11px}
.fuel-mission-strip b{display:block;font-size:14px;line-height:1.25;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mission-fuel-table{overflow-x:auto}
.mission-fuel-table table{min-width:900px;font-size:12.8px}
.mission-fuel-table th,.mission-fuel-table td{padding:9px 8px;vertical-align:middle}
.fuel-point0{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:10px;padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}
.fuel-point0>div:first-child{display:flex;align-items:center;gap:9px}.fuel-point0 i{font-size:20px}.fuel-point0 span small,.fuel-point0 span b{display:block}.fuel-point0 span small{font-size:11px;color:var(--muted);margin-bottom:2px}.fuel-point0 span b{font-size:12.5px}
.fuel-advice{display:flex;align-items:center;gap:7px;margin-top:9px;padding:8px 11px;border-radius:10px;font-size:12px}.fuel-advice.ok{background:var(--green-bg);color:var(--green)}.fuel-advice.warn{background:var(--amber-bg);color:var(--amber)}

.analysis-summary{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.analysis-summary span{border:1px solid var(--border);background:var(--surface-2);border-radius:999px;padding:6px 10px;font-size:11.5px;color:var(--muted)}.analysis-summary b{color:var(--text)}
.mission-charts{display:grid;grid-template-columns:1fr 1fr;gap:12px}.mission-chart-card{border:1px solid var(--border);border-radius:12px;padding:12px;background:var(--surface)}.chart-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.chart-head b{font-size:13px}.chart-head span{font-size:11px;color:var(--muted)}
.fx-vbars{height:180px;display:flex;align-items:stretch;gap:4px;border-bottom:1px solid var(--border);padding:8px 4px 0;overflow:hidden}.fx-vbar{flex:1;min-width:7px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:5px}.fx-vbar>div{width:100%;height:145px;display:flex;align-items:flex-end;justify-content:center}.fx-vbar i{display:block;width:min(18px,75%);min-height:2px;background:var(--brand);border-radius:4px 4px 1px 1px}.fx-vbar span{font-size:8.5px;color:var(--muted);white-space:nowrap}.fx-vbars.overtime{opacity:.92}.fx-vbars.overtime .fx-vbar i{background:var(--violet)}
.mission-finance table{font-size:13px}.mission-finance td:last-child,.mission-finance th:last-child{text-align:right}.finance-total{font-size:15px}

@media(max-width:900px){.fuel-mission-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.mission-charts{grid-template-columns:1fr}.fx-vbars{height:165px}.fx-vbar>div{height:130px}}
@media(max-width:620px){.fuel-mission-strip{grid-template-columns:1fr 1fr}.fuel-point0{align-items:flex-start;flex-direction:column}.mission-journal-table table{font-size:12px}.analysis-summary{display:grid}.fx-vbar span{font-size:8px}}


/* --------------------------------------------------------------------------
   Journal mission — correctif graphiques SVG 12/08
   Remplace le rendu flex des barres verticales, plus sensible au cache/CSS.
   -------------------------------------------------------------------------- */
.mission-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.mission-chart-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 8px;
  background: var(--surface);
  overflow: hidden;
}
.mission-chart-card .chart-scroll {
  width: 100%;
  overflow-x: auto;
  padding: 0 0 3px;
}
.mission-svg-chart {
  display: block;
  width: 100%;
  height: 220px;
}
.mission-svg-chart.overtime-chart .bar {
  fill: var(--violet);
}
.mission-svg-chart .bar {
  transition: opacity .15s ease;
}
.mission-svg-chart .bar:hover {
  opacity: .78;
}
@media (max-width: 960px) {
  .mission-charts { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .mission-chart-card { padding: 10px 8px 6px; }
  .mission-svg-chart { height: 205px; }
}


/* Journal mission — validation des heures supplémentaires */
.hours-validation-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.hours-validation-list h3 {
  margin-bottom: 9px;
  font-size: .86rem;
}

/* Les KPI du carburant utilisent désormais le composant natif FleetXP.
   On les compacte uniquement dans le panneau carburant. */
.panel:has(.mission-fuel-table) > .panel-body > .grid-auto:first-child {
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 10px;
}
.panel:has(.mission-fuel-table) > .panel-body > .grid-auto:first-child .stat {
  padding: 11px 12px;
}
.panel:has(.mission-fuel-table) > .panel-body > .grid-auto:first-child .stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.panel:has(.mission-fuel-table) > .panel-body > .grid-auto:first-child .stat-value {
  font-size: 1.08rem;
}
@media (max-width: 1050px) {
  .panel:has(.mission-fuel-table) > .panel-body > .grid-auto:first-child {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }
}
@media (max-width: 620px) {
  .panel:has(.mission-fuel-table) > .panel-body > .grid-auto:first-child {
    grid-template-columns: 1fr 1fr;
  }
}


/* Application chauffeur — expérience terrain */
.driver-mission-hero{margin-bottom:14px;padding:18px 20px;border-radius:16px;background:linear-gradient(125deg,#0b2a6b,var(--brand));color:#fff}.driver-mission-hero .eyebrow{color:rgba(255,255,255,.7)}.driver-mission-hero h1{font-size:1.35rem;margin-top:3px}.driver-mission-hero p{font-size:.82rem;color:rgba(255,255,255,.82);margin-top:5px}.driver-mission-hero>div{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.driver-mission-hero>div span{padding:3px 9px;border-radius:99px;background:rgba(255,255,255,.14);font-size:.72rem}
.driver-steps{display:grid;gap:8px}.driver-step{display:flex;align-items:center;gap:11px;padding:11px 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}.driver-step>i{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--slate-bg);color:var(--slate);font-size:1.05rem}.driver-step span{min-width:0}.driver-step b,.driver-step small{display:block}.driver-step b{font-size:.82rem}.driver-step small{font-size:.72rem;color:var(--muted);margin-top:2px}.driver-step.done>i{background:var(--green-bg);color:var(--green)}.driver-step.current{border-color:color-mix(in srgb,var(--brand) 35%,var(--border));background:var(--brand-soft)}.driver-step.current>i{background:var(--brand);color:#fff}.driver-step.locked{opacity:.55}
.driver-action-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.driver-action-grid .btn,.driver-action-grid form,.driver-action-grid form .btn{width:100%;min-height:44px}.readonly-card{padding:9px 11px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.readonly-card b,.readonly-card span{display:block}.readonly-card b{font-size:.83rem}.readonly-card span{font-size:.72rem;color:var(--muted);margin-top:2px}
@media(max-width:700px){.driver-action-grid{grid-template-columns:1fr}.driver-mission-hero{padding:15px}.driver-step{padding:10px}.driver-step>i{width:32px;height:32px}.driver-mission-hero h1{font-size:1.18rem}}


/* Application chauffeur v3.4 — compléments robustes */
.driver-history-help{font-size:.78rem;color:var(--muted)}
@media(max-width:700px){
  .main .hero{padding:16px 17px}
  .main .hero h1{font-size:1.2rem}
  .main .timeline li{padding:10px 0}
  .main .timeline li>i{width:32px;height:32px}
}


/* Navigation mobile Chauffeur — reprise de l'accès rapide de fleetxp-1108 */
.driver-bottom-nav{display:none}
@media(max-width:900px){
  body.role-driver .main{padding-bottom:92px}
  body.role-driver .app-foot{padding-bottom:86px}
  .driver-bottom-nav{
    position:fixed;left:0;right:0;bottom:0;z-index:90;
    display:grid;grid-template-columns:repeat(5,1fr);
    background:color-mix(in srgb,var(--surface) 94%,transparent);
    backdrop-filter:blur(12px);border-top:1px solid var(--border);
    padding:6px max(6px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));
    box-shadow:0 -6px 22px rgba(15,23,42,.08)
  }
  .driver-bottom-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:48px;border-radius:10px;color:var(--muted);font-size:.64rem;text-decoration:none}
  .driver-bottom-nav a i{font-size:1.15rem}
  .driver-bottom-nav a.active{color:var(--brand);background:var(--brand-soft);font-weight:700}
}

/* Le bandeau des saisies en attente passe au-dessus de la barre de navigation chauffeur. */
@media (max-width: 900px) {
  body.role-driver .outbox { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

/* Véhicule du jour : chauffeur à plusieurs véhicules (missions simultanées). */
.vehicle-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.vehicle-switch-item {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  color: var(--text); text-decoration: none;
}
.vehicle-switch-item > .ti { font-size: 1.45rem; color: var(--muted); flex: none; }
.vehicle-switch-item span { display: grid; gap: 2px; min-width: 0; flex: 1; }
.vehicle-switch-item b { font-size: 1rem; overflow-wrap: anywhere; }
.vehicle-switch-item small { color: var(--muted); font-size: .8rem; }
.vehicle-switch-item.is-on { border-color: var(--brand); background: var(--brand-soft); }
.vehicle-switch-item.is-on > .ti { color: var(--brand); }

/* Compteur en miles : l'équivalent en km enregistré, bien visible pendant la saisie. */
.odometer-hint:empty { display: none; }
.odometer-hint.is-miles { color: var(--amber); font-weight: 600; }

/* Espace client : une carte par véhicule loué (missions simultanées). */
.rental-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.rental-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface); display: grid; gap: 12px; }
.rental-card-head { display: flex; align-items: center; gap: 12px; }
.rental-card-head > .ti { font-size: 1.6rem; color: var(--brand); flex: none; }
.rental-card-head b { display: block; font-size: 1.05rem; }
.rental-card-head small { color: var(--muted); font-size: .8rem; }
.rental-card-bar { height: 6px; border-radius: 6px; background: var(--slate-bg); overflow: hidden; }
.rental-card-bar span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.rental-card .form-actions { margin: 0; }

/* Suite d'une location : menu « Prolonger / Reconduire » (Rentals::followUpForms). */
.follow-up { position: relative; display: inline-block; text-align: left; }
.follow-up > summary { list-style: none; cursor: pointer; }
.follow-up > summary::-webkit-details-marker { display: none; }
.follow-up[open] > summary::before { content: ''; position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .38); cursor: default; }
.follow-up-menu { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 61; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  padding: 16px; display: grid; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); white-space: normal; text-align: left; }
.follow-up-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.follow-up-head span { color: var(--muted); font-size: 12px; }
.follow-up-menu > b { font-size: 13px; }
.follow-up-menu > small { color: var(--muted, #64748b); font-size: 12px; line-height: 1.35; }
.follow-up-form { display: grid; gap: 8px; margin-bottom: 8px; }
.follow-up-form .field { margin: 0; }
.follow-up-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.follow-up-form .btn { justify-self: start; }
