/* ─────────────────────────────────────────────────────────────────────────────
   Envois Hanka — interface d'administration (tableau de bord, campagnes, modèles, statistiques)
   Même identité que Mon Espace : crème / terracotta, titres Cormorant Garamond, texte Inter.
   Thème clair par défaut, thème sombre en option (data-theme sur <html>).
   ───────────────────────────────────────────────────────────────────────────── */
:root {
    --hk-primary: #9C4221; --hk-primary-2: #B8572F; --hk-gold: #C9975B;
    --hk-ok: #2F8F5B; --hk-warn: #C9892B; --hk-danger: #C94040; --hk-info: #4F6D9A;
    --hk-hyz: #5B62C9;
    --hk-display: 'Cormorant Garamond', Georgia, serif; --hk-font: 'Inter', system-ui, -apple-system, sans-serif;
    --hk-radius: 18px; --hk-radius-sm: 12px; --hk-t: .2s cubic-bezier(.4, 0, .2, 1);
}
html[data-theme="light"], html:not([data-theme]) {
    --hk-bg: #F6F1EA; --hk-card: #FFFDFA; --hk-soft: #FAF6F0; --hk-text: #2B1E19; --hk-muted: #7A6B65; --hk-border: #EADFD4;
    --hk-side: #FFFDFA; --hk-input: #FFFFFF; --hk-shadow: 0 1px 2px rgba(60, 30, 15, .04), 0 14px 34px -22px rgba(60, 30, 15, .35);
    --hk-piste: rgba(156, 66, 33, .08); --hk-glow: rgba(201, 151, 91, .16);
}
html[data-theme="dark"] {
    --hk-primary: #E08A5F; --hk-primary-2: #EC9D74; --hk-gold: #D9AE78;
    --hk-ok: #4CC08A; --hk-warn: #E3A64B; --hk-danger: #EB6F6F; --hk-info: #8BA8D6; --hk-hyz: #8F95EE;
    --hk-bg: #0F1626; --hk-card: #16203A; --hk-soft: #1B2644; --hk-text: #EDE6DF; --hk-muted: #9AA3B8; --hk-border: #26324F;
    --hk-side: #121B30; --hk-input: #0F1828; --hk-shadow: 0 14px 34px -24px rgba(0, 0, 0, .8);
    --hk-piste: rgba(224, 138, 95, .12); --hk-glow: rgba(224, 138, 95, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--hk-font); font-size: 14.5px; line-height: 1.55; color: var(--hk-text); background: var(--hk-bg);
    background-image: radial-gradient(1000px 520px at 85% -10%, var(--hk-glow), transparent 70%); background-attachment: fixed;
    -webkit-font-smoothing: antialiased; }
a { color: var(--hk-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-family: var(--hk-display); font-weight: 600; letter-spacing: -.01em; color: var(--hk-text); }
svg.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--hk-muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Structure : barre latérale + contenu ─────────────────────────────────── */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 22px 16px; background: var(--hk-side);
    border-right: 1px solid var(--hk-border); z-index: 30; }
.side-marque { display: flex; align-items: center; gap: 12px; padding: 0 6px; color: var(--hk-text) !important; text-decoration: none !important; }
.side-marque img { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 3px var(--hk-card), 0 6px 18px -8px rgba(60, 30, 15, .5); }
.side-marque small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--hk-gold); }
.side-marque b { display: block; font-family: var(--hk-display); font-size: 21px; font-weight: 600; line-height: 1.1; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; font-weight: 500; color: var(--hk-muted) !important;
    text-decoration: none !important; transition: background var(--hk-t), color var(--hk-t); }
.side-nav a:hover { background: var(--hk-piste); color: var(--hk-text) !important; }
.side-nav a.on { background: var(--hk-piste); color: var(--hk-primary) !important; font-weight: 700; }
.side-nav a .compte { margin-left: auto; padding: 0 7px; border-radius: 99px; background: var(--hk-primary); color: #fff; font-size: 11px; font-weight: 700; }
.side-titre { margin: 8px 12px 0; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hk-muted); }
.side-pied { margin-top: auto; display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--hk-border); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 0 6px; font-size: 13px; }
.side-user .av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--hk-piste); color: var(--hk-primary); font-weight: 700; }
.side-actions { display: flex; gap: 6px; }
.side-actions a, .side-actions button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 1px solid var(--hk-border);
    border-radius: 10px; background: var(--hk-card); color: var(--hk-muted) !important; font: 600 12.5px var(--hk-font); cursor: pointer; text-decoration: none !important; }
