/* ============================================================
   KronoFix — thèmes sombre (défaut) & clair doux
   Les composants ne consomment que des variables : le thème
   se bascule en surchargeant les tokens sous [data-theme].
   ============================================================ */

:root {
    /* Sombre = valeurs par défaut */
    --bg: #0b1020;
    --surface: rgba(23, 29, 48, .88);
    --surface-solid: #171d30;
    --border: #262f4a;
    --text: #e9edf6;
    --text-soft: #97a1ba;
    --accent: #5b86ff;
    --accent-2: #8a63ff;
    --accent-soft: rgba(91, 134, 255, .16);
    --accent-strong: #7da0ff;
    --danger: #ff7b6e;
    --danger-soft: rgba(255, 99, 88, .16);
    --success: #4fd6a4;
    --success-soft: rgba(61, 214, 152, .14);
    --warning: #ffc46b;
    --warning-soft: rgba(255, 183, 77, .14);
    --radius: 14px;
    --radius-btn: 11px;
    --radius-champ: 11px;
    --radius-pilule: 999px;
    --sur-accent: #fff;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 30px rgb(0 0 0 / .35);
    /* LE marqueur d'état actif — en sombre, ses arrêts se foncent (≈4,7:1
       sous le libellé blanc) : l'accent pur resterait sous le seuil AA.
       Le mix suit --accent : les neuf palettes en héritent d'office. */
    --degrade-actif: linear-gradient(135deg,
        color-mix(in srgb, var(--accent) 82%, #000),
        color-mix(in srgb, var(--accent-2) 82%, #000));

    /* Tokens de surface (remplacent les couleurs jadis codées en dur) */
    --body-grad:
        radial-gradient(900px 500px at 85% -10%, rgba(124, 91, 255, .22), transparent 60%),
        radial-gradient(700px 400px at -10% 20%, rgba(47, 107, 255, .18), transparent 55%),
        linear-gradient(165deg, #0d1226 0%, #0b1020 45%, #141026 100%);
    --topbar-bg: rgba(13, 18, 34, .75);
    --hover: rgba(255, 255, 255, .06);
    --raise: rgba(255, 255, 255, .08);
    --input-bg: rgba(10, 14, 28, .6);
    --sunken: rgba(10, 14, 28, .5);
    --accent-tint: rgba(91, 134, 255, .09);
    --placeholder: #5d6680;
}

/* Clair doux — slate reposant, jamais de blanc pur */
:root[data-theme="light"] {
    --bg: #e6e9f2;
    --surface: rgba(246, 247, 251, .86);
    --surface-solid: #f1f3f9;
    --border: #d3d8e6;
    --text: #222838;
    --text-soft: #5a6178;
    --accent: #4568d8;
    --accent-2: #6d4fc8;
    /* En clair, l'accent porte déjà le blanc à plus de 5:1 : dégradé pur. */
    --degrade-actif: linear-gradient(135deg, var(--accent), var(--accent-2));
    --accent-soft: rgba(69, 104, 216, .12);
    --accent-strong: #3a5fd0;
    --danger: #c8372b;
    --danger-soft: rgba(200, 55, 43, .1);
    --success: #12805c;
    --success-soft: rgba(18, 128, 92, .12);
    --warning: #b26a00;
    --warning-soft: rgba(178, 106, 0, .14);
    --shadow: 0 1px 2px rgb(30 40 70 / .06), 0 10px 30px rgb(30 40 70 / .1);

    --body-grad:
        radial-gradient(900px 500px at 85% -10%, rgba(138, 99, 255, .1), transparent 60%),
        radial-gradient(700px 400px at -10% 20%, rgba(91, 134, 255, .12), transparent 55%),
        linear-gradient(165deg, #edeff6 0%, #e6e9f2 45%, #efe9f6 100%);
    --topbar-bg: rgba(238, 240, 247, .82);
    --hover: rgba(30, 40, 80, .05);
    --raise: rgba(30, 40, 80, .045);
    --input-bg: #edf0f7;
    --sunken: rgba(30, 40, 80, .035);
    --accent-tint: rgba(69, 104, 216, .08);
    --placeholder: #98a0b2;
}

/* ============================================================
   Les thèmes — Réglages › Apparence. Quatre mondes graphiques :
   sans data-style, KronoFix (la signature maison : tokens ci-dessus,
   dégradé de nuit, verre, dégradés d'accent). data-style="apple",
   "windows" ou "android" : le poste adopte les codes complets de la
   plateforme — fonds, surfaces, rayons, typo, ombres — pas une simple
   couleur de boutons. Le clair/sombre (data-theme) reste un axe
   indépendant qui traverse les quatre.
   ============================================================ */

/* ── Apple — Human Interface Guidelines + Liquid Glass (macOS Tahoe) ──
   Les couleurs des Réglages Système : sombre anthracite (pas le noir
   iOS) aux cartes gris élevé, clair gris perle aux cartes blanches —
   opaques et sans bordure, le verre est réservé au chrome (topbar).
   Accent systemBlue en aplat, boutons rectangulaires à arrondi modéré,
   séparateurs hairline, ombres d'élévation douces.
   Réf. : .claude/skills/kronofix-style/references/charte-apple.md */
:root[data-style="apple"] {
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    --bg: #1b1f21;
    --body-grad: linear-gradient(180deg, #1b1f21, #1b1f21);
    --surface: #2b2f30;
    --surface-solid: #313536;
    --border: rgba(255, 255, 255, .09);
    --text: #ffffff;
    --text-soft: rgba(235, 235, 245, .66);
    --placeholder: rgba(235, 235, 245, .3);
    --accent: #1e4bb0; --accent-2: #1e4bb0; --accent-strong: #4f9bff;
    --accent-soft: rgba(54, 110, 220, .22); --accent-tint: rgba(54, 110, 220, .12);
    --danger: #ff453a; --danger-soft: rgba(255, 69, 58, .16);
    --success: #30d158; --success-soft: rgba(48, 209, 88, .14);
    --warning: #ff9f0a; --warning-soft: rgba(255, 159, 10, .14);
    --radius: 12px; --radius-btn: 10px; --radius-champ: 10px;
    --shadow: 0 1px 3px rgb(0 0 0 / .3), 0 12px 32px rgb(0 0 0 / .25);
    --topbar-bg: rgba(27, 31, 33, .7);
    --hover: rgba(255, 255, 255, .06);
    --raise: rgba(255, 255, 255, .05);
    --input-bg: rgba(118, 118, 128, .24);
    --sunken: rgba(118, 118, 128, .12);
}
:root[data-style="apple"][data-theme="light"] {
    --bg: #ecedef;
    --body-grad: linear-gradient(180deg, #ecedef, #ecedef);
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --border: rgba(60, 60, 67, .24);
    --text: #000000;
    --text-soft: rgba(60, 60, 67, .6);
    --placeholder: rgba(60, 60, 67, .3);
    --accent: #007aff; --accent-2: #007aff; --accent-strong: #0071eb;
    --accent-soft: rgba(0, 122, 255, .12); --accent-tint: rgba(0, 122, 255, .07);
    --danger: #d70015; --danger-soft: rgba(215, 0, 21, .1);
    --success: #248a3d; --success-soft: rgba(36, 138, 61, .12);
    --warning: #b25000; --warning-soft: rgba(178, 80, 0, .13);
    --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px rgb(0 0 0 / .06);
    --topbar-bg: rgba(246, 246, 248, .74);
    --hover: rgba(0, 0, 0, .04);
    --raise: rgba(0, 0, 0, .03);
    --input-bg: rgba(118, 118, 128, .12);
    --sunken: rgba(118, 118, 128, .07);
}
/* Chez Apple le contenu n'est jamais en verre : cartes opaques sans
   bordure, l'élévation fait la structure. Seule la topbar est du verre. */
:root[data-style="apple"] .card,
:root[data-style="apple"] .box {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: transparent;
}
:root[data-style="apple"] .topbar {
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    backdrop-filter: blur(22px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
:root[data-style="apple"][data-theme="light"] .topbar { border-bottom-color: rgba(0, 0, 0, .08); }
/* Boutons Liquid Glass : rectangles à arrondi modéré, en VERRE.
   Le principal est teinté systemBlue, le secondaire est le verre
   neutre — blanc translucide, liseré clair, gros flou. Au survol le
   bouton se soulève d'un pixel, au clic il s'enfonce d'un pixel :
   la physique du verre, pas un écrasement. */
:root[data-style="apple"] .btn {
    font-weight: 600;
    transition: background .2s, border-color .2s, box-shadow .2s, transform .15s, filter .2s;
}
:root[data-style="apple"] .btn:active { transform: translateY(1px); }
:root[data-style="apple"] .btn-primary {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 50%),
        color-mix(in srgb, var(--accent) 84%, transparent);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    backdrop-filter: blur(12px) saturate(180%);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, .5),
        inset 0 0 0 1px rgba(255, 255, 255, .3),
        0 8px 32px rgba(0, 0, 0, .25);
}
:root[data-style="apple"] .btn-primary:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, .7),
        inset 0 0 0 1px rgba(255, 255, 255, .5),
        0 12px 40px rgba(0, 0, 0, .3);
}
:root[data-style="apple"] .btn-outline {
    background: rgba(255, 255, 255, .15);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-color: rgba(255, 255, 255, .3);
    color: var(--text);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, .5),
        0 8px 32px rgba(0, 0, 0, .25);
}
:root[data-style="apple"] .btn-outline:hover {
    background: rgba(255, 255, 255, .25);
    border-color: rgba(255, 255, 255, .5);
    transform: translateY(-1px);
}
:root[data-style="apple"][data-theme="light"] .btn-outline {
    background: rgba(255, 255, 255, .55);
    border-color: rgba(0, 0, 0, .12);
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, .9),
        0 8px 24px rgba(0, 0, 0, .12);
}
:root[data-style="apple"][data-theme="light"] .btn-outline:hover {
    background: rgba(255, 255, 255, .8);
    border-color: rgba(0, 0, 0, .2);
}
/* Les onglets de section (Réglages…) : rectangles à arrondi modéré,
   alignés sur les boutons Sombre/Clair — pas des pilules. */
:root[data-style="apple"] .subnav a { border-radius: 12px; }
/* …et les carrés colorés des Réglages macOS en thème Apple : chaque
   section porte son icône sur une pastille système — c'est ce qui rend
   la page vivante sur les fonds anthracite. */
:root[data-style="apple"] .subnav-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1;
    background: var(--ico, #8e8e93);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .3);
}
:root[data-style="apple"] .ico-gris { --ico: #8e8e93; }
:root[data-style="apple"] .ico-bleu { --ico: #0a84ff; }
:root[data-style="apple"] .ico-vert { --ico: #30d158; }
:root[data-style="apple"] .ico-indigo { --ico: #5e5ce6; }
:root[data-style="apple"] .ico-orange { --ico: #ff9f0a; }
:root[data-style="apple"] .ico-violet { --ico: #bf5af2; }
:root[data-style="apple"] .ico-rose { --ico: #ff375f; }
:root[data-style="apple"] .ico-cyan { --ico: #32ade6; }
:root[data-style="apple"] h1,
:root[data-style="apple"] h2,
:root[data-style="apple"] h3 { font-weight: 700; }
/* Le segmented control : les filtres vivent dans un rail discret, le
   segment actif est une plaque posée — LE contrôle signature d'Apple. */
:root[data-style="apple"] .filtre-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 3px;
    background: var(--input-bg);
    border-radius: 10px;
}
:root[data-style="apple"] .filtre-chips .chip {
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-soft);
    font-weight: 600;
}
:root[data-style="apple"] .filtre-chips .chip:hover { color: var(--text); }
:root[data-style="apple"] .filtre-chips .chip.actif {
    background: #5c5c61;
    color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .12);
}
:root[data-style="apple"][data-theme="light"] .filtre-chips .chip.actif {
    background: #ffffff;
    color: #000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .14);
}
:root[data-style="apple"] .filtre-chips .chip.actif .chip-n {
    background: rgba(255, 255, 255, .25);
    color: inherit;
}
:root[data-style="apple"][data-theme="light"] .filtre-chips .chip.actif .chip-n {
    background: rgba(0, 0, 0, .08);
}
/* Le ressort Apple : les tuiles se soulèvent avec un léger rebond au
   survol et se compriment au clic — la courbe à dépassement maison. */
:root[data-style="apple"] .kpi-card {
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s;
}
:root[data-style="apple"] .kpi-card:hover { transform: translateY(-2px) scale(1.012); }
:root[data-style="apple"] .kpi-card:active { transform: scale(.98); }
:root[data-style="apple"] table { font-variant-numeric: tabular-nums; }

/* ── Windows — Fluent Design (Windows 11) ──────────────────────────────
   Fond « Mica », cartes à peine détachées cerclées d'un liseré fin,
   coins serrés (8 / 5), accent bleu Windows en aplat, ombres minimales,
   Segoe UI. En sombre l'accent s'éclaircit et le texte posé dessus
   passe en encre — c'est --sur-accent qui porte cette règle Fluent. */
:root[data-style="windows"] {
    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    --bg: #202020;
    --body-grad: linear-gradient(180deg, #202020, #1b1b1b);
    --surface: #2b2b2b;
    --surface-solid: #2f2f2f;
    --border: rgba(255, 255, 255, .09);
    --text: #ffffff;
    --text-soft: rgba(255, 255, 255, .62);
    --placeholder: rgba(255, 255, 255, .38);
    --accent: #60cdff; --accent-2: #60cdff; --accent-strong: #7cd6ff;
    --sur-accent: rgba(0, 22, 34, .92);
    --accent-soft: rgba(96, 205, 255, .14); --accent-tint: rgba(96, 205, 255, .07);
    --danger: #ff6b70; --danger-soft: rgba(255, 107, 112, .15);
    --success: #6ccb5f; --success-soft: rgba(108, 203, 95, .14);
    --warning: #fce100; --warning-soft: rgba(252, 225, 0, .1);
    /* Un seul arrondi pour tout le style : boutons, champs et pilules
       épousent celui des cartes et fenêtres — cohérence avant tout. */
    --radius: 8px; --radius-btn: 8px; --radius-champ: 8px; --radius-pilule: 8px;
    --shadow: 0 0 2px rgb(0 0 0 / .22), 0 2px 8px rgb(0 0 0 / .26);
    --topbar-bg: rgba(32, 32, 32, .82);
    --hover: rgba(255, 255, 255, .06);
    --raise: rgba(255, 255, 255, .04);
    --input-bg: rgba(255, 255, 255, .06);
    --sunken: rgba(255, 255, 255, .04);
}
:root[data-style="windows"][data-theme="light"] {
    --bg: #f3f3f3;
    --body-grad: linear-gradient(180deg, #f3f3f3, #ececec);
    --surface: #fbfbfb;
    --surface-solid: #ffffff;
    --border: rgba(0, 0, 0, .09);
    --text: #1b1b1b;
    --text-soft: rgba(27, 27, 27, .61);
    --placeholder: rgba(27, 27, 27, .4);
    --accent: #005fb8; --accent-2: #005fb8; --accent-strong: #0f5ca8;
    --sur-accent: #ffffff;
    --accent-soft: rgba(0, 95, 184, .1); --accent-tint: rgba(0, 95, 184, .06);
    --danger: #c42b1c; --danger-soft: rgba(196, 43, 28, .09);
    --success: #0f7b0f; --success-soft: rgba(15, 123, 15, .1);
    --warning: #9d5d00; --warning-soft: rgba(157, 93, 0, .12);
    --shadow: 0 0 2px rgb(0 0 0 / .1), 0 2px 8px rgb(0 0 0 / .08);
    --topbar-bg: rgba(243, 243, 243, .85);
    --hover: rgba(0, 0, 0, .04);
    --raise: rgba(0, 0, 0, .03);
    --input-bg: #ffffff;
    --sunken: rgba(0, 0, 0, .03);
}
/* Fluent : la structure passe par les liserés, pas par le verre ni les
   grandes ombres. La topbar est de l'acrylique discret. */
:root[data-style="windows"] .card,
:root[data-style="windows"] .box {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
:root[data-style="windows"] .topbar {
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    backdrop-filter: blur(30px) saturate(150%);
}
/* Boutons WinUI : rectangles nets et denses, aplat d'accent cerclé d'un
   liseré ; l'appui n'écrase pas le bouton (pas de scale chez Fluent),
   il l'assombrit. Le secondaire est le bouton « standard » : surface
   légèrement levée + liseré. */
:root[data-style="windows"] .btn { padding: 9px 20px; font-size: 15px; font-weight: 600; }
:root[data-style="windows"] .btn-lg { padding: 12px 28px; font-size: 16px; }
:root[data-style="windows"] .btn-sm { padding: 6px 11px; font-size: 13.5px; }
:root[data-style="windows"] .btn:active { transform: none; filter: brightness(.85); }
:root[data-style="windows"] .btn-primary {
    background: var(--accent);
    box-shadow: inset 0 -1px 0 rgb(0 0 0 / .18);
}
:root[data-style="windows"] .btn-primary:hover { filter: brightness(1.06); }
:root[data-style="windows"] .btn-outline {
    background: var(--raise);
    border: 1px solid var(--border);
}

/* ── Android — Material You (Android 14, graine « désert ») ──────────
   Palette dynamique tirée d'un fond d'écran sable : accent pêche,
   fonds brun-noir chauds, surfaces terreuses. Boutons en pilule
   pleine, barre du haut OPAQUE (pas de verre chez Material),
   élévation courte, Roboto. En sombre le primaire est pêche et son
   texte encre brune — la règle Material des tons 80/20. */
:root[data-style="android"] {
    --font: Roboto, "Helvetica Neue", system-ui, sans-serif;
    --bg: #161110;
    --body-grad: linear-gradient(180deg, #161110, #161110);
    --surface: #211a16;
    --surface-solid: #292019;
    --border: rgba(213, 196, 182, .2);
    --text: #ede0d6;
    --text-soft: #d0c0b3;
    --placeholder: rgba(208, 192, 179, .55);
    --accent: #fac4a6; --accent-2: #fac4a6; --accent-strong: #fac4a6;
    --sur-accent: #442a12;
    --accent-soft: rgba(250, 196, 166, .15); --accent-tint: rgba(250, 196, 166, .08);
    --danger: #ff8a80; --danger-soft: rgba(255, 138, 128, .15);
    --success: #63d18b; --success-soft: rgba(99, 209, 139, .14);
    --warning: #ffb95c; --warning-soft: rgba(255, 185, 92, .13);
    --radius: 20px; --radius-btn: 999px; --radius-champ: 8px;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 1px 3px 1px rgb(0 0 0 / .15);
    --topbar-bg: #211a16;
    --hover: rgba(237, 224, 214, .08);
    --raise: rgba(237, 224, 214, .05);
    --input-bg: rgba(237, 224, 214, .06);
    --sunken: rgba(237, 224, 214, .05);
}
:root[data-style="android"][data-theme="light"] {
    --bg: #fff8f4;
    --body-grad: linear-gradient(180deg, #fff8f4, #fff8f4);
    --surface: #fdf1e9;
    --surface-solid: #ffffff;
    --border: rgba(139, 110, 88, .4);
    --text: #221a14;
    --text-soft: #52443a;
    --placeholder: rgba(82, 68, 58, .55);
    --accent: #96602e; --accent-2: #96602e; --accent-strong: #8a5424;
    --sur-accent: #ffffff;
    --accent-soft: rgba(150, 96, 46, .12); --accent-tint: rgba(150, 96, 46, .07);
    --danger: #b3261e; --danger-soft: rgba(179, 38, 30, .1);
    --success: #146c2e; --success-soft: rgba(20, 108, 46, .12);
    --warning: #7a5900; --warning-soft: rgba(122, 89, 0, .13);
    --shadow: 0 1px 2px rgb(0 0 0 / .12), 0 1px 3px 1px rgb(0 0 0 / .08);
    --topbar-bg: #f8ece2;
    --hover: rgba(34, 26, 20, .05);
    --raise: rgba(34, 26, 20, .04);
    --input-bg: rgba(34, 26, 20, .05);
    --sunken: rgba(34, 26, 20, .04);
}
:root[data-style="android"] .card,
:root[data-style="android"] .box {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: transparent;
}
:root[data-style="android"] .topbar {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
/* Boutons Material 3 : la pilule pleine (via --radius-btn), posée à plat
   — l'élévation n'apparaît qu'au survol. Le secondaire est le « outlined
   button » : pilule cerclée, libellé primaire. */
:root[data-style="android"] .btn { font-weight: 550; letter-spacing: .1px; font-size: 15px; }
:root[data-style="android"] .btn-primary {
    background: var(--accent);
    box-shadow: none;
}
:root[data-style="android"] .btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 1px 2px rgb(0 0 0 / .3), 0 1px 3px 1px rgb(0 0 0 / .15);
}
:root[data-style="android"] .btn-outline {
    border: 1px solid var(--border);
    color: var(--accent-strong);
}
/* L'indicateur actif M3 : une pilule tonale « container », pas un
   aplat vif — comme les réglages d'Android. */
:root[data-style="android"] .subnav a.active {
    background: rgba(250, 196, 166, .24);
    color: #ffdcc2;
    border-color: transparent;
}
:root[data-style="android"][data-theme="light"] .subnav a.active {
    background: rgba(150, 96, 46, .16);
    color: #5a3210;
}
/* Le vrai switch Material 3 : anneau cerclé, petit pouce discret qui
   grossit et se remplit quand on l'active. */
:root[data-style="android"] .sw {
    width: 44px;
    height: 26px;
    background: transparent;
    border: 2px solid var(--border);
}
:root[data-style="android"] .sw::after {
    /* La géométrie reste 18px : le repos est un scale(.667) — même centre
       exact que l'ancien 12px@5,5, mais l'animation vit au compositeur. */
    width: 18px;
    height: 18px;
    top: 2px;
    left: 2px;
    background: var(--text-soft);
    box-shadow: none;
    transform: scale(.667);
    transition: transform .2s, background .2s;
}
:root[data-style="android"] .pouvoir-ligne input:checked ~ .sw,
:root[data-style="android"] .acc-ligne.on .sw {
    background: var(--accent);
    border-color: var(--accent);
}
:root[data-style="android"] .pouvoir-ligne input:checked ~ .sw::after,
:root[data-style="android"] .acc-ligne.on .sw::after {
    background: var(--sur-accent);
    transform: translateX(18px) scale(1);
}

/* ── Néon — l'atelier de nuit électrique ──────────────────────────────
   Cinquième monde : marine profond, cyan et magenta électriques,
   lueurs colorées. Les tuiles du tableau de bord portent un liseré
   néon en rotation (la carte animée du repo Minimal UI, adaptée aux
   tokens) et les boutons rayonnent. Assumé spectaculaire — les autres
   thèmes restent sobres. */
:root[data-style="neon"] {
    --bg: #061733;
    --body-grad:
        radial-gradient(900px 520px at 78% -12%, rgba(0, 183, 255, .13), transparent 60%),
        radial-gradient(720px 480px at 8% 112%, rgba(255, 48, 255, .09), transparent 55%),
        linear-gradient(170deg, #081a38 0%, #061229 55%, #0a0f2e 100%);
    --surface: rgba(7, 24, 46, .92);
    --surface-solid: #0a1f3b;
    --border: #223a66;
    --text: #e6efff;
    --text-soft: #a1acc9;
    --placeholder: #5d6f96;
    --accent: #00b7ff; --accent-2: #b44bff; --accent-strong: #4fc9ff;
    --sur-accent: #fff;
    --accent-soft: rgba(0, 183, 255, .16); --accent-tint: rgba(0, 183, 255, .09);
    --danger: #ff5d8f; --danger-soft: rgba(255, 93, 143, .16);
    --success: #2fe08a; --success-soft: rgba(47, 224, 138, .13);
    --warning: #ffc46b; --warning-soft: rgba(255, 196, 107, .13);
    --radius: 12px; --radius-btn: 10px; --radius-champ: 8px;
    --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 14px 40px rgba(0, 90, 200, .22);
    --topbar-bg: rgba(6, 20, 42, .8);
    --hover: rgba(160, 200, 255, .07);
    --raise: rgba(160, 200, 255, .05);
    --input-bg: rgba(4, 14, 30, .6);
    --sunken: rgba(4, 14, 30, .5);
}
:root[data-style="neon"][data-theme="light"] {
    --bg: #eaf1fc;
    --body-grad:
        radial-gradient(900px 520px at 78% -12%, rgba(0, 135, 216, .1), transparent 60%),
        radial-gradient(720px 480px at 8% 112%, rgba(139, 63, 240, .07), transparent 55%),
        linear-gradient(170deg, #eef4fd 0%, #eaf1fc 55%, #f0ecfb 100%);
    --surface: rgba(255, 255, 255, .92);
    --surface-solid: #ffffff;
    --border: #c9d8f0;
    --text: #12203a;
    --text-soft: #52648a;
    --placeholder: #93a3c2;
    --accent: #0087d8; --accent-2: #8b3ff0; --accent-strong: #016cb0;
    --sur-accent: #fff;
    --accent-soft: rgba(0, 135, 216, .12); --accent-tint: rgba(0, 135, 216, .07);
    --danger: #d61f5e; --danger-soft: rgba(214, 31, 94, .1);
    --success: #0f8a55; --success-soft: rgba(15, 138, 85, .12);
    --warning: #a86a00; --warning-soft: rgba(168, 106, 0, .13);
    --shadow: 0 1px 2px rgb(30 60 120 / .08), 0 14px 40px rgba(0, 110, 220, .14);
    --topbar-bg: rgba(240, 246, 254, .85);
    --hover: rgba(20, 50, 110, .05);
    --raise: rgba(20, 50, 110, .04);
    --input-bg: #f2f6fd;
    --sunken: rgba(20, 50, 110, .04);
}
/* Les boutons rayonnent : le dégradé maison passe au cyan→magenta et
   gagne une lueur ; les tuiles du tableau de bord portent le liseré
   néon en rotation (statique si l'utilisateur préfère moins de
   mouvement). Le contenu des tuiles flotte au-dessus du masque. */
:root[data-style="neon"] .btn-primary {
    box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent),
        0 6px 20px rgba(0, 0, 0, .3);
}
:root[data-style="neon"] .kpi-card {
    position: relative;
    overflow: hidden;
    border-color: transparent;
}
:root[data-style="neon"] .kpi-card::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 620px;
    height: 620px;
    translate: -50% -50%;
    background: conic-gradient(#00b7ff, #b44bff, #ff30ff, #00b7ff);
    animation: kf-neon-tour 5s linear infinite;
}
:root[data-style="neon"] .kpi-card::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 10px;
    background: var(--surface-solid);
}
:root[data-style="neon"][data-theme="light"] .kpi-card::after { background: #ffffff; }
:root[data-style="neon"] .kpi-card > * {
    position: relative;
    z-index: 1;
}
:root[data-style="neon"] .kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 35%, transparent);
}
@keyframes kf-neon-tour {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    :root[data-style="neon"] .kpi-card::before { animation: none; }
}

* { box-sizing: border-box; }

html { min-height: 100%; }

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--body-grad);
    /* Sous le dégradé, la couleur du thème : c'est elle que Safari montre
       quand il n'a pas d'image de la page (dessous d'un glissé de retour,
       rebond en haut de page) — blanc par défaut, même en sombre. */
    background-color: var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: color .2s, background-color .2s;
}

/* ---------- Barre du haut ---------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: var(--topbar-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    display: inline-flex;
    width: 40px;
    height: 40px;
}

.brand-mark svg { width: 100%; height: 100%; display: block; }

.brand-name { font-weight: 650; }
.brand-secteur { font-size: 17px; line-height: 1; }   /* le métier de la boutique, hors téléphonie */

.brand-by {
    font-size: 12px;
    color: var(--text-soft);
    align-self: flex-end;
    padding-bottom: 2px;
}

.topnav { display: flex; align-items: center; gap: 6px; }

.topnav a {
    text-decoration: none;
    color: var(--text-soft);
    font-weight: 550;
    /* Un libellé ne se plie jamais sur deux lignes : quand le menu ne tient
       plus, il se replie derrière ☰ (burger_controller mesure). */
    white-space: nowrap;
    padding: 9px 14px;
    border-radius: 10px;
    transition: background .15s, color .15s;
}

.topnav a:hover { background: var(--hover); color: var(--text); }
.topnav a.active { background: var(--accent-soft); color: var(--accent-strong); }

.topnav .logout { font-size: 17px; padding: 9px 12px; }

/* Bascule de thème */
.theme-toggle {
    background: var(--raise);
    border: 1.5px solid var(--border);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--text-soft);
    padding: 8px 10px;
    border-radius: 10px;
    transition: background .15s, border-color .15s;
}

.theme-toggle:hover { background: var(--hover); border-color: var(--text-soft); }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: inline; }

/* ---------- Barre de sélection du technicien ---------- */
.techbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px 28px;
    background: var(--sunken);
    border-bottom: 1px solid var(--border);
}

.techbar-lbl { font-size: 13px; font-weight: 600; color: var(--text-soft); margin-right: 4px; }

.techbar form { display: inline; }

/* Bandeau de dépannage super-admin : volontairement voyant, on ne doit
   jamais oublier qu'on agit sur la boutique d'un autre. */
.depannage-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 9px 28px;
    font-size: 14px;
    color: #7a3e00;
    background: repeating-linear-gradient(45deg, #ffe4b3, #ffe4b3 12px, #ffd894 12px, #ffd894 24px);
    border-bottom: 2px solid #e8a33d;
}
.depannage-bar .btn {
    background: #7a3e00;
    color: #fff;
    border: none;
}
:root[data-theme="dark"] .depannage-bar { color: #ffdca6; background: #4a2f0a; }

.techbtn {
    padding: 6px 15px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-soft);
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pilule);
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s, transform .15s, box-shadow .15s;
}

.techbtn:hover { color: var(--text); border-color: var(--text-soft); }

.techbtn.active {
    color: var(--sur-accent);
    background: var(--degrade-actif);
    border-color: transparent;
}

/* ---------- Conteneur ---------- */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 32px 20px 80px;
}

/* Les pages de travail prennent 90 % de l'écran, jusqu'à 1 920 px (David,
   10/10 : « une meilleure aisance pour travailler ») — jamais moins que leur
   ancienne largeur fixe, donc rien ne rétrécit sur un écran plus petit. */
.container-wide { max-width: max(1100px, min(90%, 1920px)); }

/* La pleine envergure : pour les pages-outils denses (le Stock et son
   rail + huit colonnes) — tout se contrôle d'un regard, sans défilement
   horizontal sur un écran de bureau. */
.container-max { max-width: max(1580px, min(90%, 1920px)); }

/* Pilotage prend toute la largeur de l'écran (jusqu'à 1920 px) avec des
   marges confortables : colonne + tableaux d'activité et de finances ont
   besoin de place. Sur fenêtre moyenne et tablette on revient aux 20 px de
   côté du conteneur ; sur téléphone en mode app, `main.container` (12 px,
   plus spécifique : balise + classe) reprend la main. */
.container-pleine { max-width: 1920px; padding-left: 36px; padding-right: 36px; }
@media (max-width: 999px) {
    .container-pleine { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Flashs ---------- */
.flash {
    padding: 13px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
    border: 1px solid transparent;
}

.flash-error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }
.flash-success { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }
/* Le geste a abouti, mais quelque chose n'a pas suivi (un SMS non parti) : on le dit sans le dramatiser. */
.flash-warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-soft); }

/* Invitation à monter de formule : informative, pas punitive. */
.flash-upsell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: rgba(255, 196, 107, .12);
    color: var(--warning);
    border-color: rgba(255, 196, 107, .35);
}
.flash-upsell .btn { flex-shrink: 0; }

/* Les messages qui volent. Une page qui garde son défilement après un geste
   (la fiche dossier) ne remonte plus : ses messages viennent à l'utilisateur,
   posés au-dessus du contenu en bas d'écran (flash_volant_controller.js).
   Posé sur du contenu, le message a besoin d'un fond OPAQUE : les jetons
   « -soft » sont translucides, on les pose donc sur la surface pleine. */
.flashs-volants {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(560px, calc(100vw - 32px));
    pointer-events: none;   /* le conteneur ne bloque rien ; seuls les messages se cliquent */
}
.flashs-volants .flash {
    margin: 0;
    pointer-events: auto;
    cursor: pointer;
    background-color: var(--surface-solid);
    box-shadow: var(--shadow);
    animation: kf-flash-monte .25s cubic-bezier(.32, .72, 0, 1);   /* sans fill-mode : une fois monté, c'est .part qui pilote l'opacité */
    transition: opacity .2s, transform .2s;
}
.flashs-volants .flash-error   { background-image: linear-gradient(var(--danger-soft), var(--danger-soft));   border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.flashs-volants .flash-success { background-image: linear-gradient(var(--success-soft), var(--success-soft)); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.flashs-volants .flash-warning,
.flashs-volants .flash-upsell  { background-image: linear-gradient(var(--warning-soft), var(--warning-soft)); border-color: color-mix(in srgb, var(--warning) 35%, transparent); }
/* Fermeture douce : le message s'efface en descendant avant d'être retiré. */
.flashs-volants .flash.part { opacity: 0; transform: translateY(8px); }
@keyframes kf-flash-monte { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
    .flashs-volants .flash { animation: none; }
}
/* Téléphones et tablettes : au-dessus de la barre d'onglets, pas dessous. */
@media (hover: none) and (pointer: coarse) {
    .flashs-volants { bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* ---------- Étapes du parcours ---------- */
.steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 4px 0 36px;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 550;
    padding: 6px 12px;
    border-radius: var(--radius-pilule);
}

.step .dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--raise);
    color: var(--text-soft);
    font-size: 12.5px;
    font-weight: 700;
}

.step.done .dot { background: var(--success-soft); color: var(--success); }
.step.current { background: var(--accent-soft); color: var(--accent-strong); }
.step.current .dot { background: var(--degrade-actif); color: var(--sur-accent); }

/* La prise en charge et son panier à droite (intake/_panier.html.twig, idée reprise de
   Tilko le 10/11/2026) : ce qui est noté, ce qui manque, et le bouton de l'étape, collés
   sous la barre du haut pendant toute la saisie. Sur tablette et téléphone, la place
   manque : la barre d'étapes suffit, le panier s'efface. */
.intake-avec-panier {
    display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start;
}
.card.panier {
    position: sticky; top: calc(var(--barre-app-h, 60px) + 16px);
    margin-top: 0; padding: 18px 20px;
}
.panier-titre {
    margin: 0 0 8px; font-size: 12px; font-weight: 650; letter-spacing: .8px;
    text-transform: uppercase; color: var(--text-soft);
}
.panier-ligne {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.panier-k { flex-shrink: 0; color: var(--text-soft); font-weight: 550; }
.panier-v { min-width: 0; text-align: right; font-weight: 650; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.panier-ligne.vide .panier-v { color: var(--text-soft); font-weight: 500; }
.panier-ligne.manque .panier-v { color: var(--danger); font-weight: 600; }
.panier .btn { margin-top: 16px; }
.panier .btn.panier-pause { margin-top: 8px; }
.panier-etape { margin-top: 8px; text-align: center; font-size: 12px; color: var(--text-soft); }
/* Page unique : chaque libellé mène à sa partie. */
.panier-lien { text-decoration: none; transition: color .12s; }
.panier-lien:hover { color: var(--accent-strong); }
@media (max-width: 1000px) {
    .intake-avec-panier { display: block; }
    .card.panier { display: none; }
    /* Sur la page unique, le panier ne s'efface pas : il se pose en bas, avec ses boutons. */
    .card.panier.panier-unique { display: block; position: static; margin-top: 20px; }
}

/* La prise en charge sur une seule page (intake/dossier.html.twig) : trois parties
   numérotées l'une sous l'autre ; un lien du panier y mène, sous la barre du haut. */
.intake-parties { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.intake-parties > .card + .card { margin-top: 0; }
.intake-partie { scroll-margin-top: calc(var(--barre-app-h, 60px) + 16px); }
.card .intake-partie-titre { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.intake-num {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-strong);
    font-size: 14px; font-weight: 800;
}

/* ---------- Cartes ---------- */
.card {
    background: var(--surface);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}

.card + .card { margin-top: 20px; }

.card h1, .card h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.2px;
}

.card .subtitle {
    color: var(--text-soft);
    margin: 0 0 26px;
}

/* ---------- Formulaires ---------- */
.field { margin-bottom: 20px; }

.field label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 7px;
}

.field .hint { color: var(--text-soft); font-size: 13px; margin-top: 6px; }

input[type="text"], input[type="tel"], input[type="email"], input[type="number"],
input[type="password"], input[type="date"], input[type="url"], input[type="time"],
input[type="search"], select, textarea {
    width: 100%;
    padding: 13px 15px;
    font-size: 16px;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-champ);
    background: var(--input-bg);
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}

input::placeholder, textarea::placeholder { color: var(--placeholder); }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

select option { background: var(--surface-solid); color: var(--text); }

/* Régime fiscal : deux cartes à cocher, la choisie s'allume. */
.regime-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
.regime-carte {
    display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; cursor: pointer;
    border: 1.5px solid var(--border); border-radius: 12px; background: var(--sunken);
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.regime-carte:hover { border-color: var(--accent); }
.regime-carte.on,
.regime-carte:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-tint); }
.regime-carte:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.regime-carte input { position: absolute; opacity: 0; pointer-events: none; }
.regime-titre { font-weight: 800; font-size: 14.5px; }
.regime-desc { font-size: 12.5px; color: var(--text-soft); line-height: 1.5; }
.regime-desc strong { color: var(--text); }

/* Facture électronique : ce qui empêche encore d'allumer l'interrupteur. */
.fe-manque { margin: 12px 0 4px; padding: 10px 14px; border-radius: 10px; background: var(--warning-soft); border: 1px solid var(--warning); font-size: 13px; line-height: 1.5; }
.fe-manque ul { margin: 6px 0 0; padding-left: 20px; }
/* Le chemin pour réparer, lisible sur le fond d'alerte dans les deux thèmes. */
.fe-manque a { color: var(--warning); font-weight: 700; text-decoration: none; white-space: nowrap; }
.fe-manque a:hover { text-decoration: underline; }
/* Facture électronique — le suivi de la pièce chez la plateforme (fiche facture) : l'état courant, puis le journal, le plus récent en tête. */
.fe-suivi-etat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.fe-suivi .hint { margin: 4px 0 0; }
.fe-suivi-journal { margin-top: 12px; }
/* Sur téléphone, un statut long (« Reçue par la plateforme du client ») pousse la date à la ligne plutôt que hors de l'écran. */
.fe-suivi-journal .sm-message { flex-wrap: wrap; row-gap: 4px; }
.fe-suivi-motif { display: block; margin-top: 4px; color: var(--text-soft); font-size: 12.5px; overflow-wrap: anywhere; }
.fe-suivi-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }

/* Le bandeau « un ticket t'attend » — pleine largeur, cliquable,
   visible de l'autre bout du comptoir sans hurler. */
.ticket-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 28px; font-size: 14px; text-decoration: none;
    color: var(--accent-strong); background: var(--accent-soft);
    border-bottom: 2px solid var(--accent);
    transition: background .15s;
}
.ticket-bar:hover { background: var(--accent-tint); }
.ticket-bar strong { color: var(--text); }
.ticket-bar-point {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px;
    background: #e5484d; color: #fff; font-size: 13px; font-weight: 800;
    animation: ticket-pulse 2.4s ease-in-out infinite;
}
.ticket-bar-cta { margin-left: auto; font-weight: 700; }
/* La fin de l'essai gratuit : le même bandeau, au ton d'alerte (FinEssai). */
.ticket-bar.essai-bar { color: var(--warning); background: var(--warning-soft); border-bottom-color: var(--warning); }
/* Le texte reste à côté de son pictogramme, même sur téléphone. */
.essai-bar > span:nth-child(2) { flex: 1 1 220px; }
a.essai-bar:hover { background: color-mix(in srgb, var(--warning) 22%, transparent); }
/* Le délai passé, les enregistrements en pause : le ton de l'erreur. */
.ticket-bar.essai-bloque { color: var(--danger); background: var(--danger-soft); border-bottom-color: var(--danger); }
a.essai-bloque:hover { background: color-mix(in srgb, var(--danger) 22%, transparent); }
.paiement-essai { margin: 4px 0 12px; }
.paiement-essai a { color: inherit; font-weight: 700; }
/* La double authentification pas encore activée (gérants) : le bandeau à l'accent, le texte
   reste à côté de son pictogramme sur téléphone. */
.double-auth-bar > span:nth-child(2) { flex: 1 1 220px; }

/* ── Réglages › Sécurité : la double authentification (SecuriteController) ── */
.da-carte h2 { margin-bottom: 8px; }
.da-etat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; }
.da-etat .hint { margin: 0; }
.da-secours { margin: 12px 0 0; font-size: 14px; color: var(--text-soft); }
.da-secours strong { color: var(--text); font-variant-numeric: tabular-nums; }
.da-secours-bas { color: var(--warning); }
.da-obligation { margin: 12px 0; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); font-size: 14px; }
.da-obligation-passee { background: var(--warning-soft); border-color: var(--warning); }
.da-methode { font-weight: 650; font-size: 14px; }
/* Le choix de la méthode : deux cartes côte à côte (l'appli, recommandée ; le mail, le plus simple). */
.da-choix-titre { margin: 16px 0 10px; font-weight: 650; font-size: 14.5px; }
.da-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.da-choix-carte { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--raise); }
.da-choix-carte:has(.btn-primary) { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.da-choix-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; font-size: 15.5px; }
.da-choix-desc { flex: 1; color: var(--text-soft); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.da-choix-carte .btn { align-self: flex-start; }
/* Sur la carte en relief, la bordure neutre du bouton secondaire disparaît : on la teinte à l'accent. */
.da-choix-carte .btn-outline { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent-strong); }
.da-choix-carte .btn-outline:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.da-choix-carte .btn-outline:disabled { opacity: .5; cursor: not-allowed; }
/* « M'envoyer un code par mail » / « Renvoyer le code » : un lien d'action, discret. */
.da-recevoir { margin-top: 10px; padding: 0; background: none; border: 0; color: var(--accent-strong); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.da-recevoir:hover { text-decoration: underline; }
.da-mail-suite { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.da-mail-suite .da-retour { margin-top: 10px; }
.da-actions { display: grid; gap: 8px; margin-top: 18px; }
.da-action { border: 1px solid var(--border); border-radius: 12px; background: var(--raise); }
.da-action > summary { padding: 11px 14px; font-weight: 650; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.da-action > summary::-webkit-details-marker { display: none; }
.da-action > summary::after { content: '›'; margin-left: auto; color: var(--text-soft); transition: transform .15s; }
.da-action[open] > summary::after { transform: rotate(90deg); }
.da-action > form { padding: 0 14px 14px; }
.da-action .hint { margin: 0 0 10px; }
.da-ligne { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.da-ligne .da-saisie { flex: 1 1 160px; max-width: 240px; }
.da-saisie { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.da-saisie-chiffres { font-size: 20px; font-weight: 700; letter-spacing: .2em; text-align: center; }
.login-card .da-saisie-chiffres { width: 100%; }
.da-annuler { margin: 0; }
.da-annuler .login-oubli { width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; }
.da-activation { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: start; }
.da-activation h2 { font-size: 17px; margin: 0 0 6px; }
.da-activation .subtitle { margin-bottom: 12px; }
.da-activation form { margin-top: 10px; }
.da-qr-bloc { display: grid; gap: 10px; justify-items: center; }
/* Fond blanc quel que soit le thème : les applis lisent mal un QR sur fond sombre. */
.da-qr { width: 220px; height: 220px; padding: 6px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.da-qr svg { display: block; width: 100%; height: 100%; }
.da-cle { margin: 0 0 20px; font-size: 14px; }
.da-cle > summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; }
.da-cle .hint { margin: 8px 0; }
.da-cle-valeur { display: inline-block; padding: 8px 12px; border-radius: 10px; background: var(--sunken); font-size: 15px; letter-spacing: .08em; overflow-wrap: anywhere; cursor: copy; }
.da-retour { display: inline-block; margin-top: 14px; font-size: 13.5px; color: var(--text-soft); }
.da-codes-compte { margin: 10px 0 0; font-size: 14px; color: var(--text-soft); overflow-wrap: anywhere; }
.da-codes { margin: 14px 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.da-codes li { padding: 10px 12px; border-radius: 10px; background: var(--sunken); border: 1px solid var(--border); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 16px; font-weight: 700; letter-spacing: .08em; text-align: center; font-variant-numeric: tabular-nums; }
.da-codes-outils { display: flex; flex-wrap: wrap; gap: 8px; }
.da-codes-fin { margin-top: 18px; }
@media (max-width: 640px) {
    .da-activation { grid-template-columns: minmax(0, 1fr); }
    .da-qr-bloc { justify-self: center; }
}
/* À l'impression des codes de secours : seulement la carte, sans les boutons. */
@media print {
    body:has(.da-codes-carte) * { visibility: hidden; }
    .da-codes-carte, .da-codes-carte * { visibility: visible; }
    .da-codes-carte { position: absolute; inset: 0 auto auto 0; width: 100%; box-shadow: none; border: 0; }
    .da-codes-outils, .da-codes-fin { display: none; }
}
@keyframes ticket-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); }
    50% { box-shadow: 0 0 0 7px rgba(229, 72, 77, 0); }
}
@media (prefers-reduced-motion: reduce) { .ticket-bar-point { animation: none; } }

/* La pastille de notification (assistance / supervision). */
.notif-lien { position: relative; }
.notif-pastille {
    position: absolute; top: -7px; right: -13px;
    min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 9px; background: #e5484d; color: #fff;
    font-size: 10.5px; font-weight: 800; line-height: 17px; text-align: center;
    box-shadow: 0 0 0 2px var(--topbar-bg);
}

/* Quantités : un champ court mais LISIBLE — padding réduit, chiffre
   centré, spinners natifs retirés (ils cachaient la valeur à 64 px). */
.qte-input {
    max-width: 84px;
    padding: 11px 8px;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
.qte-input::-webkit-outer-spin-button,
.qte-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Champ date relié au calendrier maison : l'icône native du navigateur
   s'efface — le popover au thème prend le relais (natif au tactile). */
input[data-calendrier-target="date"]::-webkit-calendar-picker-indicator { display: none; }

textarea { resize: vertical; min-height: 110px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
/* Réglages › Entreprise : la livraison des locations, sous l'interrupteur du module. */
.reg-livraison { margin: 14px 0 0; padding: 12px 14px 4px; border: 1px solid var(--border); border-radius: var(--radius); }
.reg-livraison legend { padding: 0 6px; font-weight: 650; }
.reg-livraison-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 18px; }
/* Un sous-titre dans une page de réglages (Documents › Coordonnées bancaires). */
.reg-sous-titre { margin: 18px 0 6px; }

/* Réglages › Prise en charge : les pannes courantes en pilules, ✕ pour en retirer une. */
.reg-pannes { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 16px; }
.reg-panne {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 4px 4px 13px; border-radius: var(--radius-pilule);
    border: 1px solid var(--border); background: var(--raise);
    font-size: 13px; font-weight: 600;
}
.reg-panne-retirer {
    display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
    border: 0; background: none; color: var(--text-soft); cursor: pointer; font-size: 12px;
    transition: background .12s, color .12s;
}
.reg-panne-retirer:hover { background: var(--danger-soft); color: var(--danger); }
.reg-panne-ajout { max-width: 560px; }
.reg-panne-ajout input { flex: 1; }
.reg-panne-defaut { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 16px; }
.reg-livraison .hint { margin-bottom: 10px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.tiers-block {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    padding: 18px 20px 6px;
    margin-bottom: 20px;
}

.tiers-block h3 { margin: 0 0 6px; font-size: 15.5px; }

/* ---------- Saisie IMEI (étape 1) ---------- */
.imei-hero { text-align: center; padding: 48px 32px; }

.imei-hero h1 { font-size: 27px; margin-bottom: 8px; }

.imei-input {
    font-size: 27px !important;
    letter-spacing: 5px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    padding: 18px !important;
    border-radius: 14px !important;
}

.imei-help {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    color: var(--text-soft);
    font-size: 14px;
    background: var(--hover);
    padding: 8px 14px;
    border-radius: var(--radius-pilule);
}

.imei-help code {
    background: var(--input-bg);
    border: 1px solid var(--border);
    padding: 1px 8px;
    border-radius: 6px;
    font-weight: 700;
    color: var(--accent-strong);
}

/* ---------- Déverrouillage (code / schéma / mot de passe) ---------- */
[hidden] { display: none !important; }

.unlock-methods { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.unlock-methods button {
    padding: 10px 16px;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-soft);
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pilule);
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s, transform .15s, box-shadow .15s;
}

.unlock-methods button:hover { color: var(--text); border-color: var(--text-soft); }

.unlock-methods button.active {
    color: var(--sur-accent);
    background: var(--degrade-actif);
    border-color: transparent;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}

.unlock-panel { margin: 6px 0 4px; }

/* Clavier téléphone */
.code-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
    min-height: 30px;
}

.code-dots { font-size: 20px; letter-spacing: 6px; color: var(--accent-strong); }
.code-value { font-size: 15px; color: var(--text-soft); font-variant-numeric: tabular-nums; }

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 76px);
    gap: 10px;
    justify-content: center;
}

.keypad button {
    height: 58px;
    font-size: 22px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    background: var(--raise);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: background .12s, transform .05s;
}

.keypad button:hover { background: var(--accent-soft); }
.keypad button:active { transform: scale(.95); }
.keypad .keypad-alt { font-size: 19px; color: var(--text-soft); }

/* Grille de schéma 3×3 */
.pattern-wrap {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    place-items: center;
    background: var(--sunken);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.pattern-wrap svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pattern-dot {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--raise);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: color .12s, background .12s, border-color .12s, transform .12s;
    padding: 0;
}

.pattern-dot::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-soft);
    position: absolute;
}

