/* © 2026 Haesir Studio. Logiciel propriétaire sous licence, tous droits réservés.
   A-TEAM — interface de gestion.
   Charte : noir profond et rouge A-TEAM, fonds clairs, chiffres tabulaires. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../polices/inter-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../polices/inter-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --fond: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --survol: #F1F3F6;
  --bord: #E5E7EB;
  --bord-fort: #D1D5DB;
  --texte: #0B0D12;
  --texte-2: #4B5563;
  --texte-3: #6B7280;
  --accent: #E00000;
  --accent-fonce: #B00000;
  --accent-pale: #FEF1F1;
  --accent-bord: #FBCACC;
  --bleu: #1D4ED8;   --bleu-pale: #EFF4FF;   --bleu-bord: #C7D7FE;
  --vert: #047857;   --vert-pale: #ECFDF5;   --vert-bord: #A7F3D0;
  --ambre: #B45309;  --ambre-pale: #FFFBEB;  --ambre-bord: #FDE68A;
  --rouge: #B91C1C;  --rouge-pale: #FEF2F2;  --rouge-bord: #FECACA;
  --violet: #6D28D9; --violet-pale: #F5F3FF; --violet-bord: #DDD6FE;
  --gris-pale: #F3F4F6;
  --nav: #0B0D12;
  --nav-2: #151922;
  --nav-texte: #A8AFBD;
  --rayon: 12px;
  --rayon-p: 8px;
  --ombre: 0 1px 2px rgba(11,13,18,.05);
  --ombre-m: 0 4px 12px -2px rgba(11,13,18,.08), 0 2px 4px -2px rgba(11,13,18,.04);
  --ombre-l: 0 24px 48px -12px rgba(11,13,18,.25);
  --largeur-nav: 240px;
  --serie-1: #E00000; --serie-2: #0B0D12; --serie-3: #9CA3AF;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0B0D12; --surface: #12151C; --surface-2: #161A22; --survol: #1C212B; --bord: #242A35; --bord-fort: #323A48;
    --texte: #F3F4F6; --texte-2: #B4BBC8; --texte-3: #8A93A3;
    --accent-pale: #2A1214; --accent-bord: #5C1A1E;
    --bleu: #8AB4FF; --bleu-pale: #131C2E; --bleu-bord: #233456;
    --vert: #4ADE80; --vert-pale: #0F2119; --vert-bord: #1D4030;
    --ambre: #FBBF24; --ambre-pale: #231B0B; --ambre-bord: #4A3712;
    --rouge: #F87171; --rouge-pale: #2A1214; --rouge-bord: #5C1A1E;
    --violet: #C4B5FD; --violet-pale: #1B1630; --violet-bord: #362C5C;
    --gris-pale: #1C212B; --nav: #07080B; --nav-2: #10131A;
    --serie-2: #E5E7EB; --serie-3: #4B5563;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0B0D12; --surface: #12151C; --surface-2: #161A22; --survol: #1C212B; --bord: #242A35; --bord-fort: #323A48;
  --texte: #F3F4F6; --texte-2: #B4BBC8; --texte-3: #8A93A3;
  --accent-pale: #2A1214; --accent-bord: #5C1A1E;
  --bleu: #8AB4FF; --bleu-pale: #131C2E; --bleu-bord: #233456;
  --vert: #4ADE80; --vert-pale: #0F2119; --vert-bord: #1D4030;
  --ambre: #FBBF24; --ambre-pale: #231B0B; --ambre-bord: #4A3712;
  --rouge: #F87171; --rouge-pale: #2A1214; --rouge-bord: #5C1A1E;
  --violet: #C4B5FD; --violet-pale: #1B1630; --violet-bord: #362C5C;
  --gris-pale: #1C212B; --nav: #07080B; --nav-2: #10131A;
  --serie-2: #E5E7EB; --serie-3: #4B5563;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01"; font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 640; }
h3 { font-size: 13px; font-weight: 620; }
p { margin: 0; }
a { color: inherit; }
a[href^="tel:"] { white-space: nowrap; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.ic { width: 16px; height: 16px; flex: none; stroke-width: 1.9; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
svg.ic-s { width: 14px; height: 14px; }
svg.ic-l { width: 20px; height: 20px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 8px; top: -60px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.evitement:focus { top: 8px; }
#contenu:focus { outline: none; }
[hidden] { display: none !important; }
.muet { color: var(--texte-3); }
.nombre { text-align: right; white-space: nowrap; }
.fort { font-weight: 620; }

/* ——— Cadre ——— */
.cadre { display: grid; grid-template-columns: var(--largeur-nav) 1fr; min-height: 100vh; min-height: 100dvh; }
.nav { background: var(--nav); color: var(--nav-texte); position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow-y: auto; }
.marque { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; color: #fff; text-decoration: none; }
.marque .logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; display: grid; place-items: center; flex: none; }
.marque .logo svg { width: 22px; height: 22px; }
.marque strong { font-size: 16px; font-weight: 750; letter-spacing: .02em; display: block; }
.marque span { font-size: 11.5px; color: #7D8596; }
.nav-recherche { margin: 2px 12px 8px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid #222734; background: var(--nav-2); color: #8A92A3; cursor: pointer; font-size: 13px; text-align: left; }
.nav-recherche:hover { border-color: #343B4C; color: #C9CED8; }
.nav-recherche kbd { margin-left: auto; }
kbd { font: 500 11px/1 "Inter", system-ui, sans-serif; padding: 3px 5px; border-radius: 4px; border: 1px solid currentColor; opacity: .7; }
.nav-groupe { padding: 4px 10px; }
.nav-titre { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: #5D6577; padding: 12px 8px 6px; }
/* Titre de groupe : un bouton qui replie le groupe (le groupe de l'écran ouvert reste déplié). */
button.nav-titre { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; border-radius: 6px; }
button.nav-titre:hover { color: #A3AABA; }
button.nav-titre .ic { width: 12px; height: 12px; margin-left: auto; transition: transform .15s; }
.nav-groupe.replie button.nav-titre .ic { transform: rotate(-90deg); }
.nav-groupe.replie .nav-lien { display: none; }
/* Nouveautés et questions de la démo : sous la recherche, à part du métier. */
.nav-outils { display: flex; flex-direction: column; gap: 1px; padding: 0 10px 2px; }
.nav-lien.nav-outil { align-items: center; padding: 6px 9px; font-size: 13px; }
.nav-lien { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 8px; color: var(--nav-texte); font-weight: 520; font-size: 13.5px; text-decoration: none; position: relative; }
.nav-lien:hover { background: #151922; color: #fff; }
.nav-lien[aria-current="page"] { background: #1A1F2A; color: #fff; }
.nav-lien[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-lien .compteur { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 650; border-radius: 10px; padding: 1px 7px; }
.nav-lien.ia { color: #fff; }
.nav-lien.ia svg { color: #FF5A63; }
.nav-lien { align-items: flex-start; padding-block: 7px; }
.nav-lien > svg { margin-top: 1px; flex: none; }
.nav-texte { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.nav-texte small { font-size: 11.5px; font-weight: 420; line-height: 1.3; color: #7D8596; display: none; }
/* La phrase sous chaque entrée : pendant les premières visites, puis au survol, au clavier et sur l'écran ouvert. */
.nav.avec-phrases .nav-texte small, .nav-lien:hover .nav-texte small, .nav-lien:focus-visible .nav-texte small, .nav-lien[aria-current="page"] .nav-texte small { display: block; }
.nav-lien:hover .nav-texte small, .nav-lien[aria-current="page"] .nav-texte small { color: #A3AABA; }
.nav-pied { margin-top: auto; padding: 14px 14px 18px; border-top: 1px solid #1A1E28; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: #6B7385; }
.nav-pied .ligne { display: flex; align-items: center; gap: 8px; }
.nav-pied button { background: none; border: 0; color: #8A92A3; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.nav-pied button:hover { color: #fff; }
.bandeau-demo { background: var(--ambre-pale); color: var(--ambre); border: 1px solid var(--ambre-bord); padding: 8px 12px; border-radius: 8px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
.bandeau-licence { background: var(--rouge-pale); color: var(--rouge); border-color: var(--rouge-bord); }

.principal { min-width: 0; }
.barre-mobile { display: none; }
.voile, .mobile-seul, .onglets-filtre.mobile-seul, .vue-liste { display: none; }
.nav-periode { display: flex; gap: 8px; flex-wrap: nowrap; }
.page { padding: 28px 32px 64px; max-width: 1440px; margin: 0 auto; }
.entete { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.entete .titres { flex: 1; min-width: 240px; }
.entete .sur { font-size: 12.5px; color: var(--texte-3); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.entete .sur a { color: var(--texte-3); text-decoration: none; }
.entete .sur a:hover { color: var(--texte); }
.entete .sous { color: var(--texte-2); margin-top: 6px; }
/* « À quoi sert cet écran ? » (aide-ecrans.js) */
.aide-ecran { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); margin: -8px 0 18px; font-size: 13px; color: var(--texte-2); }
.aide-ecran summary { cursor: pointer; padding: 9px 14px; display: flex; align-items: center; gap: 8px; font-weight: 560; color: var(--texte); list-style: none; }
.aide-ecran summary::-webkit-details-marker { display: none; }
.aide-ecran summary::after { content: "Afficher"; margin-left: auto; font-weight: 450; font-size: 12px; color: var(--texte-3); }
.aide-ecran[open] summary::after { content: "Replier"; }
.aide-corps { padding: 0 14px 12px 36px; display: flex; flex-direction: column; gap: 6px; max-width: 900px; }
.aide-corps p { margin: 0; }
.aide-corps dl { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.aide-corps .aide-titre { font-weight: 620; color: var(--texte); margin-top: 4px; }
.aide-corps dl div { display: block; }
.aide-corps dl div dt { display: inline; font-weight: 600; color: var(--texte); }
.aide-corps dl div dt::after { content: "\00a0: "; }
.aide-corps dd { display: inline; margin: 0; }
@media (max-width: 720px) { .aide-corps { padding-left: 14px; } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ——— Boutons ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--bord-fort); background: var(--surface); color: var(--texte); font-weight: 560; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--ombre); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--survol); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primaire { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primaire:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
.btn.sombre { background: var(--texte); border-color: var(--texte); color: var(--surface); }
.btn.sombre:hover { opacity: .9; }
.btn.ia { background: linear-gradient(135deg, #0B0D12, #2A1014); border-color: #2A1014; color: #fff; }
.btn.ia svg { color: #FF5A63; }
.btn.fantome { background: transparent; border-color: transparent; box-shadow: none; }
.btn.fantome:hover { background: var(--survol); }
.btn.danger { color: var(--rouge); }
.btn.petit { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.icone { width: 36px; padding: 0; }
.btn.petit.icone { width: 30px; }

/* ——— Cartes ——— */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); min-width: 0; }
.carte-tete { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--bord); }
.carte-tete h2 { flex: 1; display: flex; align-items: center; gap: 8px; }
.carte-tete h2 svg { color: var(--texte-3); }
.carte-corps { padding: 16px 18px; }
.carte-corps.serre { padding: 0; }
.grille { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-principale { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.pile { display: flex; flex-direction: column; gap: 16px; }

/* ——— Indicateurs ——— */
.kpi .valeur.rouge { color: var(--rouge); }
.bilan-resultat { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--bord); }
.bilan-resultat dt { font-size: 12px; color: var(--texte-3); }
.bilan-resultat dd { margin: 2px 0 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.bilan-resultat .total dd { font-size: 17px; }
@media (max-width: 700px) { .bilan-resultat { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi .libelle { font-size: 12.5px; color: var(--texte-3); font-weight: 540; display: flex; align-items: center; gap: 6px; }
.kpi .valeur { font-size: 26px; font-weight: 720; letter-spacing: -.02em; }
.kpi .detail { font-size: 12.5px; color: var(--texte-2); display: flex; align-items: center; gap: 6px; }
.kpi.accent { background: var(--nav); border-color: var(--nav); color: #fff; }
.kpi.accent .libelle, .kpi.accent .detail { color: #A8AFBD; }
.kpi.accent::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, rgba(227,6,19,.35), transparent 70%); }
.tendance { white-space: nowrap;  display: inline-flex; align-items: center; gap: 3px; font-weight: 620; font-size: 12px; padding: 1px 6px; border-radius: 6px; }
.tendance.haut { color: var(--vert); background: var(--vert-pale); }
.tendance.bas { color: var(--rouge); background: var(--rouge-pale); }

/* ——— Pastilles ——— */
.pastille { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 560; white-space: nowrap; border: 1px solid transparent; }
.pastille::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pastille.sans-point::before { display: none; }
.p-gris { background: var(--gris-pale); color: var(--texte-2); border-color: var(--bord); }
.p-bleu { background: var(--bleu-pale); color: var(--bleu); border-color: var(--bleu-bord); }
.p-vert { background: var(--vert-pale); color: var(--vert); border-color: var(--vert-bord); }
.p-ambre { background: var(--ambre-pale); color: var(--ambre); border-color: var(--ambre-bord); }
.p-rouge { background: var(--rouge-pale); color: var(--rouge); border-color: var(--rouge-bord); }
.p-violet { background: var(--violet-pale); color: var(--violet); border-color: var(--violet-bord); }
.p-noir { background: var(--texte); color: var(--surface); }

/* ——— Tableaux ——— */
.tableau-conteneur { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11.5px; font-weight: 620; color: var(--texte-3); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--bord); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.lien { cursor: pointer; }
.t tbody tr.lien:hover { background: var(--survol); }
.t .sous-ligne { font-size: 12px; color: var(--texte-3); }
.t tfoot td { font-weight: 650; background: var(--surface-2); }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--bord); align-items: center; }
.filtres .recherche { flex: 1; min-width: 200px; position: relative; }
.filtres .recherche svg { position: absolute; left: 10px; top: 10px; color: var(--texte-3); }
.filtres .recherche input { padding-left: 32px; }
.filtres > select { max-width: 100%; }
.onglets-filtre { display: flex; gap: 4px; flex-wrap: wrap; }
.onglets-filtre button { border: 1px solid transparent; background: none; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--texte-2); font-weight: 540; white-space: nowrap; }
.onglets-filtre button:hover { background: var(--survol); }
.onglets-filtre button[aria-pressed="true"] { background: var(--texte); color: var(--surface); }
.onglets-filtre .n { opacity: .6; margin-left: 4px; }

/* ——— Formulaires ——— */
.champ { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.champ > span, .champ > label { font-size: 12.5px; font-weight: 560; color: var(--texte-2); }
.champ .aide { font-size: 12px; color: var(--texte-3); }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=tel], input[type=password], input[type=search], select, textarea {
  width: 100%; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--bord-fort); background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--texte-2); box-shadow: 0 0 0 3px rgba(11,13,18,.08); }
.form { display: grid; gap: 14px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.form .c3 { grid-column: span 3; } .form .c4 { grid-column: span 4; } .form .c6 { grid-column: span 6; } .form .c8 { grid-column: span 8; } .form .c12 { grid-column: span 12; } .form .c2 { grid-column: span 2; }
.form-section { grid-column: span 12; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); padding-top: 6px; border-top: 1px solid var(--bord); margin-top: 4px; }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

/* ——— Alertes ——— */
.alerte { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 9px; font-size: 13px; border: 1px solid; }
.alerte svg { margin-top: 1px; }
.lien-texte { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: inherit; text-decoration: underline; cursor: pointer; }
.alerte.info { background: var(--bleu-pale); border-color: var(--bleu-bord); color: var(--bleu); }
.alerte.att { background: var(--ambre-pale); border-color: var(--ambre-bord); color: var(--ambre); }
.alerte.err { background: var(--rouge-pale); border-color: var(--rouge-bord); color: var(--rouge); }
.alerte.ok { background: var(--vert-pale); border-color: var(--vert-bord); color: var(--vert); }

/* ——— À faire ——— */
.liste-taches { list-style: none; margin: 0; padding: 0; }
.liste-taches li a { display: flex; gap: 12px; align-items: flex-start; padding: 11px 18px; border-bottom: 1px solid var(--bord); text-decoration: none; }
.liste-taches li:last-child a { border-bottom: 0; }
.liste-taches li a:hover { background: var(--survol); }
.tache-icone { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.tache-icone.u3 { background: var(--rouge-pale); color: var(--rouge); }
.tache-icone.u2 { background: var(--ambre-pale); color: var(--ambre); }
.tache-icone.u1 { background: var(--bleu-pale); color: var(--bleu); }
.tache-texte { min-width: 0; flex: 1; }
.tache-texte strong { display: block; font-weight: 600; font-size: 13.5px; }
.tache-texte span { font-size: 12.5px; color: var(--texte-3); }

/* ——— Graphiques ——— */
.graphe { width: 100%; height: auto; display: block; overflow: visible; }
.graphe text { fill: var(--texte-3); font-size: 11px; font-family: inherit; }
.graphe .grille-l { stroke: var(--bord); stroke-width: 1; }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--texte-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.barres-h { display: flex; flex-direction: column; gap: 10px; }
.barre-h { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.barre-h .piste { height: 8px; border-radius: 4px; background: var(--gris-pale); overflow: hidden; }
.barre-h .remplie { height: 100%; border-radius: 4px; background: var(--accent); }
.barre-h .nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bulle-graphe { position: fixed; pointer-events: none; background: var(--nav); color: #fff; padding: 8px 10px; border-radius: 8px; font-size: 12px; box-shadow: var(--ombre-l); z-index: 60; }

/* ——— Planning ——— */
.planning { overflow-x: auto; }
.planning-grille { --col-agent: 190px; display: grid; min-width: 760px; font-size: 12px; }
.planning-grille .cel { border-bottom: 1px solid var(--bord); border-right: 1px solid var(--bord); min-height: 44px; position: relative; }
.planning-grille .tete { background: var(--surface-2); padding: 8px 6px; text-align: center; font-weight: 600; color: var(--texte-2); min-height: 0; }
.planning-grille .tete.we { color: var(--texte-3); background: var(--gris-pale); }
.planning-grille .tete.auj { color: var(--accent); }
.planning-grille .agent { padding: 8px 12px; display: flex; align-items: center; gap: 8px; position: sticky; left: 0; background: var(--surface); z-index: 2; font-weight: 560; }
.planning-grille .jour.we { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--gris-pale) 6px 7px); }
.bloc { position: absolute; top: 6px; bottom: 6px; border-radius: 7px; padding: 4px 8px; color: #fff; font-weight: 600; font-size: 11.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: none; z-index: 1; box-shadow: var(--ombre); }
.bloc:hover { filter: brightness(1.08); }
.bloc small { font-weight: 450; opacity: .85; }
.puce { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.av { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 650; font-size: 12px; flex: none; }

.agenda { list-style: none; margin: 0; padding: 0; }
.agenda-jour { padding: 10px 16px 6px; font-size: 12px; font-weight: 650; color: var(--texte-2); background: var(--surface-2); border-bottom: 1px solid var(--bord); }
.agenda-jour::first-letter { text-transform: uppercase; }
.agenda-jour.auj { color: var(--accent); }
.agenda-ligne { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--bord); text-decoration: none; min-height: 56px; }
.agenda-ligne.pale { opacity: .6; }
.agenda-ligne .tache-texte span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ——— Fiche prestation ——— */
.etapes { display: flex; gap: 0; overflow-x: auto; padding: 4px 0 2px; }
.etape { flex: 1; min-width: 110px; position: relative; padding-top: 22px; font-size: 12.5px; color: var(--texte-3); text-align: center; }
.etape::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 2px; background: var(--bord); }
.etape:first-child::before { left: 50%; } .etape:last-child::before { right: 50%; }
.etape::after { content: ""; position: absolute; top: 2px; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--bord-fort); }
.etape.faite { color: var(--texte-2); } .etape.faite::before { background: var(--texte); } .etape.faite::after { background: var(--texte); border-color: var(--texte); }
.etape.courante { color: var(--accent); font-weight: 650; } .etape.courante::after { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-pale); }
/* Suggestions d'un champ (public/js/suggestions.js), à la place de l'affichage des datalist. */
.liste-choix { position: fixed; z-index: 1000; margin: 0; padding: 4px; list-style: none; overflow-y: auto; background: var(--surface); border: 1px solid var(--bord-fort); border-radius: 10px; box-shadow: var(--ombre-l); }
.liste-choix li { display: block; padding: 9px 12px; border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1.3; }
.liste-choix li small { display: block; margin-top: 1px; font-size: 12px; color: var(--texte-3); }
.liste-choix li:hover, .liste-choix li.actif { background: var(--surface-2); }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1000px) { .liste-choix li { padding: 12px; font-size: 16px; } }
/* Safari sur iPhone : un champ date (ou date et heure) garde sa largeur propre et sort de la colonne sans ceci. */
@supports (-webkit-touch-callout: none) {
  input[type=date], input[type=time], input[type=datetime-local] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; text-align: left; }
  input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value { text-align: left; }
}
.etape-mobile { display: none; }
@media (max-width: 720px) {
  /* Téléphone : toutes les étapes tiennent sur la largeur, seule la courante est nommée dessous. */
  .etape { min-width: 0; font-size: 0; padding-top: 16px; }
  .etape-mobile { display: block; margin: 8px 0 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--accent); }
}
.infos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 18px; }
.info .l { font-size: 12px; color: var(--texte-3); }
.info .v { font-weight: 560; margin-top: 2px; overflow-wrap: anywhere; }
.lignes-prix td { padding: 6px 8px; }
.lignes-prix input, .lignes-prix select, .tarifs input { height: 32px; }
.tarifs input { max-width: 100px; }
.recap-prix { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; font-size: 13.5px; padding: 14px 18px; border-top: 1px solid var(--bord); }
.recap-prix .total { font-weight: 720; font-size: 16px; }
.btn.a-enregistrer { box-shadow: 0 0 0 3px var(--accent-bord); }
.lignes-a-enregistrer { margin: 0; padding: 0 18px 14px; text-align: right; color: var(--ambre); }
.lignes-prix .c-article input + input { margin-top: 6px; }
.recap-prix .choix-tva { height: 28px; width: auto; max-width: 100%; padding: 0 28px 0 8px; font-size: 13px; color: var(--texte-2); }
.recap-prix .mention-tva { display: block; margin-top: 6px; height: 30px; font-size: 12.5px; width: 100%; max-width: 360px; }
.bilan-postes { margin: 0; padding: 10px 16px; font-size: 12.5px; border-bottom: 1px solid var(--bord); }
.bilan-postes.att { color: var(--ambre); font-weight: 600; }
.marge { display: flex; flex-direction: column; gap: 8px; }
.jauge { height: 10px; border-radius: 5px; background: var(--gris-pale); overflow: hidden; display: flex; }
.jauge i { display: block; height: 100%; }
.journal { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.journal li { padding: 8px 0 8px 18px; border-left: 2px solid var(--bord); position: relative; margin-left: 4px; }
.journal li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--bord-fort); }
.journal li:first-child::before { background: var(--accent); }
.journal .q { font-size: 11.5px; color: var(--texte-3); }

/* ——— Panneaux ——— */
dialog.panneau { border: 0; padding: 0; border-radius: 16px; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); background: var(--surface); color: var(--texte); box-shadow: var(--ombre-l); }
dialog.panneau.large { width: min(1040px, calc(100vw - 32px)); }
/* Un champ amené à l'écran (Tab, toucher, Safari) s'arrête hors des bandeaux collés en haut et en bas de la fenêtre :
   sans cela, WebKit le laissait sous les boutons du pied (iPhone Duo déplié couché, 24/10/2026). */
dialog.panneau { scroll-padding-block: 64px 76px; }
dialog.panneau::backdrop { background: rgba(11,13,18,.5); backdrop-filter: blur(3px); }
.panneau-tete { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--bord); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.panneau-tete h2 { flex: 1; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.panneau-corps { padding: 18px 20px; }
.panneau-pied { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--bord); position: sticky; bottom: 0; background: var(--surface); }

/* ——— Palette Cmd+K ——— */
dialog.palette { border: 0; padding: 0; border-radius: 14px; width: min(620px, calc(100vw - 32px)); margin-top: 12vh; background: var(--surface); color: var(--texte); box-shadow: var(--ombre-l); }
dialog.palette::backdrop { background: rgba(11,13,18,.45); }
.palette input { height: 52px; border: 0; border-bottom: 1px solid var(--bord); border-radius: 0; font-size: 16px; padding: 0 18px; box-shadow: none !important; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.palette li a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; text-decoration: none; }
.palette li a:hover, .palette li a[aria-selected="true"] { background: var(--survol); }
.palette li a span { color: var(--texte-3); font-size: 12.5px; margin-left: auto; }

/* ——— Assistant ——— */
.chat { display: flex; flex-direction: column; height: calc(100vh - var(--decalage, 170px) - 32px); height: calc(100dvh - var(--decalage, 170px) - 32px); min-height: 460px; }
.chat-fil { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 760px; display: flex; gap: 12px; }
.msg.moi { align-self: flex-end; flex-direction: row-reverse; }
.msg .bulle { padding: 11px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--bord); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.moi .bulle { background: var(--texte); color: var(--surface); border-color: var(--texte); }
.msg .avatar-ia { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #0B0D12, #3A1418); color: #FF5A63; display: grid; place-items: center; flex: none; }
.chat-saisie { border-top: 1px solid var(--bord); padding: 14px; display: flex; gap: 10px; align-items: flex-end; }
.chat-saisie textarea { min-height: 44px; max-height: 180px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestions button { border: 1px solid var(--bord-fort); background: var(--surface); border-radius: 999px; padding: 7px 13px; cursor: pointer; font-size: 13px; }
.suggestions button:hover { border-color: var(--texte-2); }
.suggestions.centre { justify-content: center; margin-top: 18px; }
.msg + .suggestions { margin: -4px 0 0 44px; }
.mention-demo { display: flex; gap: 6px; align-items: center; margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--ambre-bord); font-size: 12px; line-height: 1.4; color: var(--ambre); white-space: normal; }
.mention-demo.centre { justify-content: center; border-top: 0; padding-top: 0; }
.alerte .mention-demo, .mention-demo.seule { border-top: 0; padding-top: 0; margin-top: 0; }
.points { display: inline-flex; gap: 4px; }
.points i { width: 6px; height: 6px; border-radius: 50%; background: var(--texte-3); animation: rebond 1s infinite; }
.points i:nth-child(2) { animation-delay: .15s; } .points i:nth-child(3) { animation-delay: .3s; }
@keyframes rebond { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* ——— Toasts, vide, chargement ——— */
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
#toasts[popover] { inset: auto 20px 20px auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; color: inherit; }
#toasts[popover]:not(:popover-open) { display: flex; }
.toast { background: var(--nav); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--ombre-l); font-size: 13.5px; display: flex; gap: 8px; align-items: center; animation: entree .2s ease-out; max-width: 420px; }
.toast.err { background: var(--rouge); }
.toast.vu { animation: none; }
/* Sur téléphone, une fenêtre ouverte a ses boutons en bas : les messages passent en haut. */
@media (max-width: 700px) { body:has(dialog[open]) #toasts[popover] { inset: 12px 12px auto 12px; } body:has(dialog[open]) .toast { max-width: none; } }
@keyframes entree { from { transform: translateY(8px); opacity: 0; } }
.vide { text-align: center; padding: 40px 20px; color: var(--texte-3); }
.vide svg { width: 28px; height: 28px; margin-bottom: 8px; }
.vide strong { display: block; color: var(--texte); margin-bottom: 4px; }
.chargement { padding: 60px; text-align: center; color: var(--texte-3); }
.squelette { background: linear-gradient(90deg, var(--gris-pale), var(--survol), var(--gris-pale)); background-size: 200% 100%; animation: luire 1.2s infinite; border-radius: 8px; }
@keyframes luire { to { background-position: -200% 0; } }

/* ——— Connexion ——— */
.connexion { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 80% -10%, rgba(227,6,19,.25), transparent 60%), var(--nav); padding: 20px; }
.connexion form { background: var(--surface); padding: 32px; border-radius: 18px; width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; box-shadow: var(--ombre-l); }

/* ——— Document (devis, BC, facture) ——— */
.feuille { background: #fff; color: #0B0D12; width: 210mm; min-height: 297mm; margin: 0 auto; padding: 16mm 15mm; box-shadow: var(--ombre-m); font-size: 10.5pt; line-height: 1.45; color-scheme: light; }
.feuille + .feuille { margin-top: 24px; }
.doc-tete { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.doc-logo { display: flex; align-items: center; gap: 10px; }
.doc-logo svg { width: 46px; height: 46px; }
.doc-logo strong { white-space: nowrap; font-size: 20pt; letter-spacing: .02em; font-weight: 800; }
.doc-emetteur { font-size: 9pt; color: #4B5563; white-space: pre-line; margin-top: 8px; }
.doc-type { text-align: right; }
.doc-type h1 { font-size: 22pt; font-weight: 800; letter-spacing: .04em; color: #E00000; }
.doc-type .num { font-weight: 650; font-size: 11pt; margin-top: 4px; }
.doc-type .date { color: #4B5563; font-size: 9.5pt; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0 18px; }
.doc-bloc { border: 1px solid #E5E7EB; border-radius: 8px; padding: 10px 12px; font-size: 9.5pt; white-space: pre-line; }
.doc-bloc .titre { font-size: 7.5pt; text-transform: uppercase; letter-spacing: .08em; color: #6B7280; font-weight: 650; margin-bottom: 4px; }
.doc-objet { background: #F5F6F8; border-left: 3px solid #E00000; padding: 10px 12px; border-radius: 0 8px 8px 0; font-size: 9.5pt; margin-bottom: 14px; }
.doc-objet .grille-objet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 16px; margin-top: 6px; color: #374151; }
table.doc-lignes { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.doc-lignes th { background: #0B0D12; color: #fff; text-align: left; padding: 7px 8px; font-weight: 600; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .05em; }
.doc-lignes th:first-child { border-radius: 6px 0 0 0; } .doc-lignes th:last-child { border-radius: 0 6px 0 0; }
.doc-lignes td { padding: 7px 8px; border-bottom: 1px solid #E5E7EB; }
.doc-lignes td:nth-child(n+4) { white-space: nowrap; }
.doc-totaux { margin-left: auto; width: 46%; margin-top: 10px; font-size: 10pt; }
.doc-totaux div { display: flex; justify-content: space-between; padding: 4px 8px; }
.doc-totaux div > span:last-child { white-space: nowrap; padding-left: 12px; }
.doc-totaux .ttc { background: #0B0D12; color: #fff; border-radius: 6px; font-weight: 750; font-size: 11.5pt; padding: 8px; margin-top: 4px; }
.doc-lettres { font-size: 9pt; font-style: italic; color: #374151; margin-top: 8px; text-align: right; }
.doc-mentions { font-size: 8.5pt; color: #374151; margin-top: 16px; }
.doc-mentions ul { margin: 4px 0; padding-left: 16px; }
.doc-signature { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; font-size: 9pt; }
.doc-signature .zone { border: 1px dashed #9CA3AF; border-radius: 8px; min-height: 80px; padding: 8px 10px; }
.doc-banque { display: flex; gap: 18px; flex-wrap: wrap; font-size: 8.5pt; border-top: 1px solid #E5E7EB; padding-top: 8px; margin-top: 16px; color: #374151; }
.doc-pied { font-size: 7.5pt; color: #6B7280; text-align: center; margin-top: 18px; }
.doc-cgv { columns: 2; column-gap: 8mm; font-size: 7.6pt; line-height: 1.4; color: #1F2937; }
.doc-cgv h3 { font-size: 8pt; margin: 6px 0 2px; break-after: avoid; }
.doc-cgv p { white-space: pre-line; margin-bottom: 4px; }
.doc-filigrane { color: #B91C1C; border: 2px solid #B91C1C; display: inline-block; padding: 2px 10px; border-radius: 6px; font-weight: 800; transform: rotate(-4deg); margin-top: 6px; }

/* ——— Relevés VTE ——— */
.titre-section { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); margin: 4px 0 -4px; }
.rouge { color: var(--rouge); }
.carte-releve { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; color: inherit; text-decoration: none; transition: border-color .12s; }
.carte-releve:hover { border-color: var(--bord-fort); }
.cr-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 15px; }
.cr-lieu { font-weight: 560; }
.cr-date { font-size: 12.5px; }
.cr-chiffres { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--texte-2); margin-top: 4px; }
.cr-chiffres b { font-size: 16px; color: var(--texte); margin-right: 2px; }
.cr-chiffres .rouge b { color: var(--rouge); }
.totaux-vte { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); position: sticky; top: 8px; z-index: 5; }
.panneau .totaux-vte { position: static; }
.tv-bloc { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; border-left: 1px solid var(--bord); min-width: 0; }
.tv-bloc:first-child { border-left: 0; }
.tv-bloc .l { font-size: 12px; color: var(--texte-3); }
.tv-bloc strong { font-size: 22px; font-weight: 720; letter-spacing: -.02em; }
.tv-bloc strong small { font-size: 13px; font-weight: 500; color: var(--texte-3); letter-spacing: 0; }
.tv-bloc .jauge { height: 6px; margin-top: 2px; }
.tv-bloc .jauge span { background: var(--texte); border-radius: 3px; }
.tv-classes > span:last-child { display: flex; gap: 6px; margin-top: 2px; }
.tv-classe { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--gris-pale); color: var(--texte-2); }
.tv-classe b { font-size: 15px; color: var(--texte); }
.tv-classe.c4 { background: var(--ambre-pale); color: var(--ambre); }
.tv-classe.c5 { background: var(--rouge-pale); color: var(--rouge); }
.tv-classe.c5 b { color: var(--rouge); }
.table-vte td { vertical-align: top; }
.table-vte .v-rang { width: 36px; color: var(--texte-3); }
.table-vte .v-wagon { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-vte .v-wagon .pastille { margin-left: 4px; }
.table-vte .v-defaut { white-space: nowrap; }
.table-vte .v-detail { font-size: 13px; min-width: 260px; }
.table-vte .v-ouvrir { width: 28px; color: var(--texte-3); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 600; }
.reps { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rep { font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--gris-pale); color: var(--texte-2); }
.rep.rep-oui { background: var(--ambre-pale); color: var(--ambre); }
.grand-bouton { height: 52px; font-size: 15px; width: 100%; }
.segments { display: flex; flex-wrap: wrap; gap: 6px; }
.segments label { position: relative; }
.segments input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segments span { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-width: 44px; height: 40px; padding: 0 12px; border: 1px solid var(--bord-fort); border-radius: 9px; background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; user-select: none; }
.segments input:focus-visible + span { box-shadow: 0 0 0 3px rgba(11,13,18,.15); }
.segments input:checked + span { background: var(--texte); border-color: var(--texte); color: var(--surface); }
.segments.etats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segments.etats span { width: 100%; height: 52px; font-size: 15px; }
.segments.etats label:nth-child(1) input:checked + span { background: var(--vert); border-color: var(--vert); color: #fff; }
.segments.etats label:nth-child(2) input:checked + span { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.segments.types span { min-width: 40px; padding: 0 8px; }
.champ-wagon { font-size: 18px !important; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; height: 48px !important; }
#aide-wagon .ok { color: var(--vert); display: inline-flex; gap: 5px; align-items: center; }
#aide-wagon .att { color: var(--ambre); display: inline-flex; gap: 5px; align-items: flex-start; }
.defaut-resultats { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 340px; overflow-y: auto; }
.defaut-option { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: start; text-align: left; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 9px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.defaut-option:hover { background: var(--survol); }
.do-texte { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.do-texte span { color: var(--texte-2); }
.defaut-choisi { border: 1px solid var(--bord-fort); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); }
.dc-tete { display: flex; align-items: center; gap: 8px; }
.dc-tete .btn { margin-left: auto; }
.dc-element { font-weight: 600; }
.dc-exigence { font-size: 13px; }
.dc-methode { font-size: 12px; }
.questions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.question { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 560; color: var(--texte-2); }
.question .segments label { flex: 1; }
.question .segments span { width: 100%; }
.zone-photos { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border: 1px dashed var(--bord-fort); border-radius: 10px; background: var(--surface-2); }
.photo-btn { position: relative; height: 48px; font-size: 15px; }
.cache-visuel { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; }
.photos:empty { display: none; }
.photos figure { position: relative; margin: 0; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--bord); background: var(--gris-pale); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos figure .btn.petit.icone { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; padding: 0; border-radius: 50%; }
.lecture { flex-basis: 100%; font-size: 13px; }
.lecture:empty { display: none; }
.lecture .ok { color: var(--vert); } .lecture .att { color: var(--ambre); }
.lecture svg { vertical-align: -2px; }
.lecture .lu-aussi { display: block; margin-top: 3px; }
.vignettes { display: flex; gap: 6px; margin-top: 6px; }
.vignettes img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--bord); }
.tourne { animation: rotation 1s linear infinite; }
@keyframes rotation { to { transform: rotate(360deg); } }
input[type=datetime-local] { width: 100%; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--bord-fort); background: var(--surface); outline: none; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .nav, .barre-mobile, .entete, .bandeau-demo, #toasts, .pas-imprime, .evitement { display: none !important; }
  .cadre { display: block; }
  .page { padding: 0; max-width: none; }
  .feuille { box-shadow: none; margin: 0; width: auto; min-height: auto; page-break-after: always; }
  .feuille + .feuille { margin-top: 0; }
}

/* ——— Responsive ——— */
/* ——— Compatibilité train – itinéraire ——— */
.onglets-liens a { padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 560; color: var(--texte-2); text-decoration: none; white-space: nowrap; }
.onglets-liens a:hover { background: var(--survol); }
.onglets-liens a[aria-current="page"] { background: var(--texte); color: var(--surface); }
.ambre { color: var(--ambre); }
.plan-reseau { width: 100%; height: auto; display: block; }
.plan-reseau .s { stroke: var(--bord-fort); stroke-width: 3; stroke-linecap: round; }
.plan-reseau path.s { fill: none; }
.plan-attente { aspect-ratio: 1; border-radius: 8px; background: var(--gris-pale); }
.plan-reseau .s-route { stroke-width: 6; }
.plan-reseau .s-ok { stroke: var(--texte); }
.plan-reseau .s-reserve { stroke: var(--ambre); }
.plan-reseau .s-bloquant { stroke: var(--rouge); }
.plan-reseau .s-proposition { stroke: var(--bleu); stroke-width: 3; stroke-dasharray: 7 6; }
.plan-reseau .pt circle { fill: var(--surface); stroke: var(--texte); stroke-width: 2; }
.plan-reseau .pt.fort circle { fill: var(--texte); }
.plan-reseau .pt text { font-size: 12.5px; fill: var(--texte-2); font-weight: 520; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.plan-national .s { stroke-width: 1; }
.plan-national .s-route { stroke-width: 4.5; }
.plan-national .s-proposition { stroke-width: 2.5; stroke-dasharray: 5 4; }
.filtre-sections { padding: 12px 16px 4px; }
.filtre-sections input { width: 100%; max-width: 380px; }
.plan-reseau .pt.fort text { fill: var(--texte); font-weight: 700; }
.legende-plan { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--texte-3); margin-top: 8px; }
.legende-plan span { display: inline-flex; align-items: center; gap: 6px; }
.legende-plan i { width: 20px; height: 0; border-top: 4px solid var(--texte); border-radius: 2px; }
.legende-plan .l-reserve { border-color: var(--ambre); }
.legende-plan .l-bloquant { border-color: var(--rouge); }
.legende-plan .l-proposition { border-top: 3px dashed var(--bleu); }
.legende-plan .l-autre { border-top: 3px solid var(--bord-fort); }
.verdict-rcc { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: var(--rayon); border: 1px solid; }
.verdict-rcc strong { display: block; font-size: 22px; font-weight: 760; letter-spacing: -.02em; }
.verdict-rcc span { font-size: 13px; color: var(--texte-2); }
.verdict-rcc .ic { width: 30px; height: 30px; flex: none; }
.verdict-rcc.v-compatible { background: var(--vert-pale); border-color: var(--vert-bord); color: var(--vert); }
.verdict-rcc.v-reserves { background: var(--ambre-pale); border-color: var(--ambre-bord); color: var(--ambre); }
.verdict-rcc.v-incompatible { background: var(--rouge-pale); border-color: var(--rouge-bord); color: var(--rouge); }
.motifs-rcc { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.encart-calcul { border: 1px solid var(--bord); border-radius: var(--rayon-p); background: var(--surface-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.encart-calcul .etiquette { font-size: 12.5px; font-weight: 560; color: var(--texte-2); }
.encart-calcul p { margin: 0; }
.liste-niveaux { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.motifs-rcc li > * { color: var(--texte); }
.suite-rcc { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--bleu-bord); background: var(--bleu-pale); border-radius: var(--rayon); }
.suite-rcc > .ic { color: var(--bleu); flex: none; }
.suite-rcc > div:first-of-type { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.suite-rcc .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.section-rcc { border-bottom: 1px solid var(--bord); }
.section-rcc:last-child { border-bottom: 0; }
.section-rcc summary { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.section-rcc summary::-webkit-details-marker { display: none; }
.section-rcc summary:hover { background: var(--survol); }
.sr-num { width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--gris-pale); display: grid; place-items: center; font-size: 12px; font-weight: 650; }
.s-bloquant .sr-num { background: var(--rouge-pale); color: var(--rouge); }
.s-reserve .sr-num { background: var(--ambre-pale); color: var(--ambre); }
.sr-titre { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 13px; }
.sr-titre strong { font-size: 14px; }
.sr-motifs { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-weight: 520; }
.sr-chevron { color: var(--texte-3); margin-top: 3px; transition: transform .15s; }
.section-rcc[open] .sr-chevron { transform: rotate(180deg); }
.table-controles { font-size: 13px; }
.table-controles td { vertical-align: top; }
.table-controles .code-rinf { display: block; font-size: 11.5px; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.table-controles .motif { font-size: 12.5px; color: var(--texte-2); margin-top: 4px; max-width: 280px; }
.table-controles tr.c-bloquant { background: var(--rouge-pale); }
.table-controles tr.c-reserve { background: var(--ambre-pale); }
.table-parcours td[data-l="Où"] { color: var(--texte-2); font-size: 12.5px; }
.bilan-ig { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.bilan-ig div { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 8px; font-size: 12px; color: var(--texte-2); }
.bilan-ig strong { font-size: 18px; color: var(--texte); font-variant-numeric: tabular-nums; }
.liste-visas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.liste-visas li { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 8px; font-size: 13px; }
.liste-visas li > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.liste-visas .muet { font-size: 12.5px; }
.liste-visas .visa { display: flex; align-items: flex-start; gap: 6px; color: var(--vert); font-size: 12.5px; font-weight: 520; }
.liste-visas li.vise { background: var(--vert-pale); border-color: transparent; }
.liste-visas .btn { flex-shrink: 0; }
.liste-visas li > .actions { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }
.liste-visas li > div:first-child { flex: 1 1 auto; overflow-wrap: anywhere; }
@media (max-width: 640px) { .liste-visas li { flex-direction: column; } .liste-visas li > .actions { max-width: none; justify-content: flex-start; } }
.detail-ig { margin-top: 12px; }
.detail-ig > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 600; font-size: 13.5px; }
.detail-ig > summary::-webkit-details-marker { display: none; }
.detail-ig[open] > summary { margin-bottom: 8px; }
.detail-ig[open] > summary .sr-chevron { transform: rotate(180deg); }
.table-ig .codes-ig { font-size: 11.5px; color: var(--texte-3); font-variant-numeric: tabular-nums; max-width: 180px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .bilan-ig { grid-template-columns: repeat(2, 1fr); } }
.detail-sections { padding: 0; overflow: hidden; }
.detail-sections > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; font-weight: 600; }
.detail-sections > summary::-webkit-details-marker { display: none; }
.detail-sections > summary .muet { font-weight: 400; margin-left: auto; }
.detail-sections > summary:hover { background: var(--survol); }
.detail-sections[open] > summary { border-bottom: 1px solid var(--bord); }
.detail-sections[open] > summary .sr-chevron { transform: rotate(180deg); }
.liste-compo, .controles-vehicules, .liste-rcc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.liste-compo li { display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.liste-compo .muet { font-size: 12.5px; }
.controles-vehicules li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.liste-rcc { gap: 0; }
.liste-rcc a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--bord); color: inherit; text-decoration: none; }
.liste-rcc li:last-child a { border-bottom: 0; }
.liste-rcc a:hover { background: var(--survol); }
.liste-rcc a > span:first-child { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.empreinte { overflow-wrap: anywhere; font-size: 11.5px; margin: 6px 0; }
.petit-texte { font-size: 12.5px; margin: 0; }
.petit-texte .ic { vertical-align: -3px; }
.table-parc tr.inactif { opacity: .55; }
.compo { display: flex; flex-direction: column; gap: 8px; }
.ligne-compo { display: grid; grid-template-columns: minmax(0, 1fr) 90px 120px 40px; gap: 10px; align-items: end; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--surface-2); }
.compo-pied { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.vias { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vias #puces-via { display: contents; }
.puce-via { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--gris-pale); font-size: 13px; font-weight: 560; }
.puce-via button { border: 0; background: none; color: var(--texte-3); cursor: pointer; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.puce-via button:hover { background: var(--survol); color: var(--texte); }
.select-via { width: auto; min-width: 180px; }
.cases { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.case { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.case input { width: 17px; height: 17px; accent-color: var(--texte); }
.form > .case { align-self: center; }
.choix-format { display: grid; gap: 10px; }
.choix-format .case { align-items: flex-start; line-height: 1.45; }
.choix-format .case input { margin-top: 2px; flex: none; }
.charges { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.charges label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--texte-3); }
.charges input { color: var(--texte); }

@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-principale { grid-template-columns: minmax(0, 1fr); }
}
/* Téléphone et tablette, et au doigt jusqu'à 1000 px : l'iPhone Duo déplié et couché fait 951 px de large pour
   585 de haut (WebKit, Safari 27.1) ; avec le menu à gauche, les tableaux débordaient et les champs restaient en
   13 px, si bien que Safari zoomait dessus. */
@media (max-width: 860px), (pointer: coarse) and (max-width: 1000px) {
  .cadre { grid-template-columns: 1fr; }
  .nav { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .nav.ouverte { transform: none; box-shadow: var(--ombre-l); }
  .barre-mobile { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); background: var(--nav); color: #fff; position: sticky; top: 0; z-index: 40; }
  .barre-mobile button { background: none; border: 0; color: #fff; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; }
  .marque-mobile { justify-self: center; display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; }
  .marque-mobile .logo { width: 30px; height: 30px; border-radius: 8px; background: #fff; display: grid; place-items: center; }
  .marque-mobile .logo svg { width: 20px; height: 20px; }
  .marque-mobile strong { font-size: 16px; font-weight: 750; letter-spacing: .03em; }
  .nav.ouverte ~ .principal .voile { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 45; }
  .large-seul { display: none; }
  span.mobile-seul { display: inline; }
  .onglets-filtre.mobile-seul { display: flex; }
  .bandeau-demo { padding: 6px 10px; margin-bottom: 14px; font-size: 12px; }

  /* Au doigt : champs à 16 px (sinon Safari zoome au focus) et cibles de 44 px. */
  /* !important : des règles plus précises (TVA, tarifs, liens) ne doivent pas repasser sous 16 px. */
  input, select, textarea { font-size: 16px !important; }
  input[type=text], input[type=number], input[type=date], input[type=email], input[type=tel], input[type=password], input[type=search], select { height: 44px; }
  .btn, .btn.petit, .lignes-prix input, .lignes-prix select, .tarifs input { height: 44px; }
  .btn.icone, .btn.petit.icone { width: 44px; }
  .onglets-filtre button { min-height: 40px; padding: 0 12px; }
  .onglets-filtre { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }

  /* Fenêtres : plein écran pour les grandes, feuille basse pour les autres. */
  dialog.panneau { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  dialog.panneau.large { width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .panneau-tete { padding: 8px 8px 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
  .panneau-corps { padding: 16px; }
  .panneau-pied { padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .panneau-pied .btn { flex: 1; }
  .page { padding: 18px 14px 48px; }
  h1 { font-size: 20px; }
  .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .g-4.kpis, .g-3.kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .valeur { font-size: 21px; }
  .form .c2, .form .c3, .form .c4, .form .c6, .form .c8 { grid-column: span 12; }
  table.t.empile thead { display: none; }
  table.t.empile tr { display: block; border-bottom: 1px solid var(--bord); padding: 8px 0; }
  table.t.empile td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 14px; text-align: right; }
  table.t.empile td::before { content: attr(data-l); color: var(--texte-3); font-size: 12px; text-align: left; }
  table.t.empile td.nombre { justify-content: space-between; }
  .feuille { width: 100%; min-height: 0; padding: 18px; font-size: 9.5pt; }
  .doc-parties, .doc-signature { grid-template-columns: 1fr; }
  .doc-tete { flex-wrap: wrap; }
  .doc-type { text-align: left; }
  .doc-type h1 { font-size: 17pt; }
  .doc-totaux { width: 100%; }
  .doc-lignes th, .doc-lignes td { padding: 6px 4px; }
  .doc-lignes th { font-size: 7.5pt; letter-spacing: .02em; }
  .doc-lignes td { font-size: 8.5pt; }
  .doc-cgv { columns: 1; }
  .chat { height: calc(100vh - var(--decalage, 150px) - 14px); height: calc(100dvh - var(--decalage, 150px) - 14px); min-height: 360px; }

  /* Relevé VTE : totaux sur deux rangées, wagons en cartes, questions sur une colonne. */
  .totaux-vte { grid-template-columns: repeat(2, minmax(0, 1fr)); top: 60px; }
  .tv-bloc { padding: 9px 12px; }
  .tv-bloc strong { font-size: 19px; }
  .tv-principal, .tv-classes { grid-column: span 2; border-bottom: 1px solid var(--bord); }
  .tv-classes { flex-direction: row; justify-content: space-between; align-items: center; border-bottom: 0; border-top: 1px solid var(--bord); }
  .tv-bloc:nth-child(2), .tv-classes { border-left: 0; }
  .table-vte thead { display: none; }
  .table-vte tr { display: grid; grid-template-columns: 28px 1fr auto 20px; gap: 4px 8px; padding: 12px 14px; border-bottom: 1px solid var(--bord); }
  .table-vte td { padding: 0; border: 0; }
  .table-vte .v-rang { grid-row: span 3; padding-top: 2px; }
  .table-vte .v-wagon { white-space: normal; }
  .table-vte .v-etat { grid-column: 3; grid-row: 1; }
  .table-vte .v-ouvrir { grid-column: 4; grid-row: 1; }
  .table-vte .v-defaut, .table-vte .v-detail { grid-column: 2 / span 3; min-width: 0; }
  .table-vte .v-defaut:empty, .table-vte .v-detail.vide { display: none; }
  .questions { grid-template-columns: minmax(0, 1fr); }
  input[type=datetime-local] { height: 44px; }

  /* Compatibilité : composition sur deux rangées, propositions empilées, charges sur trois colonnes. */
  .ligne-compo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .ligne-compo .lc-materiel { grid-column: 1 / span 2; }
  .ligne-compo .lc-suppr { grid-column: 3; grid-row: 1; }
  .ligne-compo .lc-nombre { grid-column: 1; }
  .ligne-compo .lc-charge { grid-column: 2; }
  .plan-reseau .pt text { font-size: 21px; stroke-width: 6px; }
  .plan-reseau .pt circle { r: 7; stroke-width: 3; }
  .plan-reseau .s { stroke-width: 5; }
  .plan-reseau .s-route { stroke-width: 10; }
  .plan-reseau .s-proposition { stroke-width: 5; stroke-dasharray: 12 9; }
  .suite-rcc { flex-direction: column; align-items: stretch; }
  .suite-rcc > .ic { display: none; }
  .charges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .verdict-rcc strong { font-size: 19px; }
  .section-rcc summary { padding: 12px 14px; }
  /* Contrôles en cartes : paramètre et résultat, puis valeurs du train et de la ligne, puis le motif. */
  table.t.table-controles tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; padding: 10px 14px; }
  table.t.table-controles td { display: block; padding: 0; text-align: left; font-size: 13px; }
  table.t.table-controles td::before { content: none; }
  table.t.table-controles td[data-l="Paramètre"] { grid-column: 1; grid-row: 1; }
  table.t.table-controles td[data-l="Résultat"] { display: contents; }
  table.t.table-controles td[data-l="Résultat"] .pastille { grid-column: 2; grid-row: 1; align-self: start; }
  table.t.table-controles td[data-l="Train"], table.t.table-controles td[data-l="Ligne"] { grid-column: 1 / span 2; color: var(--texte-2); }
  table.t.table-controles td[data-l="Train"]::before { content: "Train : "; color: var(--texte-3); }
  table.t.table-controles td[data-l="Ligne"]::before { content: "Ligne : "; color: var(--texte-3); }
  table.t.table-controles td[data-l="Où"] { grid-column: 1 / span 2; }
  table.t.table-controles td[data-l="Où"]::before { content: "Où : "; color: var(--texte-3); }
  .table-controles .motif { grid-column: 1 / span 2; max-width: none; margin-top: 2px; }
  .onglets-liens a { min-height: 40px; display: inline-flex; align-items: center; }
  .select-via { width: 100%; }

  /* Indicateurs deux par deux ; la carte mise en avant et la dernière carte seule prennent la largeur. */
  .grille.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > .kpi.accent:first-child, :is(.kpis, .kpis-5) > .kpi:last-child:nth-child(odd) { grid-column: span 2; }
  .kpis:has(> .kpi.accent:first-child) > .kpi:last-child:nth-child(odd):not(:first-child) { grid-column: auto; }
  .kpis:has(> .kpi.accent:first-child) > .kpi:last-child:nth-child(even) { grid-column: span 2; }

  /* Lignes de prix en cartes : article, libellé, Qté et PU côte à côte, total et corbeille. */
  .lignes-prix.edition thead { display: none; }
  .lignes-prix.edition tr[data-k] { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; padding: 12px 14px; border-bottom: 1px solid var(--bord); }
  .lignes-prix.edition tr[data-k] td { padding: 0; border: 0; }
  .lignes-prix.edition .c-article, .lignes-prix.edition .c-libelle { grid-column: span 2; }
  .lignes-prix.edition td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; color: var(--texte-3); margin-bottom: 3px; text-align: left; }
  .lignes-prix.edition .c-total { align-self: center; text-align: left; font-size: 15px; }
  .lignes-prix.edition .c-total::before { content: "Total "; font-weight: 400; color: var(--texte-3); font-size: 12px; }
  .lignes-prix.edition .c-suppr { justify-self: end; }
  .recap-prix .actions { grid-column: span 2; }
  .recap-prix .choix-tva { height: 40px; }
  .recap-prix .actions + span { display: none; }

  .filtres > select { flex: 1 1 100%; width: 100% !important; }
  .filtres > .filtre-date { flex: 1 1 100%; display: flex; align-items: center; gap: 8px; }
  .filtres > .filtre-date input { flex: 1; min-width: 0; }

  /* Graphiques dessinés sur 720 de large : réduits de moitié sur téléphone, leur texte double pour rester lisible. */
  .graphe:not([viewBox^="0 0 160"]) text { font-size: 20px; }

  /* Ligne empilée dont la cellule a un titre et une sous-ligne : le libellé à gauche, les deux l'un sous l'autre à droite. */
  table.t.empile td:has(> .sous-ligne) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; }
  table.t.empile td:has(> .sous-ligne)::before { grid-row: 1 / span 3; }
  table.t.empile td:has(> .sous-ligne) > * { grid-column: 2; }

  /* Prestations en cartes : intitulé et statut, référence, client, dates et agents, montants. */
  table.t.empile.cartes-prest tbody tr.lien { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; padding: 12px 14px; }
  table.t.empile.cartes-prest td { display: block; padding: 0; text-align: left; }
  table.t.empile.cartes-prest td::before { content: none; }
  table.t.empile.cartes-prest .c-intitule { order: 1; flex: 1; min-width: 0; padding-right: 10px; }
  table.t.empile.cartes-prest .c-intitule .sous-ligne { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.t.empile.cartes-prest .c-statut { order: 2; }
  table.t.empile.cartes-prest .c-client { order: 3; flex-basis: 100%; margin-top: 4px; }
  table.t.empile.cartes-prest .c-dates { order: 4; color: var(--texte-2); font-size: 13px; }
  table.t.empile.cartes-prest .c-agents { order: 5; color: var(--texte-2); font-size: 13px; }
  table.t.empile.cartes-prest .c-agents::before { content: "\00a0·\00a0"; color: var(--texte-3); }
  table.t.empile.cartes-prest .c-agents:has(> .muet) { display: none; }
  table.t.empile.cartes-prest .c-ht { order: 6; flex-basis: 100%; margin-top: 4px; }
  table.t.empile.cartes-prest .c-ht::after { content: " HT"; font-weight: 400; color: var(--texte-3); }
  table.t.empile.cartes-prest .c-marge { display: none; }
  table.t.empile.cartes-prest tfoot tr { display: flex; justify-content: space-between; padding: 12px 14px; }
  table.t.empile.cartes-prest tfoot td { display: block; padding: 0; }
  table.t.empile.cartes-prest tfoot td::before { content: none; }
  table.t.empile.cartes-prest tfoot td:last-child { display: none; }

  /* Historique : l'action en premier, puis quand, qui et sur quoi sur une ligne. */
  table.t.empile.historique tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; padding: 10px 14px; }
  table.t.empile.historique td { display: inline; padding: 0; text-align: left; font-size: 12.5px; color: var(--texte-2); }
  table.t.empile.historique td::before { content: none; }
  table.t.empile.historique td + td:not([data-l="Action"])::before { content: "\00a0·\00a0"; color: var(--texte-3); }
  table.t.empile.historique td[data-l="Action"] { order: -1; flex-basis: 100%; font-size: 14px; color: var(--texte); }
  table.t.empile.historique td[colspan] { display: block; flex-basis: 100%; }

  /* Tarifs : une carte par article, prix par niveau sur trois colonnes, chaque champ à sa largeur. */
  table.t.tarifs, table.tarifs tbody { display: block; width: 100%; }
  table.tarifs thead { display: none; }
  table.tarifs tr.groupe, table.tarifs tr.groupe th { display: block; white-space: normal; }
  table.tarifs tr[data-id] { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 14px; border-bottom: 1px solid var(--bord); }
  table.tarifs tr[data-id] td { display: block; border: 0; padding: 0; text-align: left; }
  table.tarifs tr[data-id] td:first-child { grid-column: 1 / -1; font-weight: 600; }
  table.tarifs tr[data-id] td.muet { grid-column: 1 / -1; margin-top: -6px; font-size: 12.5px; }
  table.tarifs td.nombre::before { content: attr(data-l); display: block; margin-bottom: 4px; font-size: 12px; color: var(--texte-3); }
  table.tarifs input { max-width: none; width: 100%; }

  /* Listes de documents en cartes compactes : n° et statut, client, montants, action. */
  table.cartes-docs, table.cartes-docs tbody, table.cartes-docs tfoot { display: block; width: 100%; }
  table.cartes-docs thead { display: none; }
  table.cartes-docs tfoot tr { display: flex; align-items: baseline; gap: 12px; padding: 12px 14px; background: var(--surface-2); }
  table.cartes-docs tfoot td { padding: 0; border: 0; background: none; }
  table.cartes-docs tfoot td:first-child { flex: 1; }
  table.cartes-docs tfoot td:empty, table.cartes-docs #pied-ht { display: none; }
  table.cartes-docs #pied-ttc::after { content: " TTC"; font-weight: 400; color: var(--texte-3); }
  table.cartes-docs tbody tr.lien { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; padding: 12px 14px; border-bottom: 1px solid var(--bord); }
  table.cartes-docs td { border: 0; padding: 0; text-align: left; }
  table.cartes-docs .c-num { flex: 1; order: 1; }
  table.cartes-docs .c-num .sous-ligne { display: inline; margin-left: 6px; }
  table.cartes-docs .c-statut { order: 2; }
  table.cartes-docs .c-client { order: 3; flex-basis: 100%; min-width: 0; }
  table.cartes-docs .c-client .sous-ligne { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.cartes-docs .c-ht { display: none; }
  table.cartes-docs .c-ttc { order: 4; margin-top: 4px; }
  table.cartes-docs .c-ttc::after { content: " TTC"; font-weight: 400; color: var(--texte-3); }
  table.cartes-docs .c-reste { order: 5; }
  table.cartes-docs .c-reste.solde { display: none; }
  table.cartes-docs .c-reste::before { content: "\00a0· reste\00a0"; color: var(--texte-3); }
  table.cartes-docs .c-ech { order: 6; flex-basis: 100%; color: var(--texte-2); font-size: 12.5px; }
  table.cartes-docs tr:has(.c-reste.solde) .c-ech { display: none; }
  table.cartes-docs .c-ech::before { content: "Échéance\00a0"; color: var(--texte-3); }
  table.cartes-docs .c-action { order: 7; flex-basis: 100%; }
  table.cartes-docs .c-action:not(:empty) { margin-top: 8px; }
  table.cartes-docs .c-action .btn { width: 100%; }

  /* Planning : liste jour par jour par défaut, grille avec les seules initiales. */
  .affiche-liste .vue-grille { display: none; }
  .affiche-liste .vue-liste { display: block; }
  .planning-grille { --col-agent: 48px; }
  .planning-grille .agent { padding: 6px 8px; }
  .planning-grille .nom-agent { display: none; }
  .planning-grille .tete:first-child { font-size: 10px; padding: 8px 4px; overflow-wrap: anywhere; }
}
@media (hover: none) {
  .nav-recherche kbd { display: none; }
}
.liste-liens { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.liste-liens li { display: flex; gap: 10px; align-items: flex-end; }
.liste-liens li > div { flex: 1; min-width: 0; display: grid; gap: 4px; font-size: 13.5px; }
.liste-liens input { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; color: var(--texte-2); }
/* Rapprochement bancaire */
.fichier-btn { position: relative; overflow: hidden; }
/* Renvoi vers « Demandes à traiter » en tête des prestations ; articles des conditions générales (Réglages). */
a.lien-alerte { margin-bottom: 16px; color: inherit; text-decoration: none; }
a.lien-alerte:hover { filter: brightness(.98); text-decoration: underline; }
.article-cg { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px 14px; padding: 12px; border: 1px solid var(--bord); border-radius: 9px; }
.reglage-conditions > form { padding: 16px; }
.liste-ops { list-style: none; margin: 0; padding: 0; }
.liste-ops > li.op { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 14px 18px; border-top: 1px solid var(--bord); }
.liste-ops > li.op:first-child { border-top: 0; }
.op-tete { grid-column: 1 / -1; display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.op-date { color: var(--texte-3); font-size: 12.5px; white-space: nowrap; }
.op-lib { flex: 1; min-width: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.op-montant { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.op-prop { display: flex; gap: 10px; align-items: flex-start; min-width: 0; font-size: 13px; }
.op-detail { min-width: 0; }
.op-detail ul { margin: 4px 0 0; padding-left: 18px; }
.op-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-self: end; }
.choix-factures { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.choix-factures > li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 8px; border: 1px solid var(--bord); border-radius: 8px; }
.choix-factures > li[hidden] { display: none; }
.choix-factures .case { align-items: flex-start; flex: 1; min-width: 0; }
.choix-factures .case input { margin-top: 2px; flex: none; }
.choix-factures .sous-ligne { display: block; color: var(--texte-3); font-size: 12.5px; }
.choix-factures input[type=number] { width: 120px; flex: none; text-align: right; }
@media (max-width: 720px) {
  .liste-ops > li.op { grid-template-columns: 1fr; padding: 14px; }
  .op-tete { flex-wrap: wrap; }
  .op-lib { flex-basis: 100%; order: 3; }
  .op-montant { margin-left: auto; }
  .op-prop { flex-direction: column; gap: 6px; }
  .op-actions { justify-content: flex-start; }
  .op-actions:empty { display: none; }
  .choix-factures > li { flex-wrap: wrap; }
  .choix-factures input[type=number] { width: 100%; }
}

/* Préremplissage depuis ERATV, au-dessus du formulaire du matériel */
.bloc-eratv { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--bord); }
.rangee-eratv { display: flex; gap: 8px; }
.rangee-eratv input { flex: 1; min-width: 0; }
.liste-eratv { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 240px; overflow-y: auto; }
.liste-eratv li { overflow-wrap: anywhere; }
.import-eratv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lecture-marquage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lecture-marquage > div { flex-basis: 100%; }
.lecture-marquage p { margin: 0; }
.avis-marquage { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; color: var(--ambre); font-size: 13px; }
.avis-marquage li { display: flex; gap: 6px; align-items: flex-start; }
.avis-marquage .ic-s { flex: none; margin-top: 2px; }
.charges.charges-ligne { grid-template-columns: repeat(9, minmax(0, 1fr)); }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1000px) { .charges.charges-ligne { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Aide au prix */
.raisons { margin: 0; padding-left: 18px; font-size: 13px; color: var(--texte-2); display: grid; gap: 3px; }
.carte-alerte { border-color: var(--rouge); }
.choix-format .sous-ligne { display: block; color: var(--texte-3); font-size: 12.5px; margin-top: 2px; }
.liste-achats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.liste-achats li { display: flex; justify-content: space-between; gap: 12px; }
.liste-achats li span { font-variant-numeric: tabular-nums; white-space: nowrap; }
.liste-recyclages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.liste-recyclages li { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ajout-stagiaire { padding: 14px 16px; border-top: 1px solid var(--bord); align-items: end; }
.ajout-stagiaire .c1 { grid-column: span 1; }
.ajout-stagiaire .c1 .btn { width: 100%; justify-content: center; }
.objectifs { margin: 12px 0 0; font-size: 13.5px; }
td.actions-ligne { width: 1%; white-space: nowrap; text-align: right; }
@media (max-width: 720px) { .ajout-stagiaire .c1 { grid-column: span 12; } }
@media (max-width: 720px) { table.t.empile td.actions-ligne { width: auto; justify-content: flex-end; } table.t.empile td.actions-ligne:empty { display: none; } }

/* ——— Rapport d'activité ——— */
.filtres-rapport { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.filtres-rapport .raccourcis { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.filtres-rapport .btn.actif { background: var(--texte); color: var(--surface); border-color: var(--texte); }
.note-rapport { padding: 10px 18px 14px; font-size: 12px; }
.rapport-table tfoot td { border-top: 1px solid var(--bord-fort); }
.imprime-seul { display: none; }
@media (max-width: 1100px) { .filtres-rapport { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .filtres-rapport { grid-template-columns: 1fr 1fr; }
  .filtres-rapport .champ:nth-child(5) { grid-column: 1 / -1; }
  table.t.empile td.vide-mobile { display: none; }
  table.t.empile tfoot tr { border-bottom: 0; }
}
@page rapport { size: A4; margin: 12mm; }
@media print {
  .rapport { page: rapport; gap: 10px; }
  .rapport .imprime-seul { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 2px solid var(--rouge); }
  .rapport .rapport-entete strong { font-size: 18px; }
  .rapport .carte { box-shadow: none; }
  .rapport .garde, .rapport .kpis, .rapport tr { break-inside: avoid; }
  .rapport .kpi.accent { background: none; color: inherit; border-color: var(--bord); }
  .rapport .kpi.accent::after { display: none; }
  .rapport .kpi.accent .libelle, .rapport .kpi.accent .detail { color: var(--texte-2); }
  /* La page A4 fait moins de 720 px de large : on annule la mise en page téléphone. */
  .rapport .grille.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .rapport .grille.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .rapport .kpis > .kpi { grid-column: auto !important; padding: 10px 12px; }
  .rapport .kpi .valeur { font-size: 19px; }
  .rapport .kpi .detail { font-size: 10.5px; }
  .rapport .garde { font-size: 11px; }
  .rapport table.t.empile { font-size: 10px; }
  .rapport table.t.empile thead { display: table-header-group; }
  .rapport table.t.empile tr { display: table-row; padding: 0; }
  .rapport table.t.empile td, .rapport table.t.empile td.vide-mobile { display: table-cell; text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--bord); }
  .rapport table.t.empile th { padding: 5px 6px; }
  .rapport table.t.empile td.nombre { text-align: right; white-space: nowrap; }
  .rapport table.t.empile td::before { content: none; }
  .rapport .pastille { font-size: 9.5px; }
  .rapport .sous-ligne { font-size: 9px; }
  .rapport .carte-prestations { break-before: page; }
  .rapport .note-rapport { font-size: 9px; }
  .rapport .tableau-conteneur { overflow: visible; }
  .rapport tr.lien { cursor: default; }
}

/* ——— Comptes et rôles ——— */
.masque-champ { display: none !important; }
.nav-pied .qui { justify-content: space-between; color: #C9CED8; font-size: 12.5px; }
.nav-pied .qui .role { font-size: 11px; color: #8A92A3; border: 1px solid #2A303C; border-radius: 6px; padding: 1px 6px; }
.nav-pied .voir-comme { flex-direction: column; align-items: stretch; gap: 4px; }
.nav-pied .voir-comme select { background: #12151C; color: #C9CED8; border: 1px solid #2A303C; border-radius: 7px; padding: 5px 6px; font: inherit; font-size: 12px; }
.roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.roles dt { font-weight: 640; margin-bottom: 2px; }
.roles dd { margin: 0; color: var(--texte-2); font-size: 13px; }
tr.inactif td { opacity: .55; }
/* Rôle sur mesure : un domaine par ligne, ses niveaux à droite. */
.droits-domaines { display: flex; flex-direction: column; border-top: 1px solid var(--bord); }
.droit-domaine { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 8px 0; border-bottom: 1px solid var(--bord); flex-wrap: wrap; }
.droit-domaine > span { flex: 1 1 220px; font-size: 13.5px; }
.droit-domaine .segments { flex: 0 0 auto; gap: 4px; }
.droit-domaine .segments span { height: 34px; padding: 0 10px; font-size: 13px; }
.mdp-provisoire { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; letter-spacing: .04em; user-select: all; }
.form-mdp { display: flex; flex-direction: column; gap: 12px; }
.form-mdp [role=alert]:empty { display: none; }
.form-mdp [role=alert] { color: var(--rouge); }

/* ——— Mon planning (agent) ——— */
.missions { list-style: none; margin: 0; padding: 0; }
.missions li { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--bord); align-items: start; }
.missions li:first-child { border-top: 0; }
.missions li.en-cours { background: var(--survol); }
.missions li.passee { opacity: .7; }
.mission-date { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mission-corps { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.mission-corps > span { display: inline-flex; align-items: center; gap: 5px; color: var(--texte-2); }
.mission-ref { font-size: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.liste-simple { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.liste-simple li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lien-agenda { display: flex; gap: 8px; }
.lien-agenda input { flex: 1; min-width: 0; font-size: 12.5px; }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1000px) { .lien-agenda input { font-size: 16px; } }
@media (max-width: 720px) {
  .roles { grid-template-columns: 1fr; }
  .missions li { grid-template-columns: 1fr; gap: 6px; }
  .mission-date { flex-direction: row; align-items: center; }
}

/* ——— Relevé de véhicule : convois, PV d'avarie, demande de prestation du client ——— */
.totaux-convoi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.table-convoi td, .table-convoi th { white-space: nowrap; }
.table-convoi .nb { text-align: right; font-variant-numeric: tabular-nums; }
.table-convoi .v-rang { color: var(--texte-3); }
.table-convoi .v-wagon { font-variant-numeric: tabular-nums; }
.table-convoi .v-detail { white-space: normal; min-width: 180px; font-size: 13px; }
.table-convoi .v-ouvrir { width: 28px; color: var(--texte-3); }
.table-convoi tr.laisse td { color: var(--texte-3); }
.table-convoi .v-resume { display: none; }
.bulletin-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.table-bulletin { border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; }
.table-bulletin td { padding: 7px 12px; font-size: 13.5px; }
.table-bulletin .nb { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-bulletin tr.section th { background: var(--surface-2); }
.table-bulletin tr.total td { font-weight: 650; }
.liste-operations { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.liste-operations li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--bord); font-size: 13.5px; }
.liste-operations li:last-child { border-bottom: 0; }
.liste-operations .muet { font-size: 12.5px; }
fieldset.operation, fieldset.etape-demande { border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px 12px; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
fieldset.operation legend, fieldset.etape-demande legend { font-weight: 620; font-size: 13.5px; padding: 0 4px; }
.cases-ligne { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.lien-demande { display: flex; gap: 8px; margin: 10px 0 6px; }
.lien-demande input { flex: 1; min-width: 0; font-size: 13px; }
.actions-lien { display: flex; flex-wrap: wrap; gap: 4px; }
.page-demande { background: var(--fond); }
.demande { max-width: 920px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.demande-tete { display: flex; align-items: center; gap: 12px; }
.demande-tete .logo svg { width: 38px; height: 36px; display: block; }
.demande-tete div { display: flex; flex-direction: column; }
.demande-tete strong { font-size: 18px; }
.demande-tete span { color: var(--texte-2); font-size: 14px; }
.question small { font-weight: 400; }
.erreur-demande { color: var(--rouge); font-weight: 560; }
.erreur-demande:empty { display: none; }
.envoi-demande { display: flex; justify-content: flex-end; }
.envoi-demande .btn { min-width: 220px; height: 46px; font-size: 15px; }
.demande-merci h1 { margin: 0 0 8px; font-size: 22px; }
.demande-merci .btn { margin-top: 12px; }
.demande-pied { text-align: center; font-size: 13px; }
.signer { max-width: 720px; }
.signer-devis h1 { margin: 0; font-size: 22px; }
.signer-objet { margin: 4px 0 14px; color: var(--texte-2); }
.signer-pdf { margin-top: 16px; }
.signer-accord { align-items: flex-start; line-height: 1.45; padding: 12px; border: 1px solid var(--bord-fort); border-radius: 10px; }
.signer-accord input { margin-top: 2px; flex: none; }
.signer-code { display: grid; grid-template-columns: minmax(0, 220px) max-content; justify-content: start; align-items: end; gap: 6px 10px; }
.signer-code .aide { grid-column: 1 / -1; margin: 0; }
.signer-code input { font-size: 18px; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
.signer-code input::placeholder { font-size: 15px; letter-spacing: normal; }
.signer-boutons { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.signer-boutons .btn.primaire { min-width: 220px; height: 46px; font-size: 15px; }
.signer-legal { font-size: 12px; margin: 0; }
.signature-devis .lien-demande { margin-top: 0; }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1000px) {
  .totaux-convoi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .totaux-convoi .tv-bloc:nth-child(3) { border-left: 0; }
  .totaux-convoi .tv-bloc:nth-child(n+3) { border-top: 1px solid var(--bord); }
  .bulletin-grille { grid-template-columns: minmax(0, 1fr); }
  .liste-operations li { grid-template-columns: minmax(0, 1fr) auto; }
  /* Composition en cartes : numéro, puis longueur, masses et régime sur une ligne. */
  .table-convoi thead { display: none; }
  .table-convoi tr { display: grid; grid-template-columns: auto minmax(0, 1fr) 20px; gap: 2px 10px; padding: 10px 14px; border-bottom: 1px solid var(--bord); }
  .table-convoi td { display: none; padding: 0; border: 0; }
  .table-convoi td.v-rang, .table-convoi td.v-wagon, .table-convoi td.v-ouvrir, .table-convoi td.v-resume { display: block; white-space: normal; }
  .table-convoi td.v-resume { grid-column: 2 / span 2; font-size: 13px; color: var(--texte-2); }
  .table-convoi td.v-ouvrir { grid-column: 3; grid-row: 1; }
  .table-convoi tfoot tr { background: var(--surface-2); }
  .liste-operations li .muet { grid-column: 1; grid-row: 2; }
  .envoi-demande .btn { width: 100%; }
  .signer-code { grid-template-columns: minmax(0, 1fr); }
  .signer-boutons { flex-direction: column-reverse; }
  .signer-boutons .btn { width: 100%; }
}

/* Révision du véhicule dans la saisie VTE (cartouche de maintenance, CUU 6.1.2). */
fieldset.bloc-revision { border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px 12px; margin: 0; min-width: 0; }
fieldset.bloc-revision legend { font-weight: 620; font-size: 13.5px; padding: 0 4px; }
.etat-revision { font-size: 13px; }
.etat-revision .ok, .revision-ligne.ok { color: var(--vert); }
.etat-revision .att, .revision-ligne.att { color: var(--ambre); }
.etat-revision .err, .revision-ligne.err { color: var(--rouge); font-weight: 600; }
.etat-revision span { display: inline-flex; gap: 5px; align-items: flex-start; }
.revision-ligne { font-size: 12.5px; margin-top: 3px; }

/* Prix du sillon (itinéraire entre gares, redevances du DRR) */
.sillon-etapes { display: flex; flex-direction: column; gap: 8px; position: relative; }
.sillon-etape { display: flex; align-items: center; gap: 10px; }
.sillon-etape input { flex: 1; min-width: 0; }
.sillon-puce { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--texte-2); background: var(--surface); }
.sillon-puce.depart, .sillon-puce.arrivee { background: var(--texte); border-color: var(--texte); }
.sillon-etapes > .btn { align-self: flex-start; margin-left: 22px; }
.sillon-resultat { border: 1px solid var(--bord); border-radius: 10px; margin-top: 4px; overflow: hidden; }
.sillon-trajet { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; padding: 14px 18px 0; }
.sillon-trajet .muet { font-size: 12.5px; }
.sillon-km { margin: 12px 18px 0; padding-top: 0; border-top: 0; }
.sillon-km input { width: 100%; max-width: 130px; height: 32px; font-weight: 650; }
.sillon-redevances { margin-top: 12px; }
.sillon-resultat > .alerte { margin: 0 18px 12px; }
.sillon-lignes { padding: 0 18px 12px; font-size: 13px; }
.sillon-lignes summary { cursor: pointer; color: var(--texte-2); padding: 4px 0; }
.sillon-source { font-size: 12px; margin: 0; padding: 0 18px 14px; }
@media (max-width: 700px) { .sillon-suffixe { display: none; } }

/* Questions de Haesir Studio au client, écran par écran (démonstration) */
.bandeau-retours { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: -6px 0 18px; border: 1px solid var(--bord-fort); border-radius: 10px; background: var(--surface); font-size: 13.5px; }
.bandeau-retours > span { flex: 1; min-width: 0; }
.bandeau-retours.urgent { border-color: var(--ambre-bord); background: var(--ambre-pale); }
.bandeau-retours.urgent > .ic { color: var(--ambre); }
.retours-liste .q-ecran { margin: -8px 0 0; font-size: 12.5px; }
.retours-liste .q-ecran a { display: inline-flex; align-items: center; gap: 4px; }
.nav-lien .compteur.neutre { background: var(--texte-2); }
.retours-liste { gap: 14px; }
.question-retour { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--bord); border-radius: 10px; background: var(--surface); }
.question-retour.repondue { border-color: var(--vert); }
.question-retour .q-texte { margin: 0; font-weight: 560; line-height: 1.45; }
.question-retour .q-texte .ic-s { color: var(--vert); vertical-align: -2px; margin-right: 6px; }
.question-retour .segments span { height: auto; min-height: 38px; padding: 6px 12px; font-weight: 560; font-size: 13.5px; }
.question-retour textarea { width: 100%; min-height: 0; resize: vertical; }
.question-retour .q-pied { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.question-retour.remarque { border-style: dashed; }
.question-retour.traitee { background: var(--fond); }
.question-retour.traitee p { margin: 0; }
.question-retour .q-suite { color: var(--texte-2); font-size: 13.5px; line-height: 1.45; }
.remarques-envoyees .question-retour + .question-retour { margin-top: 8px; }
.retours-note { font-size: 12.5px; margin: 0; }
.retours-note .ic-s { vertical-align: -2px; margin-right: 4px; }
.remarques-envoyees p { margin: 8px 0 0; white-space: pre-line; }
@media (max-width: 700px) {
  .bandeau-retours { flex-wrap: wrap; margin-top: 0; }
  .question-retour .segments label { flex: 1 1 100%; }
  .question-retour .segments span { width: 100%; justify-content: flex-start; }
  .question-retour .q-pied { flex-direction: column; align-items: stretch; }
}

/* Relevé de véhicule : calcul du freinage, signature de l'agent formation, masses lues sur photo. */
.calcul-freinage { grid-column: 1 / -1; display: grid; gap: 4px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 8px; background: var(--surface-2); }
.calcul-freinage p { margin: 0; overflow-wrap: anywhere; }
.annotations { display: grid; gap: 4px; margin-top: 6px; }
.annotations .form-section { grid-column: auto; }
.annotations p { margin: 0; font-weight: 600; }
.choix-masses { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.zone-signature { position: relative; max-width: 600px; border: 1px dashed var(--bord-fort); border-radius: 8px; background: #fff; overflow: hidden; }
.zone-signature canvas { display: block; width: 100%; height: auto; aspect-ratio: 600 / 180; touch-action: none; cursor: crosshair; }
.zone-signature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ligne-boutons { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; max-width: 600px; }
.signature-agent { margin: 8px 0 0; }
.signature-agent img { display: block; max-width: 240px; width: 100%; height: auto; background: #fff; border: 1px solid var(--bord); border-radius: 6px; }
.conditions-train { display: flex; flex-wrap: wrap; gap: 8px 20px; border: 1px solid var(--bord); border-radius: 8px; padding: 10px 12px; }
.conditions-train legend { padding: 0 4px; font-size: 13px; color: var(--texte-2); }
.bloc-md { border: 1px solid var(--bord); border-radius: 8px; padding: 8px 12px; }
.bloc-md summary { cursor: pointer; font-weight: 600; }
.bloc-md[open] summary { margin-bottom: 8px; }
.annotations p.muet { font-weight: 400; }

/* ——— Personnel : tableau des échéances, dossier de l'agent, paramètres ——— */
.form > .ligne-boutons, form.pile > .ligne-boutons, .carte-corps > .ligne-boutons, .carte-corps .pile > .ligne-boutons { max-width: none; }
.form .c5 { grid-column: span 5; } .form .c9 { grid-column: span 9; }
.form h3, .carte-form h3 { margin: 6px 0 0; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-3); }
.carte-form { padding: 16px 18px; }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis-5 .kpi .valeur.ambre { color: var(--ambre); }
.t tr.ligne-jaune td { background: var(--ambre-pale); }
.t tr.ligne-rouge td { background: var(--rouge-pale); }
.t tr.ligne-jaune td:first-child { box-shadow: inset 3px 0 0 var(--ambre); }
.t tr.ligne-rouge td:first-child { box-shadow: inset 3px 0 0 var(--rouge); }
.t tr.groupe th { background: var(--surface); color: var(--texte-2); text-transform: none; letter-spacing: 0; font-size: 12.5px; padding-top: 14px; }
.jours { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 999px; font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.jours.ambre { background: var(--ambre-bord); color: var(--ambre); }
.jours.rouge { background: var(--rouge-bord); color: var(--rouge); }
.dossier-tete { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; min-width: 0; }
.dossier-tete .onglets-liens { overflow-x: auto; scrollbar-width: thin; min-width: 0; }
.photo-mini { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.photo-agent { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.photo-agent img { width: 96px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bord); }
.photo-agent .av { width: 64px; height: 64px; font-size: 20px; }
.habs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding: 4px 0; }
.carte > .habs { padding: 16px 18px; }
.hab { border: 1px solid var(--bord); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); min-width: 0; }
.hab-proche { border-color: var(--ambre-bord); background: var(--ambre-pale); }
.hab-depassee, .hab-suspendue { border-color: var(--rouge-bord); background: var(--rouge-pale); }
.hab-non { border-style: dashed; background: var(--surface-2); }
.hab-tete strong { display: block; overflow-wrap: anywhere; }
.hab-tete .sous-ligne { display: block; font-size: 12px; color: var(--texte-3); }
.hab-dates { display: flex; gap: 18px; margin: 0; font-size: 12.5px; }
.hab-dates dt { color: var(--texte-3); font-size: 11.5px; }
.hab-dates dd { margin: 0; font-weight: 560; font-variant-numeric: tabular-nums; }
.hab-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.ajout-hab { padding: 14px 18px; border-top: 1px solid var(--bord); margin-top: 12px; }
.carte > .ajout-hab { margin-top: 0; }
.titre-registre .carte-corps { padding: 16px 18px; }
.interrupteur { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.interrupteur input { width: 18px; height: 18px; }
.champ-ligne { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--texte-2); }
.champ-ligne select { width: auto; }
.libelle-champ { display: block; font-size: 12.5px; font-weight: 560; color: var(--texte-2); margin-bottom: 6px; }
.signature-apercu { max-width: 260px; max-height: 90px; background: #fff; border: 1px solid var(--bord); border-radius: 6px; padding: 4px; }
.pastille-couleur { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.t .centre { text-align: center; }
.t.alertes-personnel input { width: 18px; height: 18px; }
.cases legend { font-size: 12.5px; font-weight: 560; color: var(--texte-2); margin-bottom: 6px; padding: 0; width: 100%; }
fieldset.cases { border: 0; padding: 0; margin: 0; }
@media (max-width: 1100px) { .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form .c5, .form .c9 { grid-column: span 12; }
  .habs { grid-template-columns: minmax(0, 1fr); }
  .t.alertes-personnel { font-size: 12px; }
  .dossier-tete > .av, .dossier-tete > .photo-mini { display: none; }
}
.mission-corps > span.alerte-ligne { color: var(--ambre); font-weight: 560; display: block; }
.carte-corps:not(.serre) > .carte-corps { padding: 0; }
/* ——— Sécurité (module 2, public/js/vues/securite.js et ma-securite.js) ———
   Couleurs SAMI de Bourse du Rail : S vert foncé, A vert clair, M orange, I rouge ; NC et NO en gris. */
/* Heure du contrôle : même champ que les dates (la règle générale ne couvre pas type=time). */
input[type=time] { width: 100%; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--bord-fort); background: var(--surface); color: inherit; outline: none; }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1000px) { input[type=time], input[type=color] { height: 44px; } }
:root { --sami-s: #166534; --sami-a: #86EFAC; --sami-a-encre: #14532D; --sami-m: #EA580C; --sami-i: #DC2626; --sami-n: #E5E7EB; --sami-n-encre: #374151; }
.note-sami { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 6px; font-size: 12px; font-weight: 700; background: var(--sami-n); color: var(--sami-n-encre); }
.note-S { background: var(--sami-s); color: #fff; } .note-A { background: var(--sami-a); color: var(--sami-a-encre); }
.note-M { background: var(--sami-m); color: #fff; } .note-I { background: var(--sami-i); color: #fff; }
.tuiles-sami { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tuile-sami { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "lettre l" "lettre n" "lettre pct"; gap: 0 12px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--sami-n); color: var(--sami-n-encre); }
.tuile-sami .lettre { grid-area: lettre; font-size: 30px; font-weight: 800; line-height: 1; }
.tuile-sami .l { grid-area: l; font-size: 12px; opacity: .85; } .tuile-sami strong { grid-area: n; font-size: 20px; } .tuile-sami .pct { grid-area: pct; font-size: 12px; opacity: .85; }
.note-fond-S { background: var(--sami-s); color: #fff; } .note-fond-A { background: var(--sami-a); color: var(--sami-a-encre); }
.note-fond-M { background: var(--sami-m); color: #fff; } .note-fond-I { background: var(--sami-i); color: #fff; }
.liste-sami { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.liste-sami li > a, .liste-sami li > .li-plein { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 6px; border-radius: 8px; color: inherit; text-decoration: none; }
.liste-sami li > a:hover { background: var(--survol); }
.liste-sami li > a > .note-sami { flex: none; }
.liste-sami li > a > span:not(.pastille):not(.note-sami), .liste-sami .li-plein > span:not(.pastille) { flex: 1; min-width: 0; }
.liste-sami .sous-ligne { display: block; font-size: 12px; }
.compteurs-plans { margin-top: 12px; } .compteurs-plans h3 { font-size: 12.5px; color: var(--texte-3); margin: 0 0 4px; font-weight: 560; }
.compteurs-plans ul { list-style: none; margin: 0; padding: 0; } .compteurs-plans li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 0; }
.filtres-securite { margin-bottom: 16px; }
.onglets-securite { margin-bottom: 16px; }
.filtres-securite > .bas, form[data-form="nouveau-point"] > .bas, form[data-form="reglages"] > .bas { align-self: end; }
.filtres-securite > .bas .btn, form[data-form="nouveau-point"] > .bas .btn, form[data-form="reglages"] > .bas .btn { width: 100%; justify-content: center; }
.ligne-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ligne-actions .espace { flex: 1; }
.barre-plan { margin-top: 0; padding: 12px 14px; border: 1px solid var(--bord); border-radius: 10px; background: var(--surface); }
/* Grille du contrôle : barre de couleur à gauche selon la note. */
.grille-kn { list-style: none; margin: 0; padding: 0; }
.grille-kn .categorie-kn, .edition-points .categorie-kn { padding: 10px 18px 6px; font-size: 12.5px; font-weight: 650; color: var(--texte-3); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); border-top: 1px solid var(--bord); }
.point-kn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 10px 18px 10px 14px; border-top: 1px solid var(--bord); border-left: 4px solid transparent; }
.point-kn .point-details { grid-column: 1 / -1; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px; }
.note-bord-S { border-left-color: var(--sami-s); } .note-bord-A { border-left-color: var(--sami-a); } .note-bord-M { border-left-color: var(--sami-m); } .note-bord-I { border-left-color: var(--sami-i); } .note-bord-NC, .note-bord-NO { border-left-color: var(--bord-fort); }
.notes-sami span { min-width: 40px; height: 36px; padding: 0 8px; font-size: 13px; }
.notes-sami input:checked + .n-S { background: var(--sami-s); border-color: var(--sami-s); color: #fff; }
.notes-sami input:checked + .n-A { background: var(--sami-a); border-color: var(--sami-a); color: var(--sami-a-encre); }
.notes-sami input:checked + .n-M { background: var(--sami-m); border-color: var(--sami-m); color: #fff; }
.notes-sami input:checked + .n-I { background: var(--sami-i); border-color: var(--sami-i); color: #fff; }
.notes-sami input:checked + .n-NC, .notes-sami input:checked + .n-NO { background: var(--sami-n); border-color: var(--bord-fort); color: var(--sami-n-encre); }
.notes-sami input:disabled + span { cursor: default; opacity: .75; }
.notes-sami input:disabled:checked + span { opacity: 1; }
.notes-sami.grandes span { min-width: 52px; height: 44px; font-size: 16px; }
.note-globale { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.note-globale p { margin: 2px 0 0; font-size: 13px; }
.compte-notes { font-size: 12.5px; font-weight: 500; margin-left: 8px; }
/* PVI et PVK : matrice des notes. */
.matrice-sami th, .matrice-sami td { white-space: nowrap; }
.matrice-sami td:first-child { white-space: normal; min-width: 220px; }
.matrice-sami .col-note { text-align: center; width: 1%; }
.matrice-sami th.col-note a { color: inherit; text-decoration: none; }
.matrice-sami .sous-ligne { display: block; font-size: 11px; color: var(--texte-3); }
.matrice-sami tr.groupe th { text-align: left; background: var(--surface-2); font-size: 12.5px; }
.matrice-sami tr.total td { background: var(--surface-2); font-size: 12.5px; }
.legende-sami { margin: 0 0 12px; }
.liste-points { margin: 0; padding-left: 28px; display: grid; gap: 4px; font-size: 13.5px; }
.liste-points li::marker { content: "P" counter(list-item) "  "; color: var(--texte-3); font-size: 12px; }
/* Cycle d'un PAI ou d'un PAG. */
.frise-statuts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.frise-statuts li { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--bord); font-size: 12.5px; color: var(--texte-3); background: var(--surface); }
.frise-statuts li.faite { color: var(--texte-2); background: var(--surface-2); }
.frise-statuts li.courante { color: var(--surface); background: var(--texte); border-color: var(--texte); font-weight: 650; }
.table-modalites input { width: 100%; min-width: 0; }
.table-modalites td:first-child { min-width: 220px; }
/* Édition des KN. */
.form-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-ligne input[type=text] { flex: 1; min-width: 180px; }
.liste-categories, .edition-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.edition-points { margin: 0 -18px 16px; gap: 0; }
.edition-points .point-edition { padding: 8px 18px; border-top: 1px solid var(--bord); }
.edition-points .point-edition select { width: 160px; }
.boutons-point { display: inline-flex; align-items: center; gap: 4px; }
.table-droits td, .table-droits th { text-align: center; } .table-droits td:first-child, .table-droits th:first-child { text-align: left; }
.texte-libre { white-space: pre-line; margin: 12px 0 0; }
.champ-inline select { max-width: 260px; }
@media (max-width: 1180px) { .tuiles-sami { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1000px) {
  .tuiles-sami { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .point-kn { grid-template-columns: minmax(0, 1fr); padding: 10px 14px 12px 10px; }
  .point-kn .point-details { grid-template-columns: minmax(0, 1fr); }
  .notes-sami { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .notes-sami.grandes { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .notes-sami span { min-width: 0; width: 100%; height: 44px; }
  .edition-points .point-edition select { width: 100%; }
  .table-modalites td:first-child { min-width: 0; }
  .champ-inline, .champ-inline select { width: 100%; max-width: none; }
}
/* ——— Bulletins de service, bureau (public/js/vues/bulletins.js) ; la tablette a son css/bs.css ——— */
.bs-point { display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 4px; background: var(--c, #C2C2C2); border: 1px solid rgba(0, 0, 0, .12); }
.bs-points { display: inline-flex; gap: 4px; flex-wrap: wrap; }
a.bs-kpi { color: inherit; text-decoration: none; }
a.bs-kpi:hover { border-color: var(--bord-fort); }
.bs-filtre { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texte-2); }
.bs-filtre input, .bs-filtre select { width: auto; }
.bs-lien { color: inherit; text-decoration: none; }
.bs-lien:hover { text-decoration: underline; }
.bs-export { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--bord); }
.bs-export-pieces { display: inline-flex; gap: 8px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.bs-export-pieces select { width: auto; max-width: min(100%, 22em); min-width: 0; flex: 1 1 12em; }
.bs-temps-intro { padding: 12px 14px 0; margin: 0; }
.bs-temps-agent { padding: 12px 14px 4px; border-top: 1px solid var(--bord); }
.bs-temps-agent h3 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; font-size: 1rem; }
.bs-temps-agent .alerte { margin-bottom: 10px; }
.bs-temps-liste { margin: 0; padding-left: 1.1em; }
.bs-temps-repos { margin: 0 0 10px; font-size: 13px; }
.bs-boutons { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.bs-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.bs-bureau .info > span:first-child { display: block; font-size: 12px; color: var(--texte-3); }
.bs-bureau .info > strong { display: block; font-weight: 560; margin-top: 2px; overflow-wrap: anywhere; }
.bs-justif { padding: 12px 14px; border-top: 1px solid var(--bord); }
.bs-justif p { margin: 2px 0 0; }
.bs-activite-bureau { padding: 12px 0; border-bottom: 1px solid var(--bord); }
.bs-activite-bureau:first-child { padding-top: 0; }
.bs-activite-bureau:last-child { border-bottom: 0; padding-bottom: 0; }
.bs-activite-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bs-activite-tete span:last-child { margin-left: auto; font-weight: 650; }
.bs-signalement, .bs-fiche { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--bord); }
.bs-signalement:first-child, .bs-fiche:first-child { padding-top: 0; }
.bs-signalement:last-child { border-bottom: 0; padding-bottom: 0; }
.bs-signalement p { margin: 6px 0 0; }
.bs-fiche { flex-direction: column; }
.bs-fiche .infos { width: 100%; }
.bs-fiche + .btn { margin-top: 12px; }
.bs-fiche-tete { display: flex; justify-content: space-between; gap: 12px; width: 100%; }
.bs-photos-bureau { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.bs-photos-bureau a { display: flex; flex-direction: column; border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; color: inherit; text-decoration: none; }
.bs-photos-bureau img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--surface-2); }
.bs-photos-bureau span { padding: 6px 8px; font-size: 12.5px; color: var(--texte-2); }
.bs-etapes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1000px) {
  .bs-signalement { flex-direction: column; }
  .bs-onglets { flex: 1 1 100%; min-width: 0; max-width: 100%; }
  .bs-onglets button { flex: none; white-space: nowrap; }
  .bs-filtre { flex: 1 1 140px; }
  .bs-filtre input, .bs-filtre select { width: 100%; }
}
.bs-intro { margin: 0 0 14px; }

/* Fiche client : remplissage depuis l'annuaire des entreprises */
.champ.annuaire { background: var(--surface-2); border: 1px solid var(--bord); border-radius: var(--rayon-p); padding: 12px; gap: 6px; }
.annuaire label span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.annuaire-resultats { display: grid; gap: 6px; }
.annuaire-resultats:empty { display: none; }
.annuaire-ligne { display: grid; gap: 2px; text-align: left; width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--bord); border-radius: var(--rayon-p); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.annuaire-ligne:hover, .annuaire-ligne:focus-visible { border-color: var(--accent); background: var(--survol); }
.annuaire-ok { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--vert); font-weight: 600; }
.annuaire-nom { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* Trains et sillons (vues/circulations.js) */
.ligne-boutons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
table.circulations tr.passe { opacity: .62; }
.via, #horaire { display: grid; gap: 6px; margin-bottom: 6px; }
.via-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 160px 84px 44px; gap: 6px; align-items: center; }
.horaire-ligne, .horaire-tete { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px 44px; gap: 6px; align-items: center; }
.horaire-tete { font-size: 12px; color: var(--texte-3); margin-bottom: 4px; }
.lecture-sillon { display: grid; gap: 8px; justify-items: start; }
.lecture-sillon details, .lecture-sillon #lecture-sillon { width: 100%; }
.lecture-sillon textarea { width: 100%; margin: 8px 0; }
.marche-resume { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 14px 18px; border-bottom: 1px solid var(--bord); }
.marche-resume .l { display: block; font-size: 12px; color: var(--texte-3); }
.marche-resume strong { font-size: 18px; font-weight: 680; }
.marche-points:not(.tous) tr.point-lieu { display: none; }
.marche-points tr.attribue td:first-child strong { text-decoration: underline; text-decoration-color: var(--vert, currentColor); text-underline-offset: 3px; }
.note-marche { font-size: 12px; margin-top: 10px; }
.carte-corps.serre .note-marche { padding: 0 18px 14px; }
.demande-sillon { display: grid; gap: 8px; margin: 0; }
.demande-sillon div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; }
.demande-sillon dt { color: var(--texte-3); font-size: 13px; }
.demande-sillon dd { margin: 0; overflow-wrap: anywhere; }
.demande-sillon .btn.copier-champ { height: 24px; width: 24px; margin-left: 6px; vertical-align: middle; color: var(--texte-3); }
.demande-sillon mark { background: var(--ambre-pale); color: var(--ambre); padding: 0 3px; border-radius: 4px; }
.equipe-train { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.equipe-train li { display: flex; flex-direction: column; gap: 2px; }
.troncons { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.troncon { border: 1px solid var(--bord); border-radius: var(--rayon-p); padding: 12px 14px; display: grid; gap: 4px; }
.troncon.manque { border-color: var(--rouge); }
.troncon-tete { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.troncon .avis { display: flex; gap: 6px; align-items: center; color: var(--ambre); font-size: 13px; }
.troncon details { font-size: 13px; }
.troncon details ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 720px) {
  .via-ligne, .horaire-ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .via-ligne input[name=via_nom], .horaire-ligne input[name=h_nom] { grid-column: 1 / 3; }
  .via-ligne button, .horaire-ligne button { grid-column: 3; grid-row: 1; }
  .horaire-tete { display: none; }
  .demande-sillon div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
.carte-marche .carte-tete { flex-wrap: wrap; gap: 6px 12px; }
.marche-outils { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
@media (max-width: 720px) {
  .marche-points .col-ligne { display: none; }
  .marche-points th, .marche-points td { padding-left: 10px; padding-right: 10px; }
}
.horaire-ligne .mini { display: grid; gap: 2px; min-width: 0; }
.horaire-ligne .mini span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.horaire-ligne .mini input { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 720px) { .horaire-ligne .mini span { position: static; width: auto; height: auto; clip-path: none; font-size: 11.5px; color: var(--texte-3); } }

/* Nouveautés du logiciel (public/js/nouveautes.js) */
.nouveautes-liste { gap: 12px; }
.nouveaute { border: 1px solid var(--bord); border-radius: var(--rayon, 10px); padding: 14px 16px; background: var(--surface, transparent); }
.nouveaute.nouvelle { border-color: var(--bleu-bord); }
.nouveaute-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.nouveaute-tete h3 { margin: 0; font-size: 15px; }
.nouveaute-tete .muet { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.nouveaute p { margin: 8px 0 10px; line-height: 1.5; }

/* Train et compatibilité sur la fiche prestation */
#carte-train .carte-corps > p:first-child { margin-top: 0; }
.verdict-devis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 8px; }
#carte-train details { margin: 8px 0; }
#carte-train details > summary { cursor: pointer; color: var(--texte-2, inherit); }
#carte-train details .controles-vehicules, #carte-train details .motifs-rcc { margin-top: 8px; }
.sep-carte { border-top: 1px solid var(--bord); margin: 12px -16px 0; }
#carte-train .liste-rcc { margin: 0 -16px -14px; }
.table-engins input, .table-engins select, .table-engins textarea { width: 100%; min-width: 0; }
.table-engins td { vertical-align: top; }
#carte-train .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Renseignements techniques de la ligne (fiche d'un train). */
.liste-rt { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.liste-rt li { border-top: 1px solid var(--bord); padding-top: 10px; overflow-wrap: anywhere; }
.liste-rt li:first-child { border-top: 0; padding-top: 0; }

/* Transport exceptionnel (fiche d'un train). */
.etapes-te { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.etapes-te li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bord); }
.etapes-te li:last-child { border-bottom: 0; }
.etapes-te li > span:first-child { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.te-etat { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.textes-te { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.textes-te .l { font-size: 12px; color: var(--texte-3); margin-bottom: 4px; }
.textes-te pre { white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--survol); border-radius: 8px; padding: 10px; margin: 0 0 6px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .etapes-te li { flex-direction: column; align-items: flex-start; } }
.plan-resume { margin: 0 0 6px; }
.plan-points li { border-left: 3px solid transparent; padding-left: 10px; }
.plan-points li.plan-bloquant { border-left-color: var(--rouge); }
.plan-points li.plan-a_faire { border-left-color: var(--ambre); }
.plan-points li.plan-sans_objet strong { color: var(--texte-3); font-weight: 500; }

/* Import ERATV : dépôt de l'export XML, secours quand le registre demande une vérification humaine. */
.bloc-eratv.survol-depot { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 8px; }
.secours-eratv { display: grid; gap: 8px; justify-items: start; padding: 12px; border-radius: 8px; background: var(--ambre-pale); }
.secours-eratv p { margin: 0; }

/* Relevés collés depuis un tableur (essieux RDE, points hors gabarit) : colonnes alignées. */
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.point-visite { border-top: 1px solid var(--bord); padding-top: 10px; }
/* Reconnexion sur place (outils.js) : le pied de la fenêtre est dans le formulaire. */
.reconnexion .panneau-pied { margin: 16px -20px -18px; }
@media (max-width: 860px), (pointer: coarse) and (max-width: 1000px) { .reconnexion .panneau-pied { margin: 16px -16px -16px; } }
/* Pas-à-pas « D'une demande au transport » (Prestations, Comment faire). */
.guide { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 14px; counter-reset: etape; }
.guide li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; counter-increment: etape; }
.guide-icone { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-pale); color: var(--accent); }
.guide strong::before { content: counter(etape) ". "; }
.guide p { margin: 2px 0 0; }
/* Boîte de demandes (Prestations) : mails reçus et texte du mail dans le panneau. */
.mails-traites { border-top: 1px solid var(--bord); }
.mails-traites > summary { cursor: pointer; padding: 12px 18px; font-size: 13px; color: var(--texte-2, inherit); }
.mail-texte > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.texte-mail { margin-top: 8px; padding: 12px; border: 1px solid var(--bord); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; max-height: 40vh; overflow: auto; }

/* Coût de l'IA (vues/ia-cout.js) : jauge du plafond mensuel. */
.jauge-ia { height: 6px; border-radius: 3px; background: var(--bord); overflow: hidden; margin-top: 10px; }
.jauge-ia > span { display: block; height: 100%; background: var(--vert, #16A34A); border-radius: 3px; }
.jauge-ia.haute > span { background: var(--ambre, #D97706); }
.jauge-ia.pleine > span { background: var(--rouge, #E00000); }
/* Planning : absences, missions à commander et anomalies (src/planification.js). */
.bloc-absence { position: absolute; top: 4px; bottom: 4px; left: 3px; z-index: 0; border-radius: 7px; padding: 4px 8px; font-size: 11px; font-weight: 600; color: var(--texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--bord-fort, var(--bord)); background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--gris-pale) 6px 12px); }
.bloc-absence.demandee { border-style: dashed; background: var(--surface-2); }
.bloc.a-commander { outline: 2px dashed var(--texte-2); outline-offset: -2px; }
.bloc.anomalie { outline: 2px solid var(--rouge); outline-offset: 1px; }
.bloc .ic { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
.legende-planning { font-size: 12px; margin-top: 10px; }
.titre-groupe { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 640; margin: 12px 18px 4px; color: var(--texte-2); }
.titre-groupe:first-child { margin-top: 8px; }
.liste-commande { list-style: none; margin: 0; padding: 0; }
.liste-commande li { border-bottom: 1px solid var(--bord); }
.liste-commande .case { display: flex; gap: 10px; align-items: flex-start; padding: 10px 18px; cursor: pointer; }
.liste-commande .case > span { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.liste-commande input[disabled] + span { opacity: .75; }
.liste-commande .alerte-ligne { color: var(--rouge); }
.pied-commande { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 18px; }
.pied-commande .case { display: flex; gap: 8px; align-items: center; }
.lien-bouton { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.lien-bouton:hover { color: var(--texte); }
.filtre-date { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--texte-2); }
.filtre-date input { width: auto; }
.pied-liste { display: flex; justify-content: center; padding: 12px; }
.pied-liste:empty { display: none; }
.sans-retour { white-space: nowrap; }
/* Modules de la licence (vues/comptes.js). */
.liste-modules { list-style: none; margin: 0; padding: 0; }
.liste-modules li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--bord); }
.liste-modules li:last-child { border-bottom: 0; }

/* Grand écran tactile (iPhone Duo déplié 669 et 951 px, iPad 810 px) : deux champs par ligne au lieu d'un, et les
   fenêtres gardent une largeur de lecture au lieu de couvrir tout l'écran. */
@media (min-width: 600px) and (max-width: 860px), (min-width: 600px) and (pointer: coarse) and (max-width: 1000px) {
  .form .c3, .form .c4, .form .c6 { grid-column: span 6; }
  dialog.panneau:not(.large) { width: min(760px, 100%); margin: auto auto 0; }
}

/* Écran bas (iPhone Duo plié et couché : 368 px de haut, Safari 27.1) : la barre du haut défile avec la page,
   les fenêtres prennent toute la hauteur et leurs bandeaux se resserrent, pour laisser la place aux champs. */
@media (max-height: 480px) and (max-width: 1000px) {
  .barre-mobile { position: static; }
  dialog.panneau { max-height: 100dvh; scroll-padding-block: 44px 56px; }
  .panneau-tete { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; }
  .panneau-pied { padding-top: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .bandeau-demo { margin-bottom: 8px; }
  .totaux-vte { top: 0; }
}

/* Règle iPhone (CLAUDE.md) : au doigt, quelle que soit la largeur. L'iPhone en paysage (874 px) et l'iPad
   passent au-dessus de 860 px et gardaient le réglage de la souris : champ « Voir comme » à 12 px (Safari
   zoome au focus), boutons de 30 et 36 px, « Mode sombre » à 25 px. */
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  input[type=text], input[type=number], input[type=date], input[type=email], input[type=tel], input[type=password], input[type=search], select { height: 44px; }
  .btn, .btn.petit, .lignes-prix input, .lignes-prix select, .tarifs input { height: 44px; }
  .btn.icone, .btn.petit.icone { width: 44px; }
  .nav-titre, .nav-recherche, .nav-lien, .nav-pied button, .aide-ecran > summary, .evitement { min-height: 44px; }
  .droit-domaine .segments span { height: 44px; }
  /* le logo de la barre du haut : zone invisible, la barre garde sa hauteur */
  .marque, .marque-mobile { position: relative; }
  .marque::after, .marque-mobile::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