.side-actions a:hover, .side-actions button:hover { color: var(--hk-primary) !important; border-color: var(--hk-primary); }
.contenu { min-width: 0; padding: 30px 38px 60px; }
.contenu-int { max-width: 1240px; margin: 0 auto; }
.mobile-barre { display: none; }

/* ── En-tête de page ──────────────────────────────────────────────────────── */
.tete { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px 24px; margin: 0 0 22px; }
.tete .surtitre { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--hk-gold); }
.tete h1 { font-size: 40px; line-height: 1.05; }
.tete p.sous { margin: 6px 0 0; color: var(--hk-muted); }
.tete-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.bt { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--hk-border);
    border-radius: 12px; background: var(--hk-card); color: var(--hk-text); font: 600 13.5px var(--hk-font); cursor: pointer; white-space: nowrap;
    text-decoration: none !important; transition: transform var(--hk-t), box-shadow var(--hk-t), border-color var(--hk-t), background var(--hk-t), color var(--hk-t); }
.bt:hover { border-color: var(--hk-primary); color: var(--hk-primary); transform: translateY(-1px); }
.bt:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.bt-p { border-color: transparent; color: #fff !important; background: linear-gradient(120deg, var(--hk-primary), var(--hk-primary-2) 60%, #C0673B);
    box-shadow: 0 10px 22px -12px rgba(156, 66, 33, .75); }
.bt-p:hover { color: #fff; box-shadow: 0 14px 28px -14px rgba(156, 66, 33, .8); }
.bt-s { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.bt-ico { width: 34px; height: 34px; padding: 0; border-radius: 10px; }
.bt-danger:hover { border-color: var(--hk-danger); color: var(--hk-danger); }
.bt-lien { height: auto; padding: 0; border: 0; background: none; color: var(--hk-primary); }
.bt-lien:hover { transform: none; text-decoration: underline; }

/* ── Cartes et indicateurs ───────────────────────────────────────────────── */
.carte { padding: 22px 24px; border: 1px solid var(--hk-border); border-radius: var(--hk-radius); background: var(--hk-card); box-shadow: var(--hk-shadow); }
.carte + .carte, .grille + .carte, .carte + .grille { margin-top: 18px; }
.carte-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.carte-tete h2 { font-size: 24px; }
.carte-tete .lien { font-size: 13px; font-weight: 600; }
.grille { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpi { position: relative; overflow: hidden; display: grid; gap: 2px; padding: 18px 20px; border: 1px solid var(--hk-border); border-radius: var(--hk-radius);
    background: var(--hk-card); box-shadow: var(--hk-shadow); }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--hk-gold), var(--hk-primary)); opacity: .85; }
.kpi.is-ok::before { background: var(--hk-ok); } .kpi.is-alerte::before { background: var(--hk-danger); } .kpi.is-hyz::before { background: var(--hk-hyz); }
.kpi-lib { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hk-muted); }
.kpi-n { font-family: var(--hk-display); font-size: 40px; font-weight: 600; line-height: 1.05; color: var(--hk-primary); font-variant-numeric: lining-nums; }
.kpi.is-ok .kpi-n { color: var(--hk-ok); } .kpi.is-alerte .kpi-n { color: var(--hk-danger); } .kpi.is-hyz .kpi-n { color: var(--hk-hyz); }
.kpi-sous { font-size: 12.5px; color: var(--hk-muted); }
a.kpi { color: inherit; text-decoration: none !important; transition: transform var(--hk-t), border-color var(--hk-t); }
a.kpi:hover { transform: translateY(-2px); border-color: rgba(156, 66, 33, .35); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
    background: var(--hk-piste); color: var(--hk-primary); }
