/* ===== CSS CUSTOM PROPERTIES — THEME LIGHT (default) ===== */
:root,
[data-theme="light"] {
  --body-bg:
    radial-gradient(circle at 15% 10%, rgba(31, 143, 95, .20), transparent 28%),
    radial-gradient(circle at 86% 16%, rgba(217, 155, 33, .22), transparent 24%),
    linear-gradient(135deg, #f7fbf8 0%, #f7f1e8 52%, #eef5fb 100%);
  --sidebar-bg: rgba(20, 31, 25, .95);
  --sidebar-text: #fff;
  --sidebar-muted: rgba(255, 255, 255, .62);
  --sidebar-nav-hover: rgba(255, 255, 255, .12);
  --paper: #fbfaf7;
  --panel: rgba(255, 255, 255, .88);
  --ink: #17211b;
  --muted: #66736c;
  --line: rgba(23, 33, 27, .12);
  --table-bg: rgba(255, 255, 255, .82);
  --table-head-bg: #eef7f1;
  --table-head-ink: #224134;
  --row-hover: rgba(31, 143, 95, .06);
  --input-bg: #fff;
  --pill-bg: rgba(255, 255, 255, .72);
  --shadow: 0 24px 70px rgba(24, 35, 29, .14);
  --shadow-sm: 0 8px 24px rgba(24, 35, 29, .10);
  --green: #1f8f5f;
  --blue: #2669d9;
  --gold: #d99b21;
  --red: #d94b3d;
  --theme-active-bg: rgba(255,255,255,.22);
  --theme-active-border: rgba(255,255,255,.5);
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
  --body-bg: linear-gradient(135deg, #0a0f0c 0%, #0f1a14 50%, #0d1420 100%);
  --sidebar-bg: rgba(4, 8, 6, .98);
  --sidebar-text: #d6ede0;
  --sidebar-muted: rgba(180, 220, 195, .55);
  --sidebar-nav-hover: rgba(255, 255, 255, .08);
  --paper: #0f1a14;
  --panel: rgba(18, 30, 23, .96);
  --ink: #d6ede0;
  --muted: #7aa08a;
  --line: rgba(255, 255, 255, .08);
  --table-bg: rgba(14, 24, 18, .98);
  --table-head-bg: #152219;
  --table-head-ink: #8dcfaa;
  --row-hover: rgba(31, 143, 95, .10);
  --input-bg: #152219;
  --pill-bg: rgba(255, 255, 255, .06);
  --shadow: 0 24px 70px rgba(0, 0, 0, .5);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .35);
  --green: #2dbd80;
  --blue: #4a90e8;
  --gold: #e0b84a;
  --red: #e8604e;
  --theme-active-bg: rgba(45,189,128,.15);
  --theme-active-border: rgba(45,189,128,.4);
}

/* ===== OCEAN THEME ===== */
[data-theme="ocean"] {
  --body-bg:
    radial-gradient(circle at 20% 20%, rgba(0, 100, 200, .18), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(0, 200, 180, .14), transparent 30%),
    linear-gradient(135deg, #e8f4fd 0%, #f0faff 50%, #e0f5f2 100%);
  --sidebar-bg: rgba(5, 20, 50, .97);
  --sidebar-text: #cce8ff;
  --sidebar-muted: rgba(180, 220, 255, .55);
  --sidebar-nav-hover: rgba(100, 180, 255, .12);
  --paper: #f0f8ff;
  --panel: rgba(230, 245, 255, .90);
  --ink: #0d2137;
  --muted: #3a6080;
  --line: rgba(13, 33, 55, .12);
  --table-bg: rgba(240, 250, 255, .90);
  --table-head-bg: #c8e8f8;
  --table-head-ink: #0d3a5c;
  --row-hover: rgba(0, 100, 200, .06);
  --input-bg: #f0f8ff;
  --pill-bg: rgba(255, 255, 255, .70);
  --shadow: 0 24px 70px rgba(0, 50, 120, .14);
  --shadow-sm: 0 8px 24px rgba(0, 50, 120, .10);
  --green: #00a878;
  --blue: #006fcf;
  --gold: #d9820a;
  --red: #d94040;
  --theme-active-bg: rgba(0,111,207,.12);
  --theme-active-border: rgba(0,111,207,.4);
}

/* ===== THÈME MARQUE D.H.I.S (remplace Contraste) ===== */
[data-theme="contrast"] {
  --body-bg:
    radial-gradient(circle at 10% 10%, rgba(80,200,120,.12), transparent 30%),
    radial-gradient(circle at 88% 20%, rgba(244,193,93,.10), transparent 28%),
    linear-gradient(145deg, #06100a 0%, #0b1a0e 50%, #0a160c 100%);
  --sidebar-bg:  rgba(3, 7, 4, .98);
  --sidebar-text: #e8f5ec;
  --sidebar-muted: rgba(232,245,236,.48);
  --sidebar-nav-hover: rgba(80,200,120,.12);
  --paper: #081309;
  --panel: rgba(10,20,12,.95);
  --ink:   #e8f5ec;
  --muted: #5a8a62;
  --line:  rgba(80,200,120,.14);
  --table-bg:       rgba(6,12,7,.98);
  --table-head-bg:  #091509;
  --table-head-ink: #50c878;
  --row-hover: rgba(80,200,120,.08);
  --input-bg:  #091509;
  --pill-bg:   rgba(80,200,120,.08);
  --shadow:    0 24px 70px rgba(0,0,0,.65);
  --shadow-sm: 0 8px 24px rgba(0,0,0,.45);
  --green: #50c878;
  --blue:  #f4c15d;
  --gold:  #f4c15d;
  --red:   #e8604e;
  --theme-active-bg:    rgba(80,200,120,.18);
  --theme-active-border:rgba(80,200,120,.5);
}

/* ===== RESET & BASE ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--body-bg);
  transition: background .35s ease, color .25s ease;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }

/* ===== LAYOUT ===== */
.shell { display: grid; grid-template-columns: clamp(230px, 18vw, 280px) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  overflow: auto;
  box-shadow: 10px 0 40px rgba(0, 0, 0, .18);
  transition: background .35s ease;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ===== BRAND / LOGO ===== */
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; }
.brand strong { display: block; font-size: 24px; letter-spacing: .02em; color: var(--sidebar-text); }
.brand span { color: var(--sidebar-muted); }

.logoBox {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #50c878, #f4c15d);
  color: #102117;
  font-weight: 800;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  flex-shrink: 0;
}
/* Logo sidebar : contain = logo entier visible, fond blanc quand image présente */
.logoBox img {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #fff;
  border-radius: inherit;
}
.logoBox:hover, .logoBox:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .28);
  outline: 0;
}

/* ===== NAVIGATION ===== */
nav { display: grid; gap: 8px; margin: 0 0 20px; }
.navBtn {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  color: var(--sidebar-muted);
  text-align: left;
  background: transparent;
  transition: transform .2s ease, background .2s ease, color .2s ease;
  font-weight: 500;
}
.navBtn:hover, .navBtn.active {
  transform: translateX(4px);
  background: var(--sidebar-nav-hover);
  color: var(--sidebar-text);
}

/* ===== THEME SWITCHER ===== */
.themeSection {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.10);
}
.themeLabel {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sidebar-muted);
  margin-bottom: 10px;
}
.themeGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.themeBtn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--sidebar-muted);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.themeBtn:hover { background: var(--sidebar-nav-hover); color: var(--sidebar-text); }
.themeBtn.active {
  background: var(--theme-active-bg);
  border-color: var(--theme-active-border);
  color: var(--sidebar-text);
}
.themeSwatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.2);
}
.swatchLight { background: linear-gradient(135deg, #f7fbf8, #50c878); }
.swatchDark  { background: linear-gradient(135deg, #0f1a14, #2dbd80); }
.swatchOcean { background: linear-gradient(135deg, #e8f4fd, #006fcf); }
.swatchContrast { background: linear-gradient(135deg, #fff 50%, #000 50%); }

.logoForm { display: none; }

/* ===== BUTTONS ===== */
.primary {
  padding: 11px 15px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 10px 24px rgba(31, 143, 95, .22);
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease;
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(31, 143, 95, .28); }
.ghost, .danger {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(38, 105, 217, .1);
  color: #164e9d;
}
[data-theme="dark"] .ghost { background: rgba(74,144,232,.15); color: #7ab8f5; }
[data-theme="ocean"] .ghost { background: rgba(0,111,207,.1); color: #0047ab; }
[data-theme="contrast"] .ghost { background: #e8e8e8; color: #000; border: 1px solid #000; }
.danger { background: rgba(217, 75, 61, .1); color: #a8281e; }
[data-theme="dark"] .danger { background: rgba(232,96,78,.15); color: #f08070; }
[data-theme="contrast"] .danger { background: #ffe0e0; color: #8b0000; border: 1px solid #8b0000; }

.iconBtn {
  width: 38px; height: 38px; padding: 0;
  display: inline-grid; place-items: center; flex: 0 0 auto;
}
.iconBtn svg {
  width: 19px; height: 19px; fill: none;
  stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.iconBtn:disabled { opacity: .42; cursor: not-allowed; }

/* ===== CONTENT ===== */
.content {
  min-width: 0;
  padding: clamp(16px, 2vw, 32px);
  transition: background .35s ease;
}
.topbar {
  display: flex; justify-content: space-between;
  gap: 20px; align-items: center; margin-bottom: 24px;
}
.eyebrow {
  margin: 0 0 6px; color: var(--green);
  font-weight: 800; text-transform: uppercase; font-size: 12px;
}
h1 { margin: 0; font-size: clamp(30px, 4vw, 54px); line-height: 1; color: var(--ink); }
h2, h3 { margin: 0; color: var(--ink); }
.ratePill {
  padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--pill-bg);
  color: var(--ink); white-space: nowrap;
  transition: background .25s ease, border-color .25s ease;
}

/* ===== VIEWS ===== */
.view { display: none; animation: enter .42s ease both; }
.view.active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ===== KPI CARDS ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  min-height: 154px; padding: 20px; border-radius: 24px;
  color: #fff; display: grid; align-content: space-between;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi:after {
  content: ""; position: absolute; right: -36px; bottom: -46px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, .18);
}
.kpi span, .kpi small { color: rgba(255, 255, 255, .80); font-size: 13px; }
.kpi strong { font-size: clamp(22px, 2.3vw, 34px); }
.accentA { background: linear-gradient(135deg, #197a52, #23a971); }
.accentB { background: linear-gradient(135deg, #c17a12, #e0aa3e); }
.accentC { background: linear-gradient(135deg, #1d5fbf, #42a5f5); }
.accentD { background: linear-gradient(135deg, #263238, #53636d); }

/* ===== PANELS ===== */
.panel {
  min-width: 0; padding: clamp(14px, 1.4vw, 20px);
  border: 1px solid var(--line); border-radius: 24px;
  background: var(--panel); box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: background .25s ease, border-color .25s ease;
}
.panelHead {
  display: flex; justify-content: space-between;
  gap: 14px; align-items: center; margin-bottom: 16px;
}
.panelHead h2 { font-size: 17px; }

/* ===== CHARTS GRID ===== */
.chartsGrid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.chartsGrid2 {
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}
.chartPanel { display: flex; flex-direction: column; }
.chartWrap {
  position: relative;
  flex: 1;
  min-height: 220px;
  max-height: 280px;
}
.chartWrap canvas { width: 100% !important; height: 100% !important; }
.chartDonut { max-height: 260px; display: flex; align-items: center; justify-content: center; }
.chartDonut canvas { max-width: 260px; max-height: 260px; }

/* ===== DASHBOARD GRID ===== */
.dashboardGrid {
  display: grid;
  grid-template-columns: minmax(300px, .88fr) minmax(440px, 1.12fr);
  gap: 18px;
  margin-bottom: 0;
}
.dashboardGrid > *, .reportGrid > *, .view > .panel { min-width: 0; }

/* ===== TABLES ===== */
.tableWrap {
  max-width: 100%; overflow: auto; border-radius: 16px;
  border: 1px solid var(--line); -webkit-overflow-scrolling: touch;
}
table {
  width: 100%; border-collapse: collapse; min-width: 900px;
  background: var(--table-bg);
  transition: background .25s ease;
}
th, td {
  padding: 12px 13px; text-align: left;
  border-bottom: 1px solid var(--line); font-size: 13px;
  vertical-align: top; overflow-wrap: anywhere; word-break: normal;
  color: var(--ink);
}
th {
  position: sticky; top: 0;
  background: var(--table-head-bg); color: var(--table-head-ink); z-index: 1;
  transition: background .25s ease;
}
tr:hover td { background: var(--row-hover); }

/* Hover only — no row background coloring */
#daily tbody tr:hover td { background: var(--row-hover); }

#daily .actions .iconBtn {
  border: 1px solid var(--line);
  background: var(--pill-bg);
  color: var(--muted);
  box-shadow: none;
  backdrop-filter: blur(5px);
}
#daily .actions .danger { color: var(--red); }
#daily .actions .iconBtn:hover { background: var(--panel); color: var(--ink); }

/* Table sizing */
#daily table { min-width: 1260px; }
#maintenance table { min-width: 1120px; }
#dashboard .dashboardGrid .panel:nth-child(2) table { min-width: 560px; }

/* ===== BADGES & LINKS ===== */
.linkCell { min-width: 120px; }
.docLink {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 8px 11px; border-radius: 999px;
  color: #fff; background: linear-gradient(135deg, var(--blue), var(--green));
  font-weight: 700; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 18px rgba(38, 105, 217, .16);
}
.mutedBadge {
  display: inline-flex; align-items: center; min-height: 30px;
  padding: 6px 10px; border-radius: 999px;
  color: var(--muted); background: var(--line);
  font-weight: 700; white-space: nowrap;
}
.statusBadge {
  display: inline-flex; align-items: center; min-height: 32px;
  padding: 7px 11px; border-radius: 999px; font-weight: 800;
  max-width: 100%; white-space: normal; line-height: 1.25;
}
.statusBadge.ok { color: #176342; background: rgba(31, 143, 95, .14); }
.statusBadge.warning { color: #8a5b00; background: rgba(217, 155, 33, .20); }
.statusBadge.danger { color: #9e261c; background: rgba(217, 75, 61, .16); }
[data-theme="dark"] .statusBadge.ok { color: #5edd9f; background: rgba(45,189,128,.15); }
[data-theme="dark"] .statusBadge.warning { color: #e0b84a; background: rgba(224,184,74,.12); }
[data-theme="dark"] .statusBadge.danger { color: #f08070; background: rgba(232,96,78,.14); }

/* ===== VEHICLE CARDS ===== */
.vehicleCards { display: grid; gap: 12px; }
.vehicleCard, .listItem {
  padding: 14px; border: 1px solid var(--line);
  border-radius: 18px; background: var(--panel);
  transition: background .25s ease;
}
.vehicleCard strong, .listItem strong { display: block; color: var(--ink); }
.vehicleCard small, .listItem small { overflow-wrap: anywhere; color: var(--muted); }
.progress {
  height: 9px; margin: 12px 0; border-radius: 99px;
  background: var(--line); overflow: hidden;
}
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), var(--gold)); }

/* ===== REPORT ===== */
.reportControls { display: flex; gap: 10px; flex-wrap: wrap; }
.reportControls select {
  min-width: 130px; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--input-bg); color: var(--ink); font-weight: 700;
}
.reportKpis { margin-top: 8px; }
.reportGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.reportGrid h3 { margin: 0 0 12px; font-size: 17px; color: var(--ink); }
.reportGrid table { min-width: 620px; }

/* ===== DAILY SUMMARY BAR ===== */
.dailySummary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  transition: background .25s ease;
  min-height: 46px;
}
.dailySummary:empty { display: none; }
.summaryItem {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.summaryItem .sumVal {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
}
.summaryItem .sumVal.pos { color: var(--green); }
.summaryItem .sumVal.neg { color: var(--red); }
.summaryItem .sumVal.neutral { color: var(--blue); }
.summarySep {
  width: 1px;
  height: 20px;
  background: var(--line);
  flex-shrink: 0;
}
.summaryCount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink);
  font-weight: 800;
  font-size: 12px;
}

/* ===== CATEGORY BADGE (in table) ===== */
.catBadge {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  border: 1px solid transparent;
  max-width: 100%;
}

/* Dans le tableau daily : police encore plus petite sur grands écrans */
#daily .catBadge {
  font-size: 10px;
  padding: 3px 6px;
  gap: 3px;
}
.catBadge-green  { background: rgba(31,143,95,.13);  color: #176342; border-color: rgba(31,143,95,.2); }
.catBadge-teal   { background: rgba(0,168,120,.12);  color: #005d44; border-color: rgba(0,168,120,.2); }
.catBadge-blue   { background: rgba(38,105,217,.11); color: #1a4b9e; border-color: rgba(38,105,217,.2); }
.catBadge-bordeaux { background: rgba(94,24,42,.12); color: #5e182a; border-color: rgba(94,24,42,.2); }
.catBadge-red    { background: rgba(217,75,61,.11);  color: #9e261c; border-color: rgba(217,75,61,.2); }
.catBadge-gold   { background: rgba(217,155,33,.14); color: #7a5500; border-color: rgba(217,155,33,.2); }
.catBadge-purple { background: rgba(155,89,182,.11); color: #6c3483; border-color: rgba(155,89,182,.2); }
.catBadge-slate  { background: rgba(100,116,139,.10); color: #475569; border-color: rgba(100,116,139,.2); }

[data-theme="dark"] .catBadge-green    { background: rgba(45,189,128,.18); color: #5edd9f; }
[data-theme="dark"] .catBadge-teal     { background: rgba(0,200,170,.14); color: #00e5c0; }
[data-theme="dark"] .catBadge-blue     { background: rgba(74,144,232,.16); color: #7ab8f5; }
[data-theme="dark"] .catBadge-bordeaux { background: rgba(200,60,100,.18); color: #f08090; }
[data-theme="dark"] .catBadge-red      { background: rgba(232,96,78,.16);  color: #f08070; }
[data-theme="dark"] .catBadge-gold     { background: rgba(224,184,74,.16); color: #e0b84a; }
[data-theme="dark"] .catBadge-purple   { background: rgba(200,130,240,.15); color: #c890f0; }
[data-theme="dark"] .catBadge-slate    { background: rgba(150,170,200,.12); color: #96aac8; }

/* ===== CATEGORY GRID (settings page) ===== */
.catGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.catCard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  transition: background .2s ease, transform .18s ease, box-shadow .18s ease;
  border-left: 4px solid transparent;
}
.catCard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.catCardTop {
  display: flex;
  align-items: center;
  gap: 10px;
}
.catEmoji {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--line);
}
.catCardInfo { flex: 1; min-width: 0; }
.catCardInfo strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catCardMeta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.catTypeBadge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.catTypeBadge.revenu    { background: rgba(31,143,95,.13); color: #176342; }
.catTypeBadge.depense   { background: rgba(217,75,61,.11); color: #9e261c; }
.catTypeBadge.entretien { background: rgba(38,105,217,.11); color: #1a4b9e; }
.catTypeBadge.autre     { background: rgba(100,116,139,.10); color: #475569; }
[data-theme="dark"] .catTypeBadge.revenu    { background: rgba(45,189,128,.18); color: #5edd9f; }
[data-theme="dark"] .catTypeBadge.depense   { background: rgba(232,96,78,.16); color: #f08070; }
[data-theme="dark"] .catTypeBadge.entretien { background: rgba(74,144,232,.16); color: #7ab8f5; }
[data-theme="dark"] .catTypeBadge.autre     { background: rgba(150,170,200,.12); color: #96aac8; }

.catUsageCount {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}
.catCardActions { display: flex; gap: 8px; }
.catCardActions .ghost, .catCardActions .danger {
  flex: 1;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
}

/* ===== DRIVER CARDS ===== */
.driverGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.driverCard {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, background .25s ease;
}
.driverCard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.driverCardTop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 14px;
}
.driverAvatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -.02em;
}
.driverCardInfo { flex: 1; min-width: 0; }
.driverCardInfo strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.driverCardInfo .driverPhone {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.driverStatusBadge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.driverStatusBadge.actif   { background: rgba(31,143,95,.13); color: #176342; }
.driverStatusBadge.inactif { background: rgba(217,75,61,.11); color: #9e261c; }
[data-theme="dark"] .driverStatusBadge.actif   { background: rgba(45,189,128,.18); color: #5edd9f; }
[data-theme="dark"] .driverStatusBadge.inactif { background: rgba(232,96,78,.16); color: #f08070; }

.driverStats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.driverStat {
  padding: 10px 14px;
  text-align: center;
  border-right: 1px solid var(--line);
}
.driverStat:last-child { border-right: 0; }
.driverStat .statVal {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.driverStat .statLabel {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}
.driverCardDocs {
  padding: 10px 18px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}
.driverDocPill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.driverDocPill.present {
  background: rgba(38,105,217,.11);
  color: var(--blue);
  border: 1px solid rgba(38,105,217,.2);
}
.driverDocPill.absent {
  background: var(--line);
  color: var(--muted);
  cursor: default;
}
[data-theme="dark"] .driverDocPill.present { background: rgba(74,144,232,.15); color: #7ab8f5; }
.driverCardActions {
  display: flex;
  gap: 0;
  border-top: 0;
}
.driverCardActions button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  border-top: 1px solid var(--line);
  transition: background .18s ease, color .18s ease;
}
.driverCardActions button:first-child { border-right: 1px solid var(--line); border-radius: 0 0 0 20px; }
.driverCardActions button:last-child { border-radius: 0 0 20px 0; }
.driverCardActions button:hover { background: var(--row-hover); color: var(--ink); }
.driverCardActions button.dangerBtn:hover { background: rgba(217,75,61,.08); color: var(--red); }

/* ===== VEHICLE CARDS ===== */
.vehicleGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.vehicleSettingCard {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, background .25s ease;
}
.vehicleSettingCard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.vehicleCardHeader {
  padding: 18px 18px 14px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.vehiclePlateTag {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(31,143,95,.22);
}
.vehicleCardMeta { flex: 1; min-width: 0; }
.vehicleCardMeta strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vehicleCardMeta .vehicleModel {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.vehicleStatusDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}
.vehicleStatusDot.actif   { background: var(--green); box-shadow: 0 0 0 3px rgba(31,143,95,.18); }
.vehicleStatusDot.inactif { background: var(--red);   box-shadow: 0 0 0 3px rgba(217,75,61,.16); }

.vehicleMetrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.vehicleMetric {
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}
.vehicleMetric:last-child { border-right: 0; }
.vehicleMetric .metricLabel {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.vehicleMetric .metricVal {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.vehicleMetric .metricSub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.vehicleNotes {
  padding: 10px 18px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vehicleNotes:empty { display: none; }
.vehicleAmortProgress {
  padding: 10px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.vehicleAmortLabel {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.vehicleAmortLabel span:last-child { font-weight: 800; color: var(--ink); }
.vehicleCardActions {
  display: flex;
}
.vehicleCardActions button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  border-top: 1px solid var(--line);
  transition: background .18s ease, color .18s ease;
}
.vehicleCardActions button:first-child { border-right: 1px solid var(--line); border-radius: 0 0 0 20px; }
.vehicleCardActions button:last-child { border-radius: 0 0 20px 0; }
.vehicleCardActions button:hover { background: var(--row-hover); color: var(--ink); }
.vehicleCardActions button.dangerBtn:hover { background: rgba(217,75,61,.08); color: var(--red); }

/* ===== SETTINGS LISTS ===== */
.list { display: grid; gap: 10px; }
.compact .listItem { padding: 10px 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== PAGE SIZE SELECTOR ===== */
.pageSizeSelect {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== FILTERS ===== */
.filters {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(4, minmax(140px, 1fr)) auto;
  gap: 12px; align-items: end; margin-bottom: 16px;
}
.filters .field { min-width: 0; }
.resetFilter { min-height: 45px; white-space: nowrap; }

/* ===== FORM FIELDS ===== */
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 13px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--input-bg); color: var(--ink);
  transition: background .25s ease, border-color .25s ease;
}
.field textarea { min-height: 88px; resize: vertical; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex; justify-content: space-between;
  align-items: center; gap: 14px; margin-top: 14px;
  color: var(--muted); font-weight: 700;
}
.pagination > div { display: flex; align-items: center; gap: 10px; }
.pagination strong { color: var(--ink); }

/* ===== MODAL ===== */
/* ================================================================
   MODAL — ANIMATIONS PROFESSIONNELLES
   ================================================================ */

/* --- Keyframes --- */
@keyframes modalIn {
  from { opacity: 0; transform: scale(.9) translateY(32px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}
@keyframes modalOut {
  from { opacity: 1; transform: scale(1)  translateY(0); }
  to   { opacity: 0; transform: scale(.9) translateY(24px); }
}
@keyframes backdropIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to   { opacity: 1; backdrop-filter: blur(8px);  }
}
@keyframes backdropOut {
  from { opacity: 1; backdrop-filter: blur(8px);  }
  to   { opacity: 0; backdrop-filter: blur(0px); }
}
@keyframes fieldIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes titleIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Dialog base --- */
dialog {
  border: 0; padding: 0; background: transparent;
  width: min(760px, calc(100vw - 28px));
}

/* --- Backdrop ouverture / fermeture --- */
dialog::backdrop {
  background: rgba(11, 18, 14, .52);
  backdrop-filter: blur(8px);
  animation: backdropIn .28s ease both;
}
dialog.closing::backdrop {
  animation: backdropOut .22s ease both;
}

/* --- Card ouverture --- */
.modalCard {
  position: relative;
  padding: 28px 28px 24px;
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
  transition: background .25s ease;
  animation: modalIn .34s cubic-bezier(.34, 1.28, .64, 1) both;
}

/* --- Card fermeture --- */
dialog.closing .modalCard {
  animation: modalOut .22s cubic-bezier(.4, 0, 1, 1) both;
}

/* --- Titre --- */
#modalTitle {
  animation: titleIn .3s cubic-bezier(.34, 1.2, .64, 1) .05s both;
}

/* --- Champs du formulaire : entrée en cascade --- */
.formGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 22px 0; }
.formGrid > * { animation: fieldIn .32s ease both; }
.formGrid > *:nth-child(1)  { animation-delay: .08s; }
.formGrid > *:nth-child(2)  { animation-delay: .12s; }
.formGrid > *:nth-child(3)  { animation-delay: .16s; }
.formGrid > *:nth-child(4)  { animation-delay: .20s; }
.formGrid > *:nth-child(5)  { animation-delay: .23s; }
.formGrid > *:nth-child(6)  { animation-delay: .26s; }
.formGrid > *:nth-child(7)  { animation-delay: .29s; }
.formGrid > *:nth-child(8)  { animation-delay: .32s; }
.formGrid > *:nth-child(9)  { animation-delay: .34s; }
.formGrid > *:nth-child(10) { animation-delay: .36s; }
.formGrid > *:nth-child(11) { animation-delay: .38s; }
.formGrid > *:nth-child(12) { animation-delay: .40s; }

/* Réinitialiser les animations quand la dialog est en cours de fermeture */
dialog.closing .formGrid > * { animation: none; }
dialog.closing #modalTitle   { animation: none; }

/* --- Boutons --- */
menu {
  padding: 0; margin: 0;
  display: flex; justify-content: flex-end; gap: 10px;
  animation: menuIn .3s ease .28s both;
}
menu button:not(.primary) { padding: 11px 15px; border-radius: 12px; background: var(--line); color: var(--ink); }
dialog.closing menu { animation: none; }

/* --- Bouton fermer (×) --- */
.close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--line); color: var(--ink);
  transition: transform .22s cubic-bezier(.34, 1.5, .64, 1), background .18s ease, color .18s ease;
}
.close:hover {
  transform: rotate(90deg) scale(1.15);
  background: rgba(217, 75, 61, .12);
  color: var(--red);
}

/* Focus ring sur les champs */
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 143, 95, .14);
  transition: border-color .18s ease, box-shadow .18s ease;
}

/* ===== TOAST ===== */
.toast {
  position: fixed; right: 22px; bottom: 22px;
  padding: 13px 16px; border-radius: 14px;
  color: #fff; background: var(--ink);
  opacity: 0; transform: translateY(12px);
  transition: .22s ease; z-index: 9999; font-weight: 600;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ===== GUIDE ===== */
.guide { max-width: 100%; line-height: 1.7; }
.guide h2 { margin-bottom: 14px; }
.guide h3 { margin-top: 22px; color: var(--green); }

/* ================================================================
   HAMBURGER BUTTON
   ================================================================ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease;
}
.hamburger:hover { background: var(--row-hover); }
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .26s ease, opacity .22s ease;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Topbar flex adjustment ===== */
.topbarLeft {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ================================================================
   MOBILE SIDEBAR OVERLAY
   ================================================================ */
.sidebarOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 10, .55);
  backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0;
  transition: opacity .28s ease;
}
.sidebarOverlay.sidebarOpen {
  display: block;
  opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  nav { grid-template-columns: repeat(3, 1fr); }
  .dashboardGrid, .reportGrid, .chartsGrid, .chartsGrid2 { grid-template-columns: 1fr; }
  .themeSection { margin-top: 20px; }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .resetFilter { width: 100%; }
}

@media (min-width: 1101px) {
  #daily .tableWrap, #monthly .tableWrap { overflow-x: visible; }
  #daily table, #monthly table { width: 100%; min-width: 0; table-layout: fixed; }
  #daily th, #daily td { padding: 7px 5px; font-size: 10.5px; line-height: 1.24; }
  #daily th { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
  #daily th:nth-child(1), #daily td:nth-child(1)  { width: 8%; }
  #daily th:nth-child(2), #daily td:nth-child(2)  { width: 11%; }
  #daily th:nth-child(3), #daily td:nth-child(3)  { width: 9%; }
  #daily th:nth-child(4), #daily td:nth-child(4)  { width: 13%; }
  #daily th:nth-child(5), #daily td:nth-child(5)  { width: 9%; }
  #daily th:nth-child(6), #daily td:nth-child(6)  { width: 10%; }
  #daily th:nth-child(7), #daily td:nth-child(7)  { width: 10%; }
  #daily th:nth-child(8), #daily td:nth-child(8)  { width: 13%; }
  #daily th:nth-child(9), #daily td:nth-child(9)  { width: 8%; }
  #daily th:nth-child(10), #daily td:nth-child(10) { width: 8%; }
  #daily th:nth-child(11), #daily td:nth-child(11) { width: 8%; }
  #daily .actions { gap: 4px; flex-wrap: nowrap; }
  #daily .iconBtn { width: 28px; height: 28px; }
  #daily .iconBtn svg { width: 15px; height: 15px; }
  #daily .docLink, #daily .mutedBadge {
    min-height: 0; padding: 5px 6px; font-size: 10px;
    line-height: 1.15; white-space: normal;
  }
  #monthly th, #monthly td { padding: 9px 10px; font-size: 12px; line-height: 1.25; }
}

@media (min-width: 1500px) {
  .dashboardGrid { grid-template-columns: minmax(360px, .82fr) minmax(520px, 1.18fr); }
  .panel { padding: 24px; }
  th, td { padding: 13px 15px; }
  #daily th, #daily td { padding: 8px 6px; font-size: 11.5px; }
  #monthly th, #monthly td { padding: 10px 12px; font-size: 12.5px; }
  .chartWrap { min-height: 260px; max-height: 320px; }
}

@media (min-width: 1101px) and (max-width: 1499px) {
  .sidebar { padding: 18px; }
  .brand strong { font-size: 20px; }
  .navBtn { padding: 11px 12px; font-size: 13px; }
  .content { padding: 16px; }
  h1 { font-size: 38px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .kpi { min-height: 126px; padding: 16px; }
  .kpi strong { font-size: 24px; }
  .panel { padding: 15px; border-radius: 18px; }
  .panelHead h2 { font-size: 15px; }
  th, td { padding: 8px 9px; font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
  table { min-width: 760px; }
  #daily th, #daily td { padding: 6px 4px; font-size: 9.2px; line-height: 1.22; }
  #maintenance table { min-width: 940px; }
  .docLink, .mutedBadge, .statusBadge { font-size: 11px; padding: 6px 8px; }
  #daily .docLink, #daily .mutedBadge { min-height: 0; padding: 4px 5px; font-size: 9px; }
  .docLink, .mutedBadge { white-space: normal; line-height: 1.2; }
  .iconBtn { width: 32px; height: 32px; }
  #daily .iconBtn { width: 24px; height: 24px; }
  #daily .iconBtn svg { width: 14px; height: 14px; }
  #daily .actions { gap: 3px; }
  #monthly th, #monthly td { padding: 7px 8px; font-size: 10.8px; }
  .filters { gap: 9px; }
  .field input, .field select, .field textarea { padding: 10px 11px; }
}

@media (max-width: 900px) {
  .brand { margin-bottom: 18px; }
  .sidebar { padding-bottom: 18px; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .navBtn { padding: 12px; border-radius: 12px; text-align: center; }
  .panelHead { align-items: flex-start; flex-direction: column; }
  .panelHead .primary { width: 100%; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { align-items: flex-start; }
  .ratePill { border-radius: 14px; }
  .themeGrid { grid-template-columns: repeat(4, 1fr); }
  .themeBtn { flex-direction: column; gap: 4px; font-size: 10px; padding: 8px 4px; }
}

@media (max-width: 700px) {
  .content, .sidebar { padding: 18px; }
  .topbar { display: grid; }
  nav { grid-template-columns: 1fr; }
  .formGrid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination > div { justify-content: space-between; }
  .panel { padding: 16px; border-radius: 18px; }
  .kpi { min-height: 132px; border-radius: 18px; }
  .brand strong { font-size: 20px; }
  h1 { font-size: 32px; }
  table { min-width: 680px; }
  #daily table { min-width: 1080px; }
  #maintenance table { min-width: 980px; }
  #dashboard .dashboardGrid .panel:nth-child(2) table { min-width: 540px; }
  .chartWrap { min-height: 180px; max-height: 220px; }
}

@media (max-width: 420px) {
  .content, .sidebar { padding: 14px; }
  .panel { padding: 14px; }
  .kpis { grid-template-columns: 1fr; }
  .primary, .ghost, .danger { width: 100%; }
  .actions .iconBtn, .pagination .iconBtn { width: 38px; }
  menu { flex-direction: column-reverse; }
  th, td { padding: 10px 9px; font-size: 12px; }
  #daily table { min-width: 980px; }
  #maintenance table { min-width: 900px; }
  #dashboard .dashboardGrid .panel:nth-child(2) table { min-width: 500px; }
}

/* ================================================================
   SPLASH SCREEN (PWA launch)
   ================================================================ */
.splashScreen {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity .45s ease, visibility .45s ease;
}
.splashScreen.splashHidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splashLogoWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  text-align: center;
}
.splashLogoBox {
  width: 110px;
  height: 110px;
  border-radius: 0;
  background: transparent; /* aucun fond visible — logo flotte sur le blanc */
  border: none;
  box-shadow: none;
  overflow: visible;
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 800;
  color: #102117;
  font-family: Inter, system-ui, sans-serif;
  margin: 0 auto;
}
/* Logo splash : s'adapte sans déformation, sans fond */
.splashLogoBox img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  background: #fff;
}
.splashDots {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
}
.splashDots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #23a971;
  animation: splashPulse 1.3s ease-in-out infinite;
}
.splashDots span:nth-child(2) { animation-delay: .22s; }
.splashDots span:nth-child(3) { animation-delay: .44s; }

@keyframes splashPulse {
  0%, 100% { transform: scale(.55); opacity: .35; }
  45%       { transform: scale(1);   opacity: 1; }
}

/* Desktop : logo agrandi à 450×450 (PC / tablette large) */
@media (min-width: 901px) and (display-mode: browser) {
  .splashLogoBox {
    width: 450px;
    height: 450px;
    font-size: 120px;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }
  .splashDots span {
    width: 14px;
    height: 14px;
  }
  .splashDots {
    gap: 14px;
    margin-top: 28px;
  }
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.loginBody {
  margin: 0; min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7fbf8;
}

.loginLayout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ===== LEFT PANEL ===== */
.loginLeft {
  position: relative;
  background: linear-gradient(145deg, #071020 0%, #0d1a35 45%, #0a1628 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 48px;
  overflow: hidden;
  color: #fff;
}

.loginWavesSvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.loginBrand {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.loginLogoBox {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #50c878, #f4c15d);
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px; color: #102117;
  flex-shrink: 0;
  overflow: hidden; /* clip l'image aux coins arrondis */
}
/* Logo login : contain = logo entier visible */
.loginLogoBox img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
  border-radius: inherit;
}
.loginBrand strong { display: block; font-size: 22px; font-weight: 800; color: #fff; }
.loginBrand span   { color: rgba(255,255,255,.55); font-size: 13px; }

.loginHero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 60px 0 20px;
}

.loginSecureBadge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid rgba(96, 165, 250, .4);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  color: #93c5fd;
  background: rgba(96, 165, 250, .1);
  width: fit-content;
  margin-bottom: 24px;
}

.loginHeadline {
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  margin: 0 0 18px;
}

.loginSub {
  font-size: 15px;
  color: rgba(255,255,255,.6);
  line-height: 1.65;
  margin: 0;
  max-width: 400px;
}

.loginPills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.loginPill {
  padding: 8px 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.06);
}

/* ===== RIGHT PANEL ===== */
.loginRight {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  background: #f5f7ff;
}

.loginCard {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 28px;
  padding: 40px 36px 32px;
  box-shadow: 0 32px 80px rgba(20, 40, 30, .13);
}

.loginEyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #2563eb;
}

.loginTitle {
  margin: 0 0 28px;
  font-size: 26px;
  font-weight: 800;
  color: #17211b;
}

.loginErrorMsg {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(217, 75, 61, .1);
  border: 1px solid rgba(217, 75, 61, .22);
  color: #9e261c;
  font-size: 13px;
  font-weight: 600;
}

.loginForm { display: grid; gap: 16px; }

.loginField { display: grid; gap: 7px; }
.loginField label {
  font-size: 13px;
  font-weight: 700;
  color: #66736c;
}
.loginField input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(23, 33, 27, .15);
  border-radius: 14px;
  font-size: 14px;
  color: #17211b;
  background: #fff;
  font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
  outline: none;
}
.loginField input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}

.loginSubmitBtn {
  margin-top: 4px;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 0;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 10px 28px rgba(37, 99, 235, .32);
}
.loginSubmitBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(37, 99, 235, .42);
}

.loginDivider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: #a0ada6;
  font-size: 12px;
  font-weight: 600;
}
.loginDivider::before, .loginDivider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(23,33,27,.1);
}

.loginGoogleBtn {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(23,33,27,.15);
  background: #fff;
  color: #66736c;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: not-allowed;
  opacity: .55;
}

.loginGoogleNote {
  margin: 12px 0 0;
  font-size: 11px;
  color: #a0ada6;
  line-height: 1.5;
  text-align: center;
}

.loginInstallLink {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  padding: 11px;
  border-radius: 14px;
  border: 1px dashed rgba(37, 99, 235, .35);
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease;
}
.loginInstallLink:hover {
  background: rgba(37, 99, 235, .06);
  border-color: rgba(37, 99, 235, .65);
}

.loginCredit {
  margin: 14px 0 0;
  text-align: center;
  font-size: 10px;
  color: rgba(140, 153, 146, .80);
  letter-spacing: .04em;
}
.loginCredit strong {
  color: rgba(90, 98, 105, .88);
  font-weight: 600;
}

@media (max-width: 860px) {
  /* Cacher complètement le panneau gauche — seul le formulaire reste */
  .loginLeft    { display: none; }
  .loginLayout  { display: block; min-height: 100dvh; }
  .loginBody    { background: #f5f7ff; }
  .loginRight   {
    min-height: 100dvh;
    padding: 32px 20px;
    background: #f5f7ff;
    align-items: center;
    display: flex;
    justify-content: center;
  }
  .loginCard {
    width: 100%;
    max-width: 440px;
    border-radius: 24px;
    padding: 32px 24px 28px;
    box-shadow: 0 16px 48px rgba(37, 99, 235, .12);
  }
}

/* ================================================================
   SIDEBAR USER & LOGOUT
   ================================================================ */
.sidebarUser {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 0 0;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebarUserAvatar {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #50c878, #f4c15d);
  display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: #102117;
  flex-shrink: 0;
}
.sidebarUserInfo { flex: 1; min-width: 0; }
.sidebarUserInfo strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebarUserRole {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}
.sidebarUserRole.admin       { background: rgba(244,193,93,.2); color: #f4c15d; }
.sidebarUserRole.superviseur { background: rgba(80,200,120,.15); color: #50c878; }

.logoutLink {
  display: block;
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
  border: 1px solid rgba(255,255,255,.08);
}
.logoutLink:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ================================================================
   USERS GRID
   ================================================================ */
.userGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.userCard {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, background .25s ease;
}
.userCard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.userCardTop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 14px;
}
.userCardInfo { flex: 1; min-width: 0; }
.userCardInfo strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.userUsername {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 500;
}

.rolePill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  white-space: nowrap;
}
.rolePill.admin       { background: rgba(244,193,93,.18); color: #a07018; }
.rolePill.superviseur { background: rgba(38,105,217,.11); color: #1a4b9e; }
[data-theme="dark"] .rolePill.admin       { background: rgba(244,193,93,.18); color: #f4c15d; }
[data-theme="dark"] .rolePill.superviseur { background: rgba(74,144,232,.16); color: #7ab8f5; }

.userMeta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 18px 14px;
  border-top: 1px solid var(--line);
}
.userLastLogin {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.userCardActions {
  display: flex;
  border-top: 1px solid var(--line);
}
.userCardActions button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-right: 1px solid var(--line);
  transition: background .18s ease, color .18s ease;
  font-family: inherit;
  cursor: pointer;
}
.userCardActions button:last-child { border-right: 0; border-radius: 0 0 20px 0; }
.userCardActions button:first-child { border-radius: 0 0 0 20px; }
.userCardActions button:only-child  { border-radius: 0 0 20px 20px; }
.userCardActions button:hover       { background: var(--row-hover); color: var(--ink); }
.userCardActions button.dangerBtn:hover { background: rgba(217,75,61,.08); color: var(--red); }
.userCardActions button:disabled    { opacity: .4; cursor: not-allowed; }

/* ================================================================
   CLICKABLE LINK CELLS (daily tracking)
   ================================================================ */
.linkCellActive {
  cursor: pointer;
  transition: background .15s ease;
}
.linkCellActive:hover { background: var(--row-hover) !important; }

/* ================================================================
   REPORT PANEL CONTROLS (print button)
   ================================================================ */
.reportPanelControls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.printBtn {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
}

/* ================================================================
   PRINT / PDF STYLES
   ================================================================ */
@media print {
  /* Hide everything except the monthly report */
  .sidebar,
  .topbar,
  .reportPanelControls,
  .panelHead button,
  .panelHead .printBtn,
  #daily, #dashboard, #maintenance,
  #drivers, #vehicles, #categories, #users, #guide { display: none !important; }

  body, .shell { display: block !important; background: #fff !important; }
  .content { padding: 0 !important; }
  .view  { display: none !important; }
  #monthly { display: block !important; }
  #monthly .panel { box-shadow: none !important; border: 1px solid #ddd !important; border-radius: 12px !important; }
  .kpi { print-color-adjust: exact; -webkit-print-color-adjust: exact; border-radius: 12px !important; }
  .tableWrap { overflow: visible !important; border: 1px solid #ddd !important; border-radius: 8px !important; }
  table { min-width: 0 !important; }
  .reportGrid { grid-template-columns: 1fr !important; }

  @page { margin: 1.5cm; size: A4; }
}

/* ================================================================
   MOBILE SIDEBAR DRAWER (≤ 900px)
   ================================================================ */
@media (max-width: 900px) {
  .hamburger { display: flex; }

  /* Sidebar becomes a fixed drawer */
  .shell { display: block; }
  .sidebar {
    position: fixed !important;
    top: 0; left: 0;
    height: 100dvh;
    width: clamp(260px, 78vw, 320px);
    z-index: 999;
    transform: translateX(-110%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    border-radius: 0 24px 24px 0;
    box-shadow: 8px 0 40px rgba(0,0,0,.32);
  }
  .sidebar.sidebarOpen { transform: translateX(0); }

  /* Nav items: vertical list, larger tap targets */
  nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
  }
  .navBtn {
    padding: 14px 18px !important;
    font-size: 15px !important;
    text-align: left !important;
    border-radius: 14px !important;
  }
  .navBtn.active { background: var(--theme-active-bg) !important; color: var(--sidebar-text) !important; transform: none !important; }

  /* Content takes full width */
  .content { padding: 16px 16px 80px !important; }

  /* Topbar sticks to top */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--body-bg);
    padding-bottom: 12px;
    margin-bottom: 4px;
  }
  .topbarLeft { gap: 12px; }
  h1 { font-size: 22px !important; }
  .eyebrow { font-size: 10px !important; margin-bottom: 2px !important; }

  /* Compact KPIs on mobile */
  .kpis { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .kpi  { min-height: 110px !important; padding: 16px !important; border-radius: 18px !important; }
  .kpi strong { font-size: 18px !important; }

  /* Charts: full width */
  .chartsGrid, .chartsGrid2, .dashboardGrid, .reportGrid { grid-template-columns: 1fr !important; }

  /* Theme section */
  .themeSection { margin-top: 16px; padding-top: 14px; }
  .themeGrid { grid-template-columns: repeat(4, 1fr) !important; gap: 5px !important; }
  .themeBtn { flex-direction: column !important; gap: 4px !important; font-size: 10px !important; padding: 8px 4px !important; }
}

/* ================================================================
   LECTEUR ROLE PILL
   ================================================================ */
.rolePill.lecteur { background: rgba(100,116,139,.12); color: #475569; }
[data-theme="dark"] .rolePill.lecteur { background: rgba(150,170,200,.14); color: #96aac8; }
.sidebarUserRole.lecteur { background: rgba(150,170,200,.18); color: #b0c0d0; }

/* ================================================================
   GUIDE — ENHANCED LAYOUT
   ================================================================ */
.guide { max-width: 100%; line-height: 1.7; }

.guideHeader {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.guideHeaderIcon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(31,143,95,.15), rgba(38,105,217,.12));
  display: grid; place-items: center;
  font-size: 26px;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.guideHeader h2 { margin: 0 0 6px; font-size: 22px; }
.guideSubtitle  { margin: 0; color: var(--muted); font-size: 14px; }

.guideSectionTitle {
  margin: 32px 0 14px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.guideSectionTitle::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
  margin-left: 6px;
}

/* Roles grid */
.guideRolesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.guideRoleCard {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.guideRoleCard.admin       { border-left: 4px solid #d99b21; }
.guideRoleCard.superviseur { border-left: 4px solid #23a971; }
.guideRoleCard.lecteur     { border-left: 4px solid #64748b; }
.guideRoleIcon  { font-size: 22px; margin-bottom: 8px; }
.guideRoleTitle { font-weight: 800; font-size: 15px; color: var(--ink); margin-bottom: 10px; }
.guideRoleCard ul { margin: 0; padding-left: 18px; }
.guideRoleCard li { font-size: 13px; color: var(--muted); margin-bottom: 4px; line-height: 1.5; }
.guideRoleCard li em { color: var(--red); font-style: normal; font-size: 12px; }

/* Steps grid */
.guideStepsGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.guideStep {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.guideStepNum {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.guideStep strong { display: block; font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.guideStep p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.55; }

/* Theme cards */
.guideThemeCards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.guideThemeCard {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.guideThemeCard span {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: block;
  border: 2px solid var(--line);
}
.guideThemeCard strong { font-size: 13px; color: var(--ink); }
.guideThemeCard p { margin: 0; font-size: 11px; color: var(--muted); }

/* Tip box */
.guideTip {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(31, 143, 95, .08);
  border: 1px solid rgba(31, 143, 95, .2);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}
[data-theme="dark"] .guideTip { background: rgba(45,189,128,.1); border-color: rgba(45,189,128,.2); }

/* ================================================================
   NAV — ICÔNES SVG
   ================================================================ */
.navBtn {
  display: flex;
  align-items: center;
  gap: 10px;
}
.navSvgIcon {
  width: 17px; height: 17px;
  flex-shrink: 0;
  opacity: .7;
  transition: opacity .2s ease;
}
.navBtn:hover .navSvgIcon,
.navBtn.active .navSvgIcon { opacity: 1; }

/* ================================================================
   SWATCH MARQUE
   ================================================================ */
.swatchContrast { background: linear-gradient(135deg, #50c878 50%, #f4c15d 50%); }

/* Theme marque : overrides dark styles */
[data-theme="contrast"] .ghost { background: rgba(80,200,120,.1); color: #50c878; }
[data-theme="contrast"] .danger { background: rgba(232,96,78,.12); color: #e8604e; }
[data-theme="contrast"] .statusBadge.ok { color: #50c878; background: rgba(80,200,120,.14); }

/* ================================================================
   ANIMATIONS BOUTONS (modifier / supprimer)
   ================================================================ */
@keyframes spin { to { transform: rotate(360deg); } }

.spinIcon {
  width: 16px; height: 16px;
  animation: spin .65s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.btnLoading {
  opacity: .75;
  pointer-events: none;
}
.btnSuccess {
  background: linear-gradient(135deg, var(--green), #34c97a) !important;
  color: #fff !important;
}
.btnSuccess svg { animation: none; }

/* Pulse rapide au clic sur Modifier */
.btnEditAnim:active { transform: scale(.88); }

/* Spinner dans le bouton Enregistrer */
#saveBtn .spinIcon { width: 14px; height: 14px; }
#saveBtn { display: inline-flex; align-items: center; gap: 7px; }

/* ================================================================
   VEHICLE PERFORMANCE CARDS (améliorées)
   ================================================================ */
@keyframes vcSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.vcCard {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  overflow: hidden;
  animation: vcSlideIn .45s ease both;
  transition: transform .18s ease, box-shadow .18s ease;
}
.vcCard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.vcHead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.vcPlateTag {
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .05em;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  white-space: nowrap;
  flex-shrink: 0;
}
.vcModel {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vcTripsBadge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.vcStats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom: 1px solid var(--line);
}
.vcStat {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  gap: 2px;
}
.vcStat:last-child { border-right: 0; }
.vcStatL {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.vcStatV {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vcStatV.rev { color: var(--green); }
.vcStatV.exp { color: var(--gold); }
.vcStatV.pos { color: var(--green); }
.vcStatV.neg { color: var(--red); }

.vcBars {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.vcBarRow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vcBarLabel {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  width: 90px;
  flex-shrink: 0;
  white-space: nowrap;
}
.vcBarTrack {
  flex: 1;
  height: 7px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.vcBarFill {
  height: 100%;
  border-radius: 999px;
  width: 0; /* animé via JS */
  transition: width 1.1s cubic-bezier(.4, 0, .2, 1);
}
.vcBarGood  { background: linear-gradient(90deg, #1f8f5f, #50c878); }
.vcBarMid   { background: linear-gradient(90deg, #c17a12, #f4c15d); }
.vcBarBad   { background: linear-gradient(90deg, #c62828, #e8604e); }
.vcBarAmort { background: linear-gradient(90deg, #1d5fbf, #42a5f5); }
.vcBarPct {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}
