/* =============================================================================
   ONOFF · Charte « Arcade Terminal »
   Jersey 10 : titres, menus, boutons (capitales) · VT323 : montants, heures
   IBM Plex Mono : texte courant, tableaux, saisie.
   Angles crantés (box-shadow), ombres dures, aucun flou ni dégradé.
   Thème sombre par défaut ; thème clair : <html data-theme="light"> (bouton de
   la barre du haut, mémorisé dans un cookie).
   ============================================================================= */

@font-face {
  font-family: 'Jersey 10';
  src: url('../fonts/Jersey10-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --fond: #0d0b0a;
  --panneau: #16120f;
  --survol: #1f1915;
  --trait: #3a2e25;
  --trait-fort: #5a4a3d;
  --texte: #f3e9dc;
  --texte-2: #9a8b7e;
  --texte-3: #6b5d52;
  --orange: #e95d0e;
  --orange-hover: #ff8a3d;
  --orange-relief: #a8400a;
  --vert: #3ddc84;
  --jaune: #ffd23f;
  --cyan: #29b6f6;
  --rose: #ff3864;
  --rouge: #e5322d;
  --violet: #a77bff;
  --noir: #000;
  --f-px: 'Jersey 10', 'Courier New', monospace;
  --f-vt: 'VT323', 'Courier New', monospace;
  --f-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --sidebar: 232px;
  /* Texte posé sur un aplat de couleur (bouton, puce, total) : toujours sombre */
  --encre: #0d0b0a;
  /* Reliefs des boutons secondaires */
  --relief-bas: #120e0c;
  --survol-fort: #2a221c;
  /* Graphiques (statistiques) */
  --chart-grid: #2e251f;
  --chart-ink: #9a8b7e;
  --chart-compare: #7a6b5f;
  --voile: rgba(255, 255, 255, .025);
  color-scheme: dark;
}

/* Thème clair : papier chaud, mêmes accents (palette des graphiques validée sur ce fond) */
:root[data-theme="light"] {
  --fond: #f2ece4;
  --panneau: #fffdf9;
  --survol: #f3ede5;
  --trait: #dcd2c6;
  --trait-fort: #b5a797;
  --texte: #1b1512;
  --texte-2: #5f5249;
  --texte-3: #8d7f73;
  --orange: #d9550b;
  --orange-hover: #b8470a;
  --orange-relief: #a8400a;
  --vert: #18a35b;
  --jaune: #e2a400;
  --cyan: #1590cf;
  --rose: #e0244d;
  --rouge: #c9221c;
  --violet: #7a4fd6;
  --noir: #000;
  --relief-bas: #cfc4b6;
  --survol-fort: #ebe3d8;
  --chart-grid: #e6ded3;
  --chart-ink: #6b5d52;
  --chart-compare: #9a8b7e;
  --voile: rgba(0, 0, 0, .035);
  --voile-2: rgba(0, 0, 0, .018);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font-family: var(--f-mono); font-size: 14px; line-height: 1.55;
}
a { color: var(--orange); }
a:hover { color: var(--orange-hover); }
h1, h2, h3 { font-family: var(--f-px); text-transform: uppercase; letter-spacing: .04em; font-weight: 400; margin: 0; line-height: 1.15; }
h1 { font-size: 38px; }
h2 { font-size: 25px; }
h3 { font-size: 19px; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px dashed var(--jaune); outline-offset: 3px; }

.f-px { font-family: var(--f-px); text-transform: uppercase; letter-spacing: .04em; }
.f-px.small { font-size: 16px; }
.f-vt { font-family: var(--f-vt); }
.muted { color: var(--texte-2); }
.small { font-size: 12px; }
.or { color: var(--orange); }

/* Bordure pixel (angles crantés) */
.pxbox { box-shadow: 0 -2px 0 0 var(--trait), 0 2px 0 0 var(--trait), -2px 0 0 0 var(--trait), 2px 0 0 0 var(--trait); }
.pxbox-or { box-shadow: 0 -2px 0 0 var(--orange), 0 2px 0 0 var(--orange), -2px 0 0 0 var(--orange), 2px 0 0 0 var(--orange); }
.dith-or { background-image: conic-gradient(var(--orange) 25%, transparent 0 50%, var(--orange) 0 75%, transparent 0); background-size: 4px 4px; }
.dith-cr { background-image: conic-gradient(var(--texte) 25%, transparent 0 50%, var(--texte) 0 75%, transparent 0); background-size: 4px 4px; }
.cur { display: inline-block; width: .6em; height: 1em; background: var(--orange); vertical-align: -2px; animation: blink 1.06s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cur { animation: none; } }

/* ---------------------------------------------------------------- Logo ---- */
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-px); font-weight: 400; line-height: 1; }
.logo-img, .logo-ph { width: 32px; height: 32px; flex: none; image-rendering: auto; object-fit: contain; }
.logo-ph { box-shadow: inset 0 0 0 2px var(--trait-fort); background-image: conic-gradient(var(--trait) 25%, transparent 0 50%, var(--trait) 0 75%, transparent 0); background-size: 4px 4px; }
.logo-word { display: flex; font-size: 36px; }
.logo-word .on { color: var(--orange); }
.logo-word .off { color: var(--texte); }
.logo-lg .logo-img, .logo-lg .logo-ph { width: 56px; height: 56px; }
.logo-custom { display: block; max-width: 100%; max-height: 48px; width: auto; height: auto; object-fit: contain; }
.logo-lg .logo-custom { max-height: 96px; max-width: 320px; }
.topbar-logo { display: none; text-decoration: none; align-items: center; min-width: 0; }
.topbar-logo img { display: block; max-height: 34px; max-width: 120px; object-fit: contain; }
.topbar-logo .logo-word { font-family: var(--f-px); font-size: 28px; line-height: 1; }
.logo-lg .logo-word { font-size: 68px; }

