.dash-body { background: var(--c-bg); }
.dash-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 40px); }

/* Barre latérale */
.dash-side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--sp-6);
  padding: var(--sp-5); background: var(--c-dark); color: var(--c-on-dark);
}
.dash-side .logo { color: #fff; }
.dash-nav { display: grid; gap: 4px; }
.dash-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; font-weight: 600; font-size: var(--fs-sm); color: var(--c-on-dark-muted);
}
.dash-nav a:hover { background: rgb(255 255 255 / 0.06); color: #fff; }
.dash-nav a.is-active { background: rgb(255 90 0 / 0.2); color: #fff; box-shadow: inset 3px 0 0 var(--c-orange); }
.dash-side .logo { flex: none; }
.dash-side .logo-img { height: 34px; }
.dash-side .logo-product { color: #fff; }
.dash-nav .ico { width: 18px; height: 18px; }
.dash-back { margin-top: auto; color: var(--c-on-dark-muted); border-color: rgb(255 255 255 / 0.15); }

.dash-main { padding: var(--sp-6); display: grid; gap: var(--sp-5); align-content: start; min-width: 0; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-4); flex-wrap: wrap; scroll-margin-top: 20px; }
.dash-head h1 { font-size: var(--fs-2xl); font-weight: 800; }
.dash-head-side { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.dash-content { display: grid; gap: var(--sp-5); min-width: 0; }
.dash-period { color: var(--c-muted); font-size: var(--fs-sm); font-weight: 600; margin-bottom: 4px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.kpi { padding: var(--sp-4); }
.kpi small { display: block; font-size: var(--fs-xs); color: var(--c-muted); font-weight: 600; }
.kpi b { display: block; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 2px; white-space: nowrap; }
.kpi b em { font-style: normal; font-size: var(--fs-md); color: var(--c-muted); font-weight: 600; }
.kpi span { font-size: var(--fs-xs); color: var(--c-muted); }
.kpi b span { font-size: inherit; color: inherit; }
.kpi.neg b { color: var(--c-ink-2); }
.kpi.hero { background: var(--c-dark); border-color: var(--c-dark); }
.kpi.hero small, .kpi.hero span { color: var(--c-on-dark-muted); }
.kpi.hero b { color: var(--c-positive-on-dark); }

/* Panneaux */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--sp-5); }
.dash-grid.even { grid-template-columns: 1fr 1fr; }
.history td.month { white-space: nowrap; }
.history td.month small { display: block; font-size: 11px; color: var(--c-info); font-weight: 700; }
.history th, .history td { padding-inline: 8px; }
.panel { padding: var(--sp-5); min-width: 0; scroll-margin-top: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.panel-head h2 { font-size: var(--fs-lg); font-weight: 800; }
.panel-sub { font-size: var(--fs-xs); color: var(--c-muted); font-weight: 600; }
.panel-note { margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--c-muted); }

/* Graphique */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--c-line); stroke-width: 1; }
.chart .axis { fill: var(--c-muted); font-size: 11px; font-weight: 600; }
.chart .val { fill: var(--c-ink); font-size: 12px; font-weight: 700; }
.chart .bar { fill: var(--c-series-investor); }
.chart .bar.partial { fill: url(#hatch); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover { fill: rgb(13 27 38 / 0.04); }
.tip {
  position: absolute; top: 0; width: 190px; padding: 10px 12px; border-radius: 10px; pointer-events: none;
  background: var(--c-dark); color: var(--c-on-dark); font-size: var(--fs-xs); display: grid; gap: 2px; box-shadow: var(--shadow);
}
.tip[hidden] { display: none; }
.tip b { color: #fff; }
.chart-note { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--c-muted); margin-top: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; }
.swatch.partial { background: repeating-linear-gradient(45deg, var(--c-series-investor) 0 2px, rgb(11 138 82 / 0.35) 2px 5px); }

/* Répartition */
.stack { display: flex; gap: 2px; height: 16px; border-radius: 999px; overflow: hidden; }
.stack i { display: block; height: 100%; }
.stack-legend { list-style: none; padding: 0; margin: var(--sp-5) 0 0; display: grid; gap: 0; }
.stack-legend li { display: grid; grid-template-columns: auto 1fr auto 44px; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--c-line); font-size: var(--fs-sm); font-weight: 600; color: var(--c-ink-2); }
.stack-legend li:first-child { border-top: 0; }
.stack-legend li b { color: var(--c-ink); text-align: right; }
.stack-legend li em { font-style: normal; color: var(--c-muted); font-size: var(--fs-xs); text-align: right; }
.stack-legend .total { grid-template-columns: 1fr auto 44px; border-top: 2px solid var(--c-ink); color: var(--c-ink); }
.sw { width: 12px; height: 12px; border-radius: 3px; }

/* Filtres */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { min-height: 34px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--c-line); background: var(--c-surface); font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.filter[aria-pressed='true'] { background: var(--c-dark); color: #fff; border-color: var(--c-dark); }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table.fleet, table.history { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.fleet th, .history th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-muted); padding: 8px 10px; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.fleet td, .history td { padding: 12px 10px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.fleet td small { display: block; color: var(--c-muted); font-size: 11px; margin-top: 3px; }
.r { text-align: right !important; }
.empty { text-align: center; color: var(--c-muted); padding: var(--sp-6) !important; }
.perf { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.perf-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; }
.perf-bar i { display: block; height: 100%; border-radius: 999px; background: var(--c-series-investor); }
.perf span { font-size: var(--fs-xs); font-weight: 700; width: 38px; text-align: right; }

/* Incidents */
.incidents { list-style: none; padding: 0; margin: 0; }
.incidents li { display: grid; grid-template-columns: 52px 1fr auto; gap: var(--sp-3); align-items: start; padding: 12px 0; border-top: 1px solid var(--c-line); }
.incidents li:first-child { border-top: 0; }
.inc-date { font-size: var(--fs-xs); font-weight: 700; color: var(--c-muted); padding-top: 2px; }
.inc-body b { font-size: var(--fs-sm); }
.inc-body p { font-size: var(--fs-sm); color: var(--c-ink-2); }
.dash-foot { padding-bottom: var(--sp-5); }

/* Responsive */
@media (max-width: 1080px) { .dash-grid, .dash-grid.even { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: var(--sp-3); padding: 10px var(--gutter); overflow-x: auto; }
  .dash-side .logo small, .dash-back { display: none; }
  .dash-nav { display: flex; gap: 2px; }
  .dash-nav a { padding: 8px 10px; white-space: nowrap; }
  .dash-nav .ico { display: none; }
  .dash-main { padding: var(--sp-5) var(--gutter); }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi b { font-size: var(--fs-lg); }
  .kpi.hero, .kpi.wide { grid-column: 1 / -1; }
  .dash-side .logo > span:last-child { display: none; }
  /* Tableau flotte en cartes */
  .fleet thead { display: none; }
  .fleet, .fleet tbody, .fleet tr, .fleet td { display: block; width: 100%; }
  .fleet tr { padding: 12px 0; border-bottom: 1px solid var(--c-line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  .fleet td { border: 0; padding: 0; text-align: left !important; }
  .fleet td::before { content: attr(data-l); display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-muted); margin-bottom: 2px; }
  .fleet td[data-l='vs projection'] { grid-column: 1 / -1; }
  .history th:nth-child(3), .history td:nth-child(3), .history th:nth-child(4), .history td:nth-child(4) { display: none; }
  .panel { padding: var(--sp-4); }
}
