/* ALERTE TROU — Espace d'administration
   Feuille de style unique, sans dépendance. Thème clair / sombre par jetons. */

:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --border: #e1e4ea;
  --border-strong: #c9ced8;
  --text: #16181d;
  --text-2: #4b5160;
  --text-3: #7a8191;
  --primary: #1c5cab;
  --primary-hover: #184f95;
  --primary-soft: #e6effa;
  --accent: #f5b100;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --success: #1b7a3d;
  --success-soft: #e7f5ec;
  --warning: #9a6200;
  --warning-soft: #fff4dc;
  --sidebar: #0f1f36;
  --sidebar-2: #172b48;
  --sidebar-text: #c9d3e3;
  --sidebar-active: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 10px;
  --radius-sm: 6px;
  /* Graphiques : palette catégorielle validée (ordre fixe) */
  --serie-1: #2a78d6; --serie-2: #eb6834; --serie-3: #1baf7a; --serie-4: #eda100;
  --serie-5: #e87ba4; --serie-6: #008300; --serie-7: #4a3aa7; --serie-8: #e34948;
  --grille: #e8eaef;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  font-size: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111317; --surface: #1a1c21; --surface-2: #1f2228; --surface-3: #262a31;
    --border: #2d3139; --border-strong: #3c424d; --text: #f1f2f4; --text-2: #b9bfcb; --text-3: #8a91a0;
    --primary: #4c8fe0; --primary-hover: #6aa3e8; --primary-soft: #1d2d45;
    --danger: #ef6b6b; --danger-soft: #3a1f22; --success: #4cc27a; --success-soft: #1a3325;
    --warning: #e6b04a; --warning-soft: #3a2f16; --sidebar: #0b1422; --sidebar-2: #13223a;
    --serie-1: #3987e5; --serie-2: #d95926; --serie-3: #199e70; --serie-4: #c98500;
    --serie-5: #d55181; --serie-6: #008300; --serie-7: #9085e9; --serie-8: #e66767;
    --grille: #2a2e36;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111317; --surface: #1a1c21; --surface-2: #1f2228; --surface-3: #262a31;
  --border: #2d3139; --border-strong: #3c424d; --text: #f1f2f4; --text-2: #b9bfcb; --text-3: #8a91a0;
  --primary: #4c8fe0; --primary-hover: #6aa3e8; --primary-soft: #1d2d45;
  --danger: #ef6b6b; --danger-soft: #3a1f22; --success: #4cc27a; --success-soft: #1a3325;
  --warning: #e6b04a; --warning-soft: #3a2f16; --sidebar: #0b1422; --sidebar-2: #13223a;
  --serie-1: #3987e5; --serie-2: #d95926; --serie-3: #199e70; --serie-4: #c98500;
  --serie-5: #d55181; --serie-6: #008300; --serie-7: #9085e9; --serie-8: #e66767;
  --grille: #2a2e36;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