/* -------------------------------------------------------------- Boutons --- */
.btn {
  font-family: var(--f-px); text-transform: uppercase; letter-spacing: .04em; font-size: 18px;
  border: 0; cursor: pointer; padding: 0 18px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; white-space: nowrap; background: transparent; color: var(--orange);
}
.btn-p { background: var(--orange); color: var(--encre); box-shadow: inset -3px -3px 0 0 var(--orange-relief), inset 3px 3px 0 0 #ff9a5c, 0 -3px 0 0 var(--fond), 0 3px 0 0 var(--fond), -3px 0 0 0 var(--fond), 3px 0 0 0 var(--fond); }
.btn-p:hover { background: #ff7a2e; color: var(--encre); }
.btn-p:active { box-shadow: inset 3px 3px 0 0 var(--orange-relief), inset -3px -3px 0 0 #ff9a5c; }
.btn-s { background: var(--survol); color: var(--texte); box-shadow: inset -3px -3px 0 0 var(--relief-bas), inset 3px 3px 0 0 var(--trait), 0 -2px 0 0 var(--trait-fort), 0 2px 0 0 var(--trait-fort), -2px 0 0 0 var(--trait-fort), 2px 0 0 0 var(--trait-fort); }
.btn-s:hover { background: var(--survol-fort); color: var(--texte); }
.btn-g { background: transparent; color: var(--orange); }
.btn-g:hover { color: var(--orange-hover); background: var(--survol); }
.btn-d { background: var(--rose); color: var(--encre); box-shadow: inset -3px -3px 0 0 #b0203f, inset 3px 3px 0 0 #ff7b98; }
.btn-d:hover { background: #ff5a7e; color: var(--encre); }
.btn[disabled], .btn.is-disabled { background: var(--survol); color: var(--texte-3); box-shadow: none; cursor: not-allowed; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 11px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }

/* ---------------------------------------------------------------- Chips --- */
.chip { font-family: var(--f-px); text-transform: uppercase; letter-spacing: .05em; font-size: 16px; line-height: 1; padding: 5px 8px; color: var(--encre); display: inline-block; white-space: nowrap; }
.chip-vert { background: var(--vert); }
.chip-jaune { background: var(--jaune); }
.chip-cyan { background: var(--cyan); }
.chip-rose { background: var(--rose); }
.chip-orange { background: var(--orange); }
.chip-gris { background: transparent; color: var(--texte-2); box-shadow: inset 0 0 0 2px var(--trait-fort); }

/* ------------------------------------------------------------ Formulaires - */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-family: var(--f-px); text-transform: uppercase; letter-spacing: .04em; font-size: 17px; }
.field .hint { color: var(--texte-2); font-size: 12px; }
.field .err { color: var(--rose); font-size: 13px; }
.inp {
  background: var(--fond); color: var(--texte); border: 0; border-radius: 0;
  font-family: var(--f-mono); font-size: 14px; padding: 0 12px; min-height: 44px; width: 100%;
  box-shadow: 0 -2px 0 0 var(--trait-fort), 0 2px 0 0 var(--trait-fort), -2px 0 0 0 var(--trait-fort), 2px 0 0 0 var(--trait-fort);
}
textarea.inp { padding: 10px 12px; min-height: 96px; resize: vertical; }
select.inp { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--orange) 50%), linear-gradient(135deg, var(--orange) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
.inp::placeholder { color: var(--texte-2); }
.inp:focus { outline: none; box-shadow: 0 -2px 0 0 var(--orange), 0 2px 0 0 var(--orange), -2px 0 0 0 var(--orange), 2px 0 0 0 var(--orange); }
.inp.is-invalid { box-shadow: 0 -2px 0 0 var(--rose), 0 2px 0 0 var(--rose), -2px 0 0 0 var(--rose), 2px 0 0 0 var(--rose); }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--orange); margin: 0; flex: none; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.actions-end { justify-content: flex-end; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.form { gap: 4px; }
fieldset.form > .field { margin-top: 10px; }
legend { padding: 0; margin-bottom: 8px; }

/* --------------------------------------------------------------- Panneaux - */
.panel { background: var(--panneau); padding: 22px 24px; }
.panel + .panel { margin-top: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.tile { background: var(--panneau); padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: 4px 4px 0 0 var(--trait); text-decoration: none; color: var(--texte); }
a.tile:hover { background: var(--survol); color: var(--texte); box-shadow: 4px 4px 0 0 var(--orange); }
.tile .tile-label { font-family: var(--f-px); text-transform: uppercase; font-size: 15px; color: var(--texte-2); }
.tile .tile-val { font-family: var(--f-vt); font-size: 40px; line-height: .9; color: var(--orange); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 20px; }

/* -------------------------------------------------------------- Tableaux -- */
.table-wrap { overflow-x: auto; position: relative; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-family: var(--f-px); text-transform: uppercase; letter-spacing: .04em; font-size: 17px; color: var(--texte-2); font-weight: 400; text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--trait); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.tbl tbody tr:hover td { background: var(--survol); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .row-off td { color: var(--texte-3); }
.empty { padding: 32px 12px; text-align: center; color: var(--texte-2); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 16px; }

/* ----------------------------------------------------------- Application -- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--panneau); border-right: 2px solid var(--trait);
  padding: 22px 12px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .logo { padding: 0 12px 22px; }
.nav-a {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px;
  font-family: var(--f-px); text-transform: uppercase; letter-spacing: .04em; font-size: 17px;
  color: var(--texte-2); text-decoration: none;
}
.nav-a::before { content: ''; width: 10px; height: 10px; flex: none; }
.nav-a:hover { color: var(--texte); background: var(--survol); }
.nav-a.nav-on { color: var(--texte); background: var(--survol); }
.nav-a.nav-on::before { background: var(--orange); clip-path: polygon(0 0, 20% 0, 20% 20%, 40% 20%, 40% 40%, 60% 40%, 60% 60%, 40% 60%, 40% 80%, 20% 80%, 20% 100%, 0 100%); }
.nav-a.nav-soon { color: var(--texte-3); cursor: default; }
.nav-a.nav-soon:hover { background: transparent; color: var(--texte-3); }
.nav-a .lot { margin-left: auto; font-size: 9px; color: var(--texte-3); }
/* Sous-menu repliable (Paramètres) */
.nav-group > summary { list-style: none; cursor: pointer; user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: '+'; margin-left: auto; font-family: var(--f-vt); font-size: 22px; line-height: 1; color: var(--texte-3); }
.nav-group[open] > summary::after { content: '−'; }
.nav-group > summary:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.nav-a.nav-parent-on { color: var(--texte); }
.nav-a.nav-sub { padding-left: 34px; min-height: 36px; font-size: 15px; }
.nav-a.nav-sub::before { width: 6px; height: 6px; }
/* Nom et version, en bas du menu */
.nav-foot { margin-top: auto; padding: 22px 12px 2px; display: flex; align-items: baseline; gap: 8px; }
.nav-name { font-family: var(--f-px); text-transform: uppercase; letter-spacing: .08em; font-size: 20px; color: var(--texte-2); }
.nav-version { font-family: var(--f-vt); font-size: 19px; color: var(--texte-3); }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 32px; border-bottom: 2px solid var(--trait); position: sticky; top: 0; background: var(--fond); z-index: 20; }
.topbar-search { flex: 1 1 320px; max-width: 480px; position: relative; }
.search-mobile { display: none; }
.topbar-right { display: flex; gap: 14px; align-items: center; margin-left: auto; }
.content { padding: 28px 32px 56px; max-width: 100%; width: 100%; display: flex; flex-direction: column; gap: 28px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head .crumbs { font-family: var(--f-px); text-transform: uppercase; font-size: 18px; color: var(--texte-2); display: flex; gap: 8px; margin-bottom: 8px; }
.page-head .crumbs a { color: var(--texte-2); }
.menu-toggle { display: none; }

/* Cloche et menu utilisateur */
.bell { position: relative; width: 44px; height: 44px; background: var(--survol); border: 0; color: var(--texte); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bell:hover { color: var(--orange); }
.bell .badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 4px; background: var(--orange); color: var(--encre); font-family: var(--f-px); font-size: 15px; display: flex; align-items: center; justify-content: center; }
.bell .badge[hidden] { display: none; }
.avatar { width: 44px; height: 44px; background: var(--cyan); color: var(--encre); display: flex; align-items: center; justify-content: center; font-family: var(--f-px); font-size: 20px; border: 0; cursor: pointer; }
.dropdown { position: relative; }
.dropdown-panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 260px; background: var(--panneau); z-index: 30; padding: 8px; box-shadow: 0 -2px 0 0 var(--trait-fort), 0 2px 0 0 var(--trait-fort), -2px 0 0 0 var(--trait-fort), 2px 0 0 0 var(--trait-fort), 6px 6px 0 2px var(--fond); }
.dropdown-panel[hidden] { display: none; }
.dropdown-panel .dd-item { display: flex; width: 100%; align-items: center; min-height: 40px; padding: 0 12px; color: var(--texte); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.dropdown-panel .dd-item:hover { background: var(--survol); color: var(--orange); }
.dropdown-panel .dd-head { padding: 8px 12px 10px; border-bottom: 2px solid var(--trait); margin-bottom: 6px; }
.notif-panel { width: min(380px, calc(100vw - 32px)); }
.notif-list { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.notif-item { display: block; padding: 10px 12px; border-bottom: 1px solid var(--trait); color: var(--texte); text-decoration: none; }
.notif-item:hover { background: var(--survol); color: var(--texte); }
.notif-item.unread { box-shadow: inset 4px 0 0 0 var(--orange); }
.notif-item .t { display: block; }
.notif-item .m { display: block; color: var(--texte-2); font-size: 13px; }
.notif-item .d { display: block; color: var(--texte-3); font-size: 12px; }

/* ------------------------------------------------------------ Messages ---- */
.flashes { display: flex; flex-direction: column; gap: 10px; }
.env-banner { flex: 0 1 auto; min-width: 0; padding: 7px 12px; background: var(--panneau); box-shadow: inset 4px 0 0 0 var(--jaune); font-size: 13px; line-height: 1.35; }
.env-banner strong { font-family: var(--f-px); font-weight: 400; font-size: 17px; color: var(--jaune); letter-spacing: .04em; }
.flash { padding: 12px 16px; background: var(--panneau); display: flex; gap: 12px; align-items: flex-start; }
.flash::before { font-family: var(--f-px); font-size: 17px; flex: none; }
.flash-succes { box-shadow: inset 4px 0 0 0 var(--vert); }
.flash-succes::before { content: 'OK'; color: var(--vert); }
.flash-erreur { box-shadow: inset 4px 0 0 0 var(--rose); }
.flash-erreur::before { content: 'ERR'; color: var(--rose); }
.flash-info { box-shadow: inset 4px 0 0 0 var(--cyan); }
.flash-info::before { content: 'INFO'; color: var(--cyan); }
.flash-alerte { box-shadow: inset 4px 0 0 0 var(--jaune); }
.flash-alerte::before { content: '!'; color: var(--jaune); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 50; max-width: min(380px, calc(100vw - 32px)); }
.toasts .flash { box-shadow: inset 4px 0 0 0 var(--orange), 6px 6px 0 0 var(--fond); }

/* ---------------------------------------------------------- Page invité --- */
.guest { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.guest-box { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 28px; }
.guest-box.wide { max-width: 720px; }
.guest-prompt { font-family: var(--f-px); text-transform: uppercase; font-size: 20px; display: flex; align-items: center; gap: 10px; }

/* Erreurs */
.err-code { font-family: var(--f-vt); font-size: 120px; line-height: .8; color: var(--orange); }
.debug { white-space: pre-wrap; font-size: 12px; color: var(--texte-2); background: var(--fond); padding: 12px; overflow-x: auto; }

/* --------------------------------------------------------------- Mobile --- */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .15s steps(3); }
  .sidebar.open { transform: none; box-shadow: 8px 0 0 0 var(--fond); }
  .menu-toggle { display: inline-flex; }
  .topbar-logo { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .topbar-search { display: none; }
  .search-mobile { display: inline-flex; }
  .env-banner .env-txt { display: none; }
  .content { padding: 20px 16px 48px; }
  .panel { padding: 18px 16px; }
  h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ------------------------------------------------------------ Catalogue --- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--trait); }
.tab { font-family: var(--f-px); text-transform: uppercase; letter-spacing: .04em; font-size: 17px; color: var(--texte-2); text-decoration: none; padding: 12px 14px; }
.tab:hover { color: var(--texte); background: var(--survol); }
.tab-on { color: var(--texte); box-shadow: inset 0 -4px 0 0 var(--orange); }
button.tab { background: none; border: 0; cursor: pointer; }
.sort { color: inherit; text-decoration: none; }
.sort:hover, .sort-on { color: var(--orange); }
.price { font-size: 22px; line-height: 1; color: var(--orange); white-space: nowrap; }
.thumb-cell, .fav-cell { width: 1%; }
.thumb { width: 40px; height: 40px; object-fit: contain; background: var(--fond); display: block; }
.thumb-ph { box-shadow: inset 0 0 0 2px var(--trait); background-image: conic-gradient(var(--trait) 25%, transparent 0 50%, var(--trait) 0 75%, transparent 0); background-size: 4px 4px; }
.star { background: none; border: 0; cursor: pointer; font-size: 20px; line-height: 1; color: var(--texte-3); padding: 6px; }
.star:hover { color: var(--jaune); }
.star-on { color: var(--jaune); }
.inp-unit { position: relative; }
.inp-unit .inp { padding-right: 64px; }
.inp-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--texte-2); font-size: 12px; pointer-events: none; }
.inp-file { padding: 9px 12px; }
.inp-file::file-selector-button { font-family: var(--f-px); text-transform: uppercase; font-size: 15px; background: var(--survol); color: var(--texte); border: 0; padding: 6px 10px; margin-right: 12px; cursor: pointer; box-shadow: inset 0 0 0 2px var(--trait-fort); }
.preview { max-width: 220px; max-height: 160px; object-fit: contain; background: var(--fond); padding: 6px; box-shadow: inset 0 0 0 2px var(--trait); }
.oblig { display: flex; flex-direction: column; gap: 10px; }
.oblig-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: 10px; align-items: center; }
.cat-tree { list-style: none; margin: 0; padding: 0; }
.cat-item { border-bottom: 1px solid var(--trait); padding-left: calc(var(--depth, 0) * 28px); }
.cat-item.dragging { opacity: .4; }
.cat-item.drop-before { box-shadow: inset 0 3px 0 0 var(--orange); }
.cat-item.drop-after { box-shadow: inset 0 -3px 0 0 var(--orange); }
.cat-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-height: 52px; padding: 6px 4px; }
.cat-name { font-weight: 600; }
.cat-counts { margin-left: auto; }
.cat-counts a { color: var(--texte-2); }
.cat-actions { display: flex; gap: 2px; }
.cat-actions form { margin: 0; }
.grip { cursor: grab; color: var(--texte-3); font-size: 18px; user-select: none; }
.cat-edit { padding: 6px 4px 16px 32px; }
@media (max-width: 900px) { .cat-counts { margin-left: 0; width: 100%; } .oblig-row { grid-template-columns: minmax(0, 1fr) 64px auto; } }

/* ----------------------------------------------------------------- Parc --- */
.inv { font-family: var(--f-mono); font-weight: 600; letter-spacing: .02em; }
.inv-big { font-size: 30px; line-height: 1; color: var(--orange); }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 10px 0 10px 14px; border-bottom: 1px solid var(--trait); box-shadow: inset 3px 0 0 0 var(--trait-fort); }
.timeline li.tl-incident { box-shadow: inset 3px 0 0 0 var(--rose); }
.timeline li.tl-maintenance { box-shadow: inset 3px 0 0 0 var(--jaune); }
.tl-date { font-size: 20px; line-height: 1.1; color: var(--texte-2); }
.tl-detail { display: block; margin-top: 2px; }
@media (max-width: 900px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }

/* ------------------------------------------------------- Clients, lieux --- */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 18px; }
.geo { display: flex; flex-direction: column; gap: 18px; }
.geo-search { position: relative; }
.geo-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 25; list-style: none; margin: 0; padding: 6px; background: var(--panneau); max-height: 320px; overflow-y: auto;
  box-shadow: 0 -2px 0 0 var(--orange), 0 2px 0 0 var(--orange), -2px 0 0 0 var(--orange), 2px 0 0 0 var(--orange), 6px 6px 0 2px var(--fond); }
