/* =====================================================================
   Espace Commercial — feuille de style
   Reprend les codes visuels du portail laboratoire : fond clair,
   cartes blanches, accent cyan, en-têtes de tableau en petites capitales.
   ===================================================================== */

:root {
  --accent:        #0a9fce;
  --accent-dark:   #0782a9;
  --accent-soft:   #e6f6fc;
  --accent-ring:   rgba(10, 159, 206, .25);

  --text:          #17222b;
  --text-2:        #46586a;
  --muted:         #7d8d9b;
  --border:        #e3e9ee;
  --border-strong: #cfd8e0;
  --bg:            #f4f7f9;
  --card:          #ffffff;

  --vert:   #16a34a;
  --bleu:   #0ea5e9;
  --ambre:  #f59e0b;
  --rouge:  #ef4444;
  --gris:   #94a3b8;
  --violet: #7c3aed;

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --shadow:    0 1px 2px rgba(23, 34, 43, .04), 0 1px 3px rgba(23, 34, 43, .06);
  --shadow-md: 0 4px 16px rgba(23, 34, 43, .08);
  --shadow-lg: 0 12px 40px rgba(23, 34, 43, .16);

  --sidebar-w: 254px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: Poppins, Inter, sans-serif; margin: 0; line-height: 1.25; }
a { color: var(--accent); }