.badge.ok { background: rgba(47, 143, 91, .12); color: var(--hk-ok); }
.badge.warn { background: rgba(201, 137, 43, .14); color: var(--hk-warn); }
.badge.ko { background: rgba(201, 64, 64, .1); color: var(--hk-danger); }
.badge.neutre { background: var(--hk-soft); color: var(--hk-muted); border: 1px solid var(--hk-border); }
.badge.hyz { background: rgba(91, 98, 201, .12); color: var(--hk-hyz); }
.badge .pt { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.live .pt { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* ── Barres de progression ───────────────────────────────────────────────── */
.barre { height: 8px; border-radius: 99px; background: var(--hk-piste); overflow: hidden; }
.barre i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--hk-gold), var(--hk-primary)); transition: width .4s; }
.barre.ok i { background: var(--hk-ok); }

/* ── Tableaux ────────────────────────────────────────────────────────────── */
.tab-wrap { overflow-x: auto; }
table.tab { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tab th { padding: 10px 12px; background: var(--hk-soft); border-top: 1px solid var(--hk-border); border-bottom: 1px solid var(--hk-border); text-align: left;
    font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--hk-muted); white-space: nowrap; }
.tab th:first-child { border-left: 1px solid var(--hk-border); border-radius: 12px 0 0 12px; }
.tab th:last-child { border-right: 1px solid var(--hk-border); border-radius: 0 12px 12px 0; }
.tab td { padding: 13px 12px; border-bottom: 1px solid var(--hk-border); vertical-align: middle; }
.tab tr:last-child td { border-bottom: 0; }
.tab tbody tr:hover td { background: var(--hk-glow); }
.tab .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tab .nom b { display: block; font-weight: 600; }
.tab .nom small { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; color: var(--hk-muted); font-size: 12px; }
.tab .actions { white-space: nowrap; text-align: right; }
.tab .actions > * { display: inline-flex; vertical-align: middle; margin-left: 4px; }
.tab form { margin: 0; }

/* ── Formulaires ─────────────────────────────────────────────────────────── */
.champ { display: grid; gap: 6px; margin: 0 0 16px; }
.champ > label, .champ > .lib { font-size: 12.5px; font-weight: 700; color: var(--hk-text); }
.champ .aide { font-size: 12px; color: var(--hk-muted); }
.saisie, select.saisie, textarea.saisie { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--hk-border); border-radius: 12px; background: var(--hk-input);
    color: var(--hk-text); font: 14px var(--hk-font); transition: border-color var(--hk-t), box-shadow var(--hk-t); }
.saisie:focus { outline: 0; border-color: var(--hk-primary); box-shadow: 0 0 0 3px var(--hk-glow); }
textarea.saisie { min-height: 90px; resize: vertical; }
.recherche { position: relative; }
.recherche svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--hk-muted); pointer-events: none; }
.recherche .saisie { padding-left: 38px; }
.choix { display: grid; gap: 8px; }
.choix.g2 { grid-template-columns: 1fr 1fr; }
.choix label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 11px 13px; border: 1px solid var(--hk-border); border-radius: 12px; background: var(--hk-input);
    cursor: pointer; font-weight: 500; transition: border-color var(--hk-t), background var(--hk-t); }
.choix label:hover { border-color: rgba(156, 66, 33, .35); }
.choix label:has(input:checked) { border-color: var(--hk-primary); background: var(--hk-piste); }
.choix input { accent-color: var(--hk-primary); width: 17px; height: 17px; margin: 0; flex: none; }
.choix small { display: block; font-size: 12px; color: var(--hk-muted); }
.choix .n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--hk-muted); }

/* ── Messages ────────────────────────────────────────────────────────────── */
.alert { display: block; margin: 0 0 18px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--hk-border); background: var(--hk-card); font-size: 13.5px; }
.alert.bg-ok { border-color: rgba(47, 143, 91, .3); background: rgba(47, 143, 91, .08); }
.alert.bg-err { border-color: rgba(201, 64, 64, .3); background: rgba(201, 64, 64, .07); }
.alert.bg-warn { border-color: rgba(201, 137, 43, .35); background: rgba(201, 137, 43, .09); }
.vide { padding: 34px 20px; border: 1px dashed var(--hk-border); border-radius: 14px; text-align: center; color: var(--hk-muted); }
.vide b { display: block; margin-bottom: 4px; color: var(--hk-text); font-family: var(--hk-display); font-size: 20px; }