.geo-list li { padding: 8px 10px; cursor: pointer; }
.geo-list li[aria-selected="true"], .geo-list li:hover { background: var(--survol); }
.geo-list .g-main { display: block; }
.geo-list .g-sub { display: block; color: var(--texte-2); font-size: 12px; }
.geo-list .g-note { color: var(--texte-2); font-size: 12px; cursor: default; }
.map { width: 100%; height: 320px; border: 0; display: block; filter: grayscale(.2); box-shadow: 0 0 0 2px var(--trait); }
.client-logo { width: 100px; height: 100px; object-fit: contain; background: var(--texte); padding: 4px; }
.contact { padding: 12px 0; border-bottom: 1px solid var(--trait); }
.contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.contact-actions { margin-left: auto; display: flex; gap: 4px; }
.contact-actions form { margin: 0; }
.contact-form { margin-top: 14px; padding: 16px; background: var(--fond); }

/* ---------------------------------------------------------- Prestations --- */
.tbl tr.row-conflit td { box-shadow: inset 0 -1px 0 0 var(--rose); }
.tbl tr.row-conflit td:first-child { box-shadow: inset 4px 0 0 0 var(--rose), inset 0 -1px 0 0 var(--rose); }
.tbl tr.row-risque td:first-child { box-shadow: inset 4px 0 0 0 var(--jaune); }
.date-cell { font-size: 20px; line-height: 1; white-space: nowrap; color: var(--orange); }
.presta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 24px; }
.phases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.phase { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 14px; padding: 8px 12px; background: var(--fond); }
.phase .muted { grid-column: 2; }
.phase-type { font-size: 11px; color: var(--texte-2); align-self: center; }
.phase-dates { font-size: 22px; line-height: 1; }
.phase-montage, .phase-demontage { background-image: conic-gradient(rgba(233, 93, 14, .14) 25%, transparent 0 50%, rgba(233, 93, 14, .14) 0 75%, transparent 0); background-size: 4px 4px; }
.phase-evenement, .phase-ouverture { box-shadow: inset 4px 0 0 0 var(--orange); }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row-line { display: grid; gap: 10px; align-items: center; }
.phase-line { grid-template-columns: 170px 210px 210px minmax(0, 1fr) 40px; }
.equipe-line { grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr) 40px; }
.row-head { display: grid; gap: 10px; font-family: var(--f-px); text-transform: uppercase; font-size: 15px; color: var(--texte-2); }
.qty-form { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; }
.inp-qty { width: 72px; min-height: 34px; text-align: right; }
.conflict-detail { display: block; color: var(--texte-2); margin-top: 4px; }
.dispo-live.dispo-ok { color: var(--vert); }
.dispo-live.dispo-risque { color: var(--jaune); }
.dispo-live.dispo-conflit { color: var(--rose); }
@media (max-width: 1100px) {
  .phase-line, .equipe-line { grid-template-columns: 1fr 1fr; }
  .row-head { display: none; }
}
.tile-alert { box-shadow: 4px 4px 0 0 var(--rose); }
.tile-alert .tile-val { color: var(--rose); }