.pattern-dot span {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--accent-2);
    color: var(--sur-accent);
    font-size: 11.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
    opacity: 0;
}

.pattern-dot.on { border-color: var(--accent-2); background: var(--accent-soft); }
.pattern-dot.on::after { background: #b9a2ff; }
.pattern-dot.on span { opacity: 1; }

.pattern-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.pattern-actions .btn { padding: 8px 14px; font-size: 14px; }

/* ---------- Appareil déjà connu ---------- */
.choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 6px;
}

@media (max-width: 640px) { .choice-grid { grid-template-columns: 1fr; } }

.choice {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color .15s;
}

.choice:hover { border-color: var(--accent); }

.choice-icon { font-size: 30px; }

.choice h3 { margin: 0; font-size: 17px; }

.choice p { margin: 0 0 12px; flex: 1; font-size: 14px; }

/* ---------- Suggestions du champ unique ---------- */
.suggest-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    text-align: left;
}

.suggest-client {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s, background .15s;
}

.suggest-client:hover { border-color: var(--accent); background: var(--accent-tint); }

.suggest-avatar { font-size: 22px; }

.suggest-main { flex: 1; display: flex; flex-direction: column; }

.suggest-name { font-weight: 700; }

.suggest-go { color: var(--accent-strong); font-weight: 800; font-size: 18px; }

/* ---------- Résultat du check IMEI ---------- */
.device-result {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius);
    margin-bottom: 26px;
    border: 1px solid transparent;
}

.device-result.found { background: var(--success-soft); color: var(--success); border-color: var(--success-soft); }
.device-result.unknown { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-soft); }
.device-result.blacklist { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-soft); }

.device-result .icon { font-size: 26px; }
.device-result strong { display: block; font-size: 17px; }
.device-result span { font-size: 14px; opacity: .85; }
.device-result span a { color: inherit; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    font-size: 16px;
    font-weight: 650;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s, transform .05s, background .15s;
}

.btn:active { transform: scale(.96); }

.btn-primary {
    background: var(--degrade-actif);
    color: var(--sur-accent);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn-primary:hover { filter: brightness(1.12); }

.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-soft); }

.btn-lg { padding: 16px 34px; font-size: 17px; }
.btn-block { width: 100%; }

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 12px;
}

/* ---------- Récapitulatif ---------- */
.recap-section { margin-bottom: 26px; }

.recap-section h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-soft);
    margin: 0 0 10px;
}

.recap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px 24px;
}

.recap-item .k { font-size: 13px; color: var(--text-soft); }
.recap-item .v { font-weight: 600; }

/* ---------- Connexion ---------- */
.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8vh;
}

.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
/* « Mot de passe oublié ? » et les retours : discrets, sous le bouton principal. */
.login-oubli { display: block; margin-top: 14px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--text-soft); text-decoration: none; }
.login-oubli:hover { color: var(--accent-strong); text-decoration: underline; }

/* « Se déconnecter ? » — un ancien lien demande au lieu de déconnecter. */
.deconnexion-carte { max-width: 440px; margin: 8vh auto 0; }
.deconnexion-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Rappel compact des 3 formules sous le formulaire de connexion. */
.login-formules {
    width: 100%;
    max-width: 400px;
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.login-formule {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.login-formule.is-reco { border-color: var(--accent); }
.lf-nom { font-weight: 750; font-size: 14px; }
.lf-slogan { font-size: 11px; color: var(--text-soft); line-height: 1.3; min-height: 28px; }
.lf-prix { font-weight: 700; font-size: 13.5px; margin-top: 2px; }
.lf-prix small { font-weight: 500; color: var(--text-soft); font-size: 10.5px; }
.login-formules-lien {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 13px;
    color: var(--text-soft);
    text-decoration: none;
    padding-top: 2px;
}
.login-formules-lien:hover { color: var(--text); }

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 30px;
}

.login-logo {
    width: 62px;
    height: 62px;
    flex-shrink: 0;
}

.login-logo svg { width: 100%; height: 100%; display: block; }

.login-brand > div { text-align: left; }

.login-title { font-size: 27px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.login-title-accent { color: var(--accent-strong); }

/* Case « se souvenir de moi » */
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    color: var(--text-soft);
    cursor: pointer;
    margin: 4px 0 22px;
    user-select: none;
}

.check-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.check-row:hover { color: var(--text); }

/* ---------- Réglages ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.subnav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-soft);
    font-weight: 600;
    font-size: 14.5px;
    padding: 9px 16px;
    border-radius: var(--radius-pilule);
    border: 1.5px solid var(--border);
    transition: color .15s, background .15s, border-color .15s, transform .15s, box-shadow .15s;
}

.subnav a:hover { color: var(--text); border-color: var(--text-soft); }
.subnav a.active {
    color: var(--sur-accent);
    background: var(--degrade-actif);
    border-color: transparent;
}

/* Un champ de prix compact (réception de stock). Le catalogue a désormais ses
   propres lignes de saisie — voir « Catalogue & prix » plus bas (.cat-rep). */
.price-input { width: 90px !important; text-align: right; padding: 8px 10px !important; font-variant-numeric: tabular-nums; }

.btn-sm { padding: 8px 11px; font-size: 14px; }

.logo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo-preview img {
    max-height: 54px;
    max-width: 160px;
    background: #fff;
    border-radius: 8px;
    padding: 6px;
}

input[type="file"] {
    width: 100%;
    color: var(--text-soft);
    font-size: 14px;
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 9px 16px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--raise);
    color: var(--text);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* ---------- Données / export ---------- */
.export-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px 24px;
    background: var(--raise);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 6px;
}

.export-count { font-size: 34px; font-weight: 800; line-height: 1; }

.legal-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.legal-list li { font-size: 14px; }

/* ---------- Catalogue en arborescence ---------- */
/* Les marques sont une COLONNE, façon dossiers de Mail ou de Notes : « Toutes » en
   tête, puis l'alphabet, chacune avec son nombre de modèles. Elle reste en vue
   pendant qu'on défile (sticky) et un champ la filtre sur place. La colonne a
   le dessin de celle de Pilotage, sa voisine : même plaque d'accent pour la ligne
   courante. Sur tablette et téléphone elle devient une liste « inset grouped »
   dans la page, sous la recherche.
   L'ordre du source est celui de l'écran étroit (retour, recherche, marques,
   contenu) ; sur ordinateur la grille replace la recherche en haut du contenu. */
.cat {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    column-gap: 24px;
    align-items: start;   /* indispensable au sticky de la colonne */
}
.cat-recherche { grid-column: 2; grid-row: 1; }
.cat-marques { grid-column: 1; grid-row: 1 / span 2; }
.cat-contenu {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    /* Le contenu s'adapte à SA largeur (les réparations s'empilent quand il est
       étroit), pas à celle de l'écran : trois colonnes se partagent la place. */
    container-type: inline-size;
    container-name: cat-contenu;
}
/* Le retour n'a de sens que sans colonne des marques (tablette, téléphone). */
.cat-retour { display: none; }

.cat-marques {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 100px);
}
.cat-marques-filtre input {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13.5px;
    -webkit-appearance: none;
    appearance: none;
}
/* La liste défile seule, le champ de filtre reste au-dessus. */
.cat-marques-liste {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}
/* NB : .cat-marque désigne aussi, ailleurs, la marque en grisé d'une suggestion de
   modèle (tunnel de dépôt) — d'où ces règles toujours portées par .cat-marques. */
.cat-marques .cat-marque {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 550;
    transition: background .12s;
}
.cat-marques .cat-marque:hover { background: var(--accent-tint); }
.cat-marques .cat-marque:active { background: var(--hover); }
.cat-marques .cat-marque:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cat-marques .cat-marque.actif { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
.cat-marque-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-marque-n { font-size: 12.5px; font-weight: 600; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.cat-marques .cat-marque.actif .cat-marque-n { color: var(--accent-strong); }
/* « Toutes » se sépare des marques d'un filet. */
.cat-marques .cat-marque-toutes { margin-bottom: 9px; }
.cat-marques .cat-marque-toutes::after { content: ''; position: absolute; right: 10px; bottom: -5px; left: 10px; border-top: 1px solid var(--border); }
.cat-marques-vide { margin: 0; padding: 10px; font-size: 12.5px; color: var(--text-soft); }

/* Fenêtre moyenne : trois colonnes ne tiennent pas. Celle de Pilotage se replie en
   rail d'icônes (les carrés colorés suffisent à se repérer), celle des marques reste :
   dans le catalogue, passer d'une marque à l'autre est le geste principal.
   Les libellés ne sont pas retirés mais seulement cachés à l'œil : le lecteur
   d'écran continue de les lire. Les outils du catalogue (Saisie rapide…) restent
   là, réduits à leur petit emoji, pour ne pas disparaître avec la place. */
@media (min-width: 1000px) and (max-width: 1279px) {
    .reg-cadre.reg-cadre-marques { grid-template-columns: 56px minmax(0, 1fr); gap: 20px; }
    .reg-cadre-marques .reg-groupe-titre { display: none; }
    .reg-cadre-marques .reg-label {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0 0 0 0); white-space: nowrap;
    }
    .reg-cadre-marques .reg-menu-barre .reg-ligne { justify-content: center; padding: 6px; }
    .reg-cadre-marques .reg-menu-barre .reg-sous { min-height: 30px; }
    .reg-cadre-marques .reg-verrou { display: none; }   /* le rail n'a que les icônes */
    .cat { grid-template-columns: 220px minmax(0, 1fr); column-gap: 18px; }
}

/* Tablette en portrait et téléphone : plus de place pour une colonne de plus. Les
   marques passent dans la page, sous la recherche, en liste « inset grouped » —
   lignes hautes, filets qui partent après la marge, chevron à droite (le dessin de
   la liste des Réglages). Dans une marque ou une recherche, la liste s'efface :
   le contenu occupe l'écran et « ‹ Catalogue » ramène à elle. */
@media (max-width: 999px) {
    .cat { display: block; }
    .cat-retour { display: inline-flex; margin-bottom: 6px; font-weight: 600; color: var(--accent-strong); text-decoration: none; }
    .cat-marques { position: static; max-height: none; margin-bottom: 18px; }
    .cat-mode-marque .cat-marques, .cat-mode-recherche .cat-marques { display: none; }
    .cat-marques-filtre input { min-height: 44px; padding: 8px 14px; font-size: 16px; }
    .cat-marques-liste {
        gap: 0;
        overflow: hidden;
        background: var(--surface);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border: 1px solid var(--border);
        border-radius: 12px;
    }
    .cat-marques .cat-marque { min-height: 48px; padding: 9px 14px; border-radius: 0; font-size: 16px; }
    .cat-marques .cat-marque::after { content: '›'; font-size: 22px; line-height: 1; color: var(--text-soft); opacity: .75; }
    .cat-marque-n { font-size: 15px; }
    /* Une liste de navigation n'a pas de ligne « choisie » : on est sur la page même. */
    .cat-marques .cat-marque.actif { background: none; color: var(--text); font-weight: 550; }
    .cat-marques .cat-marque.actif .cat-marque-n { color: var(--text-soft); }
    .cat-marques .cat-marque-toutes { margin-bottom: 0; }
    .cat-marques .cat-marque-toutes::after { position: static; border: 0; }
    /* Les filets séparent les seules lignes visibles (le filtre en cache). */
    .cat-marques .cat-marque:not([hidden]) ~ .cat-marque:not([hidden])::before {
        content: ''; position: absolute; top: 0; right: 0; left: 14px; border-top: 1px solid var(--border);
    }
    .cat-marques-vide { padding: 14px; font-size: 14px; }
}

.marque-section { margin-bottom: 18px; }

.marque-titre {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-soft);
    margin: 18px 0 10px;
}
.marque-titre a { color: inherit; text-decoration: none; transition: color .15s; }
.marque-titre a:hover { color: var(--accent-strong); }

.acc {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
}

.acc summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    font-weight: 650;
    list-style: none;
    transition: background .12s;
}

.acc summary::-webkit-details-marker { display: none; }

.acc summary::before {
    content: '▸';
    color: var(--text-soft);
    margin-right: 2px;
    transition: transform .15s;
    flex-shrink: 0;
}

.acc[open] > summary::before { transform: rotate(90deg); }

.acc summary > span:first-of-type { flex: 1; }

.acc summary:hover { background: var(--accent-tint); }

.acc-famille > summary { background: var(--sunken); }

.acc-count {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--accent-strong);
    background: var(--accent-soft);
    padding: 3px 11px;
    border-radius: var(--radius-pilule);
    white-space: nowrap;
}

/* Un modèle dans sa famille : un lien d'ancre (#modele-12) le ramène sous la
   barre du haut, et ouvert il se distingue des autres d'un liseré d'accent. */
.acc-modele {
    margin: 8px 12px;
    border-radius: 10px;
    scroll-margin-top: 84px;
    transition: border-color .15s;
}

.acc-modele > summary { font-weight: 600; padding: 11px 14px; }

.acc-modele[open] { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.acc-modele[open] > summary { background: var(--accent-soft); }

.acc-meta { white-space: nowrap; font-weight: 500; }

/* ── Catalogue & prix ─────────────────────────────────────────────────
   On cherche d'abord (la grande barre), on choisit une marque, on ouvre un
   modèle, et ses réparations se corrigent ou s'ajoutent sur place — la ligne
   d'ajout est au bout de chaque liste. Préfixes : cat- (le catalogue),
   cbx- (le champ à suggestions, réutilisable). */

/* La ligne d'outils : à gauche le formulaire général (replié), à droite, discret, le choix de la
   place de la ligne d'ajout — un réglage de confort qui ne doit pas sauter aux yeux. Deux colonnes
   de grille : le formulaire ouvert grandit sous son bouton sans pousser le réglage. */
.cat-outils {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px 14px;
    margin-bottom: 14px;
}
.cat-outils .chip { text-decoration: none; }
.cat-consultation { margin-bottom: 16px; }

/* Le segment à deux états : où se range la ligne d'ajout, en haut ou en bas des listes.
   Petit, sans fond plein : l'état choisi se lit à sa teinte douce, pas à un aplat d'accent. */
.cat-segment {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pilule);
    background: transparent;
}
.cat-segment-titre {
    padding: 0 6px 0 10px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-soft);
}
.cat-segment-bouton {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 11px;
    border: 0;
    border-radius: var(--radius-pilule);
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition: color .15s, background .15s;
}
.cat-segment-bouton:hover { color: var(--text); }
.cat-segment-bouton.actif { background: var(--accent-soft); color: var(--accent-strong); }

/* « ＋ Réparation sur un modèle… » : le formulaire général, replié par défaut. */
.cat-general > summary { display: inline-flex; list-style: none; cursor: pointer; }
.cat-general > summary::-webkit-details-marker { display: none; }
.cat-general[open] > summary { border-color: var(--accent); color: var(--text); }
.cat-general-corps {
    margin-top: 10px;
    padding: 18px 18px 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.cat-general-ligne { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.cat-general-ligne input[name="nom"] { flex: 2 1 240px; width: auto; }
.cat-general-ligne input[name="prix"] { flex: 1 1 150px; width: auto; max-width: 220px; }

/* La grande barre de recherche : pleine largeur, c'est la porte d'entrée du catalogue. */
.cat-recherche { position: relative; display: flex; align-items: stretch; gap: 10px; margin-bottom: 14px; }
.cat-recherche .cbx { flex: 1; min-width: 0; }
.cat-recherche-loupe {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: .7;
    pointer-events: none;
    z-index: 1;
}
.cat-recherche .cbx-champ { padding: 16px 18px 16px 50px; font-size: 17px; border-radius: var(--radius); }
.cat-recherche-bouton { flex-shrink: 0; }

/* L'en-tête d'une marque : son nom en grand, ce qu'elle contient, ses gestes. */
.cat-marque-tete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px 22px;
    flex-wrap: wrap;
    margin: 4px 0 16px;
    padding: 20px 22px;
    background: linear-gradient(100deg, var(--accent-soft), transparent 55%), var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.cat-marque-id h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.4px; }
.cat-marque-id p { margin: 3px 0 0; font-size: 14px; color: var(--text-soft); font-variant-numeric: tabular-nums; }

.cat-gestes { flex: 1 1 420px; display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
/* Un geste ouvert a besoin de la largeur : les gestes passent sous le nom de la marque. */
.cat-gestes:has(.cat-geste[open]) { flex-basis: 100%; justify-content: flex-start; }
.cat-geste > summary { list-style: none; cursor: pointer; }
.cat-geste > summary::-webkit-details-marker { display: none; }
.cat-geste[open] > summary { border-color: var(--accent); }
/* Un geste ouvert passe sur sa propre ligne : son formulaire a besoin de la largeur. */
.cat-geste[open] { flex: 1 1 100%; }
.cat-geste-corps {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 14px;
    background: var(--sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-champ);
}
.cat-geste-corps > input[type="text"] { flex: 1 1 220px; width: auto; }
.cat-geste-corps select { flex: 0 1 190px; width: auto; }
.cat-geste-corps .hint, .cat-geste-corps .field, .cat-geste-corps .check-row { flex: 1 1 100%; margin: 0; }
.cat-dupliquer { align-items: stretch; }

/* Dupliquer : les modèles de la marque en pastilles à cocher, dans une zone qui défile. */
.cat-cibles { flex: 1 1 100%; min-width: 0; margin: 0; padding: 0; border: 0; }
.cat-cibles legend { padding: 0; margin-bottom: 8px; font-size: 11px; font-weight: 650; letter-spacing: .6px; text-transform: uppercase; color: var(--text-soft); }
.cat-cibles-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding: 8px;
    background: var(--input-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-champ);
}
.cat-cible { position: relative; cursor: pointer; }
.cat-cible input { position: absolute; opacity: 0; pointer-events: none; }
.cat-cible span {
    display: inline-flex;
    padding: 6px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-soft);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pilule);
    transition: color .15s, background .15s, border-color .15s;
}
.cat-cible:hover span { color: var(--text); border-color: var(--text-soft); }
.cat-cible input:checked + span { color: var(--sur-accent); background: var(--degrade-actif); border-color: transparent; }
.cat-cible input:focus-visible + span { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.cat-geste-danger { margin-left: 8px; }

/* La liste des réparations d'un modèle : une ligne chacune, nom et prix modifiables
   sur place, 💾 pour enregistrer, 🗑 pour retirer — et la ligne d'ajout au bout. */
.cat-reps { padding: 6px 14px 4px; }
.cat-reps-vide { margin: 6px 0 8px; font-size: 14px; color: var(--text-soft); }
.cat-reps-entete,
.cat-rep {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 176px 44px 44px;
    align-items: center;
    gap: 8px;
}
.cat-reps-entete {
    padding: 6px 0 4px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-soft);
}
.cat-reps-entete span:last-child { text-align: right; padding-right: 12px; }
.cat-rep { padding: 6px 0; border-top: 1px solid var(--border); }
.cat-reps-entete + .cat-rep { border-top: 0; }
.cat-rep input[type="text"] { padding: 9px 12px; font-size: 15px; }
.cat-rep input.cat-rep-nom { font-weight: 550; }
.cat-rep-btn { width: 100%; justify-content: center; padding-left: 0; padding-right: 0; }