/* ── Panneau latéral (création de campagne) et fenêtres ──────────────────── */
.voile { position: fixed; inset: 0; z-index: 90; background: rgba(30, 20, 16, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.voile.open { opacity: 1; pointer-events: auto; }
.tiroir { position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(620px, 100vw); display: flex; flex-direction: column; background: var(--hk-card);
    border-left: 1px solid var(--hk-border); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .35); transform: translateX(105%); transition: transform .25s cubic-bezier(.4, 0, .2, 1); }
.tiroir.open { transform: none; }
.tiroir-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 26px 16px; border-bottom: 1px solid var(--hk-border); }
.tiroir-tete h2 { font-size: 28px; }
.tiroir-corps { flex: 1; overflow-y: auto; padding: 22px 26px; }
.tiroir-pied { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 26px; border-top: 1px solid var(--hk-border); background: var(--hk-soft); }
.etape { margin: 0 0 22px; }
.etape-tete { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.etape-tete .num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--hk-primary); color: #fff; font-size: 12.5px; font-weight: 700; }
.etape-tete h3 { font-family: var(--hk-font); font-size: 15px; font-weight: 700; }
.portee { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--hk-piste); font-size: 13px; }
.portee b { font-family: var(--hk-display); font-size: 26px; font-weight: 600; color: var(--hk-primary); }
.portee.alerte { background: rgba(201, 137, 43, .12); }
.recap { display: grid; gap: 8px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--hk-border); border-radius: 14px; background: var(--hk-soft); font-size: 13.5px; }
.recap div { display: flex; justify-content: space-between; gap: 12px; }
.recap span { color: var(--hk-muted); }
.recap b { text-align: right; }
.fen { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(30, 20, 16, .5); }
.fen.open { display: flex; }
.fen-boite { width: min(920px, 100%); max-height: 92vh; display: flex; flex-direction: column; border-radius: 20px; background: var(--hk-card); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5); overflow: hidden; }
.fen-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--hk-border); }
.fen-tete h2 { font-size: 26px; }
.fen-corps { flex: 1; overflow: auto; padding: 20px 24px; }
.fen iframe { width: 100%; min-height: 62vh; border: 1px solid var(--hk-border); border-radius: 12px; background: #fff; }

/* ── Modèles ─────────────────────────────────────────────────────────────── */
.modeles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.modele { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border: 1px solid var(--hk-border); border-radius: var(--hk-radius); background: var(--hk-card);
    box-shadow: var(--hk-shadow); transition: transform var(--hk-t), border-color var(--hk-t); }
.modele:hover { transform: translateY(-2px); border-color: rgba(156, 66, 33, .3); }
.modele-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.modele-tete small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hk-gold); }
.modele-tete b { display: block; margin-top: 2px; font-size: 15px; line-height: 1.35; }
.modele p { margin: 0; font-size: 13px; color: var(--hk-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.modele-pied { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--hk-border); font-size: 12px; color: var(--hk-muted); }
.editeur { margin: 0 0 22px; }
.editeur .jodit-container { border-radius: 12px !important; border-color: var(--hk-border) !important; }
.test-bat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin-top: 6px; padding: 14px; border: 1px dashed var(--hk-border); border-radius: 14px; background: var(--hk-soft); }
.test-bat .champ { margin: 0; }