code, pre, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--text-3); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Structure ------------------------------------------------------------ */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.marque { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; letter-spacing: .02em; }
.marque small { display: block; font-weight: 500; color: var(--sidebar-text); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.marque svg { flex: none; }
.menu { padding: 6px 10px 20px; display: flex; flex-direction: column; gap: 1px; }
.menu .groupe { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #7f8ea8; padding: 14px 10px 6px; }
.menu a { display: flex; align-items: center; gap: 10px; color: var(--sidebar-text); padding: 8px 10px; border-radius: 7px; font-size: 13.5px; text-decoration: none; }
.menu a:hover { background: var(--sidebar-2); color: #fff; }
.menu a.actif { background: var(--primary); color: var(--sidebar-active); }
.menu a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.menu .sous { padding-left: 37px; font-size: 13px; }
.menu .compteur { margin-left: auto; background: rgba(255,255,255,.12); border-radius: 10px; padding: 0 7px; font-size: 11px; }
.principal { min-width: 0; display: flex; flex-direction: column; }
.barre { height: 58px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.barre .fil { flex: 1; min-width: 0; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre .fil b { color: var(--text); }
.bouton-menu { display: none; }
.contenu { padding: 24px; max-width: 1480px; width: 100%; }
.entete-page { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.entete-page p { margin: 4px 0 0; color: var(--text-2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- Utilisateur / menu déroulant ----------------------------------------- */
.utilisateur { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 8px; border: 0; background: none; color: inherit; font: inherit; }
.utilisateur:hover { background: var(--surface-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.utilisateur .nom { font-weight: 600; font-size: 13px; text-align: left; }
.utilisateur .role { font-size: 11.5px; color: var(--text-3); text-align: left; }
.deroulant { position: relative; }
.deroulant-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 50; }
.deroulant-menu a, .deroulant-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.deroulant-menu a:hover, .deroulant-menu button:hover { background: var(--surface-3); text-decoration: none; }

/* ---- Boutons, formulaires -------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--surface-3); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
.btn.primaire { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primaire:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.plein-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.succes { background: var(--success); border-color: var(--success); color: #fff; }
.btn.discret { border-color: transparent; background: transparent; }
.btn.discret:hover { background: var(--surface-3); }
.btn.petit { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.icone { width: 36px; padding: 0; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.champ { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.champ label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.champ .aide { font-size: 12px; color: var(--text-3); }
.champ .erreur { font-size: 12px; color: var(--danger); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], input[type=color], select, textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; width: 100%; min-width: 0;
}
textarea { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; }
input[type=color] { padding: 3px; width: 56px; }
input.invalide, select.invalide, textarea.invalide { border-color: var(--danger); }
.case { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.case input { width: 16px; height: 16px; accent-color: var(--primary); }
.interrupteur { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.interrupteur input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.interrupteur input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.interrupteur input:checked { background: var(--success); }
.interrupteur input:checked::after { left: 19px; }
.grille-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grille-form .large { grid-column: 1 / -1; }

/* ---- Cartes / panneaux ----------------------------------------------------- */
.carte-ui { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.carte-ui > .tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.carte-ui > .corps { padding: 16px 18px; }
.carte-ui > .corps.sans-marge { padding: 0; }
.grille { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-detail { grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); align-items: start; }
.pile { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grille > *, .pile > *, .carte-ui { min-width: 0; }

/* ---- Indicateurs ----------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; min-height: 108px; }
.kpi .libelle { font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.kpi .valeur { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .valeur small { font-size: 14px; font-weight: 600; color: var(--text-3); margin-left: 3px; }
.kpi .note { font-size: 11.5px; color: var(--text-3); margin-top: auto; }
.kpi.a-definir .valeur { color: var(--text-3); font-size: 18px; }

/* ---- Tableaux -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.tableau { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tableau th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.tableau th.triable { cursor: pointer; user-select: none; }
.tableau th.triable:hover { color: var(--text); }
.tableau td .mono.nowrap, .tableau td .nowrap { white-space: nowrap; }
.tableau td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tbody tr.cliquable { cursor: pointer; }
.tableau tbody tr.cliquable:hover td { background: var(--surface-2); }
.tableau td.num, .tableau th.num { text-align: right; font-variant-numeric: tabular-nums; }
.vide { padding: 36px 16px; text-align: center; color: var(--text-3); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; flex-wrap: wrap; }

/* ---- Filtres, onglets ------------------------------------------------------ */
.filtres { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.filtres .champ { width: 170px; }
.filtres .champ.large { width: 260px; }
.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.onglets button, .onglets a { background: none; border: 0; padding: 10px 14px; font: inherit; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.onglets .actif { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.onglets .nb { font-size: 11px; background: var(--surface-3); border-radius: 9px; padding: 0 6px; color: var(--text-2); }

/* ---- Badges ---------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); border: 1px solid transparent; }
.badge .pastille { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.ko { background: var(--danger-soft); color: var(--danger); }
.badge.att { background: var(--warning-soft); color: var(--warning); }
.badge.info { background: var(--primary-soft); color: var(--primary); }

/* ---- Détail ---------------------------------------------------------------- */
.proprietes { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; margin: 0; }
.proprietes dt { color: var(--text-3); }
.proprietes dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.chronologie { list-style: none; margin: 0; padding: 0; }
.chronologie li { position: relative; padding: 0 0 16px 22px; }
.chronologie li::before { content: ""; position: absolute; left: 5px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.chronologie li:last-child::before { display: none; }
.chronologie .point { position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
.chronologie .quand { font-size: 12px; color: var(--text-3); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photos a { display: block; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.etapes { display: flex; gap: 0; margin: 4px 0 2px; }
.etapes .etape { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: center; font-size: 11.5px; color: var(--text-3); position: relative; padding-top: 28px; }
.etapes .etape::before { content: ""; position: absolute; top: 6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border-strong); z-index: 1; }
.etapes .etape::after { content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 2px; background: var(--border-strong); }
.etapes .etape:first-child::after { display: none; }
.etapes .etape.fait { color: var(--text); font-weight: 600; }
.etapes .etape.fait::before { background: var(--primary); border-color: var(--primary); }
.etapes .etape.fait::after { background: var(--primary); }
.etapes .etape.courant::before { box-shadow: 0 0 0 4px var(--primary-soft); }
.barre-progression { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.barre-progression > span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.alerte-bandeau { padding: 10px 14px; border-radius: 8px; font-size: 13px; border: 1px solid; }
.alerte-bandeau.info { background: var(--primary-soft); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 25%, transparent); }
.alerte-bandeau.att { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.alerte-bandeau.ko { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.json { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }

/* ---- Modale, notifications éphémères --------------------------------------- */
.voile { position: fixed; inset: 0; background: rgba(8, 14, 26, .5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modale { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modale.large { width: min(900px, 100%); }
.modale .tete { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modale .corps { padding: 18px 20px; overflow-y: auto; }
.modale .pied { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 380px; }
.toast.ko { background: var(--danger); color: #fff; }
.toast.ok { background: var(--success); color: #fff; }

/* ---- Connexion ------------------------------------------------------------- */
.page-connexion { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.connexion-visuel { background: linear-gradient(160deg, #0f1f36 0%, #1c5cab 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.connexion-visuel h1 { font-size: 34px; line-height: 1.15; max-width: 480px; }
.connexion-visuel p { color: #c9d8ee; max-width: 440px; font-size: 15px; }
.connexion-visuel .chaine { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.connexion-visuel .chaine span { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.connexion-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.connexion-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }

/* ---- Graphiques ------------------------------------------------------------ */
.graphique { position: relative; }
.graphique svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphique .axe text { fill: var(--text-3); font-size: 11px; }
.graphique .grille-ligne { stroke: var(--grille); stroke-width: 1; }
.graphique .etiquette { fill: var(--text-2); font-size: 12px; }
.graphique .valeur { fill: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.infobulle { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; white-space: nowrap; z-index: 5; transform: translate(-50%, calc(-100% - 10px)); }
.infobulle b { font-variant-numeric: tabular-nums; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 10px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---- Carte ----------------------------------------------------------------- */
.carte-geo { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 0 0 var(--radius) var(--radius); touch-action: none; user-select: none; cursor: grab; }
.carte-geo.glisse { cursor: grabbing; }
.carte-geo .tuiles, .carte-geo svg.couches { position: absolute; inset: 0; }
.carte-geo .tuiles img { position: absolute; width: 256px; height: 256px; max-width: none; image-rendering: auto; }
:root[data-theme="dark"] .carte-geo .tuiles img { filter: brightness(.72) contrast(1.1) saturate(.8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .carte-geo .tuiles img { filter: brightness(.72) contrast(1.1) saturate(.8); } }
.carte-geo svg.couches { width: 100%; height: 100%; overflow: visible; }
.carte-geo .zoom { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; box-shadow: var(--shadow); border-radius: 8px; overflow: hidden; z-index: 2; }
.carte-geo .zoom button { width: 34px; height: 34px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 18px; cursor: pointer; }
.carte-geo .zoom button:last-child { border-bottom: 0; }
.carte-geo .attribution { position: absolute; right: 0; bottom: 0; background: rgba(255,255,255,.8); color: #333; font-size: 10.5px; padding: 1px 6px; z-index: 2; }
.carte-geo .marqueur { cursor: pointer; }
.carte-geo .marqueur:hover { stroke-width: 3; }
.panneau-carte { position: absolute; left: 10px; top: 10px; z-index: 2; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; max-width: 230px; }

/* ---- États ----------------------------------------------------------------- */
.ecran-chargement { min-height: 60vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.chargement-ligne { padding: 40px; display: grid; place-items: center; }

/* ---- Responsive ------------------------------------------------------------ */
@media (max-width: 1100px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .layout.menu-ouvert .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .bouton-menu { display: inline-flex; }
  .contenu { padding: 16px; }
  .barre { padding: 0 16px; }
  .g2, .g3, .grille-form { grid-template-columns: minmax(0, 1fr); }
  .etapes .etape { font-size: 10px; }
  .page-connexion { grid-template-columns: 1fr; }
  .connexion-visuel { display: none; }
  .utilisateur .nom, .utilisateur .role { display: none; }
  .filtres .champ, .filtres .champ.large { width: 100%; }
  .proprietes { grid-template-columns: 1fr; }
  .proprietes dt { margin-top: 6px; }
}

/* Actualisation automatique */
.auto-maj { color: var(--text-3); font-weight: 500; gap: 6px; white-space: nowrap; }
.auto-maj .pastille { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.auto-maj.pause .pastille { background: var(--text-3); box-shadow: none; }
@media (max-width: 760px) { .auto-maj { font-size: 0; gap: 0; } }

/* Menu latéral sur mobile : bouton de fermeture et fond assombri */
.fermer-menu, .voile-menu { display: none; }
@media (max-width: 860px) {
  .marque { padding-right: 8px; }
  .fermer-menu { display: inline-flex; margin-left: auto; color: #fff; }
  .fermer-menu:hover { background: rgba(255, 255, 255, .12); }
  .layout.menu-ouvert .voile-menu { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 16, 28, .45); }
}

/* Classement des contributeurs */
.rang { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 50%; font-weight: 700; font-size: 12.5px; color: var(--text-2); }
.rang.r1 { background: #f5c542; color: #3d2c00; }
.rang.r2 { background: #c9ced8; color: #1f2430; }
.rang.r3 { background: #d99a5b; color: #2e1a07; }