/* Le prix : chiffres alignés à droite, l'euro posé dans le champ. */
.cat-prix { position: relative; display: block; }
.cat-prix input { text-align: right; padding-right: 30px !important; font-variant-numeric: tabular-nums; }
.cat-eur { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-soft); pointer-events: none; }

/* La ligne d'ajout se détache par un trait d'accent en pointillés ; elle se range en bas
   de liste par défaut, en haut si on l'a choisi (le contrôleur catalogue-ajout déplace la ligne). */
.cat-rep-ajout { margin-top: 6px; padding-top: 12px; border-top: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--border)); }
.cat-rep-ajouter { grid-column: span 2; width: 100%; justify-content: center; }
.cat[data-ajout="haut"] .cat-rep-ajout {
    margin: 0 0 6px;
    padding: 4px 0 12px;
    border-top: 0;
    border-bottom: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--border));
}
.cat[data-ajout="haut"] .cat-rep-ajout + .cat-rep { border-top: 0; }

/* Lecture seule : le tarif se consulte, rien ne se modifie. */
.cat-rep-lecture { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 0; }
.cat-rep-lecture .cat-rep-nom { font-weight: 550; overflow-wrap: anywhere; }
.cat-rep-tarif { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-rep-tarif-vide { font-weight: 500; color: var(--text-soft); }

/* Supprimer le modèle : tout en bas de l'accordéon, à l'écart des saisies. */
.cat-modele-pied { display: flex; justify-content: flex-end; padding: 8px 14px 14px; }

/* Les blocs de la vue « toutes » : universelles, invitation, ajouts, ménage. */
.cat-note { margin: 0; padding: 10px 16px 0; font-size: 13.5px; color: var(--text-soft); }
.cat-universelles { margin-bottom: 16px; }
.empty.cat-vide { padding: 36px 20px; }

.cat-ajouts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 14px; margin: 18px 0; }
.cat-ajout {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.cat-ajout > label {
    display: block;
    margin-bottom: 9px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-soft);
}
.cat-ajout-champs { display: flex; gap: 10px; flex-wrap: wrap; }
.cat-ajout-champs > input[type="text"], .cat-ajout-champs > .cbx { flex: 1 1 150px; width: auto; min-width: 0; }
.cat-ajout-champs select { flex: 0 1 170px; width: auto; }

/* « Gérer les marques » : le ménage de masse, renommer ou supprimer chaque marque. */
.cat-gerer { margin-bottom: 20px; }
.cat-gerer-corps { padding: 4px 16px 14px; }
.cat-gerer-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-top: 1px solid var(--border); }
.cat-gerer-ligne:first-of-type { border-top: 0; }
.cat-gerer-renommer { flex: 1 1 260px; display: flex; gap: 8px; }
.cat-gerer-n { font-size: 12.5px; color: var(--text-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

.cat-resultats-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.cat-resultats-tete h2 { margin: 0; font-size: 19px; font-weight: 700; }

/* Les outils annexes (saisie rapide, révision, import) dans leur carte. */
.cat-outil { margin-bottom: 20px; }
.cat-etape { margin: 22px 0 10px; }
/* Révision des tarifs : « Tout le catalogue » replie la sélection (marque, modèle, nom). */
.cat-outil form:has(input[name="portee"][value="tout"]:checked) .cat-selection { display: none; }
.cat-etape:first-of-type { margin-top: 0; }
.cat-aide { margin: 0 0 16px; color: var(--text-soft); font-size: 13px; } /* une aide hors .field : même voix que les autres */
.cat-apercu { margin-top: 14px; }
.cat-appliquer { margin-top: 22px; }
.cat-outil .check-row { margin: 4px 0 6px; }
.cat-champ-modele { max-width: 480px; }
.cat-grille-form { margin-top: 8px; }
.cat-col-prix { width: 150px; }
.cat-col-retirer { width: 110px; }
.cat-retirer { margin: 0; justify-content: center; }
.grille-table tbody tr, .cat-outil .pec-table tbody tr { cursor: default; }

/* ── Le champ à suggestions (assets/controllers/combobox_controller.js) ──
   Il se tape, la liste tombe dessous : marques, modèles, réparations groupés. */
.cbx { position: relative; }
.cbx-liste {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    max-height: min(360px, 55vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.cbx-liste[hidden] { display: none; }
.cbx-groupe { padding: 8px 10px 4px; font-size: 11px; font-weight: 650; letter-spacing: .8px; text-transform: uppercase; color: var(--text-soft); }
.cbx-option {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14.5px;
    cursor: pointer;
    transition: background .12s;
}
.cbx-option:hover { background: var(--accent-tint); }
.cbx-option[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-strong); }
.cbx-libelle { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.cbx-detail { flex-shrink: 0; font-size: 12.5px; color: var(--text-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cbx-option[aria-selected="true"] .cbx-detail { color: var(--accent-strong); }
.cbx-option-creer .cbx-libelle { color: var(--accent-strong); }
.cbx-option-tout { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; color: var(--accent-strong); }
.cbx-vide { padding: 14px 10px; font-size: 14px; color: var(--text-soft); }
/* Annonce pour les lecteurs d'écran (« 5 propositions »), invisible à l'œil. */
.cbx-etat { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Téléphone (et fenêtre étroite) : la recherche prend toute la largeur, la marque s'ouvre
   plus compacte. */
@media (max-width: 700px) {
    .cat-recherche-bouton { display: none; }
    .cat-recherche .cbx-champ { font-size: 16px; }

    .cat-marque-tete { padding: 16px; }
    .cat-marque-id h2 { font-size: 24px; }
    .cat-gestes { justify-content: flex-start; flex-basis: 100%; }
    .cat-geste-danger { margin-left: 0; }
}

/* Le contenu étroit — téléphone, tablette, ou ordinateur à trois colonnes dont la page
   est étroite : chaque réparation s'empile (le nom d'abord pleine largeur, puis le prix
   et les deux gestes dessous), les outils passent l'un sous l'autre. On mesure le
   CONTENU, pas l'écran : c'est lui qui manque de place quand les colonnes se partagent
   l'écran. */
@container cat-contenu (max-width: 640px) {
    .cat-outils { grid-template-columns: minmax(0, 1fr); }
    .cat-segment { justify-self: start; }

    .cat-reps { padding: 4px 10px 2px; }
    .cat-reps-entete { display: none; }
    .cat-rep { grid-template-columns: minmax(0, 1fr) 44px 44px; row-gap: 6px; padding: 10px 0; }
    .cat-rep input.cat-rep-nom { grid-column: 1 / -1; }
    .cat-rep-lecture { grid-template-columns: minmax(0, 1fr) auto; }
    .cat-modele-pied { padding: 6px 10px 12px; }
    .acc-modele { margin: 8px 6px; }
}
/* Les deux formulaires d'ajout (marque, modèle) se mettent l'un sous l'autre plus tôt. */
@container cat-contenu (max-width: 760px) {
    .cat-ajouts { grid-template-columns: 1fr; }
}

/* Au doigt : toutes les cibles font au moins 44 px. */
@media (hover: none) and (pointer: coarse) {
    .cat-segment-bouton { min-height: 36px; padding: 6px 14px; }
    .cat-rep input[type="text"] { min-height: 44px; }
    .cat-rep-btn { min-height: 44px; }
    .cat-rep-ajouter { min-height: 44px; }
    .cbx-option { min-height: 44px; align-items: center; padding: 10px 12px; }
    .cat-cible span { min-height: 40px; align-items: center; padding: 8px 14px; }
    /* La colonne des marques (iPad en paysage) : lignes au doigt, sous la barre du haut
       plus basse du mode app. En liste (≤ 999 px) elles font déjà 48 px. */
    .cat-marques { top: 70px; }
    .cat-marques .cat-marque { min-height: 44px; }
    /* La barre du haut porte déjà le retour « ‹ Catalogue » : pas de second lien dans la page. */
    .cat-retour { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .acc-modele, .cat-segment-bouton, .cat-cible span, .cbx-option, .marque-titre a, .cat-marques .cat-marque { transition: none; }
}

/* ---------- Recherche client instantanée ---------- */
.search-live {
    position: relative;
    margin-bottom: 18px;
}

.search-live-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: .7;
    pointer-events: none;
}

.search-live input {
    width: 100%;
    padding: 16px 18px 16px 50px !important;
    font-size: 17px;
    border-radius: var(--radius) !important;
}

.is-searching .search-fallback { display: none; }

.search-results { display: flex; flex-direction: column; gap: 12px; }

.search-empty {
    color: var(--text-soft);
    padding: 26px;
    text-align: center;
}

.search-client {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.search-client-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    background: var(--sunken);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.search-client-name { font-weight: 700; font-size: 15.5px; }

a.search-client-link { text-decoration: none; color: var(--text); }
a.search-client-link:hover { background: var(--accent-tint); }

.search-dossier {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}

.search-dossier:last-child { border-bottom: none; }
.search-dossier:hover { background: var(--accent-tint); }

.search-dossier-appareil { flex: 1; font-weight: 550; }

@media (max-width: 640px) {
    .search-dossier { flex-wrap: wrap; gap: 6px 10px; }
    .search-dossier-appareil { flex-basis: 100%; order: 3; }
}

/* ---------- Petits gestes (copie, liens, stats client) ---------- */
[data-controller="copy"] {
    cursor: copy;
    border-bottom: 1px dashed var(--text-soft);
    transition: color .15s;
}

[data-controller="copy"]:hover { color: var(--accent-strong); }
[data-controller="copy"].copied { color: var(--success); border-bottom-color: transparent; }

.link-soft { color: inherit; text-decoration: none; }
.link-soft:hover { color: var(--accent-strong); }

/* Bandeau client : identité + coordonnées + QR, pleine largeur */
.client-header {
    display: flex;
    align-items: center;
    gap: 26px;
    flex-wrap: wrap;
    padding: 22px 26px;
    margin-bottom: 16px;
}

.ch-identity { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }

.ch-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 27px;
    background: var(--raise);
    flex-shrink: 0;
}

.ch-identity h1 { margin: 0 0 2px; font-size: 23px; font-weight: 800; letter-spacing: -.4px; white-space: nowrap; }
.ch-identity .muted { font-size: 13px; }

.ch-contacts {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex: 1;
    flex-wrap: nowrap;
    min-width: 240px;
}

/* Téléphone + e-mail empilés (e-mail sous le numéro) */
.ch-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 2 1 300px;
    min-width: 250px;
}

.ch-stack .ch-item { flex: 0 0 auto; }
.ch-stack .ch-val-sm { white-space: normal; overflow: visible; overflow-wrap: anywhere; }

.ch-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 15px;
    background: var(--raise);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s, background .15s;
    flex: 1 1 auto;
    min-width: 0;
}

a.ch-item:hover { border-color: var(--accent); background: var(--accent-tint); }

.ch-ico { font-size: 19px; flex-shrink: 0; }

.ch-body { display: flex; flex-direction: column; min-width: 0; }

.ch-lbl {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--text-soft);
    font-weight: 650;
    white-space: nowrap;
}

.ch-val {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-val-sm { font-size: 13.5px; font-weight: 600; letter-spacing: 0; }

.ch-sub {
    font-size: 11.5px;
    color: var(--text-soft);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-qr { text-align: center; flex-shrink: 0; }

.ch-qr img {
    width: 88px;
    height: 88px;
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 6px;
}

.ch-qr span { display: block; font-size: 10.5px; color: var(--text-soft); margin-top: 6px; }

@media (max-width: 900px) {
    .ch-contacts { flex-wrap: wrap; }
    .ch-val, .ch-lbl { white-space: normal; overflow: visible; }
    .ch-item { flex: 1 1 190px; }
}

.stat-chips { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

.stat-chip {
    display: flex;
    align-items: baseline;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pilule);
    padding: 9px 18px;
}

.stat-num { font-size: 18px; font-weight: 800; }
.stat-lbl { font-size: 13px; color: var(--text-soft); }

.stat-chip-accent .stat-num { color: var(--accent-strong); }
.stat-chip-warn .stat-num { color: var(--warning); }

/* ---------- QR code (fiche dossier / client) ---------- */
.qr-card {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.qr-box {
    width: 118px;
    height: 118px;
    padding: 8px;
    background: #fff;
    border-radius: 12px;
    flex-shrink: 0;
}

.qr-box img { width: 100%; height: 100%; display: block; }

.qr-card > div:last-child { flex: 1; min-width: 220px; }

/* ---------- En-tête de prise en charge (lecture « document ») ---------- */
.pec-header { padding: 26px 30px; margin-bottom: 16px; }

.ph-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.ph-lbl {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .9px;
    color: var(--text-soft);
    font-weight: 650;
    margin-bottom: 4px;
}

.ph-num {
    display: block;
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.6px;
    font-variant-numeric: tabular-nums;
    margin-bottom: 8px;
}

.ph-date { text-align: right; margin-left: auto; }
.ph-val { display: block; font-size: 18px; font-weight: 700; }

.ph-tech {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 7px 14px;
    background: var(--accent-soft);
    border-radius: var(--radius-pilule);
    font-size: 14px;
    color: var(--text);
}
.ph-tech strong { font-weight: 750; }
.ph-tech.is-empty { background: transparent; border: 1px dashed var(--border); color: var(--text-soft); }

.ph-qr img {
    width: 92px;
    height: 92px;
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 6px;
}

.ph-row { padding: 16px 0; border-bottom: 1px solid var(--border); }
.ph-row:last-child { border-bottom: none; padding-bottom: 0; }

.ph-big { display: block; font-size: 21px; font-weight: 750; letter-spacing: -.3px; }
.ph-sub { display: block; font-size: 14.5px; color: var(--text-soft); margin-top: 3px; }

/* Coordonnées client : lisibles au comptoir */
.ph-contact {
    display: flex;
    align-items: center;
    gap: 8px 20px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 17px;
    font-weight: 600;
}

/* Personne à prévenir — isolée à droite, éditable en un clic */
.ph-row-split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.ph-client { flex: 1; min-width: 260px; }

.ph-tiers {
    min-width: 250px;
    padding: 12px 16px;
    background: var(--raise);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.ph-tiers > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ph-tiers > summary::-webkit-details-marker { display: none; }

.ph-tiers-nom { font-size: 16px; font-weight: 700; }
.ph-tiers-tel { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ph-tiers-vide { color: var(--text-soft); font-style: italic; }

.ph-tiers-edit {
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--accent-strong);
}

.ph-tiers[open] .ph-tiers-edit { opacity: .5; }

.ph-tiers-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.ph-tiers-form .field { margin-bottom: 12px; }
.ph-tiers-form input { padding: 9px 12px; font-size: 14.5px; }

@media (max-width: 640px) {
    .pec-header { padding: 20px 18px; }
    .ph-date { text-align: left; margin-left: 0; }
}

/* Statut d'identification IMEI (formulaire devis) */
.imei-status { font-size: 13.5px; font-weight: 600; margin-top: 6px; min-height: 18px; }
.imei-status-ok { color: var(--success); }
.imei-status-warn { color: var(--warning); }

/* ---------- Chiffrage / devis ---------- */
/* L'invite au-dessus des réparations à cocher (intake/_reparations.html.twig). */
.intake-rep-hint { margin: 0 0 12px; }

/* Les pannes courantes en un clic (pannes_courantes_controller) : des pilules ; celle qui
   est dans la panne constatée prend le dégradé de l'état actif. « ＋ » en pointillé. */
.pannes-courantes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 10px; }
.panne-puce {
    padding: 6px 13px; border-radius: var(--radius-pilule); cursor: pointer;
    border: 1px solid var(--border); background: var(--raise); color: var(--text);
    font: inherit; font-size: 13px; font-weight: 600;
    transition: border-color .12s, background .12s, color .12s, transform .05s;
}
.panne-puce:hover { border-color: var(--accent); }
.panne-puce:active { transform: scale(.96); }
.panne-puce[aria-pressed="true"] { background: var(--degrade-actif); color: var(--sur-accent); border-color: transparent; }
.panne-puce.panne-ajout { border-style: dashed; background: none; color: var(--text-soft); min-width: 36px; }
.panne-nouvelle { display: inline-flex; align-items: center; gap: 6px; }
.panne-nouvelle[hidden] { display: none; }
.panne-nouvelle input { width: 190px; padding-top: 6px; padding-bottom: 6px; }
@media (prefers-reduced-motion: reduce) {
    .panne-puce { transition: none; }
    .panne-puce:active { transform: none; }
}

.devis-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.devis-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .12s;
}

/* La ligne vit dans un .field : sa règle « label { display: block } »,
   plus spécifique, l'écrasait — le prix ne se rangeait jamais à droite. */
.field .devis-row { display: flex; margin-bottom: 0; }
/* Le prix « à définir » garde sa place à droite, sans écraser le nom. */
.devis-row .prix-a-definir { flex: 0 0 130px; width: 130px; padding: 8px 12px; }
.devis-row:last-child { border-bottom: none; }
.devis-row:hover { background: var(--accent-tint); }

.devis-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}

.devis-nom { flex: 1; font-weight: 550; }

.devis-prix {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.devis-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 13px 16px;
    background: var(--accent-soft);
    border-radius: 12px;
    font-size: 15px;
}

.devis-total strong { font-size: 21px; color: var(--accent-strong); font-variant-numeric: tabular-nums; }

/* Recherche de réparations à ajouter au devis */
.devis-add { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.devis-add > label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.devis-add .search-live { margin-bottom: 0; }
.devis-add .search-live input { padding: 12px 16px 12px 46px !important; font-size: 15px; }

.ds-results {
    display: flex;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.ds-results:empty { display: none; }

.ds-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 11px 15px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
}

.ds-row:last-child { border-bottom: none; }
.ds-row:hover { background: var(--accent-tint); }

.ds-nom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 550; }
.ds-modele { font-size: 12px; color: var(--text-soft); }
.ds-prix { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Ligne "à définir" : le prix se saisit et s'enregistre directement dans la liste */
.ds-row--saisie { padding: 6px 15px 6px 0; }
.ds-nom--btn {
    background: transparent;
    border: none;
    padding: 11px 0 11px 15px;
    font: inherit;
    font-weight: 550;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    flex: 1;
}
.ds-prix-form { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ds-prix-input {
    width: 88px;
    padding: 6px 9px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    text-align: right;
    background: var(--surface, #fff);
}
.ds-prix-input:focus { outline: none; border-color: var(--accent); }
.ds-prix-euro { color: var(--text-soft); font-size: 14px; }
.ds-prix-save {
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 5px 9px;
    cursor: pointer;
    font-size: 14px;
}
.ds-prix-save:hover { border-color: var(--accent); }
.ds-prix-save:disabled { opacity: 0.5; cursor: default; }
.ds-empty { padding: 16px; color: var(--text-soft); font-size: 14px; text-align: center; }

.ds-close {
    width: 100%;
    padding: 9px;
    background: var(--sunken);
    border: none;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color .12s;
}

.ds-close:hover { color: var(--text); }

/* Devis sur la fiche dossier */
.devis-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.devis-table td { padding: 10px 4px; border-bottom: 1px solid var(--border); }
.devis-table thead th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 650;
    color: var(--text-soft);
    padding: 6px 4px;
    border-bottom: 1px solid var(--border);
}
.devis-table tbody th { padding: 10px 4px; text-align: left; }
.devis-table tr:last-child td { border-bottom: none; }
.devis-table .amount { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Deux montants voisins ne doivent jamais se lire comme un seul :
   « 1 » puis « 1 074,17 € » collés se lisaient « 11 074,17 € ». */
.devis-table th.amount, .devis-table td.amount { padding-left: 18px; }
/* Sur téléphone : Qté et Montant TTC restent, le détail HT s'efface. */
@media (max-width: 600px) {
    .devis-table .col-ht { display: none; }
    .devis-table th.amount, .devis-table td.amount { padding-left: 10px; }
    /* La désignation garde une largeur lisible : c'est le tableau qui défile. */
    .devis-table tr:not(.devis-groupe) > :first-child { min-width: 170px; }
}
.devis-table .act { width: 44px; text-align: right; }
/* Le devis du dossier : deux gestes par ligne, ✏️ corriger sur place et 🗑 retirer. */
.devis-table.lignes-editables .act { width: 92px; white-space: nowrap; }
.devis-table.lignes-editables .act > .btn { vertical-align: middle; }
.devis-table.lignes-editables .act form { display: inline-block; vertical-align: middle; }
/* Sans cette règle, le « hidden » d'une ligne serait écrasé par le display
   des lignes (grille sur téléphone) : la ligne fermée doit vraiment disparaître. */
.devis-table tr[hidden],
.devis-table .lg-edition[hidden] { display: none; }
/* Le filet sous la dernière ligne n'a pas lieu d'être : le récap pose le sien.
   La ligne d'édition (masquée) vient après la dernière ligne affichée. */
.devis-table.lignes-editables tbody tr:nth-last-child(2) td { border-bottom: none; }
/* « 2 × 45,00 € » sous la désignation : seulement quand les colonnes Qté
   et P.U. s'effacent (téléphone) ; de même la remise en TTC. */
.lg-calcul, .devis-table .ttc-etroit { display: none; }
@media (max-width: 600px) {
    .devis-table .ttc-etroit { display: inline; }
    .devis-table .devis-remise.col-ht { display: none; }
}

.devis-recap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.devis-recap div { display: flex; justify-content: space-between; gap: 16px; }
.devis-recap .grand { font-size: 19px; font-weight: 800; }
.devis-recap .grand span:last-child { color: var(--accent-strong); font-variant-numeric: tabular-nums; }

/* Le devis détaillé comme la facture : l'appareil chapeaute ses lignes
   (même bandeau que la saisie), les lignes se mettent en retrait. */
.devis-table .devis-groupe td {
    padding: 9px 12px; border-bottom: none;
    background: var(--accent-soft); color: var(--accent-strong);
    font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.devis-table .devis-rattachee td:first-child { padding-left: 22px; }
.devis-table .devis-doux { font-weight: 550; color: var(--text-soft); }
.devis-table .badge { margin-left: 6px; vertical-align: 1px; }
.devis-remise { margin-left: 6px; font-size: 12px; color: var(--text-soft); }
.devis-recap .devis-doux { font-size: 13.5px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.devis-add .hint { margin-left: 10px; }
/* La ligne libre de la fiche dossier : le libellé prend la place, le prix reste court. */
.devis-libre { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.devis-libre input[name="libelle"] { flex: 1; min-width: 200px; }
.devis-libre input[name="prix"] { flex: 0 0 110px; text-align: right; font-variant-numeric: tabular-nums; }
.devis-add .devis-libre-aide { margin: 8px 0 0; color: var(--text-soft); font-size: 13px; }

/* Corriger une ligne sur place : la ligne devient un petit formulaire
   (ligne_edition_controller.js), libellé, quantité et prix côte à côte. */
.devis-table .lg-edition td { padding: 8px 4px 12px; }
.devis-table .lg-edition.en-edition td { background: var(--accent-tint); }
.lg-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.lg-champ { display: flex; flex-direction: column; gap: 3px; }
.lg-champ > span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 650;
    color: var(--text-soft);
}
.lg-form .lg-champ input { width: 100%; padding: 8px 10px; font-size: 15px; }
.lg-champ-lib { flex: 1 1 220px; }
.lg-champ-qte { flex: 0 0 72px; }
.lg-champ-pu { flex: 0 0 120px; }
.lg-champ-qte input, .lg-champ-pu input { text-align: right; font-variant-numeric: tabular-nums; }
.lg-form-actions { display: flex; gap: 6px; }
/* Ce que la correction sur place ne touche pas (remise, occasion) : une ligne d'aide discrète. */
.lg-form-aide { flex-basis: 100%; margin: 0; color: var(--text-soft); font-size: 13px; }

/* ---------- Pièces ---------- */
.pieces-card { border-color: var(--accent-soft); }

.piece-list { display: flex; flex-direction: column; margin-top: 12px; }

.piece-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.piece-row:last-child { border-bottom: none; }

.piece-libelle { flex: 1; font-weight: 550; min-width: 140px; }

.piece-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Bloc « À suivre » ---------- */
.attn-card { border-color: var(--warning-soft); }

/* Carte d'alerte du tableau de bord (stock bas, SMS) : une ligne, un lien pour agir. */
.card-alerte {
    display: block;
    color: inherit;
    text-decoration: none;
    border-color: var(--warning-soft);
}
.card-alerte a { color: var(--accent-strong); font-weight: 700; text-decoration: none; }
.card-alerte a:hover { text-decoration: underline; }

/* Rappel d'accueil (facture électronique 2027) : même gabarit que l'alerte, ton d'information. */
.card-rappel { display: block; border-color: var(--accent-soft, var(--border)); }
.card-rappel a { display: inline-block; margin-right: 14px; color: var(--accent-strong); font-weight: 700; text-decoration: none; }
.card-rappel a:hover { text-decoration: underline; }

.attn-list { display: flex; flex-direction: column; margin-top: 12px; }

.attn-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    flex-wrap: wrap;
}

.attn-row:hover { background: var(--warning-soft); }

.attn-what { flex: 1; font-weight: 550; }

.attn-delay { font-size: 13px; color: var(--warning); font-weight: 600; white-space: nowrap; }

/* ---------- Tableau de bord ---------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 920px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
}

.kpi-value { font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.kpi-label { font-weight: 650; margin-top: 2px; }
.kpi-sub { font-size: 13px; color: var(--text-soft); margin-top: 2px; }

.kpi-warn .kpi-value { color: var(--warning); }
.kpi-good .kpi-value { color: var(--success); }

.cards-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Annule l'espacement vertical .card + .card entre cartes côte à côte. */
.cards-2 > .card { margin-top: 0; }

@media (max-width: 720px) { .cards-2 { grid-template-columns: 1fr; } }

.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    margin-top: 20px;
}

.chart-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    gap: 6px;
    min-width: 0;
}

.chart-bar {
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    border-radius: 6px 6px 3px 3px;
    min-height: 3px;
    opacity: .9;
    transition: opacity .15s;
}

.chart-col:hover .chart-bar { opacity: 1; }

.chart-x {
    font-size: 10.5px;
    color: var(--text-soft);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
}

.chart-col:nth-child(even) .chart-x { visibility: hidden; }

.statut-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.statut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.statut-count { font-weight: 700; font-variant-numeric: tabular-nums; }

/* La grille des journées (Statistiques › Temps) : lignes = techniciens,
   colonnes = jours du mois. L'intensité d'une case dit la charge de la
   journée — l'échelle vient du template (--part, repère 7 h). */
.tmp-grille { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tmp-grille th,
.tmp-grille td {
    padding: 8px 4px;
    text-align: center;
    border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    white-space: nowrap;
}
.tmp-grille th { color: var(--text-soft); font-weight: 650; background: var(--sunken); }
.tmp-ini { display: block; font-size: 10px; letter-spacing: .5px; opacity: .7; }
.tmp-grille .tmp-nom { text-align: left; font-weight: 550; padding: 8px 12px; min-width: 120px; }
.tmp-plein { background: color-mix(in srgb, var(--accent) calc(var(--part) * .35), transparent); font-weight: 650; }
.tmp-vide { color: var(--placeholder); }
.tmp-dim { background: var(--sunken); }
td.tmp-plein.tmp-dim { background: color-mix(in srgb, var(--accent) calc(var(--part) * .35), var(--sunken)); }
th.tmp-auj { box-shadow: inset 0 -2px 0 var(--accent); }
.tmp-tot { color: var(--accent-strong); font-weight: 700; background: var(--sunken); }

/* La bulle d'info des cases (contrôleur bulle) : en fixed sur le body,
   jamais rognée par le défilement horizontal de la grille. */
.bulle {
    position: fixed;
    z-index: 60;
    background: var(--surface-solid);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 550;
    box-shadow: var(--shadow);
    pointer-events: none;
    white-space: nowrap;
}

/* Le Sceau de Kronos (partial _sceau.html.twig) : aligné sur le texte. */
.sceau { display: inline-block; vertical-align: -3px; }
.badge-sceau { display: inline-flex; align-items: center; gap: 6px; }
.badge-sceau .sceau { vertical-align: initial; }

/* Champ mot de passe avec bouton « œil » pour afficher / masquer. */
.pw-field { position: relative; display: block; }
.pw-field > input { width: 100%; padding-right: 40px; }
.pw-eye {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 4px 6px;
    opacity: .6;
}
.pw-eye:hover { opacity: 1; }

/* Zone sensible (fiche boutique) : actions destructives isolées visuellement. */
.danger-zone { border: 1px solid var(--danger); }
.danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}
.danger-row:first-of-type { border-top: none; }
.danger-delete { border-top-color: var(--danger); }
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { filter: brightness(1.05); }

/* Retour en direct sur l'unicité du code boutique. */
.code-feedback { font-size: 13px; margin-top: 6px; min-height: 18px; font-weight: 600; }
.code-feedback[data-ton="ok"] { color: var(--success); }
.code-feedback[data-ton="ko"] { color: var(--danger); }
.code-feedback[data-ton="muted"] { color: var(--text-soft); font-weight: 400; }

/* Grille de saisie du catalogue : les champs occupent toute la cellule. */
.grille-table input[type="text"] { width: 100%; }
.grille-table td { padding-top: 8px; padding-bottom: 8px; }

/* ---------- Liste des dossiers ---------- */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-head h1 { margin: 0; font-size: 24px; }

.searchbar { display: flex; gap: 10px; flex: 1; max-width: 420px; }

.pec-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.pec-table th {
    text-align: left;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-soft);
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--sunken);
}

.pec-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.pec-table tr:last-child td { border-bottom: none; }

.pec-table tbody tr { cursor: pointer; transition: background .12s; }
.pec-table tbody tr:hover { background: var(--accent-tint); }

.table-wrap { overflow-x: auto; border-radius: var(--radius); }

.ref { font-weight: 700; font-variant-numeric: tabular-nums; }
/* Le lien-cible d'une ligne cliquable : le VRAI lien que le clavier atteint
   — la ligne entière n'est qu'un raccourci de souris (ligne_lien_controller). */
.ligne-cible { color: var(--text); font-weight: 700; text-decoration: none; transition: color .12s; }
.ligne-cible:hover { color: var(--accent-strong); text-decoration: underline; }
.ligne-cible:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.muted { color: var(--text-soft); font-size: 14px; }

/* ---------- Badges de statut ---------- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pilule);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.badge-gray { background: rgba(255, 255, 255, .09); color: #b9c1d4; }
.badge-blue { background: var(--accent-soft); color: var(--accent-strong); }
.badge-orange { background: var(--warning-soft); color: var(--warning); }
.badge-purple { background: rgba(158, 110, 255, .16); color: #bfa0ff; }
.badge-green { background: var(--success-soft); color: var(--success); }
.badge-slate { background: rgba(120, 160, 200, .14); color: #9fc0dd; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }

:root[data-theme="light"] .badge-gray { background: rgba(30, 40, 80, .08); color: #4b5568; }
:root[data-theme="light"] .badge-purple { background: rgba(122, 79, 206, .13); color: #6a3fce; }
:root[data-theme="light"] .badge-slate { background: rgba(51, 82, 107, .12); color: #33526b; }

/* ---------- Ligne tutos (fiche dossier) ---------- */
.tuto-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.tuto-line em { font-style: normal; color: var(--text); font-weight: 600; }

.tuto-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
    background: var(--raise);
    border: 1px solid var(--border);
    border-radius: var(--radius-pilule);
    transition: border-color .15s, background .15s;
}

.tuto-btn:hover { border-color: var(--accent); background: var(--accent-tint); }

/* ---------- Fiche détail ---------- */
.show-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.show-head h1 { margin: 0 0 4px; font-size: 26px; }

.show-actions { display: flex; gap: 10px; flex-wrap: wrap; }
/* Les actions d'une fiche devis, facture ou client : une seule rangée, alignée (capture de David du 16/10). Les
   petits formulaires s'effacent — leurs boutons rejoignent la rangée au lieu de rester collés en haut de leur
   boîte —, tous les boutons ont la même hauteur, et la pastille d'état (« Envoyé le… ») se centre sur eux au lieu
   de s'étirer. Sur téléphone, la grille d'actions plus bas reprend la main. */
.actions-fiche { align-items: center; }
.actions-fiche > form { display: contents; }
.actions-fiche :is(.btn, .btn-action) { height: 46px; padding-block: 0; font-size: 15px; white-space: nowrap; }

.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Sélecteur de statut : reste sur une ligne à côté de son bouton */
.statut-form { flex-wrap: nowrap; flex-shrink: 0; }
.statut-form select { min-width: 190px; }
.statut-form .btn { white-space: nowrap; }
/* La liste et son bouton à la même hauteur que les actions de la fiche, sur la même ligne. */
.statut-form :is(select, .btn) { height: 46px; padding-block: 0; }
.statut-form .btn { font-size: 15px; }
/* Sur téléphone, la liste cède la place au bouton plutôt que de déborder. */
@media (max-width: 480px) {
    .statut-form { flex-shrink: 1; max-width: 100%; }
    .statut-form select { min-width: 0; flex: 1; }
}

.empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--text-soft);
}

.empty .big { font-size: 44px; margin-bottom: 12px; }

/* ---------- Réglages › Apparence ---------- */
.mode-choix { display: flex; gap: 14px; flex-wrap: wrap; }

.mode-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    font: inherit;
    font-weight: 650;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.mode-btn:hover { border-color: var(--text-soft); }
.mode-btn.on { border-color: var(--accent); background: var(--accent-tint); }

.mode-apercu { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--border); }
.mode-apercu-sombre { background: linear-gradient(135deg, #0b1020 60%, #171d30); }
.mode-apercu-clair { background: linear-gradient(135deg, #e6e9f2 60%, #f6f7fb); }

.pal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 6px;
}

.pal-pastille {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px 12px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .15s, transform .1s, background .15s;
}

.pal-pastille:hover { border-color: var(--text-soft); transform: translateY(-1px); }
.pal-pastille.on { border-color: var(--accent); background: var(--accent-tint); }
.pal-pastille.on .pal-rond { box-shadow: 0 0 0 3px var(--accent-soft); }

.pal-rond { width: 40px; height: 40px; border-radius: 50%; }
.pal-nom { font-weight: 700; font-size: 14.5px; }
.pal-note { font-size: 11.5px; color: var(--text-soft); text-align: center; line-height: 1.3; }

/* ---------- Avatars (partial _avatar.html.twig) ---------- */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    background: var(--sunken);
    flex-shrink: 0;
}

.avatar-initiales {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 750;
    letter-spacing: .3px;
    color: #fff;
    background: hsl(var(--h) 55% 46%);
    user-select: none;
}

/* La barre technicien du comptoir : des visages, plus seulement des noms. */
.techbtn { display: inline-flex; align-items: center; gap: 7px; }
.techbtn .avatar { margin-left: -6px; }

/* Grille de choix d'un avatar (Pilotage › Utilisateurs) */
.avatar-choix {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.avatar-choix label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}

.avatar-choix label:hover { border-color: var(--text-soft); }
.avatar-choix input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-choix input:checked + .avatar,
.avatar-choix label:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }

/* ---------- Comptes : le nom porte l'identifiant, le tableau tient dans sa carte ---------- */
.comptes-table th, .comptes-table td { padding-left: 14px; padding-right: 14px; }
.comptes-table .badge { white-space: nowrap; }
/* Rôle, statut, « Gérer » : juste leur contenu — le reste revient au nom. */
.comptes-table thead th:not(:first-child),
.comptes-table tbody > tr:not(.tr-gestion) > td:not(:first-child) { width: 1%; white-space: nowrap; }
.compte { display: flex; align-items: center; gap: 10px; min-width: 0; }
.compte .avatar { flex-shrink: 0; }
.compte-qui { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.compte-qui small { font-size: 12.5px; color: var(--text-soft); overflow-wrap: anywhere; }
/* Au téléphone, plus de tableau à faire défiler : chaque compte est une
   ligne qui se replie, et son panneau « Gérer » prend toute la largeur. */
@media (max-width: 700px) {
    .comptes-table, .comptes-table tbody { display: block; }
    .comptes-table thead { display: none; }
    .comptes-table tbody > tr:not(.tr-gestion) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px 14px;
        border-bottom: 1px solid var(--border);
    }
    .comptes-table tbody > tr:not(.tr-gestion) > td,
    .comptes-table tbody > tr:not(.tr-gestion) > td:not(:first-child) { display: block; width: auto; padding: 0; border: none; }
    .comptes-table tbody > tr:not(.tr-gestion) > td:first-child { flex: 1 1 100%; }
    .comptes-table tbody > tr:not(.tr-gestion) > td:last-child { margin-left: auto; }
    .comptes-table .tr-gestion:not([hidden]),
    .comptes-table .tr-gestion > td { display: block; }
    .comptes-table .tr-gestion > td { padding: 16px 14px !important; }
}

/* ---------- Panneau « Gérer » d'un utilisateur (pleine largeur) ---------- */
.btn-gerer.on { background: var(--accent-soft); color: var(--accent-strong); }

.tr-gestion > td {
    background: var(--sunken);
    padding: 20px 22px !important;
    border-top: 2px solid var(--accent-soft);
    border-bottom: 2px solid var(--accent-soft);
}

.gestion-grille {
    display: grid;
    /* Les colonnes se replient au lieu de pousser le tableau hors de la
       carte (interface agrandie, petit écran, menu des réglages ouvert). */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 12px 26px;
    align-items: start;
}

.gestion-col h4,
.gestion-pouvoirs h4 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-soft);
}