/* =====================================================================
   1. AUTHENTIFICATION
   ===================================================================== */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 520px at 15% -5%, #d9f1fa 0%, transparent 60%),
    radial-gradient(900px 480px at 95% 105%, #e8f7ef 0%, transparent 62%),
    var(--bg);
}
.auth__card {
  width: min(430px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 32px;
}
.auth__logo {
  width: 54px; height: 54px;
  border-radius: 15px;
  background: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.auth__card h1 { font-size: 24px; letter-spacing: -.3px; }
.auth__sub { color: var(--muted); margin: 6px 0 24px; font-size: 14px; }
.auth__foot { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.auth__foot button {
  background: none; border: 0; padding: 0;
  color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline;
}
.auth__mode {
  margin-top: 20px; padding: 11px 13px;
  border-radius: var(--r-sm);
  background: #fff8e6; border: 1px solid #f6e2b0;
  color: #7a5a10; font-size: 12.5px;
}

/* =====================================================================
   2. STRUCTURE : barre latérale + contenu
   ===================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar__brand strong { display: block; font-family: Poppins, sans-serif; font-size: 15px; letter-spacing: -.2px; }
.sidebar__brand small  { display: block; color: var(--muted); font-size: 11.5px; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.navbtn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 11px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-2);
  font: inherit; font-size: 14px; font-weight: 500;
  text-align: left; cursor: pointer;
  transition: background .12s, color .12s;
}
.navbtn:hover { background: #f1f5f8; color: var(--text); }
.navbtn.is-active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.navbtn__icon { width: 18px; display: grid; place-items: center; flex: 0 0 18px; }
.navbtn__count {
  margin-left: auto;
  background: #eef2f6; color: var(--text-2);
  border-radius: 999px; padding: 1px 7px;
  font-size: 11.5px; font-weight: 600;
}
.navbtn.is-active .navbtn__count { background: #fff; color: var(--accent-dark); }
.nav__sep { margin: 10px 11px 4px; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.sidebar__foot { border-top: 1px solid var(--border); padding: 12px; }
.who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.who__avatar {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 600; font-size: 14px;
}
.who strong { display: block; font-size: 13.5px; }
.who small  { display: block; color: var(--muted); font-size: 11.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: none;
  align-items: center; gap: 12px;
  padding: 10px 16px;
  background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.burger { width: 38px; height: 34px; border: 1px solid var(--border); border-radius: var(--r-sm); background: #fff; display: grid; place-content: center; gap: 4px; cursor: pointer; }
.burger span { display: block; width: 17px; height: 2px; background: var(--text-2); border-radius: 2px; }

.content { flex: 1; padding: 26px 30px 56px; max-width: 1500px; width: 100%; }

.appfoot {
  border-top: 1px solid var(--border);
  padding: 14px 30px;
  color: var(--muted); font-size: 12.5px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.scrim { display: none; }

/* =====================================================================
   3. EN-TÊTE DE PAGE
   ===================================================================== */
.page-head {
  display: flex; align-items: flex-start; gap: 16px;
  flex-wrap: wrap; justify-content: space-between;
  margin-bottom: 20px;
}
.page-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.6px; }
.page-head p  { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* =====================================================================
   4. BOUTONS
   ===================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 17px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--accent); color: #fff;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, box-shadow .12s, border-color .12s, color .12s;
}
.btn:hover  { background: var(--accent-dark); }
.btn:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 1px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--ghost   { background: #fff; color: var(--accent); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn--neutral { background: #fff; color: var(--text-2); border-color: var(--border-strong); }
.btn--neutral:hover { background: #f1f5f8; color: var(--text); }
.btn--danger  { background: #fff; color: var(--rouge); border-color: #f6c9c9; }
.btn--danger:hover { background: #fef2f2; border-color: var(--rouge); }
.btn--sm    { padding: 6px 12px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--link  { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 600; text-decoration: none; }
.btn--link:hover { background: none; text-decoration: underline; }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0 0 8px;
  color: var(--accent); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.back:hover { text-decoration: underline; }

/* =====================================================================
   5. CARTES
   ===================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card--pad { padding: 20px 22px; }
.card__head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card__head h2 { font-size: 17px; font-weight: 600; }
.card__body { padding: 20px 22px; }

.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Tuiles d'indicateurs */
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow);
}
.stat__label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat__value { font-family: Poppins, sans-serif; font-size: 28px; font-weight: 700; letter-spacing: -.8px; margin-top: 2px; }
.stat__hint  { color: var(--muted); font-size: 12px; }
.stat--accent .stat__value { color: var(--accent); }
.stat--vert   .stat__value { color: var(--vert); }
.stat--ambre  .stat__value { color: var(--ambre); }
.stat--rouge  .stat__value { color: var(--rouge); }

/* =====================================================================
   6. FILTRES
   ===================================================================== */
.filters {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden;
}
.filters__row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 14px 16px;
}
.filters__row > * { flex: 1 1 210px; min-width: 0; }
.filters__row > .filters__toggle { flex: 0 0 auto; }
.filters__more { padding: 0 16px 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.filters__more > * { flex: 1 1 200px; }
.filters__more[hidden] { display: none; }
.filters__toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; color: var(--accent);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; padding: 6px 4px;
}
.filters__toggle:hover { text-decoration: underline; }

.search { position: relative; display: block; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input[type="search"], .search input[type="text"] { padding-left: 38px; }

/* Onglets par mois */
.months {
  display: flex; align-items: center; gap: 4px;
  border-top: 1px solid var(--border);
  padding: 0 8px;
}
.months__scroll { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.months__scroll::-webkit-scrollbar { display: none; }
.month {
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 13px 15px 10px; margin-bottom: -1px;
  color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500;
  white-space: nowrap; cursor: pointer;
}
.month:hover { color: var(--text); }
.month.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.month.is-today::after { content: "•"; color: var(--accent); margin-left: 5px; }
.months__arrow {
  flex: 0 0 auto; width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: 50%;
  background: #fff; color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
}
.months__arrow:hover { background: #f1f5f8; color: var(--text); }

/* Onglets simples (En cours / Archivées) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 16px; }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 13px 14px 10px; margin-bottom: -1px;
  color: var(--muted); font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* =====================================================================
   7. CHAMPS DE FORMULAIRE
   ===================================================================== */
.field { display: block; margin-bottom: 15px; }
.field__label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field__req { color: var(--rouge); }
.field__hint { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: #fff; color: var(--text);
  font: inherit; font-size: 14px;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
input::placeholder, textarea::placeholder { color: #a6b3bf; }
textarea { resize: vertical; min-height: 96px; line-height: 1.6; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237d8d9b' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

.form-row { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* Cases d'étiquettes cliquables */
.chips-pick { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-pick {
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: #fff; color: var(--text-2);
  padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.chip-pick:hover { border-color: var(--accent); color: var(--accent); }
.chip-pick.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }

/* =====================================================================
   8. TABLEAUX
   ===================================================================== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data thead th {
  text-align: left;
  padding: 13px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap;
}
table.data tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcfd; }
.td-right { text-align: right; }
.td-tight { width: 1%; white-space: nowrap; }

/* Cellule « opération » / « laboratoire » */
.entity { display: flex; gap: 12px; align-items: flex-start; }
.pastille {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 12.5px;
  font-family: Poppins, sans-serif; letter-spacing: -.3px;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border);
}
.pastille--sm { width: 28px; height: 28px; flex-basis: 28px; font-size: 10.5px; }
.entity__name {
  display: block; background: none; border: 0; padding: 0; text-align: left;
  color: var(--accent); font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; text-transform: uppercase; letter-spacing: -.1px; line-height: 1.35;
}
.entity__name:hover { text-decoration: underline; }
.entity__sub { display: block; color: var(--text-2); font-size: 13.5px; }

/* Titre de fiche + picto de relance sur la même ligne */
.entity__title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.entity__title .entity__name { display: inline; }

/* Liste d'informations à picto (colonne INFOS) */
.infos { display: flex; flex-direction: column; gap: 7px; }
.info { display: flex; gap: 9px; align-items: flex-start; color: var(--text-2); font-size: 13.5px; line-height: 1.45; }
.info svg { flex: 0 0 16px; margin-top: 2px; color: var(--muted); }
.info strong { color: var(--text); font-weight: 600; }

/* =====================================================================
   9. BADGES ET ÉTIQUETTES
   ===================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  color: #fff; background: var(--gris);
}
.badge--outline { background: #fff; border: 1px solid currentColor; }
.badge--lg { padding: 6px 14px; font-size: 13px; }

.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--r-sm);
  background: #eef4f8; color: #4a6273;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gris); }

/* Bandeau d'état de période */
.periode-wrap { display: block; margin-top: 7px; }
.periode-wrap--right { text-align: right; }

.periode { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.periode--en_cours { color: var(--vert); }
.periode--a_venir  { color: var(--ambre); }
.periode--terminee { color: var(--muted); }

/* =====================================================================
   10. DÉTAIL D'UNE FICHE
   ===================================================================== */
.detail-head { margin-bottom: 20px; }
.detail-head h1 {
  font-size: 28px; font-weight: 700; letter-spacing: -.5px;
  text-transform: uppercase; display: inline; margin-right: 10px;
}
.detail-head__dates { color: var(--muted); font-size: 14px; margin-top: 8px; }
.detail-head__labo { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.detail-head__labo strong { color: var(--accent); font-size: 15px; font-weight: 600; }

.detail-cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }

.section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 12px;
}
.instruction {
  white-space: pre-wrap;
  color: var(--text-2); font-size: 14px; line-height: 1.65;
}
.instruction.is-clamped {
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden;
}

/* Paires libellé / valeur */
.kv { display: grid; gap: 11px; }
.kv__row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.kv__k { color: var(--muted); font-size: 13px; }
.kv__v { font-size: 14px; }
.kv__v--strong { font-weight: 600; }

/* Fil de messages d'une réclamation */
.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { background: #f7f9fb; border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; }
.msg__head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 5px; }
.msg__who { font-weight: 600; font-size: 13.5px; }
.msg__at  { color: var(--muted); font-size: 12px; }
.msg__txt { white-space: pre-wrap; color: var(--text-2); font-size: 14px; }

/* Historique */
.histo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.histo li { display: flex; gap: 9px; font-size: 13px; color: var(--text-2); }
.histo time { color: var(--muted); flex: 0 0 118px; font-size: 12.5px; }

/* =====================================================================
   11. ÉTATS VIDES, CHARGEMENT, ERREURS
   ===================================================================== */
.empty { text-align: center; padding: 54px 22px; color: var(--muted); }
.empty__icon { font-size: 34px; margin-bottom: 10px; opacity: .55; }
.empty h3 { font-size: 16px; color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0 auto 18px; max-width: 430px; font-size: 14px; }

.loading { padding: 46px; text-align: center; color: var(--muted); }
.alert {
  padding: 12px 15px; border-radius: var(--r-sm);
  background: #fef2f2; border: 1px solid #f6c9c9; color: #97231f;
  font-size: 13.5px; margin-bottom: 14px;
}
.alert--info { background: var(--accent-soft); border-color: #b7e3f2; color: #0b5a75; }

/* =====================================================================
   12. FENÊTRES MODALES
   ===================================================================== */
.modal-scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(23, 34, 43, .45);
  display: grid; place-items: center; padding: 20px;
  overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: min(620px, 100%); max-height: 92vh; overflow-y: auto;
  margin: auto;
}
.modal--lg { width: min(880px, 100%); }
.modal__head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; background: var(--card); border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 1;
}
.modal__head h2 { font-size: 18px; font-weight: 600; }
.modal__close {
  width: 32px; height: 32px; flex: 0 0 32px;
  border: 0; border-radius: var(--r-sm); background: #f1f5f8; color: var(--text-2);
  font-size: 19px; line-height: 1; cursor: pointer;
}
.modal__close:hover { background: #e6ecf1; color: var(--text); }
.modal__body { padding: 20px 22px; }
.modal__foot {
  padding: 15px 22px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  position: sticky; bottom: 0; background: var(--card); border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* =====================================================================
   13. NOTIFICATIONS
   ===================================================================== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 24px);
  background: #17222b; color: #fff;
  padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  z-index: 200; max-width: min(560px, 92vw); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: #a51f1a; }

/* =====================================================================
   14. RESPONSIVE
   ===================================================================== */
@media (max-width: 1080px) {
  .detail-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .topbar { display: flex; }
  .content { padding: 18px 16px 48px; }
  .appfoot { padding: 14px 16px; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: translateX(0); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(23, 34, 43, .4); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar.is-open ~ .scrim, .scrim.is-on { opacity: 1; pointer-events: auto; }
  .page-head h1 { font-size: 24px; }
  .detail-head h1 { font-size: 21px; }
  .kv__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .histo li { flex-direction: column; gap: 1px; }
  .histo time { flex: none; }
}

@media (max-width: 620px) {
  /* Les récapitulatifs du tableau de bord passent en liste empilée. */
  table.data--compact tbody tr { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px; }
  /* width:1% / text-align:right des cellules compactes n'ont plus de sens
     une fois la ligne empilée : on les neutralise pour éviter les chevauchements. */
  table.data--compact tbody td { display: block; border: 0; padding: 0; width: auto; text-align: left; }
  table.data--compact tbody td:first-child { flex: 1 1 100%; }
  table.data--compact .periode-wrap--right { text-align: left; }
  table.data--compact tbody tr { border-bottom: 1px solid var(--border); }

  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; }
  table.data tbody td { padding: 13px 12px; }
  table.data thead th { padding: 11px 12px; }
}

@media print {
  .sidebar, .topbar, .appfoot, .page-head__actions, .filters, .btn { display: none !important; }
  .content { padding: 0; }
  .card { border: 0; box-shadow: none; }
}