/* -------------------------------------------------------------- Planning --- */
.gantt-page { display: flex; flex-direction: column; gap: 14px; }
.gantt-date { width: 160px; min-height: 38px; }
.seg-group { display: inline-flex; }
.seg-group .btn { margin-left: -2px; }
.gantt-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.gantt-bar .tabs { border-bottom: 0; }
.gantt-filters .inp { min-height: 36px; width: auto; max-width: 220px; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 22px; height: 10px; }
.lg-point { width: 10px; transform: rotate(45deg); background: var(--jaune); }
.lg-dith, .t-montage, .t-demontage { background-color: transparent; background-image: conic-gradient(var(--rouge) 25%, transparent 0 50%, var(--rouge) 0 75%, transparent 0); background-size: 4px 4px; }
.lg-ouverture { background: var(--noir); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.lg-charge { background: var(--trait-fort); }
/* Prestation selon son statut : confirmée (vert), en attente (orange), clôturée (violet) */
.st-vert { background: var(--vert); }
.st-orange { background: var(--orange); }
.st-violet { background: var(--violet); }
.st-gris { background: var(--texte-3); }
.lg-resa { background: var(--survol); border: 1px solid var(--trait-fort); }
.lg-ok { background: var(--vert); }
.lg-risque { background: var(--jaune); }
.lg-conflit { background: var(--rose); }

.gantt { position: relative; padding: 0; }
.gantt-scroll { overflow: auto; scrollbar-gutter: stable; max-height: calc(100vh - 290px); min-height: 320px; outline: none; }
.gantt-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--orange); }
.gantt-inner { position: relative; min-width: 100%; }
.gantt .empty { position: absolute; left: 0; right: 0; top: 90px; pointer-events: none; }
.gantt-head { position: sticky; top: 0; z-index: 5; background: var(--panneau); border-bottom: 2px solid var(--trait); }
.gh-row { display: flex; height: 26px; }
.gh-top { border-bottom: 1px solid var(--trait); }
.gh-corner { position: sticky; left: 0; z-index: 2; flex: none; background: var(--panneau); border-right: 2px solid var(--trait); font-family: var(--f-px); font-size: 15px; text-transform: uppercase; color: var(--texte-2); padding: 6px 12px; }
.gh-track { position: relative; flex: none; }
.gh-cell { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--trait); padding: 4px 6px; font-size: 12px; color: var(--texte-2); white-space: nowrap; overflow: clip; }
.gh-top .gh-cell { color: var(--texte); text-transform: capitalize; }
.gh-cell span { position: sticky; left: calc(var(--label-w, 260px) + 6px); }
.gh-cell.we { color: var(--trait-fort); }
.gh-cell.today { color: var(--orange); font-weight: 600; }