.gestion-pouvoirs {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.gestion-pouvoirs h4 { margin: 0 0 4px; }
.gestion-pouvoirs > .hint { margin: 0 0 10px; }

/* ── Pouvoirs confiés : une liste de réglages, une ligne par pouvoir ── */
.pouvoirs-liste {
    background: var(--raise);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.pouvoir-ligne {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background .15s;
}
.pouvoir-ligne + .pouvoir-ligne { border-top: 1px solid var(--border); }
.pouvoir-ligne:hover { background: var(--hover); }
.pouvoir-ligne input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.pouvoir-icone {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--sunken);
    font-size: 16px;
    transition: background .15s;
}
.pouvoir-ligne:has(input:checked) .pouvoir-icone { background: var(--accent-soft); }
.pouvoir-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pouvoir-txt b { font-size: 14px; font-weight: 650; }
.pouvoir-txt small { font-size: 12.5px; color: var(--text-soft); line-height: 1.4; }
.sw {
    /* inline-block : un span inline ignore width/height — hors d'un flex
       (label dans un .field, par exemple), la pilule disparaissait. */
    display: inline-block;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    flex-shrink: 0;
    transition: background .3s;
}
.sw::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
    transition: transform .3s;
}
.pouvoir-ligne input:checked ~ .sw { background: var(--accent); }
.pouvoir-ligne input:checked ~ .sw::after { transform: translateX(16px); }
.pouvoir-ligne input:focus-visible ~ .sw {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .sw, .sw::after, .pouvoir-ligne, .pouvoir-icone { transition: none; }
}

.gestion-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
    .gestion-grille { grid-template-columns: 1fr; }
}


/* ── Fil d'Ariane des statuts (fiche dossier) : un clic = un statut ── */
.fil-statuts {
    display: flex;
    align-items: center;
    justify-content: center;   /* la frise trône au centre */
    gap: 5px;
    flex-wrap: wrap;
    width: 100%;
    margin: 4px 0 6px;
}
.fil-statut {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: var(--radius-pilule);
    border: 2px solid var(--border);
    background: var(--card, transparent);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-soft);
    transition: border-color .25s, background .25s, color .25s, transform .15s;
}
.fil-statut:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.fil-statut.fait {
    border-color: var(--success, #1f8a5b);
    color: var(--success, #1f8a5b);
    background: color-mix(in srgb, var(--success, #1f8a5b) 12%, transparent);
}
.fil-statut.actuel {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--sur-accent);
    cursor: default;
    opacity: 1;
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 45%, transparent);
}
.fil-statut .fs-point { font-size: 12px; font-weight: 800; }
.fil-lien { width: 16px; height: 2.5px; background: var(--border); flex-shrink: 0; border-radius: 2px; }
.fil-lien.fait { background: var(--success, #1f8a5b); }
@media (max-width: 900px) {
    .fil-statut .fs-label { font-size: 12px; }
    .fil-lien { display: none; }
}

/* ── Pilotage du dossier : avancement + actions mises en avant ────── */
.pilotage { margin-bottom: 18px; }
.pil-titre {
    display: block; text-align: center; margin-bottom: 10px;
    font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-soft);
}
/* Sous la frise : ce que le prochain clic déclenchera côté SMS, dit avant plutôt que subi après. */
.pil-note {
    margin: 2px 0 0;
    text-align: center;
    font-size: 12.5px;
    font-weight: 550;
    color: var(--text-soft);
}
.pil-note.attention { color: var(--warning); }
.pil-note a { color: inherit; font-weight: 750; text-decoration: none; }
.pil-note a:hover { text-decoration: underline; }
.pil-actions {
    display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
    margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.btn-action {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 26px; border-radius: 12px;
    font-size: 15px; font-weight: 800; text-decoration: none;
    border: 2px solid var(--accent);
    color: var(--accent-strong);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    transition: transform .15s, box-shadow .2s;
}
.btn-action:hover { transform: translateY(-2px); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-action-plein {
    background: var(--degrade-actif);
    border-color: transparent; color: var(--sur-accent);
}
@media (max-width: 640px) {
    .btn-action { flex: 1 1 auto; justify-content: center; }
}

/* ── Communication client (dossier → page de suivi publique) ───────── */
.sm-card {
    border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--accent) 7%, var(--surface-solid));
}
.sm-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sm-tete h2 { margin: 0; }
.sm-vis {
    font-size: 11.5px; font-weight: 800; letter-spacing: .04em;
    padding: 4px 11px; border-radius: var(--radius-pilule);
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent-strong);
}
.sm-lien { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--accent-strong); }
.sm-message { display: flex; align-items: baseline; gap: 10px; padding: 8px 2px; border-bottom: 1px dashed var(--border); }
.sm-texte { flex: 1; line-height: 1.45; }
.sm-date { color: var(--text-soft); font-size: 12px; white-space: nowrap; }
.sm-message form { display: inline; }
.sm-suppr { border: none; background: none; color: var(--text-soft); cursor: pointer; font-size: 13px; padding: 2px 7px; border-radius: 6px; }
.sm-suppr:hover { background: var(--danger-soft); color: var(--danger); }
.sm-form { display: flex; gap: 8px; margin-top: 12px; }
.sm-form input[type="text"] { flex: 1; }
@media (max-width: 640px) {
    .sm-form { flex-direction: column; }
}

/* ── Zone danger du dossier : suppression (pouvoir pec.supprimer) ──── */
.pec-danger { display: flex; justify-content: center; margin: 6px 0 24px; }
.btn-danger-doux {
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
    background: transparent; color: var(--danger);
    padding: 9px 18px; border-radius: 10px; cursor: pointer;
    font-size: 13.5px; font-weight: 700;
    transition: background .2s, color .2s;
}
.btn-danger-doux:hover { background: var(--danger); color: #fff; }

/* ── Factures ──────────────────────────────────────────────────────── */
.fa-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }

/* ── La pilule .chip — partout : barres de filtres, pagination,
      variables de SMS, états de rendez-vous. Un bouton-chip reste une
      pilule (fond neutre, pas le look bouton du navigateur). ────────── */
.filtre-chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 14px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 15px; border-radius: var(--radius-pilule);
    border: 1.5px solid var(--border); background: transparent; color: var(--text-soft);
    text-decoration: none; font: inherit; font-size: 13.5px; font-weight: 700;
    transition: border-color .2s, color .2s, background .2s;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.actif {
    border-color: var(--accent); color: var(--sur-accent);
    background: var(--degrade-actif);
}
.filtre-chips .chip-n {
    font-size: 11.5px; padding: 1px 8px; border-radius: var(--radius-pilule);
    background: var(--accent-soft); color: var(--accent-strong);
}
.filtre-chips .chip.actif .chip-n { background: rgba(255, 255, 255, .22); color: var(--sur-accent); }
.filtre-form {
    display: flex; gap: 14px 22px; align-items: center; flex-wrap: wrap;
    margin: 0 0 22px; padding: 14px 18px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 13.5px; color: var(--text-soft);
}
.filtre-groupe { display: inline-flex; align-items: center; gap: 9px; }
.filtre-titre { font-weight: 800; color: var(--text); }
.filtre-form label { cursor: pointer; }
.filtre-form input[type="date"],
.filtre-form select {
    color-scheme: dark; /* le sélecteur natif suit le thème sombre */
    background: var(--surface-solid); border: 1.5px solid var(--border);
    color: var(--text); border-radius: 10px; padding: 9px 12px;
    font: inherit; font-weight: 600;
    transition: border-color .2s;
}
:root[data-theme="light"] .filtre-form input[type="date"],
:root[data-theme="light"] .filtre-form select { color-scheme: light; }
.filtre-form input[type="date"]:focus,
.filtre-form select:focus { border-color: var(--accent); outline: none; }
.filtre-form select { max-width: 230px; }
/* Liste des dossiers : « déposé le … par » le technicien du comptoir, sous la date. */
.pec-tech { display: flex; align-items: center; gap: 6px; margin-top: 4px; white-space: nowrap; font-size: 12.5px; color: var(--text-soft); }
.pec-tech .avatar { flex-shrink: 0; }

/* SAV uniquement, 2 temps, 4 temps : des boutons bascule — allumés (dégradé
   actif) tant que le filtre joue ; la case reste là pour le clavier, invisible. */
.filtre-sav {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-pilule);
    font-weight: 700; cursor: pointer; user-select: none;
    transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}
.filtre-sav:hover { border-color: var(--accent); }
.filtre-sav:active { transform: scale(.97); }
.filtre-sav input { position: absolute; opacity: 0; pointer-events: none; }
.filtre-sav:has(input:checked) {
    color: var(--sur-accent); background: var(--degrade-actif); border-color: transparent;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}