/* ── Statistiques ────────────────────────────────────────────────────────── */
.entonnoir { display: grid; gap: 12px; }
.ent-ligne { display: grid; grid-template-columns: 150px minmax(0, 1fr) 120px; align-items: center; gap: 14px; }
.ent-ligne .lib { font-weight: 600; }
.ent-ligne .lib small { display: block; font-weight: 400; font-size: 12px; color: var(--hk-muted); }
.ent-ligne .val { text-align: right; font-variant-numeric: tabular-nums; }
.ent-ligne .val b { font-size: 16px; }
.ent-ligne .barre { height: 14px; }
.graph { display: block; width: 100%; height: auto; max-height: 240px; }
.graph .axe { stroke: var(--hk-border); }
.graph .lib-axe { fill: var(--hk-muted); font-size: 11px; font-family: var(--hk-font); }
.graph .b-ouv { fill: var(--hk-gold); } .graph .b-clic { fill: var(--hk-primary); }
.legende { display: flex; gap: 16px; font-size: 12.5px; color: var(--hk-muted); }
.legende i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.liens-l { display: grid; gap: 10px; }
.lien-l { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 6px 16px; align-items: center; }
.lien-l a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.lien-l .val { text-align: right; font-size: 12.5px; color: var(--hk-muted); }
.lien-l .barre { grid-column: 1 / -1; height: 6px; }
.note { margin: 10px 0 0; font-size: 12px; color: var(--hk-muted); }
.chargement { padding: 60px 0; text-align: center; color: var(--hk-muted); }
.chargement::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 12px; border: 3px solid var(--hk-piste); border-top-color: var(--hk-primary); border-radius: 50%; animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
details.tech { margin-top: 18px; }
details.tech > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; border: 1px solid var(--hk-border); border-radius: 14px;
    background: var(--hk-card); font-weight: 600; color: var(--hk-muted); }
details.tech > summary::-webkit-details-marker { display: none; }
details.tech[open] > summary { border-radius: 14px 14px 0 0; border-bottom-color: transparent; }
details.tech > .tech-corps { padding: 18px; border: 1px solid var(--hk-border); border-top: 0; border-radius: 0 0 14px 14px; background: var(--hk-card); font-size: 13px; }
.tech-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tech-grille h4 { margin: 0 0 6px; font-family: var(--hk-font); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hk-muted); }
.tech-grille code, .code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.liste-points { list-style: none; margin: 0; padding: 0; }
.liste-points li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hk-border); font-size: 13.5px; }
.liste-points li:last-child { border-bottom: 0; }
.liste-points li .e { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste-points li small { color: var(--hk-muted); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-21 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .side { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-105%); transition: transform .25s; box-shadow: 30px 0 60px -30px rgba(0, 0, 0, .4); }
    .side.open { transform: none; }
    .mobile-barre { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 16px;
        background: var(--hk-side); border-bottom: 1px solid var(--hk-border); }
    .contenu { padding: 20px 16px 50px; }
    .tete h1 { font-size: 32px; }
    .g3, .g2 { grid-template-columns: 1fr; }
    .test-bat { grid-template-columns: 1fr 1fr; }
    .ent-ligne { grid-template-columns: 100px minmax(0, 1fr) 80px; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr; } .choix.g2 { grid-template-columns: 1fr; } .test-bat { grid-template-columns: 1fr; } }

/* Grilles : pas de marge parasite, contenu jamais plus large que sa colonne */
.grille > * { min-width: 0; }
.grille > .carte, .grille > .grille { margin-top: 0; }
.liste-points.empile li { display: block; padding: 8px 0; }
.liste-points.empile li .e { display: block; }
.liste-points.empile li small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Petits écrans : chaque ligne de tableau devient une fiche (pas de défilement horizontal) */
@media (max-width: 700px) {
    .tab thead { display: none; }
    .tab, .tab tbody, .tab tr { display: block; width: 100%; }
    .tab tr { padding: 12px 0; border-bottom: 1px solid var(--hk-border); }
    .tab tr:last-child { border-bottom: 0; }
    .tab td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; min-width: 0 !important; }
    .tab td::before { content: attr(data-l); flex: none; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hk-muted); text-align: left; }
    .tab td[data-l=""]::before, .tab td.nom::before { display: none; }
    .tab td.nom { display: block; text-align: left; padding-bottom: 6px; }
    .tab td.actions { justify-content: flex-start; flex-wrap: wrap; padding-top: 8px; }
    .tab td.actions > * { margin: 0 6px 0 0; }
    .tab tbody tr:hover td { background: none; }
    .tab .cel-prog { flex: 1; max-width: 220px; }
    .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi { padding: 14px; } .kpi-n { font-size: 30px; } .kpi-lib { font-size: 10.5px; }
    .tete-actions { width: 100%; } .tete-actions > .bt, .tete-actions > form, .tete-actions > .recherche { flex: 1 1 auto; }
    .carte { padding: 18px 16px; }
}