.gantt-body { position: relative; }
.g-grid { position: absolute; top: 0; pointer-events: none; }
.g-we { position: absolute; top: 0; bottom: 0; background: var(--voile); }
.g-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--orange); box-shadow: 0 0 0 1px rgba(233, 93, 14, .25); z-index: 3; }
.g-row { position: absolute; left: 0; right: 0; border-bottom: 1px solid var(--trait); }
.g-row.odd { background: var(--voile-2, rgba(255, 255, 255, .012)); }
.g-row:hover { background: rgba(233, 93, 14, .05); }
.g-label { position: sticky; left: 0; z-index: 4; height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; background: var(--panneau); border-right: 2px solid var(--trait); }
.g-row:hover .g-label { background: var(--survol); }
.g-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.g-name { font-weight: 600; color: var(--texte); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.g-name:hover { color: var(--orange); }
.g-sub { font-size: 12px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-label .chip { flex: none; font-size: 9px; padding: 2px 5px; }
.g-badge { flex: none; display: inline-grid; place-items: center; width: 20px; height: 20px; font-family: var(--f-px); font-size: 17px; color: var(--encre); }
.g-badge-conflit { background: var(--rose); }
.g-badge-risque { background: var(--jaune); }
.g-track { position: absolute; top: 0; bottom: 0; right: 0; }

.g-seg { position: absolute; top: 14px; height: 24px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 6px; font-size: 12px; line-height: 16px; color: var(--encre); font-weight: 600; text-decoration: none; z-index: 1; }
a.g-seg:hover, a.g-seg:focus-visible { outline: 2px solid var(--texte); outline-offset: 1px; z-index: 2; }
.g-resa { position: absolute; top: 10px; height: 32px; background: var(--survol); border: 1px solid var(--trait-fort); }
.t-evenement { background: var(--vert); }
.t-ouverture { top: 30px; height: 10px; padding: 0; font-size: 0; background: var(--noir); box-shadow: inset 0 0 0 1px var(--trait-fort); z-index: 2; }
.t-montage, .t-demontage { color: var(--texte); text-shadow: 0 0 3px var(--fond), 0 0 3px var(--fond); }
.t-livraison, .t-retour { background: var(--jaune); }
.g-point { width: 12px; height: 12px; top: 20px; margin-left: -6px; padding: 0; transform: rotate(45deg); }
.g-seg.is-off { opacity: .35; filter: grayscale(1); }
.g-seg.is-conflit.t-evenement { box-shadow: inset 0 -4px 0 0 var(--rose); }

.g-load { top: auto; bottom: 8px; height: calc(36px * var(--fill, 1)); min-height: 8px; padding: 0 4px; display: flex; align-items: flex-end; font-size: 11px; line-height: 14px; border-right: 1px solid var(--panneau); }
.g-load.lv-ok { background: rgba(61, 220, 132, .75); }
.g-load.lv-risque { background: var(--jaune); }
.g-load.lv-conflit { background: var(--rose); }

/* Équipe : ligne de la personne, sous-lignes de ses prestations */
.g-person .g-label { background: var(--survol); }
.g-person .g-name { font-family: var(--f-px); text-transform: uppercase; font-size: 17px; font-weight: 400; letter-spacing: .03em; }
.g-presta .g-label { padding-left: 30px; }
.g-presta .g-name { font-weight: 500; font-size: 14px; }
.g-dot { flex: none; width: 10px; height: 10px; }
.t-equipe { top: 8px; height: 24px; }
.t-charge { top: 16px; height: 8px; padding: 0; background: var(--trait-fort); opacity: .9; }

.gantt-tip { position: fixed; z-index: 60; max-width: 340px; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: var(--fond); border: 2px solid var(--trait-fort); box-shadow: 4px 4px 0 0 var(--orange); font-size: 13px; pointer-events: none; }
.gantt-tip strong { color: var(--orange); }
.gantt-tip .tip-alert { color: var(--rose); }
@media (max-width: 720px) {
  .gantt-scroll { max-height: calc(100vh - 220px); }
}

/* ------------------------------------------------- Chiffrages, devis (L7) - */
.nowrap { white-space: nowrap; }
.req { color: var(--orange); }
.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.dl dt { font-family: var(--f-px); text-transform: uppercase; font-size: 15px; color: var(--texte-2); padding-top: 3px; }
.dl dd { margin: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.doc-grid-ed { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 1100px) { .doc-grid, .doc-grid-ed { grid-template-columns: 1fr; } }
.doc-lines .dl-titre td { font-size: 20px; font-family: var(--f-px); text-transform: uppercase; letter-spacing: .04em; color: var(--orange); border-bottom: 2px solid var(--orange); padding-top: 18px; }
.doc-lines .dl-texte td { font-style: italic; color: var(--texte-2); border-bottom: 0; }
.doc-lines .dl-sep td { padding: 0; border-bottom: 2px dashed var(--trait-fort); height: 6px; }
.doc-lines .dl-st td { background: rgba(233, 93, 14, .1); font-weight: 600; }
.doc-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: flex-start; }
.doc-bottom > div { flex: 1 1 260px; }
.doc-totals { border-collapse: collapse; min-width: 300px; font-variant-numeric: tabular-nums; }
.doc-totals td { padding: 7px 10px; border-bottom: 1px solid var(--trait); }
.doc-totals .num { text-align: right; white-space: nowrap; }
.doc-totals .dt-ht td { font-weight: 600; border-top: 2px solid var(--texte-2); }
.doc-totals .dt-ttc td { background: var(--orange); color: var(--encre); font-family: var(--f-px); text-transform: uppercase; font-size: 20px; padding: 10px; border: 0; }
.doc-note { margin: 0 0 10px; padding: 10px 12px; border-left: 4px solid var(--orange); background: var(--fond); color: var(--texte); white-space: normal; }
.mini-form > summary { list-style: none; cursor: pointer; justify-content: center; }
.mini-form > summary::-webkit-details-marker { display: none; }
.mini-form textarea.inp { min-height: 60px; }

/* Éditeur de lignes */
.doc-editor .page-head { position: sticky; top: 0; z-index: 6; background: var(--fond); padding: 10px 0; margin: -10px 0 0; }
.doc-editor.is-saving { opacity: .75; pointer-events: none; }
.seg-inputs { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; }
.doc-lines-panel { padding: 14px 16px 18px; }
.ed-table td { padding: 6px 6px; vertical-align: top; }
.ed-table th { padding: 8px 6px; }
.ed-table .inp { min-height: 36px; padding: 0 8px; font-size: 13px; }
.ed-table textarea.inp { min-height: 36px; padding: 7px 8px; }
.ed-table .ed-desc { min-height: 30px; margin-top: 4px; font-size: 12px; color: var(--texte-2); }
.ed-table .ed-desc:placeholder-shown:not(:focus) { min-height: 26px; height: 26px; box-shadow: none; padding-top: 3px; }
.ed-h { width: 26px; }
.ed-grip { cursor: grab; color: var(--texte-2); font-size: 18px; line-height: 36px; user-select: none; display: inline-block; padding: 0 4px; }
.ed-grip:hover { color: var(--orange); }
.ed-ref { width: 110px; }
.ed-q { width: 80px; }
.ed-pu { width: 110px; }
.ed-r { width: 70px; }
.ed-tva { width: 96px; }
.ed-tot { width: 110px; white-space: nowrap; padding-top: 14px !important; font-variant-numeric: tabular-nums; }
.ed-dispo { width: 82px; padding-top: 12px !important; }
.ed-act { width: 132px; white-space: nowrap; text-align: right; }
.ed-act .btn-icon { width: 36px; min-height: 36px; }
.ed-act .ed-del:hover { color: var(--rose); }
.ed-q .inp, .ed-pu .inp, .ed-r .inp { text-align: right; }
.ed-kind { display: inline-block; font-family: var(--f-px); text-transform: uppercase; font-size: 13px; color: var(--texte-2); margin-bottom: 3px; }
.ed-titre .inp { font-family: var(--f-px); text-transform: uppercase; color: var(--orange); letter-spacing: .04em; }
.ed-titre td { border-bottom: 2px solid var(--orange); }
.ed-commentaire textarea.inp { font-style: italic; }
.ed-sepline { border-top: 2px dashed var(--trait-fort); margin: 17px 0; }
.ed-sous_total td { background: rgba(233, 93, 14, .08); }
.ed-sous_total .inp { text-align: right; }
.ed-row.ed-dragging { opacity: .4; }
.ed-row.ed-over-top td { box-shadow: inset 0 3px 0 0 var(--orange); }
.ed-row.ed-over-bottom td { box-shadow: inset 0 -3px 0 0 var(--orange); }
.ed-add { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin-top: 14px; }
.ed-search { position: relative; flex: 1 1 360px; }
.ed-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px 0; background: var(--fond); box-shadow: 0 0 0 2px var(--trait-fort), 4px 4px 0 2px var(--orange); max-height: 360px; overflow-y: auto; }
.ed-results li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; padding: 8px 12px; cursor: pointer; }
.ed-results li.on, .ed-results li:hover { background: var(--survol); }
.ed-results .ed-noresult { display: block; color: var(--texte-2); cursor: default; }
.ed-r-type { font-family: var(--f-px); font-size: 14px; color: var(--orange); }
.ed-r-price { color: var(--texte-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ed-r-oblig { grid-column: 2 / 4; font-size: 12px; color: var(--cyan); }
.ed-buttons { gap: 8px; }
.ed-totals .doc-totals { width: 100%; }
.ed-errors { color: var(--rose); margin: 12px 0 0; padding-left: 18px; }
@media (max-width: 900px) {
  .ed-table thead { display: none; }
  .ed-table, .ed-table tbody, .ed-table tr, .ed-table td { display: block; width: auto !important; }
  .ed-table tr { display: grid; grid-template-columns: 28px repeat(4, minmax(0, 1fr)); gap: 6px; padding: 10px 0; border-bottom: 2px solid var(--trait); }
  .ed-table td { border: 0 !important; padding: 0 !important; }
  .ed-table .ed-lib, .ed-table .ed-wide { grid-column: 2 / -1; }
  .ed-table .ed-ref { grid-column: 2 / -1; }
  .ed-table .ed-act { grid-column: 1 / -1; text-align: left; }
  .ed-table .ed-h { grid-row: span 2; }
}

/* ------------------------------------------------- Réponse client (L8) --- */
.pub-body { background: var(--fond); }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 2px solid var(--trait); }
.pub-top .logo { pointer-events: none; }
.pub-tag { font-family: var(--f-px); text-transform: uppercase; font-size: 14px; color: var(--texte-2); }
.pub { max-width: 720px; margin: 0 auto; padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 16px; }
.pub-card { background: var(--panneau); border: 2px solid var(--trait); padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.pub-card h1 { font-size: 26px; line-height: 1.15; margin: 0; }
.pub-card h2 { font-size: 15px; margin: 0; }
.pub-eyebrow { font-family: var(--f-px); text-transform: uppercase; font-size: 15px; color: var(--orange); margin: 0; }
.pub-facts { margin: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
.pub-facts div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
.pub-facts dt { font-family: var(--f-px); text-transform: uppercase; font-size: 14px; color: var(--texte-2); padding-top: 3px; }
.pub-facts dd { margin: 0; }
.pub-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 14px; background: var(--orange); color: var(--encre); }
.pub-total span { font-family: var(--f-px); text-transform: uppercase; font-size: 17px; }
.pub-total strong { font-family: var(--f-vt); font-size: 38px; line-height: 1; margin-left: auto; }
.pub-total small { width: 100%; text-align: right; font-size: 12px; }
.pub-pdf { align-self: flex-start; }
.pub-decide { border-color: var(--orange); box-shadow: 6px 6px 0 0 var(--orange); }
.pub-yes { width: 100%; min-height: 56px; font-size: 15px; }
.pub-no summary { cursor: pointer; font-family: var(--f-px); text-transform: uppercase; font-size: 17px; color: var(--texte-2); padding: 10px 0; list-style: none; }
.pub-no summary::-webkit-details-marker { display: none; }
.pub-no summary::before { content: '> '; color: var(--orange); }
.pub-no[open] summary { color: var(--texte); }
.pub-no .btn { align-self: flex-start; }
.pub-state h1 { font-size: 22px; }
.pub-state p { margin: 0; }
.pub-state-vert { box-shadow: inset 4px 0 0 0 var(--vert); }
.pub-state-jaune { box-shadow: inset 4px 0 0 0 var(--jaune); }
.pub-state-cyan { box-shadow: inset 4px 0 0 0 var(--cyan); }
.pub-state-gris { box-shadow: inset 4px 0 0 0 var(--trait-fort); }
.pub-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pub-lines li { padding: 10px 0; border-bottom: 1px solid var(--trait); }
.pl-title { font-family: var(--f-px); text-transform: uppercase; font-size: 17px; color: var(--orange); border-bottom: 2px solid var(--orange) !important; padding-top: 16px !important; }
.pl-sep { border-bottom: 2px dashed var(--trait-fort) !important; padding: 4px 0 !important; }
.pl-text { font-style: italic; color: var(--texte-2); }
.pl-sub { display: flex; justify-content: space-between; gap: 12px; background: var(--survol); padding: 10px 8px !important; }
.pl-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
.pl-name { display: flex; flex-direction: column; gap: 2px; }
.pl-qty { grid-column: 1; font-size: 13px; }
.pl-total { grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap; font-weight: 600; }
.pub-totals { width: 100%; border-collapse: collapse; margin-top: 4px; }
.pub-totals td { padding: 7px 0; border-bottom: 1px solid var(--trait); }
.pub-totals td:last-child { text-align: right; white-space: nowrap; }
.pub-totals .pt-ht td { font-weight: 600; border-top: 2px solid var(--trait-fort); }
.pub-totals .pt-ttc td { background: var(--orange); color: var(--encre); font-weight: 700; padding: 10px 8px; border: 0; }
.pub-note { margin: 0; padding: 10px 12px; background: var(--fond); box-shadow: inset 4px 0 0 0 var(--orange); }
.pub-cgv summary { cursor: pointer; font-family: var(--f-px); text-transform: uppercase; font-size: 17px; }
.pub-cgv div { margin-top: 12px; color: var(--texte-2); }
.pub-foot { text-align: center; padding-top: 8px; }
.client-links .cl-row { display: flex; flex-direction: column; gap: 3px; padding: 8px 0; border-bottom: 1px solid var(--trait); }
.client-links .cl-row:last-child { border-bottom: 0; }
@media (min-width: 640px) {
  .pub-card { padding: 22px 24px; }
  .pub-card h1 { font-size: 32px; }
  .pub-yes { width: auto; min-width: 280px; }
}

/* ------------------------------------------------------ Bons E/S (L9) ---- */
.bon-cards { display: flex; flex-direction: column; gap: 8px; }
.bon-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; background: var(--fond); border: 2px solid var(--trait); }
.bon-card > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bon-card-link { color: inherit; text-decoration: none; }
.bon-card-link:hover { border-color: var(--orange); }
.bon-card-title { font-weight: 600; color: var(--texte); }
.bon-card-late { box-shadow: inset 4px 0 0 0 var(--rose); }
.bon-page { display: flex; flex-direction: column; gap: 16px; }
.scanbar { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--panneau); }
.scan-form { display: flex; gap: 8px; }
.scan-input { flex: 1; min-height: 52px; font-size: 18px; }
.scan-form .btn { min-height: 52px; }
.scan-msg { margin: 0; padding: 8px 10px; background: var(--fond); min-height: 40px; }
.scan-ok { box-shadow: inset 4px 0 0 0 var(--vert); }
.scan-alerte { box-shadow: inset 4px 0 0 0 var(--jaune); }
.scan-erreur { box-shadow: inset 4px 0 0 0 var(--rose); color: var(--rose); }
.scan-progress { margin: 0; color: var(--texte-2); }
.scan-camera { max-width: 420px; }
.scan-camera video { width: 100% !important; }
.bon-lines { display: flex; flex-direction: column; gap: 10px; }
.bon-cat { font-size: 13px; color: var(--orange); border-bottom: 2px solid var(--orange); padding: 14px 0 6px; }
.bl { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--panneau); border: 2px solid var(--trait); }
.bl-ok { border-color: var(--vert); }
.bl-ecart { border-color: var(--rose); }
.bl-partiel { border-color: var(--jaune); }
.bl-flash { animation: blflash .9s ease-out; }
@keyframes blflash { from { background: var(--survol); } to { background: var(--panneau); } }
@media (prefers-reduced-motion: reduce) { .bl-flash { animation: none; } }
.bl-head { display: flex; align-items: center; gap: 12px; }
.bl-check input { width: 32px; height: 32px; accent-color: var(--vert); cursor: pointer; }
.bl-dot { width: 14px; height: 14px; flex: none; background: var(--trait-fort); }
.bl-ok .bl-dot { background: var(--vert); }
.bl-ecart .bl-dot { background: var(--rose); }
.bl-partiel .bl-dot { background: var(--jaune); }
.bl-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bl-qty { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: flex-end; }
.bl-step { display: flex; flex-direction: column; gap: 4px; }
.bl-k { font-family: var(--f-px); text-transform: uppercase; font-size: 14px; color: var(--texte-2); }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .btn { min-width: 48px; min-height: 48px; font-size: 22px; }
.bl-v { display: inline-block; min-width: 44px; text-align: center; font-family: var(--f-vt); font-size: 34px; line-height: 1; }
.bl-prevu { color: var(--texte-2); }
.bl-bad { color: var(--rose); }
.bl-units { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.unit-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 10px; background: var(--fond); border: 1px solid var(--trait-fort); font-size: 13px; }
.unit-spare { border-style: dashed; }
.unit-x { min-width: 32px; min-height: 32px; border: 0; background: var(--survol); color: var(--texte); cursor: pointer; font-size: 16px; }
.unit-x:hover { background: var(--rose); color: var(--encre); }
.bl-returns { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ret { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 8px; background: var(--fond); }
.ret-num { min-width: 110px; font-weight: 600; }
.ret-casse, .ret-manquant { box-shadow: inset 4px 0 0 0 var(--rose); }
.ret-ok { box-shadow: inset 4px 0 0 0 var(--vert); }
.ret-btns .btn { min-height: 40px; }
.ret-grav { width: auto; min-height: 40px; }
.ret-note { flex: 1 1 200px; min-height: 40px; }
.ret-designate select { width: auto; min-width: 180px; min-height: 40px; }
.bl-casse { display: flex; flex-wrap: wrap; gap: 8px; }
.bl-casse select { width: auto; }
.bl-casse input { flex: 1 1 200px; }
.bl-note { min-height: 38px; font-size: 13px; }
.bon-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.bon-trace { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.bon-trace div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.bon-trace dt { font-family: var(--f-px); text-transform: uppercase; font-size: 14px; color: var(--texte-2); padding-top: 3px; }
.bon-trace dd { margin: 0; }
.bon-finish .btn-p, .bon-finish .btn-s { min-height: 52px; }
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.qr-tag { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; background: #ffffff; color: #1b1512; border: 1px solid var(--trait); }
.qr-tag svg { width: 120px; height: 120px; }
.qr-tag span { font-family: var(--f-mono, monospace); font-size: 13px; font-weight: 600; text-align: center; word-break: break-all; }
.qr-tag small { font-size: 10px; text-align: center; color: #4a3f38; }
@media print {
  body:has(.qr-print) * { visibility: hidden; }
  .qr-print, .qr-print * { visibility: visible; }
  .qr-print { position: absolute; inset: 0; }
  .qr-sheet { grid-template-columns: repeat(4, 1fr); gap: 4mm; }
  .qr-tag { border: 0.2mm dashed #999; break-inside: avoid; }
}

/* ---------------------------------------------------------------- Lot 10 --- */
/* Préférences de notification : choix segmenté (radios) */
.npref { border: 0; margin: 8px 0 0; padding: 0; min-width: 0; }
.npref legend { font-family: var(--f-px); text-transform: uppercase; font-size: 17px; letter-spacing: .06em; color: var(--texte-2); padding: 0; margin-bottom: 4px; }
.npref-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.npref-label { flex: 1 1 220px; }
.radio-seg { display: inline-flex; flex-wrap: wrap; }
.radio-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-seg label { padding: 0 12px; min-height: 40px; display: inline-flex; align-items: center; border: 2px solid var(--trait-fort); margin-left: -2px; cursor: pointer; font-size: 13px; color: var(--texte-2); background: var(--fond); }
.radio-seg label:first-of-type { margin-left: 0; }
.radio-seg input:checked + label { background: var(--orange); border-color: var(--orange); color: var(--encre); position: relative; }
.radio-seg input:focus-visible + label { outline: 2px solid var(--jaune); outline-offset: 2px; position: relative; }
.radio-seg label:hover { color: var(--texte); }
@media (max-width: 560px) {
  .radio-seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .radio-seg label { margin-left: 0; justify-content: center; }
}

/* Journal des relances */
.rel-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rel-stat { border: 2px solid var(--trait); padding: 10px 12px; }
.rel-stat strong { display: block; font-family: var(--f-vt); font-size: 28px; line-height: 1; color: var(--texte); }
.rel-stat span { font-size: 12px; color: var(--texte-2); }
.rel-relances { margin: 0; padding: 0; list-style: none; }
.rel-relances li { padding: 4px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.rel-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.rel-filters .inp { width: auto; min-width: 170px; }

/* ---------------------------------------------------------------- Lot 11 --- */
/* Statistiques */
.st-actions { align-items: center; }
.st-year { display: flex; gap: 6px; align-items: center; }
.st-year .inp { width: auto; min-width: 100px; }
.st-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 2px solid var(--trait); margin: 0 0 20px; scrollbar-width: none; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tabs a { flex: none; padding: 10px 14px; font-family: var(--f-px); text-transform: uppercase; font-size: 17px; letter-spacing: .04em; color: var(--texte-2); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.st-tabs a:hover { color: var(--texte); }
.st-tabs a.on { color: var(--texte); border-bottom-color: var(--orange); }
.st-title { margin: 0 0 16px; font-size: 18px; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.st-full { grid-column: 1 / -1; }
.st-half { grid-column: span 1; }
.st-block { min-width: 0; }
.st-period { font-family: var(--f-mono); text-transform: none; font-size: 14px; color: var(--texte-2); letter-spacing: 0; margin-left: 8px; }
.st-block h3 { font-family: var(--f-px); text-transform: uppercase; font-size: 24px; letter-spacing: .04em; margin: 0 0 12px; font-weight: 400; }
.st-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.st-csv { font-family: var(--f-px); text-transform: uppercase; font-size: 15px; }
.st-note { margin: 10px 0 0; }
.st-scroll { max-height: 560px; overflow: auto; }
.st-scroll thead th { position: sticky; top: 0; background: var(--panneau); z-index: 1; }
.st-tbl td { padding: 8px 10px; }
.st-tbl td.num { white-space: nowrap; }
.st-tbl th { padding: 8px 10px; }
.st-total td { font-weight: 600; border-top: 2px solid var(--trait); }
.st-d.up { color: var(--vert); }
.st-d.down { color: var(--rose); }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.st-kpi { background: var(--panneau); padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: 4px 4px 0 0 var(--trait); text-decoration: none; color: var(--texte); min-width: 0; }
a.st-kpi:hover { box-shadow: 4px 4px 0 0 var(--orange); color: var(--texte); }
.st-kpi-l { font-family: var(--f-px); text-transform: uppercase; font-size: 18px; color: var(--texte-2); }
.st-kpi-v { font-family: var(--f-vt); font-size: 40px; line-height: .95; color: var(--texte); }
.st-kpi-d { font-size: 13px; color: var(--texte-2); }
.st-kpi-d.good { color: var(--vert); }
.st-kpi-d.bad { color: var(--rose); }
.st-kpi-s { font-size: 12px; color: var(--texte-2); }
.chart-box { width: 100%; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .ax { fill: var(--chart-ink); font-size: 8px; font-family: var(--f-mono); }
.chart .gl { stroke: var(--chart-grid); }
.chart .bl { stroke: var(--chart-ink); }
.chart .ring { stroke: var(--panneau); }
.chart .vl { fill: var(--texte); font-size: 10px; font-family: var(--f-mono); font-weight: 600; }
.chart .hl { fill: var(--texte); font-size: 8px; font-family: var(--f-mono); }
.chart .mk { cursor: default; }
.chart .mk.on rect[fill="transparent"] { fill: var(--voile); }
.chart .xh { stroke: transparent; stroke-width: 1; }
.chart .mk.on .xh { stroke: var(--chart-ink); }
.chart-legend { list-style: none; margin: 0 0 8px; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--texte-2); }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .lg-box { width: 10px; height: 10px; border-radius: 2px; }
.chart-legend .lg-line { width: 16px; height: 2px; border-radius: 1px; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; background: var(--panneau); border: 1px solid var(--trait-fort); padding: 6px 10px; font-size: 12px; color: var(--texte); white-space: nowrap; box-shadow: 3px 3px 0 0 var(--trait); }
.chart-tip .tt-h { color: var(--texte-2); margin-bottom: 2px; }
@media (max-width: 900px) {
  .st-grid { grid-template-columns: minmax(0, 1fr); }
  .st-half { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .st-kpi { padding: 10px 12px; }
  .st-kpi-v { font-size: 30px; }
  .st-kpi-s { font-size: 11px; }
}
@media print {
  /* Encre sombre sur papier blanc (les fonds ne sont pas imprimés) */
  :root { --fond: #fff; --panneau: #fff; --survol: #fff; --trait: #cfc8c2; --trait-fort: #9a8f86; --texte: #15110e; --texte-2: #4a423c; --texte-3: #6b625b; }
  body { background: #fff; color: #15110e; }
  .pxbox, .st-kpi { box-shadow: none !important; border: 1px solid #cfc8c2; }
  .chart .gl { stroke: #e2ddd8; }
  .chart .ax { fill: #4a423c; }
  .sidebar, .topbar, .st-tabs, .st-actions, .st-csv, .chart-tip, form.st-note { display: none !important; }
  .st-grid { grid-template-columns: 1fr 1fr; }
  .st-block, .st-kpi { break-inside: avoid; }
  .st-scroll { max-height: none; overflow: visible; }
}

/* Accueil : raccourcis et activité */
.home-shortcuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 14px; }
.home-shortcut { display: flex; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 56px; padding: 10px 14px; font-family: var(--f-px); text-transform: uppercase; font-size: 21px; letter-spacing: .04em; line-height: 1.05; text-decoration: none; color: var(--encre); box-shadow: inset -3px -3px 0 0 rgba(0, 0, 0, .28), inset 3px 3px 0 0 rgba(255, 255, 255, .32); }
.home-shortcut:hover { color: var(--encre); filter: brightness(1.08); }
.home-shortcut:active { box-shadow: inset 3px 3px 0 0 rgba(0, 0, 0, .28), inset -3px -3px 0 0 rgba(255, 255, 255, .32); }
.home-shortcut:focus-visible { outline-offset: 3px; }
.hs-vert { background: var(--vert); }
.hs-orange { background: var(--orange); }
.hs-rouge { background: var(--rose); }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 900px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
.home-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.home-alerts li { display: flex; gap: 10px; align-items: baseline; }
.chart-legend .lg-box, .chart-legend .lg-line { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ------------------------------------------------- Thème clair / sombre --- */
.theme-toggle { color: var(--texte-2); }
.theme-toggle:hover { color: var(--texte); }
.theme-toggle .ti-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ti-sun { display: block; }
:root[data-theme="light"] .theme-toggle .ti-moon { display: none; }

/* ------------------------------------------------- Recherche globale (Lot 12) */
.search-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50; max-height: 70vh; overflow-y: auto; background: var(--panneau); box-shadow: 0 -2px 0 0 var(--trait-fort), 0 2px 0 0 var(--trait-fort), -2px 0 0 0 var(--trait-fort), 2px 0 0 0 var(--trait-fort), 6px 6px 0 0 var(--voile); padding: 6px 0; }
.ss-group { font-family: var(--f-px); text-transform: uppercase; font-size: 15px; letter-spacing: .04em; color: var(--texte-2); padding: 8px 12px 4px; }
.ss-item { display: flex; flex-direction: column; gap: 1px; padding: 6px 12px; text-decoration: none; color: var(--texte); }
.ss-item:hover, .ss-item.on { background: var(--survol-fort); color: var(--texte); box-shadow: inset 3px 0 0 0 var(--orange); }
.ss-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-sub { font-size: 12px; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-all, .ss-direct { color: var(--orange); font-weight: 600; border-top: 1px solid var(--trait); margin-top: 4px; }
.ss-direct { border-top: 0; margin-top: 0; }
.search-page-form { display: flex; gap: 10px; margin: 0 0 18px; max-width: 760px; }
.search-page-form .inp { flex: 1; }
.search-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 18px; align-items: start; }
.search-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.search-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--trait); }
.search-list li:last-child { border-bottom: 0; }
.search-list a { font-weight: 600; }

/* ---------------------------------------------------- Paramètres en onglets */
.settings { display: flex; flex-direction: column; gap: 18px; }
.settings-tabs { position: sticky; top: 70px; z-index: 6; background: var(--fond); }
.settings-tabs .chip { font-size: 12px; padding: 2px 5px; vertical-align: 2px; }
.settings-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--fond) 40%); }

/* ----------------------------------------------------------- Pennylane --- */
.pl-panel { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; box-shadow: inset 4px 0 0 0 var(--cyan); }
.pl-panel.pl-err { box-shadow: inset 4px 0 0 0 var(--rose); }
.pl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.pl-head h2 { margin: 0; }
.pl-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin: 0; }
.pl-facts dt { font-family: var(--f-px); text-transform: uppercase; font-size: 15px; color: var(--texte-2); letter-spacing: .04em; }
.pl-facts dd { margin: 2px 0 0; }
.pl-late { color: var(--rose); }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inp.inp-sm { min-height: 34px; padding: 4px 8px; font-size: 13px; }
.st-kpi.st-kpi-alert { box-shadow: inset 4px 0 0 0 var(--rose), 4px 4px 0 0 var(--trait); }
.st-kpi.st-kpi-alert .st-kpi-v { color: var(--rose); }

/* =============================================================================
   Dépôt 3D (Lot 12 bis) : scène isométrique pixel art (depot.js)
   ============================================================================= */
.depot-shell { margin-top: 18px; display: flex; flex-direction: column; background: var(--fond); }
.depot-shell:fullscreen, .depot-shell.is-max { padding: 10px; }
.depot-shell.is-max { position: fixed; inset: 0; z-index: 90; margin: 0; }
.depot-stage { position: relative; height: clamp(420px, calc(100vh - 350px), 860px); background: var(--fond); box-shadow: inset 0 0 0 2px var(--trait); overflow: hidden; user-select: none; -webkit-user-select: none; }
.depot-shell:fullscreen .depot-stage, .depot-shell.is-max .depot-stage { height: auto; flex: 1; }
.depot-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; image-rendering: pixelated; }
.depot-canvas:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.depot-hud { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 8px; }
.depot-hud > span { background: var(--panneau); box-shadow: inset 0 0 0 1px var(--trait-fort); padding: 4px 8px; font-size: 13px; color: var(--texte-2); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.depot-hud b { font-family: var(--f-vt); font-size: 20px; font-weight: 400; color: var(--texte); line-height: 1; }
.depot-hud i { width: 8px; height: 8px; display: inline-block; }
.depot-clock { font-family: var(--f-vt); font-size: 22px !important; color: var(--orange) !important; }
.depot-tools { position: absolute; right: 10px; top: 10px; display: flex; gap: 6px; }
.depot-tools .btn-icon { width: 38px; height: 38px; font-size: 20px; }
.depot-tools .ic-play, .depot-stage.is-paused .depot-tools .ic-pause { display: none; }
.depot-stage.is-paused .depot-tools .ic-play { display: inline; }
.depot-legend { position: absolute; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px 12px; background: var(--panneau); box-shadow: inset 0 0 0 1px var(--trait); padding: 6px 10px; color: var(--texte-2); pointer-events: none; }
.depot-legend span { display: inline-flex; align-items: center; gap: 6px; }
.depot-legend i { width: 10px; height: 10px; display: inline-block; }
.depot-tip { position: absolute; z-index: 3; max-width: 280px; background: var(--panneau); box-shadow: inset 0 0 0 2px var(--orange), 4px 4px 0 var(--noir); padding: 6px 10px; pointer-events: none; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.depot-tip b { font-family: var(--f-px); font-weight: 400; font-size: 18px; text-transform: uppercase; letter-spacing: .04em; line-height: 1.05; }
.depot-tip span { color: var(--texte-2); }
.depot-panel { position: absolute; z-index: 4; top: 58px; right: 10px; bottom: 10px; width: min(360px, calc(100% - 20px)); overflow-y: auto; background: var(--panneau); box-shadow: inset 0 0 0 2px var(--trait-fort), 6px 6px 0 var(--noir); padding: 16px 18px; }
.depot-panel .h-panel { font-size: 24px; margin: 0 36px 4px 0; line-height: 1.05; }
.depot-panel h3 { margin: 16px 0 6px; font-size: 17px; }
.depot-close { position: absolute; top: 10px; right: 10px; width: 32px; padding: 0; font-size: 18px; }
.depot-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--trait); font-size: 14px; }
.depot-row b { font-family: var(--f-vt); font-weight: 400; font-size: 20px; line-height: 1; }
.depot-list { list-style: none; margin: 0; padding: 0; }
.depot-list li { padding: 6px 0; border-bottom: 1px dashed var(--trait); font-size: 14px; }
.depot-list .chip { font-size: 13px; padding: 2px 5px; vertical-align: 1px; }
.depot-bar { height: 10px; background: var(--survol); box-shadow: inset 0 0 0 1px var(--trait-fort); margin: 10px 0; }
.depot-bar i { display: block; height: 100%; background: var(--cyan); }
.depot-links { margin-top: 14px; }
.depot-nojs { position: absolute; inset: 40% 20px auto; text-align: center; }
.depot-texte { margin-top: 18px; }
.depot-texte summary { cursor: pointer; font-size: 20px; }
.depot-texte h3 { margin: 18px 0 6px; }
.depot-texte ul { margin: 0; padding-left: 18px; }
@media (max-width: 760px) {
  .depot-stage { height: calc(100vh - 250px); min-height: 400px; }
  .depot-hud { gap: 4px; }
  .depot-hud > span { font-size: 12px; padding: 2px 6px; }
  .depot-hud b { font-size: 17px; }
  .depot-legend { display: none; }
  .depot-panel { top: auto; left: 10px; right: 10px; width: auto; max-height: 62%; }
}

/* Dépôt 3D, Lot 12 ter : onglets, commandes de la carte, graphique du bureau */
.depot-tabs { margin-top: 14px; }
.depot-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-bottom: 8px; }
.depot-controls .check { min-height: 36px; gap: 8px; font-size: 14px; }
.depot-controls .inp-sm, .depot-controls select { width: auto; min-height: 36px; padding: 4px 8px; }
.depot-controls [aria-pressed="true"] { background: var(--orange); color: var(--encre); }
.depot-source { margin: 8px 0 0; }
.depot-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; height: 120px; align-items: end; margin: 12px 0; }
.depot-bars > div { position: relative; height: 100px; display: flex; align-items: flex-end; justify-content: center; }
.depot-bars i { position: absolute; bottom: 0; width: 70%; display: block; }
.depot-bars i.prev { background: var(--trait-fort); width: 85%; }
.depot-bars i.cur { background: var(--vert); width: 50%; }
.depot-bars i.now { background: var(--orange); }
.depot-bars span { position: absolute; bottom: -18px; font-size: 11px; color: var(--texte-2); }
.depot-carte-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.depot-carte-actions .btn { min-height: 30px; padding: 2px 8px; font-size: 14px; }
@media (max-width: 760px) {
  .depot-controls { gap: 6px 10px; }
  .depot-hud { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .depot-hud > span { flex: none; }
  .depot-controls .check { font-size: 13px; min-height: 32px; }
  .depot-controls .seg-group .btn { font-size: 14px; padding: 4px 8px; }
}

/* Réglages > Interface */
.settings:has(#panel-interface:not([hidden])) .settings-save { display: none; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.brand-item { display: flex; flex-direction: column; gap: 8px; }
.brand-item h3 { margin: 0; }
.brand-preview { min-height: 96px; display: flex; align-items: center; justify-content: center; padding: 12px; background: var(--fond); box-shadow: inset 0 0 0 2px var(--trait); }
.brand-preview img { max-width: 100%; max-height: 72px; object-fit: contain; }
.brand-favicon img { width: 48px; height: 48px; }

/* Dépôt 3D sur toute la zone de contenu : la scène prend la hauteur restante */
.content:has(> .depot) { gap: 12px; padding-top: 20px; padding-bottom: 20px; min-height: calc(100vh - 74px); min-height: calc(100dvh - 74px); }
.depot { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.depot .page-head p { margin-top: 4px !important; }
.depot .depot-shell { flex: 1 1 auto; min-height: 0; }
.depot .depot-stage { flex: 1 1 auto; height: auto; min-height: max(420px, 62vh); }
.depot-legend:not(:has(span)) { display: none; }
.depot .depot-texte { flex: none; }
@media (max-width: 900px) { .content:has(> .depot) { min-height: calc(100dvh - 68px); padding-top: 14px; } .depot .depot-stage { min-height: 70dvh; } }