.filtre-sav:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.filtre-actions { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
@media (max-width: 760px) {
    .filtre-form { align-items: stretch; flex-direction: column; }
    .filtre-groupe { flex-wrap: wrap; }
    .filtre-actions { margin-left: 0; }
    .filtre-form select { max-width: none; width: 100%; }
}

/* ── Facture libre : catalogue au clic ─────────────────────────────── */
.fc-zone { position: relative; }
.fc-zone > input { width: 100%; }
.fc-resultats { margin-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.fc-vide { color: var(--text-soft); font-size: 13px; padding: 4px 2px; }
.fc-modele { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.fc-modele-nom { font-weight: 800; font-size: 13.5px; margin-bottom: 8px; }
.fc-reps { display: flex; flex-wrap: wrap; gap: 7px; }
.fc-rep {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 12px; border-radius: var(--radius-pilule); cursor: pointer;
    border: 1.5px solid var(--border); background: none;
    color: var(--text); font-size: 12.5px; font-weight: 600;
    transition: border-color .15s, background .15s;
}
.fc-rep:hover { border-color: var(--accent); background: var(--accent-soft); }
.fc-prix { color: var(--accent-strong); font-weight: 800; }
.fc-prix-vide { color: var(--text-soft); font-weight: 500; font-style: italic; }
.fc-lien-fiche {
    align-items: center; gap: 6px; margin-left: 10px;
    font-size: 12px; font-weight: 800; padding: 4px 11px; border-radius: var(--radius-pilule);
    background: color-mix(in srgb, var(--success, #1f8a5b) 15%, transparent);
    color: var(--success, #1f8a5b);
}
/* L'occasion réduite à son glyphe : la pilule ♻️ s'allume quand la
   ligne passe en TVA sur marge — la case vit dessous, invisible mais
   focusable (le contour suit le clavier). */
.lf-occ {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px; cursor: pointer; width: 36px; height: 34px; flex: none;
    border: 1.5px dashed var(--border); border-radius: var(--radius-pilule);
    filter: grayscale(1); opacity: .65;
    transition: border-color .15s, background .15s, opacity .15s, filter .15s;
}
.lf-occ:hover { border-color: var(--success); opacity: 1; }
.lf-occ:has(:checked) {
    border: 1.5px solid var(--success);
    background: var(--success-soft, color-mix(in srgb, var(--success) 14%, transparent));
    filter: none; opacity: 1;
}
.lf-occ input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.lf-occ:has(:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .lf-occ { transition: none; } }
.lf-suppr {
    border: none; background: none; cursor: pointer;
    color: var(--text-soft); font-size: 14px; padding: 6px 9px; border-radius: 8px;
    transition: background .15s, color .15s;
}
.lf-suppr:hover { background: var(--danger-soft); color: var(--danger); }
/* La machine choisie chapeaute ses lignes : bandeau, puis rangées en retrait. */
.lf-groupe {
    display: flex; align-items: center; gap: 8px; margin: 2px 0 8px;
    padding: 9px 12px; border-radius: 10px;
    background: var(--accent-soft); color: var(--accent-strong);
    font-weight: 650; font-size: 13.5px;
}
/* Le ✕ du bandeau — pas la poignée ⠿, qui a ses propres règles plus bas. */
.lf-groupe button:not(.lf-poignee) {
    margin-left: auto; border: none; background: none; cursor: pointer; color: inherit;
    font-size: 12px; padding: 3px 6px; border-radius: 6px; opacity: .65;
    transition: background .15s, color .15s, opacity .15s;
}
.lf-groupe button:not(.lf-poignee):hover { opacity: 1; background: var(--danger-soft); color: var(--danger); }
.ligne-facture.lf-rattachee { margin-left: 22px; }
/* Les boutons d'une facture en saisie ; sur téléphone, « Émettre » en grand,
   les autres deux par ligne — jamais une rangée qui déborde de l'écran. */
.facture-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
@media (max-width: 700px) {
    .facture-actions > .btn { flex: 1 1 calc(50% - 5px); justify-content: center; padding-left: 10px; padding-right: 10px; }
    .facture-actions > .btn-primary { flex-basis: 100%; }
}
/* La rangée de saisie : la désignation prend la place, les montants restent étroits. */
.ligne-facture { margin-bottom: 8px; border-radius: var(--radius-champ); }
/* La ligne qui arrive du catalogue s'éclaire un instant, la liste refermée
   au-dessus : on la voit se poser. Un fond et un anneau d'accent qui
   s'estompent, sans changer sa hauteur ni rien déplacer. */
.ligne-facture.lf-ajoutee { position: relative; z-index: 1; animation: lf-ajoutee 1.8s ease-out; }
@keyframes lf-ajoutee {
    0%, 35% {
        background-color: var(--accent-soft);
        box-shadow: 0 0 0 6px var(--accent-soft), 0 0 0 7.5px color-mix(in srgb, var(--accent) 55%, transparent);
    }
}
.ligne-facture .lf-lib { flex: 1; min-width: 160px; }
.ligne-facture .lf-qte { max-width: 64px; }
.ligne-facture .lf-pu { max-width: 110px; }
.ligne-facture .lf-rem { max-width: 70px; }
.ligne-facture .lf-achat { max-width: 100px; }

/* ── Glisser-déposer des lignes (lignes_ordre_controller) ─────────────
   La poignée ⠿ ouvre chaque rangée et chaque bandeau d'appareil. Elle est
   la SEULE zone qui retient le doigt (touch-action: none) : partout
   ailleurs, la page défile normalement. À l'appui elle répond tout de suite ;
   la ligne saisie se soulève et suit le pointeur, les autres s'écartent. */
.lf-poignee {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 34px; padding: 0;
    border: none; border-radius: var(--radius-btn); background: none;
    color: var(--text-soft); font-size: 18px; line-height: 1;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
    transition: background .15s, color .15s, transform .05s;
}
.lf-poignee:hover { background: var(--hover); color: var(--text); }
/* L'appui se voit à l'instant, avant même que la ligne ne bouge. */
.lf-poignee:active, .lf-en-vol .lf-poignee, .lf-pose .lf-poignee {
    background: var(--accent-soft); color: var(--accent-strong); cursor: grabbing;
}
.lf-poignee:active { transform: scale(.92); }
.lf-poignee:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Sur le bandeau, la poignée reprend la teinte de l'appareil (sans le rouge du ✕). */
.lf-groupe .lf-poignee {
    width: 24px; height: 24px; margin: -2px 0 -2px -6px;
    color: inherit; opacity: .65; font-size: 16px;
}
.lf-groupe .lf-poignee:hover, .lf-groupe .lf-poignee:active { opacity: 1; color: var(--accent-strong); background: var(--hover); }
.lf-groupe .lf-poignee:focus-visible { opacity: 1; }

/* Pendant un glissé : pas de sélection de texte, le conteneur le sait. */
.lf-tri-actif { -webkit-user-select: none; user-select: none; }
/* Les lignes qui s'écartent : un glissement doux, sur transform seulement. */
.lf-tri-actif > .lf-ecart {
    transition: transform .2s cubic-bezier(.2, .8, .2, 1);
    will-change: transform;
}
.lf-tri-actif > .lf-groupe.lf-ecart {
    transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .15s;
}
/* La ligne saisie : un fond opaque et un anneau de surface (sans changer sa
   hauteur, donc sans bouger les autres), un liseré d'accent, l'ombre du
   système. Elle passe au-dessus de ses voisines. `scale` est une propriété à
   part : le déplacement (propriété `translate`) n'en est pas multiplié. */
.lf-en-vol, .lf-pose {
    position: relative; z-index: 4;
    border-radius: var(--radius-champ);
    will-change: translate, scale;
}
.lf-en-vol {
    scale: 1.015;
    box-shadow:
        0 0 0 6px var(--surface-solid),
        0 0 0 7.5px color-mix(in srgb, var(--accent) 55%, transparent),
        var(--shadow);
    transition: scale .12s ease-out, box-shadow .12s ease-out, background-color .12s;
}
.ligne-facture.lf-en-vol { background-color: var(--surface-solid); }
/* Le bandeau soulevé garde sa teinte d'appareil, posée sur un fond plein. */
.lf-groupe.lf-en-vol {
    background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface-solid);
}
/* Posée : le relief et le fond plein retombent pendant que le ressort amène
   la ligne à sa place. */
.lf-pose {
    box-shadow: 0 0 0 0 transparent;
    transition: scale .18s ease-out, box-shadow .18s ease-out, background-color .18s;
}
/* L'appareil qui accueillerait la ligne au dépôt s'éclaire d'un liseré. */
.lf-groupe.lf-cible { box-shadow: 0 0 0 2px var(--accent); }
/* Le glissement des éléments vers leur place neuve, juste après le dépôt. */
.lf-recale { transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) {
    .lf-poignee, .lf-poignee:active { transition: none; transform: none; }
    .lf-tri-actif > .lf-ecart, .lf-tri-actif > .lf-groupe.lf-ecart, .lf-recale, .lf-pose { transition: none; }
    .lf-en-vol { scale: none; transition: none; }
}
/* Dit aux lecteurs d'écran ce que le déplacement a fait, sans rien montrer. */
.lf-annonce {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* Sur téléphone, une petite carte par ligne : la poignée à gauche sur toute
   la hauteur (une cible large pour le pouce), la désignation en entier (✕ à
   droite), puis Qté · prix · remise · €/% · ♻️ ; le prix d'achat d'occasion
   et les mentions (« sans prix », net après remise) sur leur propre ligne. */
@media (max-width: 700px) {
    .ligne-facture {
        display: grid;
        grid-template-columns: 24px 44px minmax(0, 1fr) 50px 48px 38px;
        grid-template-areas:
            "grip lib lib lib lib suppr"
            "grip qte pu rem type occ";
        align-items: center;
        gap: 5px;
        padding: 8px 8px 8px 0;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: color-mix(in srgb, var(--sunken) 60%, transparent);
    }
    .ligne-facture.lf-rattachee { margin-left: 10px; }
    /* La poignée occupe toute la hauteur de la carte : on l'attrape d'un pouce. */
    .ligne-facture .lf-poignee { grid-area: grip; align-self: stretch; width: 100%; height: auto; min-height: 44px; }
    .ligne-facture .lf-lib { grid-area: lib; min-width: 0; }
    .ligne-facture .lf-suppr { grid-area: suppr; justify-self: center; }
    .ligne-facture .lf-qte { grid-area: qte; max-width: none; }
    .ligne-facture .lf-pu { grid-area: pu; max-width: none; }
    .ligne-facture .lf-rem { grid-area: rem; max-width: none; }
    .ligne-facture .lf-remise-type { grid-area: type; max-width: none; }
    .ligne-facture .lf-occ { grid-area: occ; justify-self: center; }
    .ligne-facture .lf-achat { grid-column: 2 / -1; max-width: none; }
    .ligne-facture :is(.lf-net, .lf-sans-prix, .lf-cata) { grid-column: 2 / -1; justify-self: start; }
    .ligne-facture input, .ligne-facture select { width: 100%; padding-left: 10px; padding-right: 8px; }
    /* La colonne de la poignée a pris sa place : Qté et remise serrent leur marge intérieure. */
    .ligne-facture :is(.lf-qte, .lf-rem) { padding-left: 6px; padding-right: 4px; }
    /* Le bandeau d'appareil, lisible sur téléphone : poignée, nom et ✕ sur la
       première ligne (le nom passe à la ligne au lieu de s'écraser), l'identifiant
       en pleine largeur dessous. */
    .lf-groupe { flex-wrap: wrap; row-gap: 6px; }
    .lf-groupe > span { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
    .lf-groupe > input.lf-sn { order: 3; flex: 1 1 100%; max-width: none; margin-left: 0; }
}
/* Le nom du modèle se clique — et doit se VOIR cliquable : une barre
   bordée qui répond au survol, avec l'invite écrite en toutes lettres. */
.fc-modele-btn {
    display: flex; align-items: center; gap: 7px; width: 100%;
    padding: 8px 11px; cursor: pointer;
    border: 1.5px solid var(--border); border-radius: 10px;
    background: var(--raise);
    color: inherit; text-align: left; font: inherit; font-weight: 800; font-size: 13.5px;
    transition: border-color .15s, background .15s, transform .15s;
}
.fc-modele-btn:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.fc-modele-btn:active { transform: scale(.98); }
.fc-modele.on { border-color: var(--accent); background: var(--accent-tint); }
.fc-modele.on .fc-modele-btn { border-color: transparent; background: none; }
.fc-inviter {
    margin-left: auto; white-space: nowrap;
    font-size: 11.5px; font-weight: 700; padding: 3px 10px;
    border: 1.5px dashed var(--border); border-radius: var(--radius-pilule);
    color: var(--text-soft);
    transition: border-color .15s, color .15s;
}
.fc-modele-btn:hover .fc-inviter { border-color: var(--accent); color: var(--accent-strong); }
.fc-sel {
    margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pilule);
    background: var(--accent-soft); color: var(--accent-strong); white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
    .fc-modele-btn, .fc-modele-btn:hover, .fc-modele-btn:active { transform: none; }
}
/* Sur le document : l'en-tête de machine, puis ses réparations en retrait. */
.lg-machine td { font-weight: 700; padding-top: 16px; border-bottom: none; }
.lg-sous-machine { padding-left: 22px !important; }

/* ── Calendrier maison (champs date des filtres) ───────────────────── */
.filtre-groupe { position: relative; }
.filtre-form input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.cal-pop {
    position: absolute; z-index: 1000;
    background: var(--surface-solid); border: 1px solid var(--border);
    border-radius: 14px; padding: 12px; width: 256px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, .35);
}
.cal-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-mois { font-weight: 800; font-size: 13.5px; color: var(--text); text-transform: capitalize; }
.cal-nav {
    border: none; background: var(--accent-soft); color: var(--accent-strong);
    width: 27px; height: 27px; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1;
    transition: background .15s, color .15s;
}
.cal-nav:hover { background: var(--accent); color: var(--sur-accent); }
.cal-sem {
    display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
    font-size: 10.5px; font-weight: 800; color: var(--text-soft); margin-bottom: 4px;
}
.cal-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-jour {
    border: none; background: none; color: var(--text);
    font-size: 12.5px; font-weight: 600; padding: 6px 0; border-radius: 8px; cursor: pointer;
    transition: background .12s, color .12s;
}
.cal-jour:hover { background: var(--accent-soft); color: var(--accent-strong); }
.cal-jour.auj { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-jour.on { background: var(--degrade-actif); color: var(--sur-accent); }
.cal-pied { display: flex; justify-content: space-between; margin-top: 8px; }
.cal-lien {
    border: none; background: none; color: var(--accent-strong);
    font-size: 12px; font-weight: 700; cursor: pointer; padding: 4px 7px; border-radius: 6px;
}
.cal-lien:hover { background: var(--accent-soft); }

/* ── Bouton en attente (imports de fichiers) ───────────────────────── */
button.patiente { position: relative; opacity: .8; overflow: hidden; }
button.patiente::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 45%;
    background: rgba(255, 255, 255, .75); border-radius: 2px;
    animation: patiente-balaie 1s ease-in-out infinite alternate;
}
@keyframes patiente-balaie { from { transform: translateX(-30%); } to { transform: translateX(230%); } }

/* ── Récapitulatif vivant de la facture libre ──────────────────────── */
.fl-total {
    margin-top: 18px; padding: 13px 18px; border-radius: 12px;
    background: var(--accent-soft); border: 1.5px solid var(--accent);
    color: var(--text); font-size: 16px; font-weight: 800;
}

/* La barre d'export comptable (liste des factures) : compacte, discrète. */
.export-comptable {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin: 0 0 16px; padding: 12px 16px;
    border: 1px dashed var(--border); border-radius: 12px;
}
.export-criteres { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; flex: 1; }
/* Le bouton vit en bout de ligne — la carte tient sur une rangée. */
.export-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.export-comptable .export-titre { font-weight: 700; font-size: 14px; margin-right: 4px; }
.export-comptable .export-ou { color: var(--muted); font-size: 13px; }
.export-comptable select, .export-comptable input[type="date"] {
    width: auto; flex: 0 1 auto; padding: 8px 11px; font-size: 14px;
}
.export-comptable .btn-export { padding: 9px 18px; font-size: 14.5px; }
.export-comptable .btn-export-pdf { padding: 9px 16px; font-size: 14px; }
@media (max-width: 640px) {
    .export-actions { flex-direction: column; }
    .export-actions .btn { width: 100%; }
}

/* ── Stock — les rayons ───────────────────────────────────────────────
   Le stock se lit par rayons (catégories) : sections repliables,
   valorisation par rayon, bandeau de rangement, gestion des rayons. */

/* Le nom d'article est LE lien de sa ligne — accessible au clavier,
   sans onclick sur la ligne. */
.stk-lien {
    color: var(--text); font-weight: 700; text-decoration: none;
    transition: color .12s;
}
.stk-lien:hover { color: var(--accent-strong); text-decoration: underline; }

/* Valeur d'achat (rayon ou ligne) : des chiffres qui s'alignent. */
.stk-rayon-val {
    font-variant-numeric: tabular-nums; font-weight: 700;
    color: var(--text-soft); white-space: nowrap;
}

/* Tri par en-tête de colonne : le lien reste discret, l'actif s'accentue. */
.th-tri { color: inherit; text-decoration: none; transition: color .12s; white-space: nowrap; }
.th-tri:hover { color: var(--accent-strong); }
.th-tri.actif { color: var(--accent-strong); }

/* Le bandeau « ranger » : une invitation, pas une alarme. */
.stk-ranger {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 14px; padding: 13px 16px;
    background: linear-gradient(100deg, var(--accent-soft), transparent 55%), var(--surface);
    border: 1px solid var(--border); border-radius: 12px;
    color: var(--text); text-decoration: none; font-size: 14px;
    transition: border-color .15s, transform .15s;
}
.stk-ranger:hover { border-color: var(--accent); transform: translateY(-1px); }
.stk-ranger-ico { font-size: 20px; flex-shrink: 0; }
.stk-ranger span:nth-child(2) { flex: 1; }

/* Les articles sans rayon ouvrent la page, surlignés : à ranger sur place. */
.stk-a-ranger {
    background: linear-gradient(var(--warning-soft), transparent 70%), var(--surface);
    margin-bottom: 16px;
}
.stk-a-ranger-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stk-a-ranger-tete h2 { margin: 0; }
.stk-a-ranger-liste { max-height: 320px; overflow-y: auto; }
.stk-a-ranger-ligne {
    display: grid; grid-template-columns: 1fr auto auto;
    align-items: center; gap: 12px;
    padding: 8px 2px; border-top: 1px solid var(--border);
}
.stk-a-ranger-ligne:first-child { border-top: none; }
.stk-a-ranger-qte { color: var(--text-soft); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stk-a-ranger-ligne select { width: auto; min-width: 190px; padding: 6px 10px; font-size: 13px; }
@media (max-width: 700px) {
    .stk-a-ranger-ligne { grid-template-columns: 1fr auto; }
    .stk-a-ranger-qte { display: none; }
}

/* Intérieur des blocs repliés (ajout d'article, gestion des rayons). */
.stk-bloc { padding: 16px; }

/* La supervision à deux colonnes : le rail des boutiques à gauche, la
   fiche à droite — la liste ne devient pas un mur de tuiles à 50 clientes. */
/* Tunnel, motoculture : 2 temps / 4 temps en deux gros boutons (radios), le choisi s'allume. */
.moteur-choix { border: 0; padding: 0; min-width: 0; }
.moteur-choix legend { padding: 0; font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.moteur-boutons { display: flex; gap: 8px; }
.moteur-boutons label {
    flex: 1; display: flex; align-items: center; justify-content: center; min-height: 46px; margin: 0;
    font-size: 15px; font-weight: 650; color: var(--text-soft); cursor: pointer;
    background: var(--input-bg); border: 1.5px solid var(--border); border-radius: var(--radius-pilule);
    transition: color .15s, background .15s, border-color .15s, box-shadow .15s;
}
.moteur-boutons label:hover { color: var(--text); border-color: var(--text-soft); }
.moteur-boutons label:active { transform: scale(.97); }
.moteur-boutons label:has(input:checked) {
    color: var(--sur-accent); background: var(--degrade-actif); border-color: transparent;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 30%, transparent);
}
.moteur-boutons label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.moteur-boutons input { position: absolute; opacity: 0; pointer-events: none; }
.moteur-choix .hint { margin-top: 6px; color: var(--text-soft); font-size: 13px; }

/* Fiche dossier, motoculture : le menu 2 temps / 4 temps tient dans la case du récap. */
.pec-moteur-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.pec-moteur-form select { width: auto; min-width: 150px; padding: 6px 10px; font-size: 14px; }
.pec-moteur { display: inline-block; margin-left: 8px; }
.pec-moteur > summary { display: inline; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent-strong); list-style: none; }
.pec-moteur > summary::-webkit-details-marker { display: none; }
.pec-moteur[open] > summary { color: var(--text-soft); }
.pec-moteur[open] .pec-moteur-form { margin-top: 8px; }

/* Supervision : les SMS du mois sur le quota de la formule ; quota atteint = orange. */
.sup-sms, .sup-factures { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sup-sms-epuise { color: var(--warning); font-weight: 700; }
.sup-sms-pack { display: block; font-size: 11.5px; font-weight: 550; color: var(--text-soft); }

/* Fiche boutique : depuis quand elle est cliente, sous les compteurs. */
.sup-depuis { margin: 2px 0 0; font-size: 13.5px; }
.sup-depuis strong { color: var(--text); font-variant-numeric: tabular-nums; }
.sup-layout {
    display: grid; grid-template-columns: 285px minmax(0, 1fr);
    gap: 18px; align-items: start; margin-top: 4px;
}
.sup-rail {
    position: sticky; top: 84px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 8px;
    max-height: calc(100vh - 110px); overflow-y: auto;
}
.sup-rail .stk-rail-item { flex-wrap: wrap; }
.sup-rail .badge { font-size: 10.5px; }
.sup-rail-cherche {
    width: 100%; margin: 4px 0 8px;
    padding: 7px 10px; font-size: 13px;
}
.sup-rail-vide { padding: 10px; font-size: 12.5px; color: var(--text-soft); }
.sup-suspendue { opacity: .55; }
/* Les enseignes : un titre de groupe dans le rail, ses boutiques en retrait ;
   une ligne de groupe dans le tableau. */
.sup-rail-groupe {
    font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-soft); font-weight: 650; padding: 12px 10px 4px;
}
.sup-rail .stk-rail-item.dans-groupe { margin-left: 10px; }
/* Le titre d'une enseigne ouvre son panel : ce que voit sa direction. */
a.sup-rail-panel { display: flex; justify-content: space-between; text-decoration: none; border-radius: 8px; transition: color .12s, background .12s; }
a.sup-rail-panel:hover { color: var(--accent-strong); background: var(--accent-tint); }
.sup-rail-panel-ico { opacity: .6; }
.sup-groupe-ligne td {
    background: var(--sunken); font-weight: 650; font-size: 12.5px;
    padding: 5px 12px; border-bottom: 1px solid var(--border);
}
/* Le tableau des boutiques reste léger à cinquante lignes : cellules
   serrées, nom sur une ligne (le titre complet au survol). */
.sup-table td, .sup-table th { padding: 5px 10px; line-height: 1.3; font-size: 13px; }
.sup-table .sup-nom { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sup-table .btn-sm { padding: 4px 9px; font-size: 12px; }
/* Les comptes d'une boutique : une ligne-volet par compte — le clic sur
   la ligne ouvre tout ce qui se gère (rôle, accès, pouvoirs, mot de passe). */
.sup-compte { margin: 6px 0; }
.sup-compte summary .muted { font-weight: 400; font-size: 12.5px; margin-left: 8px; }
.sup-compte summary .badge { margin-left: 8px; }
.sup-compte-corps { padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.sup-compte-corps .grid-2 { margin-bottom: 4px; }
.sup-contenu { min-width: 0; }

/* Les volets d'une fiche (Supervision d'une boutique, fiche client… — tour UX,
   étape 3) : chaque partie se replie derrière son titre, le résumé dit
   l'essentiel (formule, adresse d'envoi, relance programmée…), un clic ouvre.
   Un volet à id ouvert le reste après un geste (volets_controller). */
.card.volet { padding: 0; margin: 0 0 12px; overflow: hidden; }
.volet > summary {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 16px 22px; cursor: pointer; list-style: none;
    transition: background .12s;
}
.volet > summary::-webkit-details-marker { display: none; }
.volet > summary::before { content: '▸'; color: var(--text-soft); flex-shrink: 0; transition: transform .15s; }
.volet[open] > summary::before { transform: rotate(90deg); }
.volet > summary:hover { background: var(--accent-tint); }
.card.volet > summary h2 { margin: 0; font-size: 18px; }
.volet-resume { margin-left: auto; color: var(--text-soft); font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; }
.volet-corps { padding: 20px 22px 22px; border-top: 1px solid var(--border); }
.volet-corps > .subtitle:first-child { margin-top: 0; }
.volet-corps h3 { margin: 22px 0 10px; font-size: 16px; }
/* Un volet vide le dit sans la grande marge d'une page vide ; son action suit. */
.empty.volet-vide { padding: 22px 12px; margin: 0; }
.volet-action { margin-top: 14px; }
/* Ce qui ouvre le corps d'un volet : ses boutons (Devis) ou un lien (Fiche client). */
.volet-corps > .volet-actions { margin-bottom: 16px; }
.volet-corps > .volet-lien { margin: -6px 0 12px; }
/* Le devis du dossier part par mail : sans adresse connue, le champ se tape à côté du bouton. */
.devis-envoi { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.devis-envoi input[type="email"] { width: 230px; max-width: 100%; }
/* Le devis rangé dans Devis : son numéro, son état, et l'alerte s'il ne suit plus le chiffrage. */
.devis-lie { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; margin: -4px 0 16px; font-size: 14px; }
.devis-lie-numero { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.devis-lie-alerte { color: var(--warning); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
    .volet > summary, .volet > summary::before { transition: none; }
}
@media (max-width: 1000px) {
    .sup-layout { grid-template-columns: 1fr; }
    .sup-rail { position: static; max-height: 260px; }
}

/* Les trois formules dans la fiche : comparer et changer sans quitter
   la page — la courante se distingue, la conseillée s'annonce. */
.abo-formules {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px; margin: 18px 0 4px;
}
.abo-formule {
    display: flex; flex-direction: column; gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--raise);
    transition: border-color .15s, transform .15s;
}
.abo-formule:hover { border-color: var(--accent); transform: translateY(-1px); }
.abo-formule.actuelle { border-color: var(--success); background: var(--success-soft); }
.abo-formule.conseillee:not(.actuelle) { border-color: var(--accent); }
.abo-f-nom { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.abo-f-prix { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.abo-f-prix small { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.abo-f-slogan { color: var(--text-soft); font-size: 12.5px; }
.abo-f-plus { font-size: 12.5px; line-height: 1.4; margin: 6px 0 10px; flex: 1; }
.abo-f-actuelle {
    text-align: center; font-size: 12.5px; font-weight: 650;
    color: var(--text-soft); padding: 7px 0;
}

/* Les gestes de l'abonnement : l'action courante d'abord, la
   résiliation à côté mais sans crier, l'explication en dessous. */
.abo-actions {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-top: 20px;
}
.abo-actions .hint { flex-basis: 100%; margin: 0; }
.abo-detail { margin-top: 20px; }
.abo-detail summary {
    cursor: pointer; font-size: 13.5px; font-weight: 650; color: var(--text-soft);
    padding: 6px 0;
}
.abo-detail summary:hover { color: var(--accent-strong); }
.abo-pied {
    margin-top: 16px; padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* Les contrôles avant vitrine : tant qu'ils ne sont pas cochés, le bloc
   se signale ; une fois en règle, il se fait discret. */
.rac-controles {
    border: 1px solid var(--warning); border-radius: var(--radius);
    background: var(--warning-soft);
    padding: 14px 16px; margin-bottom: 18px;
    transition: border-color .15s, background .15s;
}
.rac-controles.ok { border-color: var(--success); background: var(--success-soft); }
.rac-controles h3 { margin: 0 0 10px; font-size: 15px; }
.rac-check { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.rac-check input { margin-top: 3px; flex-shrink: 0; }
.rac-check strong { display: block; font-weight: 650; }
.rac-check small { color: var(--text-soft); font-size: 12.5px; line-height: 1.4; }

/* La vie d'un objet racheté : les gestes du comptoir, sur une ligne. */
.rac-vie { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rac-vie-form { display: flex; align-items: center; gap: 8px; }
.rac-vie-form input { width: 160px; }

/* Le catalogue proposé SOUS le champ (marque et modèle du tunnel) : une
   liste ancrée, jamais la datalist native qui se posait hors de l'écran. */
/* L'ancre entoure l'input SEUL : la liste tombe juste sous lui, jamais
   sous le hint qui suit. */
.cat-ancre { position: relative; }
.cat-liste {
    position: absolute; z-index: 30; left: 0; right: 0; top: 100%;
    margin-top: 3px; max-height: 280px; overflow-y: auto;
    background: var(--surface-solid); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow);
}
.cat-liste:empty { display: none; }
.cat-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    width: 100%; padding: 9px 13px;
    background: none; border: none; border-top: 1px solid var(--border);
    color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
    transition: background .12s;
}
.cat-item:first-child { border-top: none; }
.cat-item:hover, .cat-item:focus-visible { background: var(--accent-tint); }
.cat-nom { font-weight: 600; }
.cat-marque { color: var(--text-soft); font-size: 12.5px; white-space: nowrap; }

/* Les dossiers mis de côté : le comptoir s'interrompt, pas le travail. */
.steps .pause-form { margin-left: auto; align-self: center; }
.pause-carte {
    background: linear-gradient(100deg, var(--accent-soft), transparent 55%), var(--surface);
    margin-bottom: 16px;
    padding-top: 14px; padding-bottom: 10px;
}
.pause-carte h2 { margin: 0 0 6px; font-size: 16px; }
.pause-ligne {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 2px; border-top: 1px solid var(--border);
}
.pause-ligne:first-of-type { border-top: none; }
.pause-label { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pause-quand { color: var(--text-soft); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Tuile banque (Finances) : la croix se découvre au survol ---------- */
.kpi-banque { position: relative; }
.kpi-banque .kpi-label a { color: var(--accent-strong); font-weight: 650; text-decoration: none; }
.kpi-banque .kpi-label a:hover { text-decoration: underline; }
.kpi-fermer-form { position: absolute; top: 6px; right: 8px; margin: 0; }
.kpi-fermer {
    border: none; background: none; cursor: pointer; padding: 4px 7px;
    color: var(--text-soft); font-size: 12px; line-height: 1; border-radius: 8px;
    opacity: 0; transition: opacity .15s, background-color .15s;
}
.kpi-banque:hover .kpi-fermer, .kpi-fermer:focus-visible { opacity: 1; }
.kpi-fermer:hover { background: var(--hover); color: var(--text); }

/* ---------- Banque (Réglages › Banque) ---------- */
/* Réglages › Site internet : les clés d'API. La clé neuve se montre une fois, dans un cadre accent qu'on ne
   rate pas ; une clé révoquée reste dans la liste, en retrait, pour l'historique. */
.cle-neuve { margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--accent); border-radius: 12px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.cle-neuve h3 { margin: 0 0 6px; font-size: 16px; }
.cle-neuve p { margin: 0; }
.cle-neuve-valeur { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.cle-neuve-valeur code { flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; padding: 10px 12px; border-radius: var(--radius-champ); background: var(--sunken); border: 1px solid var(--border); font-size: 14px; font-variant-numeric: tabular-nums; user-select: all; }
.cles-api td { vertical-align: middle; }
.cles-api td .hint { display: block; margin-top: 2px; }
.cles-api code { font-variant-numeric: tabular-nums; color: var(--text-soft); }
.cles-api .badge + .badge { margin-left: 4px; }
.cles-api .cle-usage { color: var(--text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cles-api .cle-actions { text-align: right; white-space: nowrap; }
.cles-api .cle-actions form { display: inline; }
.cles-api tr.cle-revoquee td { opacity: .55; }
.cle-form { display: grid; gap: 14px; max-width: 560px; }
.cle-droits { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.cle-droits legend { margin-bottom: 8px; font-weight: 600; }
.cle-droits label.sw-label { align-items: flex-start; margin-bottom: 0; }
/* L'aide sous un interrupteur : en retrait du libellé, jamais au même poids. */
.cle-droits .hint, .loc-site-choix .hint { display: block; margin-top: 2px; color: var(--text-soft); font-size: 13px; font-weight: 400; }
.cle-acces { display: grid; gap: 6px; }
.cle-acces label.sw-label { margin-bottom: 0; font-size: 14px; white-space: nowrap; }
.cle-form .btn-primary { justify-self: start; }

/* Réglages › Site internet : le cadre de suivi à coller soi-même — le code à
   gauche, l'aperçu à droite. Le fond de l'aperçu figure le site de la boutique,
   clair comme le cadre lui-même (monde « suivi public », toujours clair). */
.cadre-reglages { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.cadre-code { display: grid; gap: 10px; }
.cadre-code label { font-weight: 600; font-size: 14px; }
.cadre-code textarea { min-height: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; }
.cadre-code .btn { justify-self: start; }
.cadre-code .hint { margin: 0; }
.cadre-apercu { padding: 14px; border: 1px dashed var(--border); border-radius: 12px; background: #eef1f6; }
.cadre-apercu-titre { display: block; margin-bottom: 8px; color: #667085; font-size: 11.5px; font-weight: 650; letter-spacing: .8px; text-transform: uppercase; }
.cadre-apercu iframe { display: block; width: 100%; height: 440px; border: 0; }
@media (max-width: 900px) {
    .cadre-reglages { grid-template-columns: 1fr; }
}
/* Côté boutique, le lien se lit seulement : NosWeb le tient (Supervision › Site internet). */
.cle-geree { margin: 12px 0 0; }

.banque-etat { margin: 4px 0 16px; }
.banque-orga { font-weight: 650; margin-bottom: 10px; }
.banque-comptes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.banque-compte {
    display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--radius);
    background: var(--raise);
}
.banque-compte-nom { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.banque-solde { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--accent-strong); }
.banque-option { margin: 0 0 14px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.banque-solde.hors-suivi { color: var(--text-soft); opacity: .6; text-decoration: line-through; }
.banque-compte label.sw-label { margin: 0; min-width: 0; }
/* L'encart-guide vers la clé Qonto : la main tendue avant les deux champs. */
.banque-guide {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 16px; margin-bottom: 16px;
    background: var(--raise); border: 1.5px solid var(--border); border-radius: var(--radius);
}
.banque-guide-ico { font-size: 22px; flex-shrink: 0; }
.banque-guide-txt { flex: 1; min-width: 220px; font-size: 13.5px; color: var(--text-soft); line-height: 1.5; }
.banque-guide-txt b { color: var(--text); }
.banque-guide-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* « Comment ça pointe ? » : quatre pas aérés plutôt qu'un pavé. */
.banque-etapes { display: flex; flex-direction: column; gap: 11px; margin: 2px 0 14px; }
.banque-etape { display: flex; gap: 12px; align-items: flex-start; }
.banque-etape-num {
    flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; margin-top: 1px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.banque-etape-txt { font-size: 13.5px; line-height: 1.55; color: var(--text-soft); }
.banque-etape-txt b { color: var(--text); font-weight: 650; }
.banque-astuce { margin: 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-soft); }

/* ---------- Packs de SMS (Réglages › SMS) ---------- */
.sms-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.sms-pack {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 16px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
    background: var(--raise); text-align: center;
}
.sms-pack.conseille { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sms-pack .badge { margin-bottom: 4px; }
.sms-pack-n { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.sms-pack-n small { font-size: 12px; font-weight: 700; color: var(--text-soft); }
.sms-pack-prix { font-size: 19px; font-weight: 800; color: var(--accent-strong); margin-top: 4px; }
.sms-pack-unit { font-size: 12px; color: var(--text-soft); margin-bottom: 10px; }
.sms-pack form, .sms-pack > a { width: 100%; margin-top: auto; }

/* Le lien direct de prise de rendez-vous et son QR de vitrine. */
.rdv-lien { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.rdv-lien-corps { flex: 1; min-width: 0; }
.rdv-lien-corps .v { word-break: break-all; }
.rdv-lien-qr {
    display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0;
    padding: 10px; border-radius: 10px; background: #fff; border: 1px solid var(--border);
    text-decoration: none; font-size: 11.5px; font-weight: 700; color: var(--text-soft);
}
.rdv-lien-qr img { display: block; }
.rdv-lien-qr:hover { border-color: var(--accent); }
@media (max-width: 640px) { .rdv-lien { flex-direction: column; } }

/* Les horaires d'ouverture : une ligne par jour, deux plages, un jour fermé s'efface. */
.hor-table td { vertical-align: middle; }
.hor-plage { white-space: nowrap; }
.hor-plage input[type="time"] { width: auto; display: inline-block; padding: 6px 8px; font-variant-numeric: tabular-nums; }
.hor-table tr.ferme .hor-plage { opacity: .4; }
.hor-table tr:has(input[type="checkbox"]:checked) .hor-plage { opacity: 1; }
.hor-table tr:has(input[type="checkbox"]:not(:checked)) .hor-plage { opacity: .4; }

/* Un service piloté par switch dans la fiche boutique (supervision).
   « label.… » : il faut battre « .field label » qui repasserait en block. */
label.sw-label.opt-switch { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-size: inherit; }
.opt-switch .sw { margin-top: 2px; }
.opt-corps { flex: 1; }
/* Vert = le service est actif — un état de santé, pas une préférence.
   (label.… pour l'emporter sur le bleu accent du switch générique.) */
label.opt-switch input:checked ~ .sw { background: var(--success); border-color: var(--success); }

/* Un switch générique, hors des tuiles de pouvoirs. */
label.sw-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; margin-bottom: 14px; }
.sw-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-label input:checked ~ .sw { background: var(--accent); }
.sw-label input:checked ~ .sw::after { transform: translateX(16px); }
.sw-label input:focus-visible ~ .sw { outline: 3px solid var(--accent); outline-offset: 2px; }
.sw-label input:disabled ~ .sw { opacity: .45; }
.sw-label input:disabled ~ span { color: var(--text-soft); }
/* Android : le switch Material vaut aussi pour ces labels génériques. */
:root[data-style="android"] .sw-label input:checked ~ .sw { background: var(--accent); border-color: var(--accent); }
:root[data-style="android"] .sw-label input:checked ~ .sw::after {
    /* La géométrie 18px vient de la base : seul le transform voyage. */
    background: var(--sur-accent); transform: translateX(16px) scale(1);
}

/* Les textes de SMS : les variables en chips, l'aperçu rendu, le compteur. */
.sms-gabarit { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.sms-gabarit textarea { font-family: inherit; }
.sms-variables { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 10px; }
.sms-variables .chip { cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.sms-apercu {
    display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline;
    padding: 10px 14px; border-radius: 10px; background: var(--sunken);
}
.sms-apercu .k { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); }
.sms-apercu .v { font-size: 13.5px; line-height: 1.45; }
.sms-compteur { grid-column: 2; }
.sms-compteur.neg { color: var(--danger); font-weight: 700; }

/* ---------- Agenda (rendez-vous) ---------- */
/* Un jour à la fois : la navigation tient sur une ligne, la date en évidence. */
.rdv-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.rdv-date { font-size: 18px; font-weight: 800; }
.rdv-date::first-letter { text-transform: uppercase; }
.rdv-nav-droite { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.rdv-nav-droite input[type="date"] { width: auto; }

.rdv-liste { display: flex; flex-direction: column; }
.rdv-ligne {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    padding: 12px 8px;
    border-top: 1px solid var(--border);
}
.rdv-liste > .rdv-ligne:first-child { border-top: none; }
.rdv-heure { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.rdv-duree { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-soft); }
.rdv-corps { min-width: 0; }
.rdv-qui { font-weight: 700; }
.rdv-qui .muted { font-weight: 500; margin-left: 6px; font-variant-numeric: tabular-nums; }
.rdv-quoi { color: var(--text-soft); font-size: 13px; margin-top: 2px; }
.rdv-actions { display: flex; gap: 8px; align-items: center; }
/* L'heure est passée sans pointage : la ligne s'efface, sans disparaître. */
.rdv-ligne.passe .rdv-heure { color: var(--warning); }
.rdv-ligne.annule .rdv-heure, .rdv-ligne.annule .rdv-qui { text-decoration: line-through; opacity: .55; }
.rdv-ligne.honore .rdv-heure { color: var(--success); }
/* Le titre d'un jour dans la liste « À venir » : un micro-label cliquable. */
.rdv-jour-titre {
    display: block; margin: 14px 0 2px; padding: 0 8px;
    font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-soft); text-decoration: none;
}
.rdv-jour-titre::first-letter { text-transform: uppercase; }
.rdv-jour-titre:hover { color: var(--accent-strong); }
.rdv-jour-titre + .rdv-ligne { border-top: none; }
@media (max-width: 640px) {
    .rdv-ligne { grid-template-columns: 64px minmax(0, 1fr); }
    .rdv-ligne > .badge, .rdv-actions { grid-column: 2; justify-self: start; }
}

/* Sur le tableau de bord : la carte du jour, même accent que les brouillons. */
.rdv-carte { background: linear-gradient(100deg, var(--accent-soft), transparent 55%), var(--surface); margin-bottom: 16px; }

/* Le fil du jour : une frise horizontale, les rendez-vous en pilules reliées. */
.rdvfil {
    display: flex; align-items: center; gap: 0;
    overflow-x: auto; padding: 8px 2px 6px; scroll-snap-type: x proximity;
    scrollbar-width: thin;
}
.rdvfil-item { flex-shrink: 0; scroll-snap-align: center; }
.rdvfil-bulle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: var(--radius-pilule); cursor: pointer;
    border: 2px solid var(--border); background: var(--card, transparent); color: var(--text);
    font-size: 13.5px; font-weight: 650; white-space: nowrap;
    transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
}
.rdvfil-bulle:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.rdvfil-heure { font-weight: 800; font-variant-numeric: tabular-nums; }
.rdvfil-etat { font-size: 11.5px; font-weight: 700; color: var(--text-soft); }
/* Les couleurs disent l'urgence : passé et validé, à venir, imminent, en retard. */
.rdvfil-bulle.honore { border-color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.rdvfil-bulle.honore .rdvfil-etat { color: var(--success); }
.rdvfil-bulle.absent { border-color: var(--border); opacity: .55; }
.rdvfil-bulle.absent .rdvfil-nom { text-decoration: line-through; }
.rdvfil-bulle.bientot { border-color: var(--warning); background: var(--warning-soft); }
.rdvfil-bulle.bientot .rdvfil-etat { color: var(--warning); }
.rdvfil-bulle.retard { border-color: var(--danger); background: var(--danger-soft); }
.rdvfil-bulle.retard .rdvfil-etat { color: var(--danger); }
/* Le prochain : plein, c'est lui qu'on regarde. */
.rdvfil-bulle.prochain.prevu, .rdvfil-bulle.prochain.bientot {
    border-color: transparent; color: var(--sur-accent, #fff);
    background: var(--degrade-actif);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 45%, transparent);
}
.rdvfil-bulle.prochain.prevu .rdvfil-etat, .rdvfil-bulle.prochain.bientot .rdvfil-etat { color: inherit; opacity: .9; }
.rdvfil-lien { width: 22px; height: 2.5px; background: var(--border); flex-shrink: 0; border-radius: 2px; }
.rdvfil-lien.fait { background: var(--success); }
@media (prefers-reduced-motion: reduce) { .rdvfil-bulle { transition: none; } }
.rdv-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.rdv-tete h2 { margin: 0; font-size: 16px; }

/* ── La grille de la semaine : heures en lignes, jours en colonnes, pastilles ── */
.agd-carte { padding: 0; overflow-x: auto; }
.agd {
    --agd-h: 56px;                      /* la hauteur d'une heure */
    display: grid;
    grid-template-columns: 52px repeat(7, minmax(112px, 1fr));
    grid-template-rows: auto calc(var(--agd-lignes) * var(--agd-h));
    min-width: 860px;
}
/* Les traits de la grille : plus légers que les bordures de l'app, comme Calendrier. */
.agd { --agd-trait: color-mix(in srgb, var(--border) 70%, transparent); }
.agd-coin { position: sticky; top: 0; z-index: 3; background: var(--surface-solid); border-bottom: 1px solid var(--border); }
/* L'en-tête d'un jour : le nom en petit, le numéro dans un disque — plein pour aujourd'hui. */
.agd-jour {
    position: sticky; top: 0; z-index: 3;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 6px; background: var(--surface-solid); border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-soft);
}
.agd-jour-num {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; border-radius: 50%;
    font-size: 17px; font-weight: 700; letter-spacing: 0; color: var(--text); font-variant-numeric: tabular-nums;
}
.agd-jour.auj .agd-jour-nom { color: var(--accent-strong); }
.agd-jour.auj .agd-jour-num { background: var(--accent); color: var(--sur-accent, #fff); font-weight: 800; }
.agd-jour.dim .agd-jour-num, .agd-jour.dim .agd-jour-nom { color: var(--text-soft); opacity: .7; }
.agd-jour-n {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; font-weight: 800;
}
/* Les heures : le libellé se cale sur son trait, comme dans Calendrier. */
.agd-heures { display: grid; grid-template-rows: repeat(var(--agd-lignes), var(--agd-h)); }
.agd-heure {
    position: relative; font-size: 11px; font-weight: 600; color: var(--text-soft); font-variant-numeric: tabular-nums;
    text-align: right; padding-right: 8px;
}
.agd-heure > span, .agd-heure { line-height: 1; }
.agd-heure { transform: translateY(-6px); }
.agd-col { position: relative; border-left: 1px solid var(--agd-trait); }
.agd-col.dim { background: color-mix(in srgb, var(--sunken) 45%, transparent); }
/* Chaque case vide : un « + » discret vers la prise à cette heure. */
.agd-case {
    display: flex; align-items: flex-start; justify-content: flex-end;
    height: var(--agd-h); padding: 4px 8px; border-top: 1px solid var(--agd-trait);
    color: transparent; text-decoration: none; font-weight: 800; transition: background .12s, color .12s;
}
.agd-case:hover { background: var(--hover); color: var(--accent-strong); }
/* Le trait rouge de l'heure qu'il est, dans la colonne du jour. */
.agd-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.agd-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
/* L'événement : un bloc teinté, posé à son heure, haut comme sa durée. */
.agd-rdv { position: absolute; padding: 1px 2px; z-index: 1; }
/* Les calendriers du dehors : un fantôme hachuré sous les vraies pastilles —
   « occupé ailleurs », sans détail criard et sans interaction possible. */
.agd-ext {
    position: absolute; left: 2px; right: 2px; z-index: 0;
    border: 1px dashed var(--border); border-radius: 8px;
    background: repeating-linear-gradient(-45deg, transparent 0 5px, color-mix(in srgb, var(--text-soft) 12%, transparent) 5px 7px), var(--sunken);
    padding: 3px 7px; overflow: hidden;
}
.agd-ext-txt {
    display: block; font-size: 11px; font-weight: 550; color: var(--text-soft); font-style: italic;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* La journée entière (congés, salon…) : un ruban sous le numéro du jour. */
.agd-entiere {
    display: block; max-width: 100%; margin-top: 3px; padding: 1px 7px;
    border-radius: 999px; background: var(--sunken); border: 1px dashed var(--border);
    font-size: 10.5px; font-style: italic; color: var(--text-soft);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Sous la grille : l'état des calendriers fusionnés, ou la porte pour en brancher. */
.agd-fusion {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-top: 10px; padding: 10px 14px;
    background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.agd-fusion-etat { font-size: 13px; color: var(--text-soft); }
.agd-fusion-etat b { color: var(--text); font-weight: 650; }
/* La gestion des calendriers fusionnés (Réglages › Rendez-vous). */
.agd-cals-liste { margin-bottom: 16px; }
.agd-cals-ligne {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 9px 2px; border-bottom: 1px solid var(--border);
}
.agd-cals-ligne:last-child { border-bottom: none; }
.agd-cals-nom { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agd-cals-ajout { display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .agd-cals-ajout { grid-template-columns: 1fr; } }
/* Glisser-déposer : la pastille se soulève, un fantôme marque l'heure visée. */
.agd-rdv[draggable="true"] .agd-pastille { cursor: grab; }
.agd-rdv.en-vol { opacity: .45; }
.agd-rdv.en-vol .agd-pastille { cursor: grabbing; }
.agd-fantome { position: absolute; left: 2px; right: 2px; height: 2px; z-index: 3; pointer-events: none; background: var(--accent); }
.agd-fantome::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.agd-fantome::after {
    content: attr(data-heure); position: absolute; right: 4px; top: -20px;
    padding: 2px 7px; border-radius: 6px; background: var(--accent); color: var(--sur-accent, #fff);
    font-size: 11px; font-weight: 800; line-height: 1.4; font-variant-numeric: tabular-nums;
}
.agd-pastille {
    width: 100%; height: 100%; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: baseline;
    column-gap: 6px; row-gap: 1px;
    padding: 3px 7px; overflow: hidden; text-align: left; cursor: pointer;
    border: none; border-radius: 6px;
    background: color-mix(in srgb, var(--accent) 22%, var(--surface-solid)); color: var(--accent-strong);
    box-shadow: inset 3px 0 0 var(--accent);
    font-size: 12.5px; line-height: 1.25;
    transition: transform .12s, box-shadow .15s, filter .15s;
}
.agd-pastille:hover { filter: brightness(1.06); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); z-index: 2; }
.agd-pastille.honore { background: color-mix(in srgb, var(--success) 20%, var(--surface-solid)); color: var(--success); box-shadow: inset 3px 0 0 var(--success); }
.agd-pastille.absent { background: color-mix(in srgb, var(--warning) 22%, var(--surface-solid)); color: var(--warning); box-shadow: inset 3px 0 0 var(--warning); }
.agd-pastille.annule { background: var(--sunken); color: var(--text-soft); box-shadow: inset 3px 0 0 var(--border); opacity: .7; }
.agd-pastille.annule .agd-p-nom { text-decoration: line-through; }
.agd-p-heure { font-weight: 600; font-size: 11.5px; font-variant-numeric: tabular-nums; opacity: .85; }
.agd-p-nom { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; min-width: 0; }
.agd-p-quoi { color: var(--text-soft); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-basis: 100%; }
/* Un rendez-vous court n'a qu'une ligne : l'heure, puis le nom abrégé — jamais repoussé sous la ligne, où il serait coupé. */
.agd-pastille.court { flex-wrap: nowrap; }
/* La bulle : la fiche du rendez-vous, et les gestes. */
dialog.agd-bulle { width: min(560px, 92vw); }
.rdv-nav .agd-vues { margin: 0; }

/* ── L'agenda en Année, Mois, Jour — comme Calendrier ─────────────────
   Le grand titre (en couleur pour la période en cours), ‹ › ＋ en ronds,
   le choix de la vue ; un glissé de côté change de période (pan-y : le
   geste vertical reste au défilement). */
.cal { touch-action: pan-y pinch-zoom; }
.cal-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.cal-titre { margin: 0; min-width: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; }
.cal-titre.courant { color: var(--accent-strong); }
.cal-titre-an { font-weight: 600; color: var(--text-soft); }
.cal-outils { display: flex; gap: 8px; flex-shrink: 0; }
.cal-rond {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    font-size: 22px; line-height: 1; text-decoration: none;
    transition: background .15s, transform .05s;
}
.cal-rond:hover { background: var(--hover); }
.cal-rond:active { transform: scale(.94); }
.cal-nouveau { background: var(--degrade-actif); border-color: transparent; color: var(--sur-accent, #fff); font-size: 19px; }
.cal-barre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-barre .agd-vues { margin: 0; }
.cal-aujourdhui {
    display: inline-flex; align-items: center; min-height: 40px; padding: 8px 18px;
    border-radius: var(--radius-pilule); border: 1.5px solid var(--border);
    color: var(--accent-strong); font-size: 15px; font-weight: 650; text-decoration: none;
}
.cal-aujourdhui:hover { border-color: var(--accent); }

/* L'année : douze petits mois ; aujourd'hui dans un disque, un point sous
   les jours qui ont un rendez-vous. */
.ca-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; }
.ca-mois { display: block; min-width: 0; padding: 8px; border-radius: 12px; color: var(--text); text-decoration: none; transition: background .12s; }
.ca-mois:hover { background: var(--hover); }
.ca-nom { display: block; margin: 0 0 6px 3px; font-size: 17px; font-weight: 700; }
.ca-mois.courant .ca-nom { color: var(--accent-strong); }
.ca-jours {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
    font-size: 12px; font-weight: 550; text-align: center; font-variant-numeric: tabular-nums;
}
.ca-jours > span { position: relative; z-index: 0; line-height: 24px; }
.ca-jours .auj { color: var(--sur-accent, #fff); font-weight: 800; }
.ca-jours .auj::before {
    content: ""; position: absolute; z-index: -1; left: 50%; top: 50%;
    width: 22px; height: 22px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%);
}
.ca-jours .a-rdv::after {
    content: ""; position: absolute; left: 50%; bottom: 1px;
    width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent);
}
.ca-jours .auj.a-rdv::after { content: none; }

/* Le mois : une case par jour, les rendez-vous en pastilles teintées par
   leur statut, les calendriers du dehors en gris. */
.cm-entete, .cm-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cm-entete {
    padding: 6px 0; border-bottom: 1px solid var(--border);
    font-size: 12px; font-weight: 650; color: var(--text-soft); text-align: center;
}
.cm-entete .we { opacity: .7; }
.cm-jour {
    display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 116px;
    padding: 6px 4px 8px; border-bottom: 1px solid var(--border);
    color: var(--text); text-decoration: none; overflow: hidden; transition: background .12s;
}
a.cm-jour:hover, a.cm-jour:active { background: var(--hover); }
.cm-num {
    align-self: center; display: inline-grid; place-items: center; min-width: 30px; height: 30px; margin-bottom: 2px;
    border-radius: 50%; font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.cm-jour.we .cm-num { color: var(--text-soft); }
.cm-jour.auj .cm-num { background: var(--accent); color: var(--sur-accent, #fff); font-weight: 800; }
.cm-evt {
    display: block; padding: 1px 5px; border-radius: 4px;
    background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-strong);
    font-size: 11.5px; font-weight: 600; line-height: 1.45; white-space: nowrap; overflow: hidden;
}
.cm-evt.honore { background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); }
.cm-evt.absent { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning); }
.cm-evt.annule { background: var(--sunken); color: var(--text-soft); text-decoration: line-through; }
.cm-evt.ext, .cm-evt.journee { background: var(--sunken); color: var(--text-soft); font-style: italic; }
.cm-evt.journee { border: 1px dashed var(--border); }
.cm-heure { font-weight: 500; opacity: .8; font-variant-numeric: tabular-nums; }
.cm-plus { padding-left: 5px; font-size: 11px; font-weight: 700; color: var(--text-soft); }

/* Le jour : la semaine en bandeau (le jour choisi dans un disque), puis
   la grille des heures de la semaine, réduite à une colonne. */
.cj-semaine {
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-bottom: 12px; padding: 2px 0 10px; border-bottom: 1px solid var(--border);
}
.cj-j { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); text-decoration: none; }
.cj-nom { font-size: 11.5px; font-weight: 650; color: var(--text-soft); }
.cj-num {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; transition: background .15s;
}
.cj-j:not(.choisi):hover .cj-num { background: var(--hover); }
.cj-j.we .cj-num { color: var(--text-soft); }
.cj-j.auj .cj-num, .cj-j.auj .cj-nom { color: var(--accent-strong); font-weight: 800; }
.cj-j.choisi .cj-num { background: var(--text); color: var(--surface-solid); font-weight: 700; }
.cj-j.choisi.auj .cj-num { background: var(--accent); color: var(--sur-accent, #fff); }
.cj-journee { margin: 0 0 8px; padding: 4px 10px; font-size: 12.5px; }
.cal-jour .cal-titre { font-size: 24px; }
.agd.cj-grille {
    --agd-h: 64px;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: calc(var(--agd-lignes) * var(--agd-h));
    min-width: 0; padding-top: 8px;
}
.cj-grille .agd-pastille { font-size: 14px; padding: 5px 9px; }
.cj-grille .agd-p-heure, .cj-grille .agd-p-quoi { font-size: 12.5px; }

/* ── La grille suit le style du poste : Apple par défaut (ci-dessus),
      Windows (Calendrier de Windows : blocs pleins, jour souligné),
      Android (Google Agenda : cercle du jour, blocs pleins arrondis). ── */
:root[data-style="windows"] .agd { --agd-trait: var(--border); }
:root[data-style="windows"] .agd-jour {
    justify-content: flex-start; padding: 10px 12px; gap: 8px;
    text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--text);
    border-bottom: 2px solid transparent;
}
:root[data-style="windows"] .agd-jour-num { min-width: 0; height: auto; border-radius: 0; font-size: 13px; font-weight: 700; }
:root[data-style="windows"] .agd-jour.auj { border-bottom-color: var(--accent); }
:root[data-style="windows"] .agd-jour.auj .agd-jour-num { background: none; color: var(--accent-strong); }
:root[data-style="windows"] .agd-jour.auj .agd-jour-nom { color: var(--accent-strong); }
:root[data-style="windows"] .agd-heure { transform: none; padding-top: 4px; font-size: 12px; }
:root[data-style="windows"] .agd-case { border-top-color: var(--border); }
:root[data-style="windows"] .agd-pastille {
    border-radius: 4px; box-shadow: none;
    background: var(--accent); color: var(--sur-accent, #fff);
    border-left: 4px solid color-mix(in srgb, var(--accent) 60%, #000);
}
:root[data-style="windows"] .agd-pastille:hover { filter: brightness(1.08); box-shadow: 0 2px 8px rgb(0 0 0 / .3); }
:root[data-style="windows"] .agd-pastille.honore { background: var(--success); color: #fff; border-left-color: color-mix(in srgb, var(--success) 60%, #000); box-shadow: none; }
:root[data-style="windows"] .agd-pastille.absent { background: var(--warning); color: #fff; border-left-color: color-mix(in srgb, var(--warning) 60%, #000); box-shadow: none; }
:root[data-style="windows"] .agd-pastille.annule { background: var(--sunken); color: var(--text-soft); border-left-color: var(--border); box-shadow: none; }
:root[data-style="windows"] .agd-p-heure, :root[data-style="windows"] .agd-pastille.honore .agd-p-heure { color: inherit; opacity: .85; }
:root[data-style="windows"] .agd-p-quoi { color: inherit; opacity: .8; }
:root[data-style="windows"] .agd-now { background: var(--accent); }
:root[data-style="windows"] .agd-now::before { background: var(--accent); }

:root[data-style="android"] .agd-jour { flex-direction: column; gap: 2px; padding: 8px 6px 6px; font-size: 11px; letter-spacing: .06em; }
:root[data-style="android"] .agd-jour-num { min-width: 36px; height: 36px; font-size: 20px; font-weight: 500; }
:root[data-style="android"] .agd-jour.auj .agd-jour-num { font-weight: 600; }
:root[data-style="android"] .agd-jour-n { position: absolute; top: 6px; right: 6px; }
:root[data-style="android"] .agd-heure { font-size: 10.5px; font-weight: 500; }
:root[data-style="android"] .agd-pastille {
    border-radius: 6px; box-shadow: none;
    background: var(--accent); color: var(--sur-accent, #fff);
    font-size: 12px; padding: 4px 8px;
}
:root[data-style="android"] .agd-pastille:hover { filter: brightness(1.06); box-shadow: 0 1px 3px 1px rgb(0 0 0 / .25); }
:root[data-style="android"] .agd-pastille.honore { background: var(--success); color: #fff; box-shadow: none; }
:root[data-style="android"] .agd-pastille.absent { background: var(--warning); color: #fff; box-shadow: none; }
:root[data-style="android"] .agd-pastille.annule { background: var(--sunken); color: var(--text-soft); box-shadow: none; }
:root[data-style="android"] .agd-p-heure, :root[data-style="android"] .agd-pastille.honore .agd-p-heure { color: inherit; opacity: .85; font-weight: 500; }
:root[data-style="android"] .agd-p-nom { font-weight: 500; }
:root[data-style="android"] .agd-p-quoi { color: inherit; opacity: .8; }
:root[data-style="android"] .agd-now::before { left: -6px; top: -5px; width: 12px; height: 12px; }
.agd-bulle-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.agd-bulle-etats { display: flex; gap: 6px; margin-left: auto; }

/* La prise : le formulaire, et à droite ce qui est déjà noté ce jour-là. */
.rdv-prise { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.rdv-colonne { position: sticky; top: 84px; }
.rdv-col-jour { font-weight: 800; margin-bottom: 10px; }
.rdv-col-jour::first-letter { text-transform: uppercase; }
.rdv-col-ligne {
    display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: baseline;
    padding: 7px 0; border-top: 1px solid var(--border);
}
.rdv-col-ligne:first-child { border-top: none; }
.rdv-col-heure { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.rdv-col-nom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdv-col-duree { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.rdv-col-ligne.annule .rdv-col-heure, .rdv-col-ligne.annule .rdv-col-nom { text-decoration: line-through; opacity: .55; }
.rdv-col-vide { margin: 4px 0 0; font-size: 13px; }
@media (max-width: 900px) {
    .rdv-prise { grid-template-columns: 1fr; }
    .rdv-colonne { position: static; }
}

/* La fiche : les gestes en tête, les états en chips. */
.rdv-gestes { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.rdv-statuts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.rdv-statuts .chip { cursor: pointer; }
.rdv-statuts .chip:disabled { cursor: default; }

/* Une ligne de rayon dans la gestion : édition, ordre, suppression. */
.stk-cat-ligne {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 9px 0; border-top: 1px solid var(--border); margin-top: 9px;
}
.stk-cat-ligne:first-of-type { border-top: none; }
.stk-cat-form { flex: 1; min-width: 260px; flex-wrap: nowrap; }
.stk-cat-n { font-size: 12.5px; white-space: nowrap; }

/* La quantité suggérée de la liste de courses. */
.stk-suggestion { color: var(--accent-strong); font-variant-numeric: tabular-nums; }

/* Prix et quantités : jamais coupés en deux lignes. */
.stk-prix { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Le rail des rayons : la navigation technique du stock — une colonne
   collée au défilement, chiffres alignés, trente rayons sans déborder. */
.stk-layout {
    display: grid; grid-template-columns: 295px minmax(0, 1fr);
    gap: 18px; align-items: start; margin-top: 4px;
}
/* Les noms d'articles restent sur une ligne — la table défile au besoin. */
.stk-layout .pec-table td:first-child { white-space: nowrap; }

/* Densité « outil » à côté du rail : cellules resserrées, huit colonnes
   qui tiennent. Le clic se fait sur le nom, pas sur la ligne. */
.stk-layout .pec-table th { padding: 10px 12px; }
.stk-layout .pec-table td { padding: 10px 12px; font-size: 13.5px; }
.stk-layout .pec-table tbody tr { cursor: default; }

/* Géométrie de colonnes COMMUNE à tous les rayons : chaque section est
   une table, mais les colonnes tombent au même endroit partout — l'œil
   descend de haut en bas comme dans un seul grand tableau. */
.stk-layout .pec-table { table-layout: fixed; min-width: 1010px; }
.stk-layout .pec-table th:nth-child(2) { width: 200px; } /* Référence */
.stk-layout .pec-table th:nth-child(3) { width: 130px; } /* Emplacement */
.stk-layout .pec-table th:nth-child(4) { width: 112px; } /* En stock */
.stk-layout .pec-table th:nth-child(5) { width: 86px; }  /* Achat */
.stk-layout .pec-table th:nth-child(6) { width: 86px; }  /* Vente */
.stk-layout .pec-table th:nth-child(7) { width: 86px; }  /* Valeur */
.stk-layout .pec-table th:nth-child(8) { width: 130px; } /* Fournisseur */
/* Sans le pouvoir « marges.voir », Achat et Valeur ont disparu : six colonnes,
   Vente glisse en 5e et Fournisseur en 6e — on leur redonne leur largeur. */
.stk-layout .pec-table.stk-sans-couts { min-width: 838px; }
.stk-layout .pec-table.stk-sans-couts th:nth-child(5) { width: 86px; }  /* Vente */
.stk-layout .pec-table.stk-sans-couts th:nth-child(6) { width: 130px; } /* Fournisseur */
.stk-layout .pec-table td { overflow: hidden; text-overflow: ellipsis; }
/* La quantité en stock se lit au centre de sa colonne. */
.stk-layout .pec-table th:nth-child(4),
.stk-layout .pec-table td:nth-child(4) { text-align: center; }
.stk-rail {
    position: sticky; top: 18px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 8px;
}
.stk-rail-titre {
    font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
    color: var(--text-soft); font-weight: 650; padding: 4px 10px 8px;
}
.stk-rail-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px; border-left: 3px solid transparent;
    text-decoration: none; color: var(--text);
    font-size: 13.5px; font-weight: 600;
    transition: background .12s, border-color .12s, color .12s;
}
.stk-rail-item:hover { background: var(--accent-tint); }
.stk-rail-item.actif {
    background: var(--accent-soft); border-left-color: var(--accent);
    color: var(--accent-strong);
}
.stk-rail-nom { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stk-rail-val {
    font-size: 12px; color: var(--text-soft);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stk-rail-n {
    font-size: 11.5px; font-weight: 700; color: var(--text-soft);
    background: var(--raise); padding: 1px 7px;
    border-radius: var(--radius-pilule);
    min-width: 26px; text-align: center;
    font-variant-numeric: tabular-nums;
}
.stk-rail-item.actif .stk-rail-n { background: var(--accent-soft); color: var(--accent-strong); }
.stk-rail-alerte { font-size: 11.5px; color: var(--warning); font-weight: 700; white-space: nowrap; }
.stk-rail-sep { height: 1px; background: var(--border); margin: 8px 6px; }
@media (max-width: 900px) {
    /* minmax(0, …) : une colonne « 1fr » ne descend pas sous son contenu le plus large. */
    .stk-layout { grid-template-columns: minmax(0, 1fr); }
    .stk-rail { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
    .stk-rail-titre { width: 100%; padding-bottom: 4px; }
    .stk-rail-item { flex: 1 1 44%; border: 1px solid var(--border); }
    .stk-rail-item.actif { border-color: var(--accent); }
    .stk-rail-val { display: none; }
    .stk-rail-sep { display: none; }
}

/* Le glisser-déposer du stock : la ligne saisie s'estompe, le rayon
   survolé s'allume, la poignée ⠿ réordonne les rayons. */
.stk-layout tr[data-article] { cursor: grab; }
.stk-layout tr.drag-en-cours { opacity: .45; }
.stk-rail-item.drop-cible {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1.5px var(--accent);
    color: var(--accent-strong);
}
.stk-rail-aide {
    font-size: 11.5px; color: var(--text-soft);
    padding: 10px 10px 4px; line-height: 1.45;
}

/* Créer un rayon depuis le rail, sans quitter la page. */
.stk-rail-nouveau { margin-top: 8px; padding: 0 6px; }
.stk-rail-nouveau summary {
    cursor: pointer; list-style: none;
    font-size: 13px; font-weight: 650; color: var(--text-soft);
    padding: 7px 4px; border-radius: 8px;
    transition: color .15s, background .15s;
}
.stk-rail-nouveau summary:hover { color: var(--accent-strong); background: var(--hover); }
.stk-rail-nouveau input {
    width: 100%; margin: 6px 0 8px;
    padding: 7px 10px; font-size: 13px;
}
.stk-rail-etat { display: block; font-size: 12px; color: var(--text-soft); padding: 6px 2px 0; }
@media (max-width: 900px) { .stk-rail-nouveau { display: none; } }
.stk-grip {
    cursor: grab; color: var(--text-soft); user-select: none;
    font-size: 15px; padding: 0 4px; flex-shrink: 0;
}
.stk-grip:active { cursor: grabbing; }
.stk-cat-ligne.fantome { opacity: .4; }
@media (max-width: 900px) { .stk-rail-aide { display: none; } }

/* L'inventaire chiffré : mêmes largeurs de colonnes dans tous les rayons,
   les prix et valeurs s'empilent bien droit de haut en bas. */
.inv-grille .pec-table { table-layout: fixed; min-width: 1010px; }
.inv-grille .pec-table th { padding: 10px 12px; }
.inv-grille .pec-table td {
    padding: 10px 12px; font-size: 13.5px;
    overflow: hidden; text-overflow: ellipsis;
}
.inv-grille .pec-table tbody tr { cursor: default; }
.inv-grille .pec-table th:nth-child(2) { width: 150px; } /* Référence */
.inv-grille .pec-table th:nth-child(3) { width: 128px; } /* Emplacement */
.inv-grille .pec-table th:nth-child(4) { width: 90px; }  /* Achat */
.inv-grille .pec-table th:nth-child(5) { width: 90px; }  /* Vente */
.inv-grille .pec-table th:nth-child(6) { width: 96px; }  /* Valeur */
.inv-grille .pec-table th:nth-child(7) { width: 96px; }  /* Théorique */
.inv-grille .pec-table th:nth-child(8) { width: 110px; } /* Compté */
/* Les quantités (théorique et comptée) se lisent au centre. */
.inv-grille .pec-table th:nth-child(7), .inv-grille .pec-table td:nth-child(7),
.inv-grille .pec-table th:nth-child(8), .inv-grille .pec-table td:nth-child(8) { text-align: center; }

/* La zone de dépôt de fichiers (import) : dessinée en pointillés,
   elle s'allume au survol d'un fichier. */
.depot-zone {
    border: 2px dashed var(--border); border-radius: 12px;
    padding: 24px 16px; text-align: center; cursor: pointer;
    margin-bottom: 14px;
    transition: border-color .15s, background .15s;
}
.depot-zone:hover, .depot-zone.survol { border-color: var(--accent); background: var(--accent-tint); }
.depot-ico { font-size: 26px; margin-bottom: 4px; }
.depot-noms { margin-top: 8px; font-weight: 600; color: var(--accent-strong); font-size: 13px; }

/* La détection en direct du formulaire d'ajout : le rayon deviné s'annonce. */
.hint.stk-indice-ok { color: var(--accent-strong); font-weight: 600; }

/* Le filtre des longs sélecteurs (réception) : discret au-dessus de la liste. */
.fs-filtre {
    display: block; max-width: 240px; margin-top: 6px;
    padding: 7px 11px; font-size: 12.5px;
}

/* Réception : chaque article du bon se lit en deux rangées collées —
   les valeurs du bon en haut (article, réf, qté, achat, vente), la mise
   en stock dessous (filtre, article visé, rayon), centrée. */
tr.rcp-haut td { border-bottom: none; padding-bottom: 6px; }
tr.rcp-suite td { padding-top: 0; }
.pec-table tbody tr.rcp-haut, .pec-table tbody tr.rcp-suite { cursor: default; }
.pec-table tbody tr.rcp-haut:hover, .pec-table tbody tr.rcp-suite:hover { background: transparent; }
.rcp-ref .muted { font-size: 11.5px; }
.rcp-ref input { max-width: 190px; padding: 6px 10px; font-size: 12.5px; margin: 4px 0; }
.rcp-outils {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; flex-wrap: wrap;
}
.rcp-outils .fs-filtre { margin-top: 0; flex: 0 1 210px; }
.rcp-article { flex: 0 1 340px; min-width: 220px; }
.rcp-rayon { flex: 0 1 220px; }
.rcp-etat { font-size: 11.5px; white-space: nowrap; }

/* La création de rayon à la volée, en tête d'aperçu de réception. */
.rcp-rayon-volee {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 18px; padding: 11px 16px;
    border: 1px dashed var(--border); border-radius: 12px;
    font-size: 13.5px;
}
.rcp-volee-titre { font-weight: 650; white-space: nowrap; }
.rcp-rayon-volee input { flex: 1 1 260px; max-width: 340px; padding: 8px 12px; font-size: 13.5px; }
.rcp-volee-etat { font-size: 12.5px; font-weight: 600; color: var(--accent-strong); }

/* Le rayon en tête de fiche article : un sélecteur compact, façon badge —
   choisir, c'est enregistré. */
.stk-rayon-fiche {
    display: inline-block; width: auto; max-width: 230px;
    padding: 5px 28px 5px 12px; margin-left: 8px;
    font-size: 12.5px; font-weight: 650;
    color: var(--accent-strong); background-color: var(--accent-soft);
    border: 1.5px solid transparent; border-radius: var(--radius-pilule);
    cursor: pointer; vertical-align: middle;
    transition: border-color .15s;
}
.stk-rayon-fiche:hover { border-color: var(--accent); }

/* ── Tarification de la fiche article ─────────────────────────────────
   Quatre chiffres qui se répondent : dernier achat, prix moyen pondéré,
   prix de vente, marge. */
.tar-chips {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}
.tar-chip {
    background: var(--raise); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 3px;
}
.tar-val { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tar-val.neg { color: var(--danger); }
.tar-lbl {
    font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-soft); font-weight: 650;
}

/* Le coefficient de marge, dans la gestion des rayons. */
/* input.… : la règle générale input[type="text"] (largeur 100 %) l'emportait. */
input.stk-coef { width: 74px; text-align: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.stk-coef-lu { width: 74px; text-align: center; flex-shrink: 0; font-variant-numeric: tabular-nums; } /* le coefficient en lecture seule (sans catalogue.modifier) */

/* Les codes en vue sur la fiche : fond blanc obligatoire — une douchette
   ne lit rien sur fond sombre, même à l'écran. */
.cb-visuels { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; justify-content: center; margin-bottom: 12px; }
/* Le QR de la fiche article : ancré en HAUT à droite de la carte, en
   face du nom — hors du flux, le wrap ne le fait plus descendre. */
.stk-tete { position: relative; padding-right: 118px; }
.stk-tete .ch-qr { position: absolute; top: 0; right: 0; }
/* Étiquette et Archiver : la même carrure. */
.btn-egal { min-width: 132px; justify-content: center; }
.cb-carte {
    background: #fff; border-radius: 10px; padding: 12px 16px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.cb-carte.cb-barres svg { width: 250px; height: 62px; display: block; }
.cb-carte img { display: block; }
.cb-code { color: #111; font-size: 12.5px; font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.cb-legende { font-size: 11.5px; color: var(--text-soft); text-align: center; margin-top: 5px; }

/* ── Finances — le graphe mensuel en CSS pur ──────────────────────────
   Douze mois, deux barres : ce qui rentre (accent), ce qui sort
   (orange doux). Thémable, imprimable, zéro bibliothèque. */
.fin-graphe {
    display: grid; grid-template-columns: repeat(12, 1fr);
    gap: 8px; height: 200px; align-items: end; margin-top: 8px;
}
.fin-mois { display: flex; flex-direction: column; height: 100%; min-width: 0; }
.fin-barres {
    flex: 1; display: flex; align-items: flex-end; justify-content: center;
    gap: 3px; border-bottom: 1px solid var(--border); padding-bottom: 1px;
}
.fin-barre { width: 38%; max-width: 22px; border-radius: 3px 3px 0 0; min-height: 0; }
.fin-barre.fin-vente { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.fin-barre.fin-depense { background: var(--warning); opacity: .75; }
.fin-nom {
    text-align: center; font-size: 10.5px; color: var(--text-soft);
    margin-top: 5px; white-space: nowrap; overflow: hidden;
}
.fin-legende { display: flex; gap: 18px; justify-content: center; margin-top: 12px; font-size: 12.5px; color: var(--text-soft); }
.fin-puce { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.fin-puce.fin-vente { background: var(--accent); }
.fin-puce.fin-depense { background: var(--warning); opacity: .75; }
.fin-pos { color: var(--success); }
.fin-neg { color: var(--danger); }
tr.fin-vide td { opacity: .45; }
tr.fin-total td { background: var(--sunken); border-top: 2px solid var(--border); }
/* Une ligne qui porte une destination se montre cliquable. */
tr[data-href] { cursor: pointer; }
.fin-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
/* La barre des grandes listes (Dossiers, Factures) : compte, taille de page, boutons. */
.pagination-liste { justify-content: space-between; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pagination-liste .pg-compte { font-size: 13px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.pagination-liste .pg-tailles { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); }
.pagination-liste .chip { padding: 5px 12px; font-size: 12.5px; }
.pagination-liste .pg-boutons { display: inline-flex; align-items: center; gap: 10px; }
.pagination-liste .pg-ou { font-size: 13px; color: var(--text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-aide-regime { color: var(--warning); font-weight: 600; }
.fin-aide-regime:empty { display: none; }
.fin-prevision { display: flex; gap: 22px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.fin-prevision-chips { flex: 0 1 380px; }

/* ── Appareils du client & modale ─────────────────────────────────────
   Chaque appareil est une carte compacte ; le détail des réparations
   s'ouvre dans une <dialog> native — Échap, croix ou fond pour fermer. */
.app-grille {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px; margin-bottom: 16px;
}
.app-carte {
    display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
    padding: 16px; text-align: left; width: 100%;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    cursor: pointer; font: inherit; color: var(--text);
    transition: border-color .15s, transform .15s;
}
.app-carte:hover { border-color: var(--accent); transform: translateY(-2px); }
.app-ico { font-size: 22px; }
.app-nom { font-weight: 700; font-size: 15px; }
.app-meta { font-size: 12.5px; overflow-wrap: anywhere; }

dialog.modale {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface-solid); color: var(--text);
    padding: 0; width: min(780px, 92vw);
    box-shadow: var(--shadow);
}
dialog.modale::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.modale-boite { padding: 20px; }
.modale-action { margin-top: 14px; }
.reparations-table .c-ref { width: 170px; }
.reparations-table .c-statut { width: 150px; }
.reparations-table .c-date { width: 110px; }
.reparations-table .c-montant { width: 90px; }
.reparations-table .montant-droite { text-align: right; }
.modale-tete {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; margin-bottom: 14px;
}

/* ── Accessibilité — Réglages › Apparence ─────────────────────────────
   Réglages du poste, cumulables, valables dans les cinq thèmes et les
   deux modes. Déclarés en fin de feuille : ils ont le dernier mot. */

/* Couleurs d'état distinguables (base Okabe-Ito) : succès, alerte et
   danger restent différenciables quel que soit le type de vision. */
:root[data-acc-couleurs] {
    --success: #00c48f; --success-soft: rgba(0, 196, 143, .15);
    --warning: #e69f00; --warning-soft: rgba(230, 159, 0, .15);
    --danger: #e97132; --danger-soft: rgba(233, 113, 50, .16);
}
:root[data-acc-couleurs][data-theme="light"] {
    --success: #007a59; --success-soft: rgba(0, 122, 89, .12);
    --warning: #9a6b00; --warning-soft: rgba(154, 107, 0, .14);
    --danger: #c24f00; --danger-soft: rgba(194, 79, 0, .12);
}

/* Interface calme : plus aucune animation ni transition décorative
   (liseré Néon compris) — pour les personnes sensibles au mouvement. */
:root[data-acc-calme] *,
:root[data-acc-calme] *::before,
:root[data-acc-calme] *::after {
    animation: none !important;
    transition-duration: .01ms !important;
}

/* Interface agrandie : tout prend ~12 % de plus, d'un seul geste. */
:root[data-acc-grand] body { zoom: 1.12; }

/* Contraste renforcé : bordures et textes secondaires plus francs,
   focus clavier impossible à manquer. */
:root[data-acc-contraste]:not([data-theme="light"]) {
    --border: rgba(255, 255, 255, .34);
    --text-soft: rgba(240, 242, 250, .82);
    --placeholder: rgba(240, 242, 250, .5);
}
:root[data-acc-contraste][data-theme="light"] {
    --border: rgba(0, 0, 0, .45);
    --text-soft: rgba(15, 20, 35, .8);
    --placeholder: rgba(15, 20, 35, .5);
}
:root[data-acc-contraste] :focus-visible {
    outline: 3px solid var(--accent-strong);
    outline-offset: 2px;
}

/* Les lignes-interrupteurs de la carte Accessibilité. */
.acc-lignes { display: flex; flex-direction: column; gap: 10px; }
.acc-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    font: inherit;
    text-align: left;
    color: var(--text);
    background: var(--raise);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-champ);
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.acc-ligne:hover { border-color: var(--text-soft); }
.acc-ligne.on { border-color: var(--accent); background: var(--accent-tint); }
.acc-txt b { display: block; font-weight: 650; }
.acc-txt small { color: var(--text-soft); font-size: 13px; line-height: 1.45; }
.acc-ligne.on .sw { background: var(--accent); }
.acc-ligne.on .sw::after { transform: translateX(16px); }

/* ── Ripple Material (posé par ripple_controller, thème Android) ────── */
.ripple-hote { position: relative; overflow: hidden; }
.md-ripple {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: currentColor;
    opacity: .16;
    transform: scale(0);
    animation: md-ripple .5s ease-out forwards;
}
@keyframes md-ripple {
    to { transform: scale(1); opacity: 0; }
}

/* ── Écrans tactiles — les petites cibles s'élargissent au doigt ──────
   @media (pointer: coarse) : la tablette d'atelier et le téléphone
   gagnent leurs 44px ; la souris du comptoir garde le compact. */
@media (pointer: coarse) {
    .chip { padding: 12px 18px; }
    .pagination-liste .chip { padding: 11px 16px; }
    .btn-sm { padding: 12px 16px; }
    .kpi-fermer { opacity: 1; padding: 10px 14px; font-size: 14px; }
    .sw-label { padding: 6px 0; }
}

/* ═══ L'établi — la page du scan d'atelier ══════════════════════════
   Un téléphone posé sur le banc, des doigts pleins de cambouis :
   colonne unique, boutons larges, l'essentiel à portée de pouce. */
.atl-page { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; }
.atl-tete { display: grid; gap: 10px; }
.atl-ref { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.atl-icone { font-size: 30px; line-height: 1; }
/* La référence d'abord : sur petit écran, le badge cède et passe dessous. */
.atl-ref-txt { flex: 1; min-width: 55%; }
.atl-num { margin: 0; font-size: clamp(17px, 5vw, 21px); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.atl-machine { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.atl-serie { color: var(--text-soft); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.atl-client { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-weight: 550; }
.atl-tel { color: var(--accent-strong); text-decoration: none; font-weight: 650; }
.atl-tel:hover { text-decoration: underline; }
.atl-panne { background: var(--sunken); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; color: var(--text-soft); font-weight: 550; }
.atl-compteur { font-size: 14px; color: var(--text-soft); }
.atl-compteur strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* Le chrono se mérite un bouton qu'on ne peut pas rater. */
.atl-btn-geant { width: 100%; min-height: 58px; font-size: 17px; font-weight: 700; }
.atl-chrono-live { display: grid; gap: 12px; justify-items: center; }
.atl-chrono-badge { font-size: 17px; padding: 8px 18px; font-variant-numeric: tabular-nums; }
.atl-hint { margin-top: 8px; }

.atl-pointer { margin-top: 14px; display: grid; gap: 8px; }
.atl-pointer input[name="note"] { width: 100%; }
.atl-pointer-ligne { display: flex; gap: 8px; }
.atl-pointer-ligne input[name="duree"] { max-width: 110px; }
.atl-pointer-ligne .btn { flex: 1; }
.atl-pointages { margin-top: 14px; }

.atl-form-empile { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.atl-form-empile select, .atl-form-empile input[type="text"] { flex: 1; min-width: 180px; }
.atl-vers-fiche { margin-top: 2px; }
/* Le seul lien du haut de l'établi : la fiche, sans jamais se plier. */
.atl-lien-fiche { white-space: nowrap; }

/* ═══ Le burger — la nav se replie sur petit écran ══════════════════
   Scopé à .burger : la nav minimale de l'établi, elle, reste visible. */
.burger { display: flex; align-items: center; }
.burger-btn {
    display: none;
    background: var(--raise);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 19px;
    line-height: 1;
    padding: 9px 13px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.burger-btn:hover { background: var(--hover); border-color: var(--accent); }
.burger-btn:active { transform: scale(.96); }

@media (max-width: 1200px) {
    .burger-btn { display: inline-flex; }
    .burger .topnav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px 16px 16px;
        background: var(--surface-solid);
        -webkit-backdrop-filter: blur(26px) saturate(180%);
        backdrop-filter: blur(26px) saturate(180%);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        /* La barre du haut reste collée : sans plafond, les entrées du bas
           sortaient de l'écran du téléphone, inatteignables. Le panneau
           s'arrête au bas de l'écran et défile seul, sans entraîner la page. */
        max-height: calc(100dvh - var(--burger-haut, 72px));
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
    .burger .topnav.ouvert { display: flex; }
    .burger .topnav a { padding: 13px 16px; font-size: 15.5px; }
    .burger .topnav .theme-toggle { align-self: flex-start; margin-top: 6px; }
}

/* « Plus ▾ » : ce que la ligne du menu ne peut pas montrer (motif
   « priorité + », rangement fait par burger_controller). Le bouton se
   comporte comme une entrée du menu ; il s'allume quand la page courante
   y est rangée. */
.nav-plus { position: relative; }
.nav-plus[hidden] { display: none; }
.nav-plus-btn {
    padding: 9px 14px;
    font: inherit;
    font-weight: 550;
    color: var(--text-soft);
    white-space: nowrap;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.nav-plus-btn:hover, .nav-plus.ouvert .nav-plus-btn { background: var(--hover); color: var(--text); }
.nav-plus-btn.active { background: var(--accent-soft); color: var(--accent-strong); }
.nav-plus-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    flex-direction: column;
    gap: 2px;
    min-width: 210px;
    padding: 6px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.nav-plus.ouvert .nav-plus-menu { display: flex; }
.nav-plus-menu a { padding: 10px 12px; }
/* Une notification (ticket, assistance) rangée dans « Plus » ne passe pas
   inaperçue : un point sur le bouton, comme sur l'entrée elle-même. */
.nav-plus:has(.nav-plus-menu .notif-pastille:not([hidden])) .nav-plus-btn::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    vertical-align: 2px;
    border-radius: 50%;
    background: var(--danger);
}

/* Plus large, le même repli quand les entrées ne tiennent plus dans la
   barre : burger_controller pose .replie après mesure (sinon le menu d'un
   super-admin débordait jusqu'à 1 400 px et la page défilait en largeur). */
.burger.replie .burger-btn { display: inline-flex; }
.burger.replie .topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 16px 16px;
    background: var(--surface-solid);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: calc(100dvh - var(--burger-haut, 72px));
    overflow-y: auto;
    overscroll-behavior: contain;
}
.burger.replie .topnav.ouvert { display: flex; }
.burger.replie .topnav a { padding: 13px 16px; font-size: 15.5px; }
.burger.replie .topnav .theme-toggle { align-self: flex-start; margin-top: 6px; }

/* ── La promesse de restitution, sous la date de dépôt ─── */
.ph-restit { margin-top: 10px; }
.ph-restit summary { list-style: none; cursor: pointer; }
.ph-restit summary::-webkit-details-marker { display: none; }
.ph-restit summary:hover .ph-lbl { color: var(--accent-strong); }
.ph-restit .ph-val { font-size: 16px; }
.ph-restit.en-retard .ph-val { color: var(--danger); }
.ph-restit-form { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ph-restit-form input[type="date"] { max-width: 150px; }
.ph-restit-form input[type="time"] { max-width: 100px; }
@media (max-width: 900px) { .ph-restit-form { justify-content: flex-start; } }

/* ── La plaque signalétique en photo (pré-remplissage) ─── */
.plaque-bloc { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.plaque-btn { cursor: pointer; }
.plaque-hint { margin: 0; }
.plaque-etat { width: 100%; margin: 0; font-size: 14px; font-weight: 550; color: var(--accent-strong); }

/* ═══ La location de matériel ═══════════════════════════════════════ */
.loc-resume { margin-top: 14px; }
.loc-retiree td { opacity: .55; }

/* La toile de signature : du blanc sous le trait, même en sombre. */
/* La toile de signature — contrat de location, bon de rachat : le même geste au doigt. */
.loc-toile, .sig-toile {
    display: block; width: 100%; height: 180px;
    background: #fff; border: 1.5px dashed var(--border); border-radius: var(--radius);
    touch-action: none; cursor: crosshair;
}
.loc-toile-actions, .sig-toile-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.loc-signature-img, .sig-image { background: #fff; border-radius: 10px; padding: 8px 14px; max-height: 90px; max-width: 100%; }
.sig-consigne, .sig-note { color: var(--text-soft); font-size: 13.5px; }
.sig-consigne { margin: 0 0 12px; }
.sig-note { margin: 10px 0 0; }

/* La galerie d'état des lieux : des miniatures franches, la preuve au clic. */
.loc-galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.loc-photo { position: relative; margin: 0; }
.loc-photo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); display: block; }
.loc-photo figcaption { font-size: 11.5px; color: var(--text-soft); margin-top: 3px; font-variant-numeric: tabular-nums; }
.loc-photo form { position: absolute; top: 4px; right: 4px; }
.loc-ajout-photos { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.loc-ajout-photos label { cursor: pointer; }
.loc-ajout-photos .hint { margin: 0; }

/* Le calendrier du parc : une ligne par machine, un mois d'un regard. */
.loc-cal-nav { display: flex; align-items: center; gap: 14px; }
.loc-cal-nav h2 { margin: 0; }
.loc-cal { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.loc-cal th { font-weight: 650; color: var(--text-soft); padding: 4px 2px; text-align: center; min-width: 26px; }
.loc-cal th.we { color: color-mix(in srgb, var(--text-soft) 55%, transparent); }
.loc-cal th.auj { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.loc-cal-machine { text-align: left !important; font-weight: 650; padding: 6px 10px 6px 0 !important; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.loc-cal-case { height: 30px; border: 1px solid var(--border); border-radius: 4px; }
.loc-cal-case.auj { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 45%, transparent); }
.loc-cal-case.reservee { background: color-mix(in srgb, var(--accent) 28%, transparent); cursor: pointer; }
.loc-cal-case.en_cours { background: linear-gradient(135deg, var(--accent), var(--accent-2)); cursor: pointer; }
.loc-cal-legende { display: flex; gap: 18px; margin-top: 10px; font-size: 13px; color: var(--text-soft); }
.loc-cal-puce { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.loc-cal-puce.reservee { background: color-mix(in srgb, var(--accent) 28%, transparent); border: 1px solid var(--border); }
.loc-cal-puce.en_cours { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
/* Une demande du site pas encore validée : ses jours sont gardés, en hachures — pris, mais pas encore acquis. */
.loc-cal-case.a_valider,
.loc-cal-puce.a_valider { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent) 34%, transparent) 0 4px, transparent 4px 8px); }
.loc-cal-case.a_valider { cursor: pointer; }
.loc-cal-puce.a_valider { border: 1px solid var(--border); }

/* Les demandes du site : en tête de la page Location, puis leur fiche — valider (le client, le message) ou refuser. */
.loc-demandes h2 .badge { vertical-align: 2px; margin-left: 4px; }
.loc-demandes-tel { display: block; font-variant-numeric: tabular-nums; }
.loc-demande-delai { margin-top: 0; }
.loc-demande-mot { grid-column: 1 / -1; }
.loc-livraison { grid-column: 1 / -1; }
.loc-demande-form { margin-top: 18px; }
.loc-prevenir .regime-carte:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.loc-apercu { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius-champ); background: var(--sunken); border: 1px solid var(--border); font-size: 13.5px; line-height: 1.5; }
.loc-apercu .k { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 650; letter-spacing: .6px; text-transform: uppercase; color: var(--text-soft); }
.loc-refus .hint { margin-top: 0; }

/* L'état vide qui propose l'action : la phrase, puis le bouton. */
.empty .btn { margin-top: 16px; }
.empty p { margin: 0; }

/* Le registre de la caution : trois gestes, un clic chacun. */
.loc-caution-modes { display: flex; gap: 10px; flex-wrap: wrap; }
.loc-caution-rendre { display: grid; gap: 10px; justify-items: start; }
.loc-caution-ligne { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.loc-caution-ligne input[name="retenue"] { max-width: 230px; }
.loc-caution-ligne input[name="motif"] { flex: 1; min-width: 220px; }
.loc-caution-rendre .hint { margin: 0; }
.loc-retenue { color: var(--danger); }

/* Le parc en images : une vignette par machine, le rayon en chips. */
.loc-vignette-cell { width: 64px; }
.loc-vignette { width: 56px; height: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.loc-vignette-vide { display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--sunken); }
.loc-photo-machine { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.loc-photo-machine label { cursor: pointer; }
.loc-photo-machine .hint { margin: 0; width: 100%; }
.loc-parc-actions { white-space: nowrap; }
.loc-parc-actions label { cursor: pointer; }

/* La fiche machine : on corrige la machine qu'on a, tarifs et vitrine du site compris. */
.loc-parc-nom { color: var(--text); text-decoration: none; }
.loc-parc-nom:hover strong { color: var(--accent-strong); text-decoration: underline; }
.loc-a-fixer { color: var(--warning); }
.loc-fiche-photo { width: 112px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.loc-tarifs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 18px; }
.loc-tarifs .field { margin-bottom: 12px; }
.loc-tarifs input { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .loc-tarifs { grid-template-columns: 1fr 1fr; } }
.loc-site-choix { display: grid; gap: 12px; margin: 4px 0 20px; }
.loc-site-choix label.sw-label { align-items: flex-start; margin-bottom: 0; }
.loc-fiche .card > .hint { color: var(--text-soft); font-size: 13px; margin: 0; }
.loc-fiche-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }

/* La modale des rayons et le select qui range sur place. */
.loc-cat-ligne { display: flex; gap: 8px; }
.loc-cat-ligne select { flex: 1; }
.loc-modale { border: none; border-radius: var(--radius); padding: 0; background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); width: min(440px, 92vw); }
.loc-modale::backdrop { background: rgba(8, 10, 18, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.loc-modale-corps { padding: 20px 22px 22px; }
.loc-modale-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.loc-modale-tete h2 { margin: 0; font-size: 17px; }
.loc-rayons { display: grid; gap: 8px; margin-bottom: 14px; }
.loc-rayon { display: flex; gap: 6px; align-items: center; }
.loc-rayon-renomme { display: flex; gap: 6px; flex: 1; }
.loc-rayon-renomme input { flex: 1; min-width: 0; }
.loc-rayon-ajout { display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 14px; }
.loc-rayon-ajout input { flex: 1; min-width: 0; }

/* La fiche d'une machine (fenêtre du parc et pleine page) : un aperçu qui se lit, et « Modifier » fait apparaître
   les champs à la place des valeurs — chaque case porte les deux (.mf-valeur / .mf-saisie). */
.mf { display: grid; gap: 22px; }
.mf > .flash { margin: 0; }
.mf:not(.en-edition) .mf-saisie,
.mf:not(.en-edition) .mf-vide,
.mf.en-edition .mf-valeur { display: none; }
.mf-tete { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 22px; align-items: start; }
.mf-photo img,
.mf-photo-vide { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: var(--sunken); }
.mf-photo-vide { display: flex; align-items: center; justify-content: center; font-size: 48px; }
.mf-photo .loc-photo-machine { margin-top: 10px; }
.mf-identite { min-width: 0; }
.mf-identite h2 { margin: 2px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.mf-sous { margin: 0 0 14px; color: var(--text-soft); font-weight: 550; }
.mf-etat { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; font-weight: 650; }
.mf-etat a { color: var(--accent-strong); }
.mf-pastille { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.mf-pastille-libre { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.mf-pastille-louee { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.mf-retard { color: var(--danger); }
.mf-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.mf-section h3 { margin: 0 0 10px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .8px; color: var(--text-soft); }
.mf-unite { text-transform: none; letter-spacing: 0; font-weight: 550; }
/* Les aides hors d'un champ (.field les règle déjà) : discrètes, comme les autres. */
.mf .hint { color: var(--text-soft); font-size: 13px; line-height: 1.45; }
.mf-section > .hint { margin: 8px 0 0; }
.mf-section h3 + .hint { margin: 0 0 12px; }
.mf-tarifs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mf-tarif { min-width: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--sunken); }
.mf-k { display: block; margin: 0 0 3px; font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.mf-v { font-weight: 700; overflow-wrap: anywhere; }
.mf-tarif .mf-v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mf-tarif input { font-variant-numeric: tabular-nums; }
.mf-infos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; }
.mf-info { min-width: 0; }
.mf-serie { font-variant-numeric: tabular-nums; }
.mf-texte { margin: 0; white-space: pre-line; line-height: 1.55; overflow-wrap: anywhere; }
.mf-prochaines ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mf-prochaines a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; transition: border-color .15s, background-color .12s; }
.mf-prochaines a:hover { border-color: var(--accent); background: var(--accent-tint); }
.mf-dates { font-weight: 700; font-variant-numeric: tabular-nums; }
.mf-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mf-enregistre { margin: 0 0 18px; }
/* Le parc : la ligne entière ouvre la fiche. */
.mf-ligne { cursor: pointer; }
/* La fenêtre : la croix reste à portée quand la fiche défile. */
.mf-fenetre:focus { outline: none; }
.mf-fenetre { width: min(800px, 94vw); max-height: min(92dvh, 960px); overflow-y: auto; overscroll-behavior: contain; }
.mf-fenetre .mf-fermer { position: sticky; top: 10px; z-index: 2; display: flex; margin: 10px 10px -40px auto; background: var(--surface-solid); }
.mf-fenetre turbo-frame { display: block; padding: 22px 24px 24px; }
.mf-fenetre turbo-frame[busy] { opacity: .55; transition: opacity .15s; }
.mf-fenetre .mf-tete,
.mf-fenetre .mf-enregistre,
.mf-fenetre .mf > .flash { margin-right: 40px; }
.mf-attente { margin: 48px 0; text-align: center; color: var(--text-soft); }
@media (max-width: 640px) {
    .mf-tete { grid-template-columns: 1fr; }
    .mf-photo { max-width: 340px; }
    .mf-tarifs,
    .mf-infos { grid-template-columns: 1fr 1fr; }
    .mf-fenetre turbo-frame { padding: 16px; }
}
.loc-select-rayon { padding: 7px 10px; font-size: 13.5px; max-width: 180px; }

/* Tête de bloc : le titre à gauche, l'action à droite. */

/* La première connexion : une seule chose à faire, au centre. */
.pc-page { max-width: 480px; margin: 40px auto 0; }

/* ── Validation visible (validation_visible_controller) : le blocage
   d'un formulaire se voit — champ surligné, bandeau près du bouton. ── */
.champ-bloquant {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

.form-bloque {
    margin: 12px 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--danger-soft);
    color: var(--danger);
    font-weight: 600;
    font-size: .92rem;
}

/* Une ligne qui décrit sans compter : dit en clair, à côté du prix vide. */
.lf-sans-prix {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--warning);
    white-space: nowrap;
    align-self: center;
}

/* Le net après remise, lisible sur la ligne même (facture libre). */
.lf-net {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--accent-strong);
    white-space: nowrap;
    align-self: center;
}

/* ── Code postal → ville (cp_ville_controller) : les communes proposées
   en pilules sous le champ d'adresse. ── */
.cpv-liste {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.cpv-choix {
    font: inherit;
    font-size: 12.5px;
    font-weight: 650;
    cursor: pointer;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    background: var(--surface-solid);
    color: var(--text);
    padding: 4px 12px;
    transition: border-color .15s, color .15s;
}

.cpv-choix:hover { border-color: var(--accent); color: var(--accent-strong); }

/* Le n° de série au bandeau machine de la facture libre : discret,
   dans le fil du bandeau. */
.lf-groupe .lf-sn {
    font-size: 12.5px;
    max-width: 160px;
    padding: 4px 10px;
    margin-left: 8px;
}

/* L'adresse en trois champs : la rue au-dessus, CP et ville côte à côte. */
.adr-cp-ville { display: flex; gap: 8px; margin-top: 8px; }

.adr-cp-ville input[name$="Cp"] { max-width: 110px; }

.adr-cp-ville input[name$="Ville"] { flex: 1; }

/* Fiche client : pays sous code postal / ville, et le « proposé à partir de l'adresse ». */
.adr-pays { margin-top: 8px; max-width: 260px; }
.hint-propose { color: var(--warning); font-weight: 600; }

/* Annuaire officiel des entreprises : le bouton à côté de la société, la liste des résultats dessous. */
.annuaire-ligne { display: flex; gap: 8px; align-items: stretch; }
.annuaire-ligne input { flex: 1; min-width: 0; }
.annuaire-ligne .btn { white-space: nowrap; }
.annuaire-resultats { margin-top: 8px; }
.annuaire-message { margin: 0; font-size: 13.5px; color: var(--text-soft); }
.annuaire-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.annuaire-choix {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%;
    padding: 9px 12px; text-align: left; font: inherit; color: var(--text);
    background: var(--surface-solid); border: 1.5px solid var(--border); border-radius: var(--radius-champ);
    cursor: pointer; transition: border-color .15s, background .15s;
}
.annuaire-choix:hover, .annuaire-choix:focus-visible { border-color: var(--accent); background: var(--accent-tint); outline: none; }
.annuaire-choix.ferme { opacity: .75; }
.annuaire-detail { flex-basis: 100%; font-size: 12.5px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.card-rappel .rappel-ligne { margin-top: 8px; }
.card-rappel .rappel-ligne:first-child { margin-top: 0; }

/* Le choix € / % de la remise de ligne : collé au champ, compact. */
.lf-remise-type { max-width: 60px; padding-left: 8px; padding-right: 6px; }

/* Plusieurs communes pour un code postal : la liste déroulante sous la ville. */
.cpv-select { margin-top: 6px; width: 100%; }

/* Le premier prix d'une réparation « à saisir » part au catalogue : le
   badge le dit, puis s'efface. */
.lf-cata {
    font-size: 12px;
    font-weight: 650;
    color: var(--success);
    white-space: nowrap;
    align-self: center;
}

/* La pilule scindée du catalogue : le nom ajoute la ligne, « à saisir ✏️ »
   fixe le prix sur place — une seule pilule à l'œil. */
.fc-rep-scindee { padding: 0; overflow: hidden; cursor: default; }

.fc-rep-scindee .fc-rep-nom {
    font: inherit; color: inherit; cursor: pointer;
    background: none; border: none;
    padding: 7px 4px 7px 12px;
    display: inline-flex; align-items: center; gap: 7px;
}

.fc-rep-scindee .fc-rep-nom:hover { color: var(--accent-strong); }

.fc-prix-fixer {
    font: inherit; font-size: 12.5px; cursor: pointer;
    background: none; border: none;
    border-left: 1px dashed var(--border);
    padding: 7px 12px 7px 9px;
    transition: color .15s, background .15s;
}

.fc-prix-fixer:hover { color: var(--accent-strong); background: var(--accent-soft); font-style: normal; }

.lf-modale-prix .modale-boite { min-width: 320px; }

/* Le rappel de la réparation chiffrée dans la modale : le nom en clair,
   sa machine dessous — l'erreur de clic se voit ici. */
.lf-mp-rep { margin: 8px 0 16px; display: grid; gap: 3px; }

.lf-mp-rep b { font-size: 16px; letter-spacing: -.01em; }

.lf-mp-rep .muted { font-size: 13px; }

/* ═══ Les Réglages, façon Apple ═════════════════════════════════════
   L'accueil (/reglages) est la liste groupée de l'app Réglages ; les
   pages s'ouvrent dans un cadre façon Réglages Système du Mac — la même
   liste en barre latérale. Les carrés colorés reprennent les couleurs
   système d'Apple : une palette d'icônes fixe, comme celle du thème Apple. */
.reg-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 29px;
    height: 29px;
    border-radius: 7px;
    font-size: 16px;
    line-height: 1;
    background: var(--ico, #8e8e93);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .25);
}
.reg-ico.ico-gris { --ico: #8e8e93; }
.reg-ico.ico-bleu { --ico: #0a84ff; }
.reg-ico.ico-vert { --ico: #30d158; }
.reg-ico.ico-indigo { --ico: #5e5ce6; }
.reg-ico.ico-orange { --ico: #ff9f0a; }
.reg-ico.ico-violet { --ico: #bf5af2; }
.reg-ico.ico-rose { --ico: #ff375f; }
.reg-ico.ico-cyan { --ico: #32ade6; }
.reg-ico.ico-rouge { --ico: #ff453a; }

.reg-menu { display: flex; flex-direction: column; gap: 24px; }
.reg-groupe-titre { margin: 0 0 7px 16px; font-size: 12.5px; font-weight: 650; letter-spacing: .6px; text-transform: uppercase; color: var(--text-soft); }
/* Les listes « inset grouped » : un bloc arrondi, des lignes, des filets
   qui commencent après l'icône — le dessin de l'app Réglages. */
.reg-liste {
    overflow: hidden;
    background: var(--surface);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.reg-ligne {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 9px 14px;
    font-size: 16px;
    color: var(--text);
    text-decoration: none;
    transition: background .12s;
}
.reg-ligne + .reg-ligne::before { content: ''; position: absolute; top: 0; right: 0; left: 55px; border-top: 1px solid var(--border); }
.reg-ligne:hover { background: var(--accent-tint); }
.reg-ligne:active { background: var(--hover); }
.reg-label { flex: 1; min-width: 0; }
.reg-valeur { font-size: 15px; color: var(--text-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Une page d'une formule supérieure : elle reste en vue, discrète, avec son cadenas. */
.reg-verrou { flex-shrink: 0; font-size: 13px; opacity: .75; }
.reg-ligne:has(.reg-verrou) .reg-label { color: var(--text-soft); }
.reg-menu-accueil { max-width: 680px; }
.reg-menu-accueil .reg-ligne::after { content: '›'; font-size: 22px; line-height: 1; color: var(--text-soft); opacity: .75; }

/* La boutique en tête, comme la carte de l'identifiant Apple. */
.reg-carte {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 680px;
    margin-bottom: 28px;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    background: var(--surface);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: background .12s;
}
.reg-carte::after { content: '›'; margin-left: auto; font-size: 22px; color: var(--text-soft); opacity: .75; }
.reg-carte:hover { background: var(--accent-tint); }
.reg-carte-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--degrade-actif);
    color: var(--sur-accent);
    font-size: 26px;
    font-weight: 800;
}
.reg-carte-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.reg-carte-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.reg-carte-txt strong { font-size: 19px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reg-carte-txt span { font-size: 13.5px; color: var(--text-soft); }

/* La même liste en barre latérale : compacte, sans chevron, l'entrée
   courante en plaque d'accent — la colonne des Réglages Système. */
.reg-menu-barre { gap: 16px; }
.reg-menu-barre .reg-groupe-titre { margin-left: 10px; font-size: 11px; }
.reg-menu-barre .reg-liste { overflow: visible; background: none; border: none; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.reg-menu-barre .reg-ligne { min-height: 36px; gap: 10px; padding: 6px 10px; font-size: 14px; border-radius: 8px; }
.reg-menu-barre .reg-ligne + .reg-ligne::before { content: none; }
.reg-menu-barre .reg-ico { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.reg-menu-barre .reg-ligne.actif { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
.reg-menu-barre .reg-valeur { display: none; }

/* Une sous-entrée : un outil rangé sous son entrée (Saisie rapide sous
   Catalogue & prix). Pas de carré coloré — un petit emoji, aligné sur le
   libellé de l'entrée mère, et une ligne plus discrète. */
.reg-sous-ico { flex-shrink: 0; width: 16px; text-align: center; font-size: 14px; line-height: 1; }
.reg-menu-barre .reg-sous { min-height: 30px; padding-left: 42px; gap: 8px; font-size: 13px; color: var(--text-soft); }
.reg-menu-barre .reg-sous-ico { width: 12px; font-size: 12px; }
/* Dans la colonne resserrée (tablette), « Importer un catalogue » tient sur sa
   ligne : un libellé de sous-entrée se coupe aux points de suspension plutôt
   que de se replier sous son emoji. */
.reg-menu-barre .reg-sous .reg-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Allumée, une sous-entrée prend la plaque d'accent d'une entrée active (.reg-ligne.actif). */
.reg-menu-barre .reg-sous:not(.actif):hover { color: var(--text); }
/* En accueil (téléphone) : une ligne normale à chevron, indentée pour que
   l'emoji tombe sous le libellé de l'entrée mère — le filet, lui, part du
   même endroit que celui des autres lignes. */
.reg-menu-accueil .reg-sous { padding-left: 55px; gap: 10px; font-size: 15px; }

.reg-cadre { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 28px; align-items: start; }
/* La page ne force jamais la grille : un tableau large défile dans son
   .table-wrap au lieu de pousser la colonne hors de l'écran. */
.reg-page { min-width: 0; }
.reg-cote { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }
.reg-retour { display: none; }
/* Fenêtre moyenne et tablette : la barre latérale se resserre, mais reste. */
@media (max-width: 999px) {
    .reg-cadre { grid-template-columns: 196px minmax(0, 1fr); gap: 20px; }
}
/* Écran de téléphone : la page seule, un retour vers l'accueil en liste. */
@media (max-width: 699px) {
    .reg-cadre { display: block; }
    .reg-cote { display: none; }
    .reg-retour { display: inline-flex; margin-bottom: 6px; font-weight: 600; color: var(--accent-strong); text-decoration: none; }
}
/* Le lien « Réglages » du menu : la première page sur ordinateur et
   tablette, l'accueil en liste sur téléphone (règles du mode app). */
.topnav a.telephone-seulement { display: none; }

/* La barre « Pour la comptable » de Finances : les deux journaux de l'année. */
.compta-barre {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 14px;
    border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface);
}
.compta-titre { margin-right: auto; font-size: 14px; font-weight: 700; }
@media (max-width: 700px) {
    .compta-titre { flex-basis: 100%; }
    .compta-barre .btn { flex: 1 1 calc(50% - 4px); justify-content: center; }
}

/* ── Les journaux de la comptable (Factures › Export, Finances) ──────
   Un bloc par journal : ce qu'il contient, ses chiffres, son bouton. */
.journaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.journal {
    display: flex; flex-direction: column; gap: 10px; padding: 16px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--raise);
}
.journal h3 { margin: 0; font-size: 16px; }
.journal-quoi { margin: 0; font-size: 13px; color: var(--text-soft); }
.journal-chiffres { display: grid; gap: 6px; margin: 0; }
.journal-chiffres > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.journal-chiffres dt { color: var(--text-soft); }
.journal-chiffres dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal-total { padding-top: 6px; border-top: 1px solid var(--border); }
.journal-total dt, .journal-total dd { font-weight: 800; color: var(--text); }
.journal > .btn { align-self: flex-start; margin-top: auto; }
/* Le même journal en deux formats : l'Excel pour la comptable, le PDF pour lire ou imprimer. */
.journal-boutons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
@media (max-width: 700px) {
    .journal > .btn { align-self: stretch; justify-content: center; }
    .journal-boutons .btn { flex: 1 1 0; justify-content: center; }
}

/* ── 📷 Scanner avec l'appareil photo — la douchette du téléphone ──────
   Le bouton se pose dans le champ, à droite, sur écran tactile seulement
   (scan-possible : le navigateur donne accès à la caméra) ; sur ordinateur,
   la douchette reste reine et rien ne change. */
.scan-champ { position: relative; display: block; }
.scan-champ-court { flex: 0 1 220px; min-width: 0; }
.scan-champ-bon { flex: 0 1 220px; min-width: 0; }
.scan-champ-plein { display: block; width: 100%; }
.scan-bouton { display: none; }
@media (hover: none) and (pointer: coarse) {
    .scan-champ.scan-possible > .scan-bouton {
        display: grid; place-items: center;
        position: absolute; z-index: 2; top: 50%; right: 5px; transform: translateY(-50%);
        width: 40px; height: 40px; padding: 0;
        border: none; border-radius: 10px;
        background: var(--accent-soft); color: var(--accent-strong);
        font-size: 20px; line-height: 1; cursor: pointer;
        transition: transform .05s;
    }
    .scan-champ.scan-possible > .scan-bouton:active { transform: translateY(-50%) scale(.92); }
    .scan-champ.scan-possible:not(.scan-champ-large) > input { padding-right: 52px; }
    /* Le grand bouton, sous le champ (la prise en charge : scanner y est le geste principal). */
    .scan-champ-large.scan-possible { display: flex; flex-direction: column; }
    .scan-champ-large.scan-possible > .scan-bouton {
        order: 2; position: static; transform: none;
        display: flex; align-items: center; justify-content: center; gap: 8px;
        width: 100%; height: auto; min-height: 50px; margin-top: 10px;
        border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 12px;
        font-size: 17px; font-weight: 700;
    }
    .scan-champ-large.scan-possible > .scan-bouton:active { transform: scale(.98); }
}

/* Le viseur : plein écran, noir comme l'appareil photo de l'iPhone (quel que
   soit le thème — on regarde l'image, pas l'app), un cadre où viser, qui
   passe au vert quand le code est lu. */
dialog.scan-feuille {
    position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
    margin: 0; padding: 0; border: none; overflow: hidden;
    background: #000; color: #fff;
}
dialog.scan-feuille::backdrop { background: #000; }
.scan-feuille video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-viseur {
    position: absolute; left: 50%; top: 42%; width: min(80vw, 380px); aspect-ratio: 16 / 10;
    transform: translate(-50%, -50%); border-radius: 18px;
    outline: 3px solid rgb(255 255 255 / .9);
    box-shadow: 0 0 0 100vmax rgb(0 0 0 / .45);   /* tout le reste assombri */
    transition: outline-color .15s;
}
.scan-feuille.lu .scan-viseur { outline-color: var(--success); }
.scan-feuille:has(.scan-erreur:not(:empty)) .scan-viseur { display: none; }   /* pas de caméra : rien à viser */
.scan-bas {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 28px 20px calc(22px + env(safe-area-inset-bottom));
    text-align: center; background: linear-gradient(transparent, rgb(0 0 0 / .75) 35%);
}
.scan-message { margin: 0 0 8px; font-size: 16px; font-weight: 600; text-wrap: balance; }
.scan-erreur { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: #ffb4a8; text-wrap: balance; }
.scan-erreur:empty { display: none; }
.scan-boutons { display: flex; justify-content: center; gap: 12px; }
.scan-annuler, .scan-lampe {
    min-height: 48px; padding: 12px 28px; border: none; border-radius: var(--radius-pilule);
    background: rgb(255 255 255 / .18); color: #fff; font: inherit; font-size: 17px; font-weight: 650;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); cursor: pointer;
}
.scan-lampe[hidden] { display: none; }
.scan-annuler:active, .scan-lampe:active { background: rgb(255 255 255 / .3); }

/* ── Installer KronoFix sur l'écran d'accueil (accueil, téléphone et tablette) ──
   Caché d'office (attribut hidden) : installer_app_controller ne l'ouvre
   que sur écran tactile, hors app installée, tant qu'il n'a pas été masqué. */
.installer-app { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; padding: 16px; }
.installer-app[hidden], .installer-app [hidden] { display: none !important; }
.installer-icone { flex-shrink: 0; width: 56px; height: 56px; border-radius: 13px; box-shadow: 0 1px 4px color-mix(in srgb, #000 30%, transparent); }
.installer-corps { min-width: 0; }
.installer-titre { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; }
.installer-texte { margin: 3px 0 0; font-size: 14px; color: var(--text-soft); }
.installer-etapes { margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; }
.installer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.installer-actions .btn { min-height: 40px; }
/* Le pictogramme « Partager » de Safari, dessiné en CSS : un bac ouvert,
   une flèche qui en sort — reconnu d'un coup d'œil sur l'iPhone. */
.glyphe-partage {
    position: relative;
    display: inline-block;
    width: 12px;
    height: 11px;
    margin: 0 1px 0 3px;
    border: 1.6px solid currentColor;
    border-top: none;
    border-radius: 0 0 2.5px 2.5px;
    color: var(--accent-strong);
    vertical-align: -1px;
}
.glyphe-partage::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 3px;
    width: 1.6px;
    height: 12px;
    background: currentColor;
    transform: translateX(-50%);
}
.glyphe-partage::after {
    content: '';
    position: absolute;
    left: 50%;
    top: -4px;
    width: 5px;
    height: 5px;
    border-top: 1.6px solid currentColor;
    border-left: 1.6px solid currentColor;
    transform: translateX(-50%) rotate(45deg);
}

/* ═══ KronoFix en mode app — téléphones et tablettes ══════════════════
   Sur écran tactile (hover: none, pointer: coarse), l'app se tient comme
   une app iOS : barre du haut compacte et translucide avec retour « ‹ »
   et titre qui s'y installe au défilement, barre d'onglets en bas, menu
   « Plus » en feuille qui monte du bas. Tablette en paysage : barre
   latérale façon iPad. L'ordinateur (souris) n'est pas concerné. */

.onglets, .plus-voile, .plus-tete, .barre-retour, .barre-fermer, .barre-titre, .logout-txt, .app-seulement, .steps-compact, .tel-seulement { display: none; }
/* Le volet des filtres : un simple titre sur téléphone, invisible sur ordinateur (toujours déplié). */
.filtre-repli > summary { display: none; }

@media (hover: none) and (pointer: coarse) {
    a, button, input, select, textarea, label, summary {
        touch-action: manipulation;           /* plus de délai de double-tap */
        -webkit-tap-highlight-color: transparent;
    }
    /* Sous 16 px, l'iPhone zoome tout seul sur le champ qu'on touche.
       :where() = spécificité nulle : les petits champs remontent à 16 px,
       les grands qui l'imposent (le scan IMEI, 27 px) gardent leur taille. */
    :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { font-size: 16px !important; }
    .app-seulement { display: flex; }
    /* Devis | Factures : deux moitiés égales, comme un sélecteur iOS. */
    .segments-ventes { flex-wrap: nowrap; margin-bottom: 14px; }
    .segments-ventes a { flex: 1; justify-content: center; }

    /* La barre du haut. Le verre passe sur un pseudo-élément : un
       backdrop-filter sur la barre elle-même capturerait la feuille « Plus »
       (position fixe) au lieu de la laisser se poser sur l'écran. */
    .topbar {
        min-height: 52px;
        padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
        background: transparent;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        border-bottom-color: transparent;
        transition: border-color .2s;
    }
    .topbar::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        background: var(--topbar-bg);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        backdrop-filter: blur(20px) saturate(180%);
    }
    /* Le filet n'apparaît que quand le contenu passe dessous. */
    .topbar.defile { border-bottom-color: var(--border); }
    .topbar:has(.burger.ouvert) { z-index: 80; }   /* la feuille passe au-dessus des onglets */
    .brand-by, .burger-btn { display: none; }
    .brand-mark { width: 32px; height: 32px; }
    .topbar.a-retour .brand { display: none; }
    .barre-retour {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        min-height: 44px;
        padding-right: 8px;
        font-size: 17px;
        font-weight: 500;
        color: var(--accent-strong);
        text-decoration: none;
    }
    .barre-retour span { font-size: 32px; font-weight: 400; line-height: 0; transform: translateY(-2px); }
    .barre-retour:active { opacity: .5; }
    .barre-titre {
        display: block;
        position: absolute;
        left: 50%;
        top: calc(env(safe-area-inset-top) + 8px);
        max-width: 52%;
        line-height: 36px;
        font-size: 17px;
        font-weight: 650;
        color: var(--text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transform: translateX(-50%);
        opacity: 0;
        transition: opacity .2s;
        pointer-events: none;
    }
    .topbar.titre-visible .barre-titre { opacity: 1; }
    /* Avec un retour à gauche, le titre se resserre (et s'abrège) plutôt que de le chevaucher. */
    .topbar.a-retour .barre-titre { max-width: calc(100% - 236px); }
    /* Le titre arrive, le nom de la marque et l'emoji du secteur s'effacent
       (le logo reste) : ils ne se chevauchent jamais. */
    .brand-name, .brand-secteur { transition: opacity .2s; }
    .topbar.titre-visible :is(.brand-name, .brand-secteur) { opacity: 0; }

    /* Le grand titre de la page, à l'iOS : gros, serré. */
    main .page-head h1, main .show-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; }

    /* Le contenu ne passe jamais sous la barre d'onglets. */
    main.container { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

    /* Le technicien au comptoir : une ligne de pilules qui défile au doigt. */
    .techbar { flex-wrap: nowrap; overflow-x: auto; padding: 8px max(16px, env(safe-area-inset-left)); scrollbar-width: none; }
    .techbar::-webkit-scrollbar { display: none; }
    .techbar-lbl, .techbar form { flex-shrink: 0; white-space: nowrap; }

    /* ── La barre d'onglets ── */
    .onglets {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        padding: 5px max(6px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
        background: var(--topbar-bg);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid var(--border);
    }
    .onglet {
        /* Chaque onglet part de la largeur de son libellé : « Devis/Factures »
           tient en entier sans rogner les autres. */
        flex: 1 1 auto;
        min-width: 0;
        min-height: 49px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 2px 0;
        border: none;
        background: none;
        font: inherit;
        color: var(--text-soft);
        text-decoration: none;
        cursor: pointer;
    }
    /* Emoji au repos en gris, en couleur une fois l'onglet actif. */
    .onglet-ico { font-size: 22px; line-height: 28px; filter: grayscale(1); opacity: .6; transition: filter .15s, opacity .15s, transform .1s; }
    .onglet-lbl { max-width: 100%; font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .onglet.actif { color: var(--accent-strong); }
    .onglet.actif .onglet-ico { filter: none; opacity: 1; }
    .onglet:active .onglet-ico { transform: scale(.88); }
    .onglet-ico.onglet-plus { font-size: 13px; font-weight: 800; letter-spacing: 1.5px; filter: none; opacity: 1; color: inherit; }
    /* Le geste n° 1 du comptoir, au centre : la nouvelle prise en charge. */
    .onglet-nouvelle .onglet-ico {
        width: 46px;
        height: 30px;
        border-radius: var(--radius-pilule);
        background: var(--degrade-actif);
        color: var(--sur-accent);
        font-size: 22px;
        line-height: 30px;
        text-align: center;
        filter: none;
        opacity: 1;
        box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
    }

    /* ── La feuille « Plus » : le menu monte du bas, se ferme d'un glissé ── */
    .burger .topnav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 70;
        max-height: min(82dvh, 700px);
        padding: 0 max(14px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
        background: var(--surface-solid);
        border: none;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -10px 40px color-mix(in srgb, #000 35%, transparent);
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateY(105%);
        visibility: hidden;
        transition: transform .45s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .45s;
    }
    .burger .topnav.ouvert {
        transform: none;
        visibility: visible;
        transition: transform .45s cubic-bezier(.32, .72, 0, 1), visibility 0s;
    }
    .plus-voile {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 69;
        background: color-mix(in srgb, #000 40%, transparent);
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s;
    }
    .burger.ouvert .plus-voile { opacity: 1; pointer-events: auto; }
    html:has(.burger.ouvert) { overflow: hidden; }
    .plus-tete {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 1;
        padding: 7px 0 8px;
        background: var(--surface-solid);
        touch-action: none;                    /* le glissé est pour la feuille */
        cursor: grab;
    }
    .plus-poignee { width: 36px; height: 5px; margin-bottom: 8px; border-radius: var(--radius-pilule); background: var(--text-soft); opacity: .45; }
    .plus-titre { font-size: 17px; font-weight: 700; }
    .burger .topnav .nav-onglet { display: none; }
    .burger .topnav a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 50px;
        padding: 12px 4px;
        font-size: 17px;
        border-radius: 0;
        border-bottom: 1px solid var(--border);
        background: none;
    }
    .burger .topnav a::after { content: '›'; font-size: 24px; line-height: 1; color: var(--text-soft); }
    .burger .topnav a.active { background: none; color: var(--accent-strong); }
    .burger .topnav a:active { background: var(--hover); }
    .burger .topnav .logout { justify-content: flex-start; gap: 4px; color: var(--danger); border-bottom: none; }
    .burger .topnav .logout::after { content: none; }
    .logout-txt { display: inline; }
    .burger .topnav .theme-toggle { align-self: flex-start; margin: 12px 0 2px; }
}

/* Téléphone : l'écran est étroit, chaque pixel de marge compte. La page
   et ses cartes ne cumulent plus 104 px de marges sur 375. */
@media (hover: none) and (pointer: coarse) and (max-width: 600px) {
    main.container { padding-left: 12px; padding-right: 12px; padding-top: 18px; }
    .card { --carte-pad-x: 16px; --carte-pad-y: 20px; padding: var(--carte-pad-y) var(--carte-pad-x); }
    .tiers-block { padding: 14px 12px; }
    /* Le scan : l'invite tient en entier (l'espacement des chiffres ne
       sert qu'à l'IMEI tapé), l'astuce *#06# se lit d'une traite. */
    .imei-input::placeholder { letter-spacing: 0; }
    .imei-help { display: block; text-align: center; line-height: 1.7; border-radius: 14px; }
}

/* ── Le tunnel de prise en charge, en feuille modale iOS ──
   Plein écran, sans onglets ; « Fermer » en haut, l'étape en clair, et le
   bouton qui fait avancer toujours sous le pouce, en bas de l'écran. */
@media (hover: none) and (pointer: coarse) {
    .flux .onglets { display: none; }
    .flux main.container { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
    .flux .brand { display: none; }
    .flux .barre-titre { opacity: 1; }
    .barre-fermer {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding-right: 8px;
        font-size: 17px;
        font-weight: 500;
        color: var(--accent-strong);
        text-decoration: none;
    }
    .barre-fermer:active { opacity: .5; }

    /* Les cinq pastilles deviennent « Étape 2 sur 5 · Appareil » + une barre. */
    .flux .steps { display: none; }
    .steps-compact { display: block; margin: 0 4px 16px; }
    .steps-compact-titre { margin-bottom: 8px; font-size: 13px; font-weight: 650; color: var(--text); }
    .steps-compact-titre span { color: var(--text-soft); font-weight: 600; }
    .steps-compact-barre { display: flex; gap: 4px; }
    .steps-compact-barre span { flex: 1; height: 4px; border-radius: var(--radius-pilule); background: var(--border); transition: background .2s; }
    .steps-compact-barre .fait { background: color-mix(in srgb, var(--accent) 55%, transparent); }
    .steps-compact-barre .courant { background: var(--accent); }

    /* La barre d'actions du bas : collée au bas de l'écran pendant qu'on
       remplit, « Continuer » en pleine largeur, retour et pause dessous. */
    .flux .form-actions {
        position: sticky;
        bottom: 0;
        z-index: 5;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 8px;
        /* Elle déborde jusqu'aux bords de la carte, quelle que soit sa marge. */
        margin: 20px calc(-1 * var(--carte-pad-x, 32px)) calc(-1 * var(--carte-pad-y, 32px));
        padding: 10px var(--carte-pad-x, 32px) calc(10px + env(safe-area-inset-bottom));
        background: var(--topbar-bg);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid var(--border);
        border-radius: 0 0 var(--radius) var(--radius);
    }
    .flux .form-actions > * { min-width: 0; }
    /* Un formulaire qui n'enveloppe QUE les boutons (le récap) bornerait la
       barre collante à sa propre hauteur : il s'efface de la mise en page,
       la barre se colle alors au bas de l'écran sur toute la carte. */
    .flux .card > form:has(> .form-actions:only-child) { display: contents; }
    .flux .form-actions .btn-primary { grid-column: 1 / -1; order: -1; width: 100%; padding: 15px 16px; font-size: 17px; }
    .flux .form-actions .btn:not(.btn-primary) { width: 100%; padding: 10px 6px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    /* L'étape Panne : un prix « à définir » ne s'ouvre qu'une fois la
       réparation cochée — la liste reste une liste, pas un formulaire de 40 champs. */
    .devis-row:not(:has(input[type="checkbox"]:checked)) .prix-a-definir { display: none; }
    /* Des lignes de liste iOS : 48 px au doigt, case large, prix à droite. */
    .field .devis-row { min-height: 48px; padding: 10px 14px; font-size: 16px; flex-wrap: wrap; }
    .devis-row input[type="checkbox"] { width: 22px; height: 22px; }
    .devis-row .prix-a-definir { flex: 1 1 100%; width: auto; margin-left: 35px; }
}

/* ── Les listes en mode app ── */
@media (hover: none) and (pointer: coarse) {
    .masque-app { display: none !important; }

    /* Les pastilles de vue : une ligne qui défile au doigt, jamais trois. */
    .filtre-chips { flex-wrap: nowrap; overflow-x: auto; margin: 14px -12px 10px; padding: 0 12px 2px; scrollbar-width: none; }
    .filtre-chips::-webkit-scrollbar { display: none; }
    .filtre-chips .chip { flex-shrink: 0; white-space: nowrap; }

    /* « Filtres » : la liste d'abord, les critères sur demande. */
    .filtre-repli { margin-bottom: 12px; }
    .filtre-repli > summary {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        min-height: 40px;
        padding: 6px 14px;
        list-style: none;
        cursor: pointer;
        font-size: 15px;
        font-weight: 600;
        color: var(--accent-strong);
        border: 1.5px solid var(--border);
        border-radius: var(--radius-pilule);
    }
    .filtre-repli > summary::-webkit-details-marker { display: none; }
    .filtre-repli[open] > summary { margin-bottom: 10px; }
}

/* Les listes sur téléphone : chaque ligne de tableau devient une cellule
   iOS. Le même tableau, réorganisé en grille — l'ordinateur n'y voit rien.
   Chaque colonne déclare son rôle ; celles qui n'en ont pas s'effacent :
     li-titre  (gras)          li-fin (pastille, quantité)   ›
     li-sous                   li-montant
     li-detail (une ligne, abrégée)
     li-meta (référence)       li-date
   Une cellule cliquable (ligne-lien) s'ouvre en entier au doigt ; une
   ligne sans ligne-lien étend son lien principal (.li-lien) à toute la cellule. */
@media (hover: none) and (pointer: coarse) and (max-width: 700px) {
    .liste-ios thead { display: none; }
    .liste-ios, .liste-ios tbody { display: block; width: 100%; }
    .liste-ios tbody tr {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto 12px;
        grid-template-areas:
            "titre  fin     chev"
            "sous   montant chev"
            "detail detail  chev"
            "meta   date    chev";
        column-gap: 10px;
        row-gap: 2px;
        padding: 12px 12px 12px 14px;
        border-bottom: 1px solid var(--border);
    }
    .liste-ios tbody tr:last-child { border-bottom: none; }
    .liste-ios tbody tr:active { background: var(--hover); }
    .liste-ios td { display: block; min-width: 0; padding: 0; border: none; }
    .liste-ios td:not(.li-titre, .li-fin, .li-sous, .li-montant, .li-detail, .li-meta, .li-date),
    .liste-ios .li-cache { display: none; }
    .liste-ios tbody tr::after { content: '›'; grid-area: chev; align-self: center; font-size: 22px; line-height: 1; color: var(--text-soft); }
    .liste-ios .li-titre { grid-area: titre; font-size: 16px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .liste-ios .li-titre a { color: inherit; text-decoration: none; }
    .liste-ios .li-fin { grid-area: fin; align-self: start; text-align: right; white-space: nowrap; }
    .liste-ios .li-sous { grid-area: sous; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .liste-ios .li-sous strong { font-weight: 550; }
    .liste-ios .li-montant { grid-area: montant; font-size: 14.5px; font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
    .liste-ios .li-detail { grid-area: detail; font-size: 13.5px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .liste-ios .li-meta { grid-area: meta; display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-soft); white-space: nowrap; overflow: hidden; }
    .liste-ios .li-meta .ref, .liste-ios .li-meta a { font-weight: 600; color: var(--text-soft); text-decoration: none; }
    .liste-ios .li-meta br { display: none; }
    .liste-ios .li-date { grid-area: date; font-size: 12.5px; color: var(--text-soft); text-align: right; white-space: nowrap; }
    .liste-ios .li-lien::after { content: ''; position: absolute; inset: 0; }

    /* Le stock aligne ses colonnes sur ordinateur (table fixe, 1 010 px) :
       sur téléphone, la cellule reprend ses droits. */
    .stk-layout .pec-table.liste-ios { min-width: 0; table-layout: auto; }
    .stk-layout .liste-ios td { padding: 0; overflow: visible; }
    .stk-layout .liste-ios td.li-titre { overflow: hidden; }
    .stk-layout .liste-ios td.li-fin { text-align: right; }
    /* Une carte qui ne porte qu'une liste perd son cadre intérieur : la liste est déjà un bloc. */
    .card:has(> .table-wrap > .liste-ios) { padding: 6px; }
}

/* ── La fiche dossier sur téléphone ── */
@media (hover: none) and (pointer: coarse) and (max-width: 700px) {
    /* La frise des statuts : une ligne qui défile, plus trois. */
    .fil-statuts {
        position: relative;                    /* repère du centrage (defile-actif) */
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        margin: 4px calc(-1 * var(--carte-pad-x, 16px)) 6px;
        padding: 4px var(--carte-pad-x, 16px) 6px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }
    .fil-statuts::-webkit-scrollbar { display: none; }
    .fil-statut { flex-shrink: 0; padding: 9px 14px; scroll-snap-align: center; white-space: nowrap; }

    /* Les actions : une grille à deux colonnes, « Imprimer le bon » en tête. */
    .pil-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .pil-actions form { display: contents; }
    .pil-actions .btn-action { justify-content: center; width: 100%; padding: 12px 8px; font-size: 15px; white-space: nowrap; }
    .pil-actions .btn-action-plein { grid-column: 1 / -1; }

    /* Les blocs de fiche (Appareil, Client, récap du tunnel) : des lignes
       iOS — le libellé à gauche, la valeur à droite, un filet entre deux. */
    .recap-grid { display: block; }
    .recap-item { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border); }
    .recap-item:last-child { border-bottom: none; }
    .recap-item .k { flex-shrink: 0; font-size: 15px; }
    .recap-item .v { min-width: 0; text-align: right; font-weight: 550; overflow-wrap: anywhere; }
    .recap-item:has(form) { display: block; }
    .recap-item:has(form) .v { text-align: left; }
}

/* ── Les fiches devis, facture et client sur téléphone ──
   Même vocabulaire que la fiche dossier : actions en grille, blocs en
   lignes iOS, et les lignes d'un document en cellules — plus jamais un
   tableau qui défile de côté. L'ordinateur n'y voit rien. */
@keyframes kf-feuille-monte { from { transform: translateY(100%); } }
@media (hover: none) and (pointer: coarse) and (max-width: 700px) {
    .masque-tel { display: none !important; }
    .tel-seulement { display: block; }

    /* Les actions : deux par ligne, l'action principale en tête sur toute
       la largeur, l'état (« Envoyé le… ») au-dessus ; une action seule sur
       sa ligne la prend en entier — jamais une demi-case orpheline. */
    .page-head:has(> .actions-fiche) { display: block; }
    .page-head > .statut-form { margin-bottom: 12px; }
    .fa-tete > div:first-child, .fa-tete > .actions-fiche { flex: 1 1 100%; }
    .actions-fiche { display: flex; flex-wrap: wrap; gap: 8px; }
    .actions-fiche form { display: contents !important; }   /* les formulaires en ligne s'effacent : leurs boutons rejoignent la grille */
    .actions-fiche :is(.btn, .btn-action) { flex: 1 1 calc(50% - 4px); justify-content: center; min-width: 0; min-height: 46px; padding: 11px 8px; font-size: 15px; white-space: nowrap; }
    /* Les secondaires prennent l'allure des actions de la fiche dossier. */
    .actions-fiche .btn-outline {
        border: 2px solid var(--accent);
        border-radius: 12px;
        color: var(--accent-strong);
        background: color-mix(in srgb, var(--accent) 10%, transparent);
        font-weight: 800;
    }
    .actions-fiche :is(.btn-primary, .btn-action-plein) { order: -1; flex-basis: 100%; }
    .actions-fiche > .badge { order: -2; flex-basis: 100%; display: flex; justify-content: center; padding: 8px 12px; font-size: 13px; }
    .actions-fiche .action-detruire { color: var(--danger); }

    /* Les lignes d'un devis ou d'une facture : la désignation à gauche,
       « 2 × 45,00 € » et la remise dessous, le TTC à droite, le HT sous lui. */
    .lignes-ios, .lignes-ios tbody { display: block; width: 100%; }
    .lignes-ios thead, .lignes-ios .lg-qte, .lignes-ios .lg-pu, .lignes-ios .act { display: none; }
    /* Le devis du dossier (.lignes-editables) garde ses gestes sur téléphone :
       ✏️ et 🗑 passent sous la ligne, à droite, en vraies cibles de 44 px.
       Le devis et la facture, eux, n'ont pas de geste ici (règle ci-dessus). */
    .devis-table.lignes-editables .act { display: flex; grid-area: act; justify-content: flex-end; gap: 4px; margin-top: 6px; width: auto; }
    .devis-table.lignes-editables .act .btn { min-height: 44px; min-width: 44px; }
    .devis-table.lignes-editables .act form { display: contents; }
    .devis-table.lignes-editables tbody tr:not(.lg-edition) {
        grid-template-rows: auto 1fr auto;
        grid-template-areas: "lib ttc" "lib ht" "act act";
    }
    .devis-table.lignes-editables tbody tr:nth-last-child(2) { border-bottom: none; }
    /* La correction sur place : un bloc teinté, les champs empilés, le pouce à l'aise. */
    .devis-table.lignes-editables .lg-edition:not([hidden]) { display: block; padding: 12px; border-bottom: none; border-radius: var(--radius); }
    .devis-table.lignes-editables .lg-edition.en-edition { background: var(--accent-tint); }
    .devis-table.lignes-editables .lg-edition.en-edition td { background: transparent; }
    .lignes-ios .lg-form .lg-champ { flex-basis: 100%; }
    .lignes-ios .lg-form .lg-champ-qte { flex: 1 1 40%; }
    .lignes-ios .lg-form .lg-champ-pu { flex: 1 1 50%; }
    .lignes-ios .lg-form .lg-champ input { min-height: 44px; font-size: 16px; }   /* 16 px : iOS ne zoome pas sur le champ */
    .lignes-ios .lg-form-actions { flex-basis: 100%; }
    .lignes-ios .lg-form-actions .btn { flex: 1; min-height: 46px; justify-content: center; }
    .lignes-ios tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto 1fr;          /* le HT colle au TTC, même sous une désignation de sept lignes */
        grid-template-areas: "lib ttc" "lib ht";
        column-gap: 14px;
        align-items: start;
        padding: 11px 0;
        border-bottom: 1px solid var(--border);
    }
    .lignes-ios tbody tr:last-child,
    .lignes-ios tr:has(+ .lg-total) { border-bottom: none; }   /* le récap pose déjà son filet */
    .lignes-ios td, .lignes-ios th { display: block; min-width: 0; padding: 0 !important; border: none; }
    .lignes-ios .lg-lib { grid-area: lib; font-size: 15.5px; font-weight: 550; overflow-wrap: anywhere; }
    .lignes-ios .lg-ttc { grid-area: ttc; text-align: right; font-size: 15.5px; font-weight: 700; }
    .lignes-ios .lg-ht { display: block; grid-area: ht; text-align: right; font-size: 12.5px; font-weight: 550; color: var(--text-soft); }
    .lignes-ios .lg-ht::after { content: ' HT'; }
    .lignes-ios .lg-ht:empty, .lignes-ios .lg-ht:has(.muted) { display: none; }
    .lignes-ios .lg-calcul,
    .lignes-ios .devis-remise { display: block; margin: 2px 0 0; font-size: 13px; font-weight: 500; color: var(--text-soft); font-variant-numeric: tabular-nums; }
    .lignes-ios .devis-remise.col-ht { display: none; }
    .lignes-ios .badge { margin-left: 6px; }
    /* L'appareil chapeaute ses lignes : un bandeau, les lignes en retrait. */
    .lignes-ios :is(.devis-groupe, .lg-machine) { display: block; margin-top: 12px; padding: 0; border: none; }
    .lignes-ios tr:first-child:is(.devis-groupe, .lg-machine) { margin-top: 0; }
    .lignes-ios :is(.devis-groupe, .lg-machine) td {
        padding: 8px 12px !important;
        border-radius: 10px;
        background: var(--accent-soft);
        color: var(--accent-strong);
        font-size: 13.5px;
        font-weight: 650;
        overflow-wrap: anywhere;
    }
    .lignes-ios .devis-rattachee { padding-left: 12px; }
    /* Les totaux de la facture : libellé à gauche, montant à droite. */
    .lignes-ios .lg-total { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 5px 0; border-bottom: none; }
    .lignes-ios tr:not(.lg-total) + .lg-total { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
    .lignes-ios .lg-total th { font-size: 17px; font-weight: 800; }
    .lignes-ios .lg-total th:last-child { color: var(--accent-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .lignes-ios .lg-total-doux td { font-size: 13.5px; }
    .lignes-ios .lg-total > :last-child { flex-shrink: 0; }   /* le montant ne cède jamais : c'est le libellé qui passe à la ligne */
    .lignes-ios .lg-total-doux td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }

    /* « Modifier les lignes » : le bouton sur toute la largeur, l'aide dessous. */
    .devis-add { display: flex; flex-direction: column; gap: 8px; }
    .devis-add .btn { justify-content: center; min-height: 46px; }
    .devis-add .hint { margin-left: 0; }
    .devis-libre input[name="libelle"] { flex-basis: 100%; }   /* le libellé en entier, le prix à côté du bouton */
    .devis-libre .btn { flex: 1; }

    .fa-infos { margin-top: 10px; }

    /* La fiche client : le nom passe à la ligne plutôt que de déborder,
       les compteurs tiennent sur une ligne qui défile au doigt. */
    .client-header { gap: 16px; padding: 18px var(--carte-pad-x, 16px); }
    .ch-identity { flex-shrink: 1; min-width: 0; }
    .ch-identity h1 { white-space: normal; overflow-wrap: anywhere; }
    .ch-contacts, .ch-stack { min-width: 0; flex-basis: 100%; }
    .stat-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 16px; padding: 0 12px 2px; scrollbar-width: none; }
    .stat-chips::-webkit-scrollbar { display: none; }
    .stat-chip { flex-shrink: 0; white-space: nowrap; }
    .reparations-table .li-titre { color: var(--text); }
    .piece-row .piece-libelle { flex-basis: 100%; }

    /* Les modales montent du bas, en feuille — comme sur iPhone. */
    dialog.modale {
        width: 100%;
        max-width: 100%;
        max-height: calc(100dvh - 48px);
        margin: auto 0 0;
        border-bottom: none;
        border-radius: 16px 16px 0 0;
        padding-bottom: env(safe-area-inset-bottom);
        overflow-y: auto;
    }
    dialog.modale[open] { animation: kf-feuille-monte .4s cubic-bezier(.32, .72, 0, 1); }
    .modale-boite { padding: 18px 16px 20px; }
    .lf-modale-prix .modale-boite { min-width: 0; }
    .modale-action .btn { width: 100%; justify-content: center; min-height: 46px; }
}

/* Les espaces à colonne (Réglages, Pilotage) en mode app. Tablette : colonne
   + page, comme les Réglages de l'iPad — la colonne fait le retour. Téléphone :
   la page seule, « ‹ Réglages » ou « ‹ Pilotage » dans la barre du haut,
   l'accueil en liste. */
@media (hover: none) and (pointer: coarse) {
    .reg-retour { display: none; }
    .reg-cote { top: 70px; }
    .reg-menu-accueil .reg-ligne { min-height: 50px; }
    .burger .topnav a.telephone-seulement { display: none; }
}
@media (hover: none) and (pointer: coarse) and (min-width: 700px) {
    .topbar.retour-cadre .barre-retour { display: none; }
    .topbar.retour-cadre .brand { display: flex; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 699px) {
    .burger .topnav a.hors-telephone { display: none; }
    .burger .topnav a.telephone-seulement { display: flex; }
}

/* ── Les transitions de page à l'iOS ──────────────────────────────
   Turbo passe par l'API View Transitions ; transitions.js pose le sens
   sur <html data-sens>. « avance » : la page arrive par la droite, la
   précédente recule d'un tiers en s'assombrissant ; « retour » : l'inverse.
   La barre du haut, les onglets et la barre technicien ne glissent pas
   (noms de transition à part) — seul le contenu bouge, comme sur iPhone. */
@keyframes kf-entre-droite { from { transform: translateX(100%); } }
@keyframes kf-sort-gauche  { to   { transform: translateX(-30%); filter: brightness(.82); } }
@keyframes kf-sort-droite  { to   { transform: translateX(100%); } }
@keyframes kf-entre-gauche { from { transform: translateX(-30%); filter: brightness(.82); } }

/* Ordinateur : aucune animation, le changement de page reste instantané. */
@media (hover: hover), (pointer: fine) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) { animation: none; }
}
@media (hover: none) and (pointer: coarse) {
    .topbar { view-transition-name: barre; }
    .onglets { view-transition-name: onglets; }
    .techbar { view-transition-name: techbar; }
    /* Ce qui ne glisse pas change sur place, sans fondu. */
    ::view-transition-old(onglets), ::view-transition-new(onglets),
    ::view-transition-old(techbar), ::view-transition-new(techbar) { animation: none; }
    ::view-transition-group(barre) { animation-duration: .25s; }
    /* « aucun » : pas de glissé (onglets, menu Plus, formulaires). */
    html[data-sens="aucun"]::view-transition-old(root),
    html[data-sens="aucun"]::view-transition-new(root) { animation: none; }

    html[data-sens="avance"]::view-transition-old(root) { animation: kf-sort-gauche .4s cubic-bezier(.32, .72, 0, 1) both; }
    html[data-sens="avance"]::view-transition-new(root) {
        animation: kf-entre-droite .4s cubic-bezier(.32, .72, 0, 1) both;
        box-shadow: -10px 0 30px color-mix(in srgb, #000 30%, transparent);
    }
    html[data-sens="retour"]::view-transition-old(root) {
        z-index: 1;
        animation: kf-sort-droite .4s cubic-bezier(.32, .72, 0, 1) both;
        box-shadow: -10px 0 30px color-mix(in srgb, #000 30%, transparent);
    }
    html[data-sens="retour"]::view-transition-new(root) { animation: kf-entre-gauche .4s cubic-bezier(.32, .72, 0, 1) both; }
}

/* Le zoom de l'agenda, comme Calendrier : le mois touché s'ouvre en grand
   depuis sa case, « ‹ 2026 » s'y referme. Aussi sur ordinateur (comme
   Calendrier sur Mac) : c'est un changement d'échelle, pas une page. */
/* La page du dessous reste opaque (elle grandit ou se rapproche, toujours
   plein écran) ; seule celle du dessus fond — le fond du navigateur ne
   transparaît jamais. */
@keyframes kf-zoom-grandit { to { transform: scale(2.2); filter: brightness(.7); } }
@keyframes kf-zoom-arrive  { from { transform: scale(.35); opacity: 0; } }
@keyframes kf-zoom-retrecit { to { transform: scale(.35); opacity: 0; } }
@keyframes kf-zoom-recule  { from { transform: scale(2.2); filter: brightness(.7); } }
html[data-sens="zoom-avant"]::view-transition-old(root),
html[data-sens="zoom-avant"]::view-transition-new(root),
html[data-sens="zoom-arriere"]::view-transition-old(root),
html[data-sens="zoom-arriere"]::view-transition-new(root) { transform-origin: var(--zoom-x, 50%) var(--zoom-y, 50%); }
html[data-sens="zoom-avant"]::view-transition-old(root) { animation: kf-zoom-grandit .42s cubic-bezier(.32, .72, 0, 1) both; }
html[data-sens="zoom-avant"]::view-transition-new(root) { animation: kf-zoom-arrive .42s cubic-bezier(.32, .72, 0, 1) both; }
html[data-sens="zoom-arriere"]::view-transition-old(root) { z-index: 1; animation: kf-zoom-retrecit .38s cubic-bezier(.32, .72, 0, 1) both; }
html[data-sens="zoom-arriere"]::view-transition-new(root) { animation: kf-zoom-recule .38s cubic-bezier(.32, .72, 0, 1) both; }

/* L'agenda sur téléphone : pas de sélecteur de vue (on zoome), les grilles
   d'un bord à l'autre, « Aujourd'hui » qui flotte au-dessus des onglets. */
@media (hover: none) and (pointer: coarse) and (max-width: 700px) {
    .agenda-semaine[data-controller~="agenda-telephone"] { visibility: hidden; }
    .cal .agd-vues { display: none; }
    .cal-barre { margin: 0; }
    .cal-aujourdhui {
        position: fixed; z-index: 45;
        left: max(16px, env(safe-area-inset-left)); bottom: calc(72px + env(safe-area-inset-bottom));
        background: var(--topbar-bg); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
        box-shadow: var(--shadow);
    }
    .cal-tete { margin-bottom: 8px; }
    .cal-rond { width: 36px; height: 36px; font-size: 20px; }
    .cm-entete, .cm-grille, .cj-semaine { margin-left: -12px; margin-right: -12px; }
    /* Les jours de la semaine restent en vue quand le mois défile. */
    .cm-entete {
        position: sticky; top: var(--barre-app-h, 60px); z-index: 5;
        background: var(--topbar-bg); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
    }
}
@media (max-width: 700px) {
    .ca-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 6px; margin: 0 -6px; }
    .ca-mois { padding: 4px 2px; }
    .ca-nom { margin-bottom: 3px; font-size: 15px; }
    .ca-jours { font-size: 10px; letter-spacing: -.2px; }
    .ca-jours > span { line-height: 17px; }
    .ca-jours .auj::before { width: 18px; height: 18px; }
    .ca-jours .a-rdv::after { width: 3px; height: 3px; margin-left: -1.5px; bottom: 0; }
    .cm-jour { min-height: 86px; padding: 4px 1px 6px; }
    .cm-num { min-width: 28px; height: 28px; font-size: 16px; }
    .cm-evt { padding: 1px 3px; border-radius: 3px; font-size: 10px; line-height: 1.4; }
    .cm-heure { display: none; }
    .cm-plus { padding-left: 3px; font-size: 10px; }
    .cj-num { width: 36px; height: 36px; font-size: 18px; }
    .agd.cj-grille { --agd-h: 56px; grid-template-columns: 50px minmax(0, 1fr); }
}

/* Tablette en paysage : la barre latérale façon iPad, toujours ouverte. */
@media (hover: none) and (pointer: coarse) and (orientation: landscape) and (min-width: 1024px) {
    .onglets, .plus-voile, .plus-tete { display: none; }
    body { padding-left: 260px; }
    main.container { padding-bottom: 40px; }
    .burger .topnav {
        top: 0;
        right: auto;
        width: 260px;
        max-height: none;
        z-index: 20;
        padding: calc(14px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
        background: var(--topbar-bg);
        -webkit-backdrop-filter: blur(26px) saturate(180%);
        backdrop-filter: blur(26px) saturate(180%);
        border-radius: 0;
        border-right: 1px solid var(--border);
        box-shadow: none;
        transform: none;
        visibility: visible;
        transition: none;
    }
    .burger .topnav .nav-onglet { display: flex; }
    .burger .topnav a { min-height: 44px; padding: 10px 12px; font-size: 16px; border-bottom: none; border-radius: 10px; }
    .burger .topnav a::after { content: none; }
    .burger .topnav a.active { background: var(--accent-soft); }
    html:has(.burger.ouvert) { overflow: visible; }
}

/* Mouvements réduits : la feuille apparaît en fondu, sans glisser. */
@media (hover: none) and (pointer: coarse) and (prefers-reduced-motion: reduce) {
    dialog.modale[open] { animation: none; }
    .burger .topnav { transform: none; opacity: 0; transition: opacity .2s, visibility 0s linear .2s; }
    .burger .topnav.ouvert { opacity: 1; transition: opacity .2s, visibility 0s; }
}
/* Transparence réduite : verre plein. */
@media (hover: none) and (pointer: coarse) and (prefers-reduced-transparency: reduce) {
    .topbar::before, .onglets { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ── Visite guidée (visite_controller.js) ──────────────────────────────
   Des infobulles, étape par étape, sur le tableau de bord : un halo autour
   de la cible, le reste de l'écran assombri, une infobulle en verre avec le
   compteur « Étape X sur N ». Sans cible visible (menu replié, petit écran),
   la carte se centre et dit où trouver la fonction ; sur téléphone, elle
   devient une feuille en bas de l'écran (en haut si la cible est en bas).
   Le voile est un noir translucide, comme .plus-voile : seule couleur « brute »,
   un voile n'a pas de teinte de thème. */
.vg-racine { position: fixed; inset: 0; z-index: 950; }
.vg-voile { position: fixed; inset: 0; }
.vg-racine:has(.vg-halo[hidden]) .vg-voile { background: color-mix(in srgb, #000 45%, transparent); }

.vg-halo {
    position: fixed;
    box-sizing: border-box;
    border-radius: calc(var(--radius-btn) + 4px);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 9999px color-mix(in srgb, #000 45%, transparent),
                0 0 18px color-mix(in srgb, var(--accent) 55%, transparent);
    pointer-events: none;
    transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
}
.vg-halo[hidden] { display: none; }

.vg-bulle {
    position: fixed;
    z-index: 1;
    box-sizing: border-box;
    width: min(380px, calc(100vw - 24px));
    padding: 20px 22px 18px;
    background: var(--surface-solid);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
    outline: none;
}
/* Carte centrée : accueil, fin, ou cible introuvable. */
.vg-racine.vg-centre .vg-bulle { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.vg-racine.vg-entree .vg-bulle { animation: vg-entree .18s ease-out; }
@keyframes vg-entree { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }

.vg-titre { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.vg-texte { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text); }
.vg-ou { margin: 10px 0 0; padding: 8px 12px; font-size: 13px; line-height: 1.4; border-radius: var(--radius-btn);
         background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.vg-ou[hidden] { display: none; }

.vg-pied { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 12px; }
.vg-compteur { padding: 3px 11px; border-radius: var(--radius-pilule); background: var(--accent-soft); color: var(--accent-strong);
               font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vg-points { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.vg-point { width: 7px; height: 7px; border-radius: var(--radius-pilule); background: var(--border); transition: background-color .15s ease, width .15s ease; }
.vg-point.fait { background: var(--accent); opacity: .55; }
.vg-point.actif { width: 18px; background: var(--degrade-actif); }

.vg-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.vg-actions .btn[hidden] { display: none; }
.vg-passer { margin-right: auto; color: var(--text-soft); }

/* La flèche : un carré tourné, calé sur le bord tourné vers la cible. */
.vg-fleche {
    position: absolute; width: 14px; height: 14px; display: none;
    background: var(--surface-solid); border: 1px solid var(--border); rotate: 45deg;
}
.vg-racine.vg-dessous .vg-fleche { display: block; top: -8px; left: var(--vg-fleche-x, 50%); margin-left: -7px; border-right: 0; border-bottom: 0; }
.vg-racine.vg-dessus .vg-fleche { display: block; bottom: -8px; left: var(--vg-fleche-x, 50%); margin-left: -7px; border-left: 0; border-top: 0; }
.vg-racine.vg-droite .vg-fleche { display: block; left: -8px; top: var(--vg-fleche-y, 50%); margin-top: -7px; border-right: 0; border-top: 0; }
.vg-racine.vg-gauche .vg-fleche { display: block; right: -8px; top: var(--vg-fleche-y, 50%); margin-top: -7px; border-left: 0; border-bottom: 0; }

/* Téléphone : une feuille en bas de l'écran (en haut quand la cible est en bas : barre d'onglets). */
@media (max-width: 640px) {
    .vg-racine.vg-feuille .vg-bulle {
        left: 12px; right: 12px; width: auto; transform: none;
        top: auto; bottom: calc(12px + env(safe-area-inset-bottom));
    }
    .vg-racine.vg-feuille.vg-haut .vg-bulle { bottom: auto; top: calc(12px + env(safe-area-inset-top)); }
    .vg-racine.vg-feuille .vg-fleche { display: none; }
    .vg-racine.vg-centre .vg-bulle { width: calc(100vw - 32px); }
    .vg-bulle { padding: 18px 16px 16px; }
    .vg-actions { flex-wrap: nowrap; gap: 6px; }
    .vg-actions .btn { min-height: 40px; padding-inline: 12px; white-space: nowrap; }
    .vg-passer { padding-inline: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .vg-racine.vg-entree .vg-bulle { animation: none; }
    .vg-halo, .vg-point { transition: none; }
}
