/* ══════════════════════════════════════════════════════════════════════
   Socle graphique commun — portail, « Mon équipe », backoffice, connexion
   TA INFO — Espace client
   Composants et gabarits. AUCUNE couleur, police ni taille de texte en dur ici : tout vient des
   variables de reglages.css, chargée juste avant (changer le design = changer reglages.css).
   Chaque feuille de zone (dashboard.css, admin.css, auth.css) charge reglages.css puis ce socle
   et ne garde que ce qui lui est propre : aucune définition en double. Charte : docs/design.md.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100vh; min-height: 100lvh; background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-body); font-size: var(--t-md); line-height: 1.5; font-weight: 400;
    background: var(--bg); color: var(--text);
    min-height: 100vh;
    font-synthesis: none;   /* jamais de faux gras : seules les graisses hébergées s'affichent */
    /* Pas de display:flex sur body (casse le plein écran iOS) ; menu en fixed + margin-left */
    transition: background .2s, color .2s;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-weight: 600; color: var(--title); line-height: 1.25; }
/* Un titre garde la police des titres, même dans un composant qui fixe la police de l'interface pour son contenu
   (html:root : passe devant une règle « .composant h2 », comme le faisait l'habillage avant sa fusion dans le socle). */
html:root h1, html:root h2, html:root h3, html:root h4 { font-family: var(--font-title); letter-spacing: -.01em; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-underline-offset: 3px; }
:focus-visible { outline: none; outline-offset: 2px; box-shadow: var(--ring); }
.sr-only {
    position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
/* Lien « Aller au contenu » (ui_skip()) : premier arrêt du clavier, visible seulement quand il a le focus */
.skip-link {
    position: absolute; left: var(--s-3); top: var(--s-3); z-index: 300; display: inline-flex; align-items: center;
    min-height: var(--tap); padding: 0 var(--s-4); border-radius: var(--radius-sm); background: var(--btn-bg); color: var(--on-primary);
    font-weight: 600; text-decoration: none; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
@media (max-width: 767px) { .skip-link:focus { transform: translateY(calc(env(safe-area-inset-top, 0px) + var(--tap) + var(--s-2))); } }   /* téléphone : sous la barre du haut, jamais sur le bouton du menu */
.main-wrap:focus { outline: none; box-shadow: none; }   /* cible du lien : pas d'anneau autour de toute la page */
.ico { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.ico-fill { fill: currentColor; }
.ico-gap { margin-right: 4px; }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warning-text); }   /* action à faire (dépassement à revoir au bilan ou à lisser) */
.num, .tnum { font-variant-numeric: tabular-nums; }

/* ── Mise en page : menu latéral, contenu ──────────────────────────── */
.sidebar {
    width: var(--sidebar-w); flex-shrink: 0;
    background: var(--sidebar-bg); box-shadow: var(--sidebar-shadow);
    position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; z-index: 100;
    overflow: hidden;   /* règle 5 : seul le menu défile ; le haut, l'encart d'aide et le compte restent visibles */
    transition: background .2s;
}
.sidebar > * { flex-shrink: 0; }
.sidebar > .sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--sidebar-muted); border-radius: 2px; }
.sidebar-brand {
    padding: 18px 16px 14px; padding-top: calc(18px + env(safe-area-inset-top));
    border-bottom: 1px solid transparent; flex-shrink: 0; text-align: center;
}
.sidebar-brand img { width: 132px; height: auto; display: block; margin: 0 auto 6px; }
.sidebar-brand img.brand-logo-dark { display: none; }
html[data-theme="dark"] .sidebar-brand img.brand-logo-light { display: none; }
html[data-theme="dark"] .sidebar-brand img.brand-logo-dark  { display: block; }
/* Logo cliquable vers l'accueil (composant 92) : même taille et même place, anneau de focus du socle */
.brand-link { display: block; width: fit-content; margin-inline: auto; border-radius: var(--radius-sm); }
.sidebar-brand-admin .brand-link { margin-inline: 0; }
.sidebar-brand p, .sidebar-brand .sub { color: var(--sidebar-muted); font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 500; }
.sidebar-brand .cname {
    display: block; color: var(--sidebar-text-strong); font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 600;
    margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Sélecteur de société (compte rattaché à plusieurs sociétés, includes/portal_nav.php) : la liste
   s'ouvre sous le nom, dans le menu (pas de fenêtre flottante, que le menu couperait) */
.org-switch { margin-top: 4px; text-align: left; }
.org-switch > summary {
    display: flex; align-items: center; gap: 4px; list-style: none; cursor: pointer;
    padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--sidebar-border);
    font-family: var(--font-ui); font-size: var(--t-sm); color: var(--sidebar-text);
}
.org-switch > summary::-webkit-details-marker { display: none; }
.org-switch > summary:hover { background: var(--sidebar-hover-bg); }
.org-switch > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.org-switch .org-caret { margin-left: auto; flex-shrink: 0; transition: transform .15s; }
.org-switch[open] .org-caret { transform: rotate(180deg); }
.org-list { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.org-opt {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: var(--radius-sm);
    background: none; color: var(--sidebar-text); font-family: var(--font-ui); font-size: var(--t-sm); text-align: left; cursor: pointer;
}
.org-opt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-opt:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text-strong); }
.org-opt .um-check { margin-left: auto; flex-shrink: 0; opacity: 0; color: var(--sidebar-active-text); }
.org-opt.active { color: var(--sidebar-active-text); font-weight: 600; }
.org-opt.active .um-check { opacity: 1; }
.sidebar-nav { flex: 1; padding: 12px 10px; }
.nav-section {
    font-family: var(--font-title); font-size: var(--t-xs); font-weight: 600; color: var(--sidebar-muted);
    text-transform: uppercase; letter-spacing: .07em; padding: 16px 10px 6px;
}
.nav-item {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px;
    padding: 8px 10px; margin-bottom: 2px; border-radius: var(--radius-sm);
    color: var(--sidebar-text); font-family: var(--font-ui); font-size: var(--t-md); font-weight: 500;
    text-decoration: none; text-align: left; background: none; border: none; cursor: pointer;
    transition: background .15s, color .15s;
}
.nav-item:hover  { background: var(--sidebar-hover-bg); color: var(--sidebar-text-strong); }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.nav-item .nav-icon { flex-shrink: 0; opacity: .85; }
.nav-item:hover .nav-icon, .nav-item.active .nav-icon { opacity: 1; }
.nav-item.active .nav-icon { color: var(--primary); }
/* Menu du portail (includes/portal_nav.php) : service courant déplié et ses sous-entrées (8 au plus). */
.nav-imp { color: var(--warning-text) !important; }
.nav-item.nav-open:not(.active) { color: var(--sidebar-active-text); font-weight: 600; }
.nav-item.nav-open:not(.active) .nav-icon { opacity: 1; }
.nav-sub { list-style: none; margin: 2px 0 8px 18px; padding: 0 0 0 10px; border-left: 1px solid var(--sidebar-border); }
.nav-sub-item {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 1px; border-radius: var(--radius-sm);
    color: var(--sidebar-text); font-size: var(--t-sm); text-decoration: none; transition: background .15s, color .15s;
}
.nav-sub-item:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text-strong); }
.nav-sub-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.nav-sub-item:focus-visible, .nav-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.nav-sub-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-sub-item.nav-sub-more { color: var(--sidebar-muted); font-size: var(--t-xs); }
.nav-sub-item.nav-sub-more.active { color: var(--sidebar-active-text); }
.sidebar-footer {
    padding: 12px 10px 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--sidebar-border); flex-shrink: 0;
}
/* Menu du compte (thème, mot de passe, déconnexion) */
.user-menu-wrap { position: relative; }
.user-info {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 9px 10px; margin-bottom: 5px; border-radius: var(--radius-md);
    background: transparent; border: none; cursor: pointer; text-align: left;
    transition: background .15s;
    min-height: 52px;
}
.user-info:hover { background: var(--sidebar-hover-bg); }
.user-avatar {
    width: var(--tap-sm); height: var(--tap-sm); border-radius: 50%; flex-shrink: 0;
    background: var(--sidebar-avatar-bg); color: var(--sidebar-avatar-text);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-title); font-size: var(--t-xs); font-weight: 600;
}
.user-details { flex: 1; min-width: 0; }
.user-details .uname, .user-details .name {
    color: var(--sidebar-text-strong); font-family: var(--font-ui); font-size: var(--t-md); font-weight: 500; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-details .login {
    color: var(--sidebar-muted); font-size: var(--t-xs); line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-caret { margin-left: auto; flex-shrink: 0; color: var(--sidebar-muted); transition: transform .2s; }
.user-menu-wrap.open .user-caret { transform: rotate(180deg); }
.user-menu {
    position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 200;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); padding: 6px;
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.user-menu-wrap.open .user-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.um-section { font-family: var(--font-title); font-size: var(--t-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; padding: 8px 10px 4px; }
.um-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 8px 10px; border-radius: var(--radius-xs); border: none; background: none;
    color: var(--text); font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 500;
    cursor: pointer; text-decoration: none; text-align: left; transition: background .12s;
}
.um-item:hover { background: var(--surface-2); }
.um-item svg { flex-shrink: 0; opacity: .85; }
.um-item .um-check { margin-left: auto; opacity: 0; color: var(--primary); }
.um-item.active { color: var(--primary); }
.um-item.active .um-check { opacity: 1; }
.um-item.um-danger { color: var(--danger); }
.um-form { display: contents; }   /* déconnexion : formulaire POST dans le menu, bouton à la place du lien */
.um-form.um-orgs { display: none; }   /* choix de la société dans le menu du compte : tablette seulement */
.um-divider { height: 1px; background: var(--line); margin: 5px 4px; }

.main-wrap { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
/* Contenu jusqu'à 1 600 px (--content-max), centré ; tableaux et grilles en pleine largeur */
.content { flex: 1; width: 100%; max-width: calc(var(--content-max) + 56px); margin: 0 auto; padding: 28px; }   /* mêmes marges que la barre de titre : bords alignés */

/* ── Barre de titre ────────────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; gap: 12px; min-height: 64px;
    padding: 12px 28px; background: var(--bg); border-bottom: 1px solid transparent;
    /* titre aligné sur le contenu (1 600 px au plus, centré) */
    padding-left: max(28px, calc((100% - var(--content-max)) / 2)); padding-right: max(28px, calc((100% - var(--content-max)) / 2));
}
/* Titre de la page : police des titres, couleur du texte */
.topbar h1 {
    flex: 1; font-family: var(--font-title); font-weight: 600; font-size: var(--t-2xl); line-height: 1.2;
    color: var(--title); letter-spacing: -.01em;
}
.btn-sidebar-toggle {
    display: none; width: var(--tap); height: var(--tap); flex-shrink: 0;
    align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text-soft); cursor: pointer; transition: background .15s;
}
.btn-sidebar-toggle:hover { background: var(--primary-pale); }
/* Zone cliquable derrière le tiroir : TRANSPARENTE et arrêtée aux zones sûres (règle iOS
   de CLAUDE.md : un fond sombre ou plein écran fait peindre en gris les barres de Safari) */
.sidebar-overlay {
    position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; bottom: env(safe-area-inset-bottom, 0px);
    background: transparent; z-index: 190; cursor: pointer;
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease;
}
.sidebar-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

/* Barre collante (pages sans en-tête composé : backoffice, « Mon équipe ») ; sous 768 px elle défile */
.topbar-sticky { position: sticky; top: 0; z-index: 50; padding-top: calc(12px + env(safe-area-inset-top)); }
/* Barre collée translucide : ordinateur et tablette seulement. Sous 768 px elle garde un fond PLEIN, celui de la page :
   Safari d'iOS 26 peint la zone de l'heure avec le fond de l'élément collé en haut (CLAUDE.md, « Bandes grises iOS Safari »). */
@media (min-width: 769px) {
    @supports (backdrop-filter: blur(8px)) {
        .topbar-sticky { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
    }
}

/* Pied de page du portail et de « Mon équipe » (support, Confidentialité et cookies) */
.footer {
    text-align: center; padding: 16px 28px; color: var(--muted); font-size: var(--t-xs);
    border-top: 1px solid var(--line); margin-top: auto;
}
.footer a { color: var(--primary); text-decoration: none; }
/* Fraîcheur (« Mis à jour le … », écrite par le script) : le point séparateur n'apparaît qu'avec elle (composant 93) */
.footer-fresh:not(:empty)::before { content: "· "; }
/* Texte long (page Confidentialité et cookies) : titres de section, paragraphes aérés */
.prose h2 { margin: 22px 0 6px; font-size: var(--t-lg); }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 10px; line-height: 1.6; color: var(--text-soft); }
.prose .prose-meta { margin-top: 22px; font-size: var(--t-xs); color: var(--muted); }

/* ── Cartes ────────────────────────────────────────────────────────── */
/* Pile de cartes d'une page : espacement régulier entre les blocs */
.stack { display: grid; gap: 20px; }
.stack > * { min-width: 0; }
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 18px 24px; border-bottom: 1px solid var(--line);
}
/* Titres de blocs : police des titres, 600 */
.card-header h2, .card-title { flex: 1; font-family: var(--font-title); font-weight: 600; font-size: var(--t-lg); color: var(--title); }
.card-body { padding: 24px; }

/* ── Boutons : principal, secondaire, discret, danger, icône ; 44 px (page) ou 36 px (tableau) ── */
.btn, .btn-primary, .btn-outline, .btn-ghost, .btn-danger, .btn-danger-solid, .btn-icon {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex-shrink: 0;
    min-height: var(--tap); padding: 0 18px; border-radius: var(--radius-sm);
    border: 1px solid transparent; background: transparent;
    font-family: var(--font-ui); font-size: var(--t-md); font-weight: 600; line-height: 1.1;
    text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.btn[hidden] { display: none; }   /* l'attribut hidden prime sur display: inline-flex */
.btn-primary { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--on-primary); }
.btn-primary:hover { background: var(--btn-bg-hover); border-color: var(--btn-bg-hover); }
.btn-outline { border-color: var(--field-border); color: var(--title); background: var(--surface); }
.btn-outline:hover { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.btn-ghost { border-color: var(--field-border); color: var(--text-soft); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-danger-solid { background: var(--danger-strong); border-color: var(--danger-strong); color: var(--on-danger); }
.btn-danger-solid:hover { filter: brightness(.94); }
.btn-icon { width: var(--tap); padding: 0; border-color: var(--line); color: var(--text-soft); background: var(--surface); }
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm, td .btn, td .btn-primary, td .btn-outline, td .btn-ghost, td .btn-danger {
    min-height: var(--tap-sm); padding: 0 12px; font-size: var(--t-sm); border-radius: var(--radius-xs);
}
.btn-icon.btn-sm, td .btn-icon { width: var(--tap-sm); min-height: var(--tap-sm); padding: 0; border-radius: var(--radius-xs); }
.btn:disabled, .btn-primary:disabled, .btn-outline:disabled, .btn-ghost:disabled, .btn-danger:disabled, .btn-danger-solid:disabled, .btn-icon:disabled {
    opacity: .5; cursor: not-allowed;
}
.btn-block { display: flex; width: 100%; }
.btn-link {
    background: none; border: 0; padding: 0; font: inherit; color: var(--primary);
    text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.btn-link:hover { color: var(--primary-hover); }
.btn-link:disabled { color: var(--muted); cursor: not-allowed; }

/* ── Champs et formulaires ─────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label, label.form-label {
    display: block; margin-bottom: 6px;
    font-family: var(--font-title); font-size: var(--t-xs); font-weight: 600; color: var(--text-soft);
    text-transform: uppercase; letter-spacing: .04em;
}
.form-control {
    display: block; width: 100%; min-height: var(--tap); padding: 9px 14px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--field-border); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: var(--t-md);   /* 16 px : pas de zoom iOS au focus */
    transition: border-color .15s, box-shadow .15s;
}
textarea.form-control { min-height: 88px; line-height: 1.45; }
.form-control::placeholder { color: var(--placeholder); }
.form-control:hover { border-color: var(--muted); }
.form-control:focus { outline: none; border-color: transparent; box-shadow: var(--ring); }
.form-control:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
/* Champs de date et d'heure (composant 14) : Safari d'iPhone leur donne une largeur propre qui ignore width: 100 % et déborde
   de la carte à 390 px (« Mon compte », Rappels) — largeur du conteneur, aspect natif retiré sur iPhone et iPad, texte à gauche */
.form-control[type="date"], .form-control[type="time"], .form-control[type="datetime-local"], .form-control[type="month"], .form-control[type="week"] { min-width: 0; }
@supports (-webkit-touch-callout: none) {
    .form-control[type="date"], .form-control[type="time"], .form-control[type="datetime-local"], .form-control[type="month"], .form-control[type="week"] {
        -webkit-appearance: none; appearance: none;
    }
}
.form-control::-webkit-date-and-time-value { text-align: left; }
.form-hint { margin-top: 5px; font-size: var(--t-xs); color: var(--muted); }
.form-hint code { overflow-wrap: anywhere; }   /* chemin ou commande dans une aide (tâche planifiée) : coupé à la largeur de la carte sur téléphone */
.form-static { margin: 0; padding: 4px 0 0; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }   /* valeur en lecture seule à la place d'un champ */
.form-error { margin: 6px 0 0; font-size: var(--t-xs); color: var(--danger); }
/* Formulaire dans sa carte : aligné à gauche (plus de colonne centrale étroite) ; ce sont les champs
   qui sont limités (--field-max) et les cartes qui se placent côte à côte (docs/design.md) */
.form-center { max-width: none; }
/* Boutons d'un formulaire : l'action (Enregistrer) puis Annuler */
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
/* Bloc secondaire d'une fiche, sous le formulaire (mot de passe, appareils, suppression) : séparé par un filet
   (fiche utilisateur du backoffice et de « Mon équipe », qui ne charge pas admin.css) */
.form-block { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-block h3 { margin-bottom: 4px; }
.form-block .form-hint { margin: 0 0 12px; }
/* Aide collée à son libellé, avant une liste, entre deux */
.form-hint.hint-flush { margin: 0; }
.form-hint.hint-lead { margin: 0 0 8px; }
.form-hint.hint-mid { margin: 8px 0; }
/* Deux champs côte à côte (un seul sous 640 px) */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: minmax(0, 1fr); } }
/* Cases à cocher : la case puis UN seul <span> de libellé (plusieurs morceaux en flex = colonnes) */
.check-line { display: flex; align-items: center; gap: 10px; min-height: 28px; cursor: pointer; font-size: var(--t-sm); color: var(--text); }
.check-line > span { flex: 1 1 auto; min-width: 0; }
.check-line[hidden] { display: none; }   /* l'attribut hidden prime sur display: flex (choix masqué selon les destinataires, recherche) */
.check-line input[type="checkbox"], .check-line input[type="radio"] { flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--btn-bg); }
/* Liste de cases (lignes accessibles…) dans un encadré */
.check-list {
    display: flex; flex-direction: column; gap: 8px; padding: 12px 14px;
    border: 1.5px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface-2);
}
/* Liste à hauteur bornée (.info-pick, .rights-pick) : une ligne garde toujours sa hauteur (sinon, en colonne flexible, les lignes
   se tassent et leurs textes de deux ou trois lignes se chevauchent). */
.check-list > .check-line { flex-shrink: 0; }
.check-meta { margin-left: 6px; color: var(--muted); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
/* Options des briques ui_field() et ui_check() (composants 78 et 81, lot 2 de la nouvelle interface) : lien à droite du
   libellé d'un champ, bouton à droite du champ sur la même ligne, précision d'une case sous son libellé. */
.form-label-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-1) var(--s-3); margin-bottom: 6px; }
.form-label-row > .form-label { margin-bottom: 0; }
.field-row { display: flex; align-items: flex-start; gap: var(--s-2); }
.form-group > .field-row { max-width: var(--field-max); }
.field-row > .form-control { flex: 1 1 auto; min-width: 0; }
.check-stack { align-items: flex-start; }
.check-stack input[type="checkbox"] { margin-top: 2px; }
.check-stack .check-meta { display: block; margin: 2px 0 0; }
.form-control[aria-invalid="true"] { border-color: var(--danger); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--btn-bg); width: 16px; height: 16px; }

/* ── Tableaux : en-tête bleu pâle, lignes alternées, total bleu clair ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: transparent; }
thead th {
    padding: 14px; text-align: left; white-space: nowrap;
    font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: .03em;
    border-bottom: 1px solid var(--line);
}
tbody tr { transition: background .1s; }
tbody tr:nth-child(even) { background: transparent; }
tbody tr:hover { background: var(--surface-2); }
/* Marges latérales de 14 px (16 px avant le lot 1 de la nouvelle interface) : elles compensent l'échelle des textes
   (cellules à 15 px, en-têtes à 13 px), pour qu'un tableau garde sa largeur */
td { position: relative; padding: 14px; font-size: var(--t-sm); color: var(--text); vertical-align: middle; font-variant-numeric: tabular-nums; }
th { position: relative; }
tbody tr:not(:last-child) td { border-bottom: 1px solid var(--line); }
.td-muted { color: var(--muted); }
td.td-muted { font-size: var(--t-sm); }
/* Tableau vide : une cellule sur toute la largeur, texte centré */
/* 55. Tableau vide = une phrase, sans en-têtes (ux/pages-legeres, règle 14) : un tableau dont le corps n'a que sa ligne
   « vide » masque ses en-têtes et son pied ; la phrase s'aligne à gauche, comme une ligne vide de carte */
td.td-empty { text-align: left; color: var(--muted); padding: 14px; }
table:has(> tbody > tr:only-child > td.td-empty) > thead, table:has(> tbody > tr:only-child > td.td-empty) > tfoot { display: none; }
/* Cellule d'actions : reste une cellule de tableau (hauteur et alignement de la ligne, jamais
   display:flex sur le <td>) ; boutons côte à côte, sans retour à la ligne, dans .td-actions-in */
td.td-actions { white-space: nowrap; }
.td-actions-in { display: flex; align-items: center; gap: 6px; }
.td-actions-in > form { display: flex; margin: 0; }
/* Texte long tronqué (points de suspension, valeur complète dans title) */
.cell-ellipsis { display: block; max-width: 15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Mot jamais coupé dans une cellule (numéro de facture, montant) : la colonne prend sa largeur, le reste de la cellule va à la
   ligne normalement (composant 106) */
.cell-keep { white-space: nowrap; }
/* Tableau qui tient dans sa carte sans défilement (ordinateur) : en-têtes sur deux lignes si besoin,
   marges de cellule réduites */
table.table-fit thead th { white-space: normal; }
table.table-fit th, table.table-fit td { padding-left: 12px; padding-right: 12px; }
td.td-nowrap { white-space: nowrap; }
/* Cellule coupée n'importe où au besoin (adresse e-mail, identifiant sans espace) : le tableau tient dans sa carte sans
   défiler à partir de 1 024 px (fix/retouches-2) */
td.td-break { overflow-wrap: anywhere; min-width: 9ch; }
/* Tableau de cinq ou six colonnes qui tient dans sa carte de 641 à 1 100 px : marges serrées
   (fiche client, Utilisateurs ; « Mon équipe ») */
@media (min-width: 641px) and (max-width: 1100px) {
    table.table-tight th, table.table-tight td { padding-left: 8px; padding-right: 8px; }
    table.table-tight thead th, table.table-tight .td-actions .td-muted { white-space: normal; }
}
/* Tableau de chiffres serré (composant 18, sept ou huit colonnes) : de 641 à 1 439 px, marges de 8 px, titres de colonnes
   et première colonne sur deux lignes au besoin (borne haute portée de 1 279 à 1 439 px au lot 1 de la nouvelle interface :
   en-têtes à 13 px, le tableau « Clients » du Pilotage tient dans sa carte à 1 280 px) */
@media (min-width: 641px) and (max-width: 1439px) {
    table.num-table.table-tight th, table.num-table.table-tight td { padding-left: 8px; padding-right: 8px; }
    table.num-table.table-tight thead th.num, table.num-table.table-tight tbody th[scope="row"] { white-space: normal; }
    table.num-table.table-tight tbody th[scope="row"] { min-width: 150px; }
    /* précision sous un montant (« avant : 10 449,80 € ») sur deux lignes au besoin ; le montant, insécable, ne se coupe jamais
       (montants à deux décimales depuis ux/chiffres-menus : le tableau « Clients » du Pilotage tient à 1 024 px) */
    table.num-table.table-tight .num-sub { white-space: normal; }
}
/* Factures et avoirs (assets/invoices.js) : espace client et backoffice */
.inv-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 18px; }
.inv-head h2 { margin: 0; font-family: var(--font-ui); font-size: var(--t-lg); font-weight: 600; color: var(--title); }
.inv-year { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-weight: 600; font-size: var(--t-xs); color: var(--muted); }
.inv-gap { flex: 1; }
.inv-year select { min-height: 36px; padding: 4px 10px; border: 1px solid var(--field-border); border-radius: var(--radius-xs); background: var(--surface); color: var(--text); font-size: var(--t-md); }
.inv-status, .inv-note { flex-basis: 100%; margin: 0; font-size: var(--t-xs); color: var(--muted); }
.inv-status:empty { display: none; }
.inv-note { color: var(--warning-text); }
/* Chargement, erreur, liste vide (composant 96) : ligne vide du composant 55, mêmes marges que l'en-tête de la liste */
.inv-empty { padding: var(--s-3) 18px var(--s-5); }
.inv-msg { margin: 0; padding: 8px 18px 12px; font-size: var(--t-xs); color: var(--danger); }
.inv-msg:empty { display: none; }
td.inv-dl { width: 1%; text-align: right; white-space: nowrap; }
/* État de paiement d'une facture (composant 64 de docs/design.md) : étiquette (vert Payée, orange À régler, rouge En
   retard), puis échéance et reste à payer en petit ; ligne en retard : filet rouge à gauche (comme la file des demandes) ;
   filtre « Toutes / À régler » : choix segmenté (composant 23) dans l'en-tête de la liste */
.pay-in { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.pay-in .badge { white-space: normal; }
.pay-sub { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-table tr.is-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.inv-filter .seg-opt span { white-space: nowrap; }
@media (max-width: 640px) {
    .inv-filter { flex-basis: 100%; }
    /* Portail (lignes en cartes, valeur à droite) seulement ; backoffice (tableau replié, composant 89) : à gauche, comme la colonne */
    .inv-table.table-stack .pay-in { align-items: flex-end; }
    /* Liste en cartes : filet rouge sur toute la carte de la facture en retard */
    .inv-table tr.is-late { box-shadow: inset 3px 0 0 var(--danger); }
    .inv-table tr.is-late td:first-child { box-shadow: none; }
}
/* Colonne « État » en plus : marges serrées de 641 à 1 279 px (comme table.num-table.table-tight), la liste tient sans défiler à 1 024 px */
@media (min-width: 641px) and (max-width: 1279px) {
    .inv-table.has-pay th, .inv-table.has-pay td { padding-left: 10px; padding-right: 10px; }
}
/* Mode présentation (composant 65 de docs/design.md, includes/presentation.php) : pastille discrète « Présentation » en haut
   (barre collée du backoffice, bandeau de l'aperçu), commandes d'écriture hors formulaire masquées (lecture seule) */
.pres-pill {
    display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin: 0 0 4px;
    padding: 2px 9px; border-radius: 20px; background: var(--primary-pale); color: var(--primary);
    font: 600 var(--t-xs)/1.5 var(--font-ui); letter-spacing: .02em; white-space: nowrap;
}
.pres-pill .ico { flex-shrink: 0; }
.impersonate-bar .pres-pill { margin: 0; }
.impersonate-bar .pres-toggle { display: contents; }
html[data-presentation] [data-write], html[data-presentation] [data-unpaid-refresh] { display: none !important; }
/* Exports qui contiennent des montants (Pilotage, affaires, hors forfait) : masqués ; le serveur les refuse de toute façon (phrase claire) */
html[data-presentation] a[href*="export="]:not([href*="prospects.php"]), html[data-presentation] a[href*="export_mobile="] { display: none !important; }
/* Backoffice : rattachement à une société Sellsy */
.sellsy-result { margin: 0 0 10px; font-size: var(--t-sm); }
.sellsy-result:empty { display: none; }
.sellsy-linked { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.sellsy-linked form, .sellsy-pick form { margin: 0; }
.sellsy-combo { max-width: 560px; }
.combo { position: relative; }
/* Liste rattachée à <body> et placée en position fixe sous (ou sur) le champ par assets/sellsy_picker.js :
   jamais coupée par un parent qui masque ce qui dépasse (cartes), au-dessus de tout le contenu (z-index max : 300) */
.combo-list {
    position: fixed; z-index: 1000; top: 0; left: 0; max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
    box-sizing: border-box; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--field-border);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    scroll-padding-bottom: 44px;   /* option active jamais cachée sous la ligne d'information (flèches) */
}
.combo-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px; border-radius: var(--radius-xs); cursor: pointer; color: var(--text); }
/* 1 000 sociétés et plus : seules les options visibles sont mises en page (hauteur retenue une fois affichées) */
.combo-list li[role="option"] { content-visibility: auto; contain-intrinsic-size: auto 38px; }
.combo-list li[aria-selected="true"], .combo-list li[data-i]:hover { background: var(--primary-pale); color: var(--primary); }
.combo-list .combo-city { flex-shrink: 0; font-size: var(--t-xs); color: var(--muted); }
.combo-list .combo-empty { cursor: default; color: var(--muted); }
/* Intitulé « Résultats approchants » et ligne d'information (nombre de sociétés) : ni options ni sélectionnables */
.combo-list .combo-head { cursor: default; padding: 6px 10px 4px; font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.combo-list .combo-foot {
    position: sticky; bottom: -4px; margin: 4px -4px -4px; padding: 8px 14px; cursor: default; user-select: none;
    background: var(--surface-2); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-size: var(--t-xs); color: var(--muted);
}
.combo-list .combo-name { min-width: 0; overflow-wrap: anywhere; }
.combo-list .combo-taken { margin-left: 8px; padding: 1px 6px; border-radius: 6px; background: var(--warning-bg); color: var(--warning-text); font-size: var(--t-xs); font-weight: 600; white-space: nowrap; }
.sellsy-dup { margin: 10px 0 0; font-size: var(--t-sm); color: var(--danger); }
/* Variante « recherche » (suggestions pendant la frappe, assets/combo.js) : liste dans le flux sous le champ, jamais coupée par la carte,
   options de 44 px ; fiche choisie (mode « fill ») rappelée sous le champ */
.combo-list.combo-flow { position: static; width: 100%; max-height: 300px; margin-top: 4px; box-shadow: none; }
.combo-list.combo-flow li[role="option"] { min-height: 44px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; content-visibility: visible; }
.combo-list.combo-flow .combo-city { flex-shrink: 1; overflow-wrap: anywhere; }   /* nom au-dessus, « Contact · société » dessous : jamais un nom écrasé */
.combo-search .combo-chosen { margin: 6px 0 0; font-size: var(--t-sm); font-weight: 600; color: var(--primary); }
.combo-search.form-group > .combo-list.combo-flow { max-width: var(--field-max); }   /* même largeur que son champ dans un formulaire */
.list-filters .combo-search { flex: 1 1 240px; min-width: 0; }
.list-filters .combo-search .form-control { width: 100%; }
.combo-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.combo-info .form-hint { margin: 0; }
.sellsy-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.sellsy-combo [hidden] { display: none; }   /* .btn et .sellsy-pick imposent display : l'attribut hidden doit primer */
[data-pwa-install][hidden] { display: none; }   /* bouton « Installer l'application » (assets/pwa.js) : même raison */
/* ── Fil de messages (composant 20 : « Mes demandes », backoffice) : conversation du plus ancien au plus
   récent, sur toute la largeur de son cadre (comme l'en-tête de la page) ; par message : avatar à initiales, bulle (auteur, date,
   texte, citation repliée, pièces jointes). Client : fond de carte ; TA INFO : bleu pâle, avatar « TA » ;
   note interne (backoffice seulement) : jaune pâle, mention « Interne ». Texte : HTML sûr produit par
   le serveur (texte échappé, liens seuls), affiché en pre-line ── */
.dm-conv { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.thread-msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: start; }
.thread-av { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--surface-3); color: var(--title); font: 600 var(--t-xs) var(--font-ui); letter-spacing: .02em; }
.thread-ta .thread-av { background: var(--btn-bg); color: var(--on-primary); }
.thread-note .thread-av { background: var(--note-line); color: var(--note-text); }
.thread-bubble { min-width: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.thread-ta .thread-bubble { background: var(--primary-pale); border-color: var(--primary-soft); }
.thread-note .thread-bubble { background: var(--note-bg); border-color: var(--note-line); }
.thread-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 6px; font-family: var(--font-ui); }
.thread-head strong { color: var(--title); font-weight: 600; }
.thread-ta .thread-head strong { color: var(--primary); }
.thread-tag { padding: 1px 7px; border-radius: 6px; background: var(--note-line); color: var(--note-text); font: 600 var(--t-xs) var(--font-ui); letter-spacing: .04em; text-transform: uppercase; }
.thread-at { margin-left: auto; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.thread-body { white-space: pre-line; overflow-wrap: anywhere; font-size: var(--t-sm); color: var(--text); line-height: 1.55; }
.thread-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.thread-quote { margin-top: 10px; }
.thread-quote > summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none; font: 500 var(--t-xs) var(--font-ui); color: var(--muted); }
.thread-quote > summary::-webkit-details-marker { display: none; }
.thread-quote > summary:hover { color: var(--primary); }
.thread-quote[open] > summary { margin-bottom: 6px; }
.thread-quote[open] > summary .ico { transform: rotate(90deg); }
.thread-quote .thread-body { padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); font-size: var(--t-sm); }
/* Zone de réponse en bas du fil : champ de 4 lignes qui grandit, fichiers choisis, limites en petit, « Envoyer » à droite */
.thread-reply { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.thread-reply textarea.form-control { width: 100%; max-width: none; min-height: 7.4em; max-height: 60vh; resize: vertical; line-height: 1.5; }
.thread-reply.is-note textarea.form-control { background: var(--note-bg); border-color: var(--note-line); }
.reply-hint { margin: 0; font-size: var(--t-xs); color: var(--muted); }
.thread-reply.is-note .reply-hint { color: var(--note-text); }
.reply-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.reply-lim { flex: 1 1 220px; margin: 0; font-size: var(--t-xs); color: var(--muted); line-height: 1.35; }
.reply-bar > .btn-primary { margin-left: auto; }
.thread-reply .form-error:empty { display: none; }
/* Demande close : la zone de réponse est remplacée */
.thread-closed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 16px;
    border: 1px dashed var(--field-border); border-radius: var(--radius-sm); background: var(--surface-2); }
.thread-closed p { margin: 0; font-weight: 600; color: var(--title); }
/* Choix segmenté (composant 23) : deux à quatre choix exclusifs, boutons radio (clavier : flèches) */
.seg { display: inline-flex; flex-wrap: wrap; align-self: flex-start; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.seg-opt { position: relative; }
.seg-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg-opt span { display: block; padding: 6px 12px; border-radius: var(--radius-xs); font: 600 var(--t-xs) var(--font-ui); color: var(--muted); }
.seg-opt input:checked + span { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
/* Droits par rubrique (composant 35) : une rangée par rubrique — nom, choix segmenté (composant 23) —, cases des
   lignes, lignes mobiles ou liens choisis et cases PUK / eSIM dessous ; une colonne sous 640 px */
.rights-grid { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.rights-grid[hidden] { display: none; }
.pk-add [hidden] { display: none !important; }   /* clés d'accès (composant 58) : explication ou formulaire selon l'appareil, message d'erreur */   /* display: flex ci-dessus : l'attribut hidden (rôle « Responsable du compte ») doit primer */
.rights-grid > .form-hint { margin: 0; padding: 10px 14px 0; }
.rights-row { display: grid; grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); gap: 8px 16px; align-items: center; padding: 10px 14px; }
.rights-row + .rights-row { border-top: 1px solid var(--line); }
.rights-row > .seg { justify-self: start; }
.rights-name { font-weight: 600; font-size: var(--t-sm); color: var(--text); }
.rights-absent { display: block; font-weight: 400; font-size: var(--t-xs); color: var(--muted); }
.rights-fixed { font-size: var(--t-sm); color: var(--text-soft); }
.rights-fixed .rights-absent { display: inline; margin-left: 4px; }
.rights-pick, .rights-sub { grid-column: 2; min-width: 0; }
.rights-pick .check-list { max-height: 260px; overflow-y: auto; }
.rights-pick .form-hint, .rights-sub .form-hint { margin: 0; }
.rights-owner { margin: 0; }
/* Modèles en un clic au-dessus de la grille : boutons en contour, retour « … appliqué » à droite */
.rights-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 10px; }
.rights-presets[hidden] { display: none; }
.rights-presets-t { font: 600 var(--t-xs) var(--font-ui); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-right: 2px; }
.rights-presets-done { flex: 1 1 100%; font-size: var(--t-xs); color: var(--muted); }
.rights-presets-done:empty { display: none; }
@media (max-width: 640px) {
    .rights-row { grid-template-columns: minmax(0, 1fr); }
    .rights-pick, .rights-sub { grid-column: 1; }
}
/* Ligne de précision de l'en-tête (composant 1) : état, numéro, dates, séparées par « · » */
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 2px 0 0; font-size: var(--t-xs); color: var(--muted); line-height: 1.4; }
.page-meta .pm-sep { color: var(--field-border); }
.page-meta:empty { display: none; }
/* ── Pièces jointes (composant 21) : puces à télécharger ; sélecteur de fichiers de la charte (bouton
   « Joindre des fichiers », champ natif masqué, fichiers choisis en puces avec « Retirer ») ── */
.file-chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.file-chips li { max-width: 100%; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 10px; border: 1px solid var(--field-border); border-radius: 999px;
    background: var(--surface); color: var(--primary); font: 500 var(--t-xs) var(--font-ui); cursor: pointer; }
.file-chip span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip:hover { background: var(--primary-pale); }
.file-chip:disabled { opacity: .6; cursor: wait; }
.file-size { color: var(--muted); font-weight: 400; flex-shrink: 0; }
.file-picked { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-self: stretch; min-width: 0; }
.file-picked[hidden] { display: none; }
.file-picked li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; padding: 3px 3px 3px 10px; border: 1px solid var(--field-border);
    border-radius: 999px; background: var(--surface-2); font: 500 var(--t-xs) var(--font-ui); color: var(--text); }
.fp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-del { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 50%;
    background: transparent; color: var(--muted); cursor: pointer; }
.fp-del:hover { background: var(--surface-3); color: var(--danger); }
.file-err { margin: 0; font-size: var(--t-xs); color: var(--danger); }
.file-err:empty { display: none; }
/* ── Liste de choix dans la page (composant 22, recherche d'une entreprise dans l'outil de support) :
   sous le champ, dans le flux (jamais coupée par la carte), défilante ── */
.combo-list.fd-list { position: static; max-height: 280px; margin-top: 4px; box-shadow: none; }
.combo-list li[aria-disabled="true"] { cursor: not-allowed; opacity: .6; }
.fd-chosen { margin: 8px 0 0; font-weight: 600; color: var(--primary); }
/* « Mes demandes » : liste, fiche, formulaire (espace client) et onglet Demandes de la fiche client */
.dm-head { flex-wrap: wrap; }
.dm-status, .dm-note { flex-basis: 100%; margin: 0; font-size: var(--t-xs); color: var(--muted); }
.dm-status:empty { display: none; }
.dm-note { color: var(--warning-text); }
.dm-notice { margin: 12px 18px; }
.dm-table td.dm-subj { min-width: 160px; overflow-wrap: anywhere; }
.dm-table td.dm-when { min-width: 92px; }
.dm-table .badge { white-space: normal; }
@media (min-width: 641px) and (max-width: 1400px) { .dm-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.dm-table tr[data-href] { cursor: pointer; }
.dm-table tr[data-href]:hover td { background: var(--surface-2); }
.dm-msg, .dm-form-err { margin: 0; font-size: var(--t-sm); color: var(--danger); }
.dm-form-err { margin-top: 10px; }
.dm-msg:empty, .dm-form-err:empty, .dm-form .form-error:empty { display: none; }
.dm-top-act { display: contents; }
.file-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
/* ── Zone de dépôt de fichiers (composant 26) : glisser-déposer sur ordinateur, « Choisir des fichiers »,
   « Prendre une photo » sur téléphone (appareil photo), fichiers choisis en lignes (nom, taille, état,
   titre facultatif par fichier au backoffice, « Retirer ») ; progression de l'envoi par la jauge (composant 7) ── */
.drop-zone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 16px;
    border: 2px dashed var(--field-border); border-radius: var(--radius); background: var(--surface-2); text-align: center; transition: border-color .15s, background .15s; }
.drop-zone.is-over { border-color: var(--primary); background: var(--primary-pale); }
.drop-zone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop-zone .drop-ico { color: var(--primary); }
.drop-title { margin: 0; font: 600 var(--t-sm) var(--font-ui); color: var(--title); }
.drop-hint { margin: 0; font-size: var(--t-xs); color: var(--muted); line-height: 1.4; }
.drop-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.drop-btns .btn { cursor: pointer; }
.drop-cam { display: none !important; }
@media (max-width: 768px), (pointer: coarse) { .drop-cam { display: inline-flex !important; } .drop-desk { display: none; } }
.drop-files { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.drop-files:empty { display: none; }
.drop-file { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 6px 10px; align-items: center; padding: 8px 8px 8px 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.drop-file > .ico { color: var(--primary); }
.df-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 var(--t-sm) var(--font-ui); color: var(--text); }
.df-state { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }
.df-state.df-ok { color: var(--success); }
.df-state.df-err { color: var(--danger); white-space: normal; }
.drop-file .df-title { grid-column: 2 / -1; max-width: none; }
.drop-file .df-msg { grid-column: 2 / -1; margin: 0; font-size: var(--t-xs); color: var(--danger); }
.drop-file .df-msg:empty { display: none; }
.drop-file.is-err { border-color: var(--danger-line); }
.drop-file.is-ok { border-color: var(--success-line); }
.drop-progress[hidden] { display: none; }
.drop-progress { margin-top: 12px; }
/* ── Liste de documents (composant 27) : une carte par catégorie (titre + nombre), une ligne par document
   (icône du type, titre + « Nouveau », précision : type, taille, date, auteur, version ; visibilité ;
   description ; actions à droite, dessous sur téléphone ; versions précédentes repliées) ── */
/* Page « Mes documents » : filtres, cartes des catégories et aide empilées, espacées comme les autres rubriques */
.ged-page { display: flex; flex-direction: column; gap: 18px; }
.ged-page > .card, .ged-page > details.help, .ged-page > .alert, .ged-page > .form-hint { margin: 0; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line); }
.doc-item:first-child { border-top: 0; }
.doc-item.is-received { box-shadow: inset 3px 0 0 var(--warning); }
.doc-ico { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-xs); background: var(--primary-pale); color: var(--primary); }
.doc-main { min-width: 0; }
.doc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font: 600 var(--t-md) var(--font-ui); color: var(--title); overflow-wrap: anywhere; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 3px 0 0; font-size: var(--t-xs); color: var(--muted); }
.doc-meta > span:not(:last-child)::after { content: "·"; margin: 0 8px; color: var(--field-border); }
.doc-desc { margin: 6px 0 0; font-size: var(--t-sm); color: var(--text-soft); white-space: pre-line; overflow-wrap: anywhere; }
.doc-note { margin: 6px 0 0; padding: 8px 10px; border-left: 3px solid var(--warning-line); background: var(--warning-bg); font-size: var(--t-sm); color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.doc-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.doc-acts form { display: inline-flex; margin: 0; }
.doc-more { grid-column: 2 / -1; margin-top: 4px; }
.doc-more > summary { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font: 600 var(--t-xs) var(--font-ui); color: var(--primary); list-style: none; }
.doc-more > summary::-webkit-details-marker { display: none; }
.doc-more > summary .ico { transition: transform .15s; }
.doc-more[open] > summary .ico { transform: rotate(90deg); }
.doc-more-body { margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.doc-old { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.doc-old li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; font-size: var(--t-xs); }
.doc-old .td-muted { font-size: var(--t-xs); }
.doc-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px; }
.doc-filters .form-control { width: auto; min-width: 0; }
.doc-filters input[type="search"] { flex: 1 1 220px; }
.doc-filters select { flex: 0 1 200px; }
.doc-usage { flex-basis: 100%; margin: 0; font-size: var(--t-xs); color: var(--muted); }
@media (max-width: 640px) {
    .doc-item { grid-template-columns: 32px minmax(0, 1fr); padding: 12px 14px; }
    .doc-ico { width: 32px; height: 32px; }
    .doc-acts { grid-column: 1 / -1; justify-content: flex-start; }
    .doc-more { grid-column: 1 / -1; }
    .doc-filters { padding: 12px 14px; }
    .doc-filters select, .doc-filters input[type="search"] { flex: 1 1 100%; }
    .drop-file { grid-template-columns: 22px minmax(0, 1fr) auto; }
    .drop-file .df-state { grid-column: 2 / -1; grid-row: 2; }
}
/* Backoffice (admin/demandes.php) : file (retard en filet rouge), fiche = fil + panneau « Suivi » / « Demande » */
.dm-queue td.dm-client { min-width: 110px; }
.dm-rq-sub { display: none; }
/* 641 à 1 399 px : le demandeur passe sous le client (colonne masquée), aucun défilement du tableau */
.dm-queue td .badge-err, .dm-queue td .badge-warn { white-space: nowrap; }
@media (min-width: 641px) and (max-width: 1399px) {
    .dm-queue .dm-rq { display: none; }
    .dm-queue .dm-rq-sub { display: block; margin-top: 2px; font-size: var(--t-xs); color: var(--muted); }
    .dm-queue td.dm-client { min-width: 96px; }
    .dm-queue td.dm-subj { min-width: 130px; }
}
.dm-queue tr.dm-late td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
/* Outil interne (migration 49) : personne chargée sous le statut, en petit (composant 20 de docs/design.md) */
.dm-queue .dm-assignee { display: block; margin-top: 2px; font-size: var(--t-xs); color: var(--muted); }
.dm-admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
/* Fiche du backoffice : la grille occupe toute la largeur du contenu, comme l'en-tête (fil élastique,
   panneau « Suivi » / « Demande » de 300 à 360 px à droite) */
@media (min-width: 1180px) { .dm-admin-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); } }
/* Échéances (backoffice) : dépassée en rouge, date dessous ; à venir ; respectée en gris */
.due-late { color: var(--danger); font-weight: 600; }
.due-soon { color: var(--text); }
.due-done { color: var(--muted); }
.due-date { display: block; margin-top: 2px; font-size: var(--t-xs); font-weight: 400; color: var(--muted); }
.dm-queue .due-sub { display: block; margin-top: 3px; font-size: var(--t-xs); white-space: nowrap; }
.dm-queue .due-soon { font-size: var(--t-sm); white-space: nowrap; }
.dm-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dm-side .kv dd { font-weight: 500; overflow-wrap: anywhere; }
.dm-upd .form-group { margin-bottom: 12px; }
.dm-upd .form-control { max-width: none; }
.dm-readonly { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--t-sm); color: var(--muted); }
.dm-page { display: flex; flex-direction: column; gap: 18px; }
fieldset.dm-level { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
/* Groupe de choix (boutons radio) dans un formulaire : aucun cadre de fieldset (portail et backoffice) */
.net-page fieldset.form-group { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }
.dm-home-state { margin: 2px 0 0; font-size: var(--t-xs); color: var(--warning-text); }

/* Cellule « Utilisateur » : nom en gras, adresse e-mail dessous en texte secondaire (sans retour
   à la ligne ; tronquée au-delà de 40 caractères côté serveur, adresse complète dans title) */
.user-cell { display: block; min-width: 0; }
.user-cell strong { display: block; white-space: nowrap; }
.user-cell .user-mail { display: block; white-space: nowrap; font-size: var(--t-xs); color: var(--muted); }
/* En-tête avec un second tri (ex. « Utilisateur » par nom, puis « adresse ») */
/* Cellule à deux étages (ex. client puis rôle, état puis « Renvoyer l'invitation ») */
.cell-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.cell-stack > form { margin: 0; }
/* Précision sous un rôle (« Reçoit les rappels d'échéance des services ») */
.role-note { display: block; font-size: var(--t-xs); line-height: 1.3; margin-top: 2px; }
.cell-stack .btn-link { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 500; white-space: nowrap; }
.th-sort-sub { margin-left: 8px; font-size: var(--t-xs); font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
td.num, th.num { text-align: right; }
tfoot td, tr.row-total td { background: var(--primary-soft); font-weight: 600; color: var(--title); }
/* Sous 640 px : chaque ligne devient une carte (libellé de colonne dans data-label) */
@media (max-width: 640px) {
    table.table-stack thead { display: none; }
    table.table-stack, table.table-stack tbody, table.table-stack tfoot { display: block; width: 100%; }
    table.table-stack tr {
        display: block; background: var(--surface);
        border: 1px solid var(--line); border-radius: var(--radius-sm);
        padding: 6px 14px; margin-bottom: 10px;
    }
    table.table-stack tr:hover { background: var(--surface); }
    /* Titre de groupe (tr.row-group) en mode cartes : simple intertitre au-dessus des cartes du groupe */
    table.table-stack tr.row-group { padding: 0; margin: 16px 0 8px; border: 0; background: none; box-shadow: none; }
    table.table-stack tr.row-group th { display: block; padding: 0 2px; border: 0; background: none; }
    table.table-stack tfoot tr { background: var(--primary-soft); }
    table.table-stack td {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        padding: 7px 0 !important; border: none !important; background: transparent;
        text-align: right; width: auto !important; min-width: 0; overflow-wrap: anywhere;
    }
    table.table-stack td:not(:last-child) { border-bottom: 1px solid var(--surface-3) !important; }
    table.table-stack td::before {
        content: attr(data-label); flex-shrink: 0; text-align: left;
        font-family: var(--font-ui); font-weight: 600; font-size: var(--t-xs); color: var(--muted);
        text-transform: uppercase; letter-spacing: .06em;
    }
    table.table-stack td[data-label=""]::before { content: none; }
    table.table-stack td.td-actions { flex-wrap: wrap; gap: 6px; white-space: normal; }
    table.table-stack td.td-actions .td-actions-in { display: contents; }   /* boutons rendus à la cellule, comme avant */
    table.table-stack td.td-actions .btn { flex: 1; justify-content: center; min-width: 110px; }
    /* Tableau vide en mode cartes : bloc centré, pas de libellé de colonne */
    table.table-stack td.td-empty { display: block; padding: 18px 6px !important; text-align: center; }
    table.table-stack td.td-empty::before { content: none; }
    table.table-stack tr:has(> td.td-empty:only-child) { padding: 0; margin: 0; border: 0; background: none; }   /* composant 112 : la phrase seule, sans carte autour */
    table.table-stack .cell-ellipsis { max-width: none; white-space: normal; overflow-wrap: anywhere; }
    table.table-stack .user-cell { text-align: right; }
    table.table-stack .cell-stack { align-items: flex-end; }
    table.table-stack .user-cell strong, table.table-stack .user-cell .user-mail { white-space: normal; overflow-wrap: anywhere; }
}
/* Tableau replié sur téléphone (composant 89, brique de assets/ui.js) : sous 640 px, colonnes gardées puis flèche ; ligne ouverte : le reste dessous */
.table-fold .c-tog{display:none}
.row-tog{display:inline-flex;align-items:center;justify-content:center;width:var(--tap);height:var(--tap);padding:0;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);color:var(--primary);cursor:pointer;flex-shrink:0}
.row-tog::before{content:'';width:8px;height:8px;margin-top:-4px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg)}
.row-tog[aria-expanded="true"]::before{margin-top:4px;transform:rotate(-135deg)}
@media (max-width:640px){
.table-fold,.table-fold>thead,.table-fold>tbody,.table-fold>tfoot{display:block;width:100%}
.table-fold{--ft:calc(var(--tap) + 8px)}
.table-fold>thead>tr,.table-fold .fold-row{display:grid;grid-template-columns:minmax(0,1fr) var(--ft);align-items:center;column-gap:0;border-bottom:1px solid var(--line)}
.fold-k2>thead>tr,.fold-k2 .fold-row{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) var(--ft)}
.fold-k3>thead>tr,.fold-k3 .fold-row{grid-template-columns:minmax(0,1.4fr) repeat(2,minmax(0,1fr)) var(--ft)}
.fold-k4>thead>tr,.fold-k4 .fold-row{grid-template-columns:minmax(0,1.3fr) repeat(3,minmax(0,1fr)) var(--ft)}
.fold-w1>thead>tr,.fold-w1 .fold-row{grid-template-columns:minmax(0,2fr) repeat(var(--fk,2),minmax(0,.8fr)) var(--ft)}.fold-k2.fold-w1{--fk:1}.fold-k4.fold-w1{--fk:3}
.fold-k2.fold-w2>thead>tr,.fold-k2.fold-w2 .fold-row{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) var(--ft)}
.fold-k3.fold-w2>thead>tr,.fold-k3.fold-w2 .fold-row{grid-template-columns:minmax(0,.5fr) minmax(0,1.5fr) minmax(0,1fr) var(--ft)}
.table-fold .fold-row>td{border-bottom:0}
.table-fold tr>th,.table-fold tr>td{display:block;min-width:0!important;width:auto!important;max-width:none;padding:10px 8px 10px 0;border:0;overflow-wrap:anywhere;white-space:normal}
.table-fold tr>:first-child{padding-left:12px}
.table-fold tr>.c-x:first-child+:not(.c-x){padding-left:12px} /* 89 : première colonne repliée, la suivante garde la marge du bord (113, relances à venir) */
.table-fold .fold-row>:not(.c-x){text-align:left}.table-fold .fold-row>:not(.c-x) .badge{white-space:normal;overflow-wrap:normal}
.table-fold .c-x{display:none;order:1}
.table-fold .c-tog{display:flex;justify-content:flex-end;grid-row:1;grid-column:-2;padding:4px 0}
.table-fold .is-open>.c-x{display:flex;align-items:center;justify-content:space-between;gap:12px;grid-column:1/-1;padding:6px 12px;border-top:1px solid var(--surface-3);text-align:right}
.table-fold .is-open>.c-x::before{content:attr(data-label);flex-shrink:0;text-align:left;font:600 var(--t-xs) var(--font-ui);color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.table-fold .fold-full,.table-fold .fold-full>*{display:block}
}
/* Ajustements (après la mise en production du 14/11/2026) : flèche à 8 px du bord de la carte ; colonnes gardées à la mesure
   de leur contenu (une seule grille pour l'en-tête et toutes les lignes, sous-grille par ligne), comme un tableau ordinaire */
@media (max-width:640px){
.table-fold{--ft:calc(var(--tap) + 12px)}
.table-fold .c-tog{padding:4px 8px 4px 0}
@supports (grid-template-columns:subgrid){
.table-fold{--fw:minmax(30%,1fr);--fc:fit-content(30%);display:grid;grid-template-columns:var(--fw) var(--ft)}
.table-fold.fold-k3,.table-fold.fold-k4{--fc:fit-content(25%)}
.table-fold .user-cell strong,.table-fold .user-cell .user-mail{white-space:normal;overflow-wrap:anywhere}
.table-fold.fold-k2{grid-template-columns:var(--fw) var(--fc) var(--ft)}
.table-fold.fold-k3{grid-template-columns:var(--fw) var(--fc) var(--fc) var(--ft)}
.table-fold.fold-k4{grid-template-columns:var(--fw) var(--fc) var(--fc) var(--fc) var(--ft)}
.table-fold.fold-k2.fold-w2{grid-template-columns:var(--fc) var(--fw) var(--ft)}
.table-fold.fold-k3.fold-w2{grid-template-columns:var(--fc) var(--fw) var(--fc) var(--ft)}
.table-fold.fold-k4.fold-w2{grid-template-columns:var(--fc) var(--fw) var(--fc) var(--fc) var(--ft)}
.table-fold.fold-k3.fold-w3{grid-template-columns:var(--fc) var(--fc) var(--fw) var(--ft)}
.table-fold>thead,.table-fold>tbody,.table-fold>tfoot{display:contents}
.table-fold>caption,.table-fold .fold-full{grid-column:1/-1}
table.table-fold.table-fold>thead>tr,table.table-fold.table-fold .fold-row{grid-template-columns:subgrid;grid-column:1/-1}
table.table-fold.table-fold tr>th,table.table-fold.table-fold tr>td{min-width:auto!important;overflow-wrap:break-word}
table.table-fold.table-fold tr>.td-break,table.table-fold.table-fold tr>.c-x{overflow-wrap:anywhere}
table.table-fold.table-fold tr>td :is(input:not([type=checkbox]):not([type=radio]),select,textarea){width:100%;min-width:0}
}
}

/* ── Étiquettes d'état (point de couleur) et étiquettes simples ─────── */
.badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--radius-pill);
    font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.badge-ok, .badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn, .badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-err, .badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-off { background: var(--surface-3); color: var(--neutral); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-ok::before, .badge-success::before, .badge-warn::before, .badge-warning::before, .badge-err::before,
.badge-danger::before, .badge-off::before, .badge-info::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
/* Étiquette simple (« Fixe 6 », « Numéro principal », rôle) : sans point */
.tag, .badge-admin, .badge-client {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-pill);
    background: var(--primary-soft); color: var(--primary);
    font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; line-height: 1.35; white-space: nowrap;
}

/* ── 2. Barre d'onglets (ui_tabs() ; comportement : assets/nav.js, [data-tabbar]) ─────────────────
   .tabbar > .tabs[role=tablist] > a[role=tab]. Jamais un onglet coupé sans signe : quand la liste déborde, le script pose
   .has-more-left / .has-more-right (dégradé : masque de la liste, sans couleur — elle s'efface vers son fond, clair ou
   sombre) et montre une flèche de chaque côté où il reste des onglets ; l'onglet actif est ramené en vue au chargement,
   sans faire défiler la page ; au doigt sur téléphone. Sans script : la liste défile, comme avant. */
.tabbar { position: relative; min-width: 0; margin-bottom: 18px; }
.tabs {
    display: flex; gap: 4px; border-bottom: 1px solid var(--line);
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs > a, .tabs > button {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap);
    padding: 10px 14px 9px; margin-bottom: -1px; border: none; border-bottom: 2px solid transparent; background: none;
    font-family: var(--font-ui); font-size: var(--t-md); font-weight: 600; color: var(--text-soft);
    text-decoration: none; white-space: nowrap; cursor: pointer;
}
.tabs > a:hover, .tabs > button:hover { color: var(--primary); }
.tabs > .active, .tabs > [aria-selected="true"], .tabs > [aria-current="page"] {
    color: var(--primary); border-bottom-color: var(--primary);
}
.tabs > a:focus-visible, .tabs > button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 6px; }
/* Débordement : place des flèches gardée au défilement du clavier (focus) et au retour de l'onglet actif */
.tabbar.is-over > .tabs { scroll-padding-inline: 56px; }
.tabbar.has-more-right > .tabs { -webkit-mask-image: linear-gradient(to left, transparent, currentColor 56px); mask-image: linear-gradient(to left, transparent, currentColor 56px); }
.tabbar.has-more-left > .tabs { -webkit-mask-image: linear-gradient(to right, transparent, currentColor 56px); mask-image: linear-gradient(to right, transparent, currentColor 56px); }
.tabbar.has-more-left.has-more-right > .tabs {
    -webkit-mask-image: linear-gradient(to right, transparent, currentColor 56px, currentColor calc(100% - 56px), transparent);
    mask-image: linear-gradient(to right, transparent, currentColor 56px, currentColor calc(100% - 56px), transparent);
}
.tabbar-arrow {
    position: absolute; top: 50%; z-index: 1; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; margin-top: -16px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
    background: var(--surface); color: var(--text-soft); box-shadow: var(--shadow); cursor: pointer;
}
.tabbar-arrow[hidden] { display: none; }
.tabbar-arrow:hover { color: var(--primary); border-color: var(--primary-soft); }
.tabbar-arrow .ico { flex: none; }
.tabbar-prev { left: 2px; }
.tabbar-next { right: 2px; }
/* Barre de 8 onglets (fiche client) : icônes masquées sous 1 500 px, marges réduites ; elle tient sur une ligne
   à 1 280 px (règle 3) et défile en dessous */
@media (max-width: 1500px) {
    .tabs.tabs-compact > a .ico { display: none; }
    .tabs.tabs-compact > a { padding-left: 11px; padding-right: 11px; }
}
/* Sous-onglets (ui_tabs(…, ['sub' => true])) : seconde barre, plus discrète, sous l'onglet — pastilles sans filet */
.tabbar-sub { margin: -6px 0 16px; }
.tabs.tabs-sub { gap: 6px; padding: 2px 0; border-bottom: none; }
.tabs.tabs-sub > a {
    padding: 6px 12px; margin: 0; border-bottom: none; border-radius: var(--radius-sm);
    font-size: var(--t-sm); color: var(--muted);
}
.tabs.tabs-sub > a:hover { color: var(--primary); background: var(--surface-2); }
.tabs.tabs-sub > [aria-selected="true"] { color: var(--primary); background: var(--primary-pale); }
.tabbar-sub .tabbar-arrow { width: 28px; height: 28px; margin-top: -14px; }
/* Bandeau (ui_tabs(…, ['bar' => 'tabbar-band']), portail : sous la barre du haut ou en tête d'une carte) : fond de carte,
   filet en bas, toute la largeur */
.tabbar-band { margin-bottom: 0; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tabbar-band > .tabs { border-bottom: none; }
.tabbar-band > .tabs > a { padding: 12px 14px 10px; font-size: var(--t-sm); }
@media (max-width: 640px) { .tabbar-band { padding: 0 8px; } }

/* 32. Sélecteur de période (ui_period_pick()) : périodes fixes en onglets (liens réels), puis « Autre période… »
      replié (du … au …, « Valider ») sur la même ligne ; ouvert, le formulaire passe sous la barre, pleine largeur.
      Le filet de la barre court sous les deux. */
.period-pick { display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.period-pick > .tabbar { flex: 0 1 auto; margin-bottom: 0; min-width: 0; }
.period-pick > .tabbar > .tabs { border-bottom: none; }
.period-other { flex: 0 0 auto; }
.period-other[open] { flex: 1 1 100%; }   /* ouvert : sur sa propre ligne (résumé puis dates) */
.period-other > summary {
    list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px 9px; margin-bottom: -1px;
    border-bottom: 2px solid transparent; font-family: var(--font-ui); font-size: var(--t-md); font-weight: 600; color: var(--text-soft);
    cursor: pointer; white-space: nowrap;
}
.period-other > summary::-webkit-details-marker { display: none; }
.period-other > summary:hover { color: var(--primary); }
.period-other > summary[aria-current="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.period-other > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 6px; }
.period-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; padding: 12px 0 14px; }
.period-form .form-group { margin: 0; }
.period-form .form-control { width: auto; min-width: 150px; }

/* ── Chiffres clés : police des titres, dernière case (total) en bleu clair ── */
/* Rangée de chiffres clés (règle 2, docs/design.md) : nombre de colonnes FIXE selon le nombre de tuiles
   (ui_kpis() pose kpis-n1 … kpis-n6) — une ligne à partir de 1 280 px ; en dessous, 3 + 2 ou 3 + 3,
   jamais une tuile seule sur une seconde ligne ; téléphone : deux colonnes, la première tuile en
   pleine largeur quand le nombre est impair. Libellés sur une ligne (abrégés par la page si besoin). */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin-bottom: 22px; }
.kpis[class*="kpis-n"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpis.kpis-n1 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) { .kpis.kpis-n3 > :first-child, .kpis.kpis-n5 > :first-child { grid-column: 1 / -1; } }
@media (min-width: 641px) {
    .kpis.kpis-n3, .kpis.kpis-n5, .kpis.kpis-n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kpis.kpis-n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .kpis.kpis-n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .kpis.kpis-n6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
.kpis .kpi { min-width: 0; }
.kpis .kpi-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-orange .kpi-value { color: var(--warning-text); }
.kpi-red .kpi-value { color: var(--danger); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; box-shadow: var(--shadow); }
.kpi-total { background: var(--primary-soft); border-color: transparent; }
.kpi-label { font-family: var(--font-title); font-size: var(--t-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.kpi-total .kpi-label, .kpi-total .kpi-value { color: var(--primary); }
.kpi-value { margin-top: 8px; font-family: var(--font-title); font-weight: 500; font-size: var(--t-xl); line-height: 1.2; color: var(--title); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ── Fenêtre modale ────────────────────────────────────────────────── */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 300;
    background: var(--overlay); align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    width: 100%; max-width: 500px; max-height: 85vh; overflow-y: auto;
    background: var(--surface); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-lg);
}
.modal h3 { font-family: var(--font-ui); font-size: var(--t-lg); font-weight: 600; color: var(--title); margin-bottom: 12px; }
.modal-msg { font-size: var(--t-sm); line-height: 1.55; color: var(--text-soft); }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
/* Fenêtre de confirmation à case à cocher */
.modal-check .modal-msg p + p { margin-top: 10px; }
.modal-check .check-line { margin-top: 16px; }
/* Session (assets/session.js, composant 24) : avertissement d'expiration et confirmation du mot de
   passe, dans la fenêtre modale du socle */
.modal .reauth-form { margin-top: 14px; }
.modal .reauth-form .form-group { margin-bottom: 0; }
.modal .reauth-form .form-control { max-width: none; }
/* « Mes appareils de confiance » : connexion persistante (« Rester connecté ») sous le nom de l'appareil */
.dev-persist { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: var(--t-xs); }

/* ── Fil d'Ariane ──────────────────────────────────────────────────── */
.breadcrumb { font-family: var(--font-ui); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 14px; list-style: none; font-size: var(--t-sm); color: var(--muted); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: '›'; color: var(--muted); }
.breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 500; }

/* ── Messages ──────────────────────────────────────────────────────── */
/* Bloc (pas flex : un message peut mêler texte, liens et <code>) ; icône facultative en tête,
   suivie du texte dans un <span> qui garde sa marge. */
.alert {
    display: block; margin-bottom: 16px; padding: 12px 16px;
    border-radius: var(--radius-sm); border: 1px solid transparent; font-size: var(--t-sm); line-height: 1.45;
}
.alert::after { content: ''; display: block; clear: both; }
.alert > .ico:first-child { float: left; margin-top: 1px; }
.alert > .ico:first-child + span, .alert > .ico:first-child + div { display: block; margin-left: 28px; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border-color: var(--danger-line); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-color: var(--warning-line); }
.alert-info    { background: var(--primary-pale); color: var(--primary); border-color: var(--info-line); }
.alert a { color: inherit; font-weight: 600; }
.alert-txt { margin: 0; }                   /* ui_alert() : la phrase, puis son action sur la ligne suivante */
.alert-actions { margin: var(--s-2) 0 0; }

/* ── Pagination ────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; padding: 12px 18px; border-top: 1px solid var(--line); }
.btn-page {
    min-width: 33px; height: 33px; padding: 0 8px; border-radius: var(--radius-xs);
    border: 1.5px solid var(--field-border); background: var(--surface); color: var(--text-soft);
    font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 600; font-variant-numeric: tabular-nums;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s;
}
.btn-page:hover  { border-color: var(--primary); color: var(--primary); }
.btn-page.active { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--on-primary); }
.btn-page:disabled { opacity: .4; cursor: default; }
.page-info { padding: 0 6px; font-size: var(--t-xs); color: var(--muted); }

/* ══════════════════════════════════════════════════════════════════════
   Charte d'interface (docs/design.md) — composants communs au backoffice et à l'espace client.
   Toute page se construit avec eux ; un besoin non couvert = un composant ajouté ici ET dans
   docs/design.md d'abord, jamais une mise en page au cas par cas. Rendus PHP : includes/ui.php.
   ══════════════════════════════════════════════════════════════════════ */

/* 1. En-tête de page (.topbar) : fil d'Ariane au-dessus, titre (Fjalla One), sous-titre, actions à droite */
.topbar-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.topbar-main h1 { flex: none; }
.topbar-main .breadcrumb { margin: 0 0 2px; font-size: var(--t-xs); }
.page-sub { font-size: var(--t-sm); color: var(--muted); line-height: 1.35; }
.topbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; min-width: 0; }
/* 22/11/2026 (nom de client long, écran de tablette) : au-delà de 640 px, le bloc du titre garde au moins 20rem ; sinon les actions passent
   dessous, le titre prend toute la largeur (avant : titre écrasé sous les boutons, fil d'Ariane replié mot à mot). Fil d'Ariane sur une ligne,
   le dernier niveau coupé en « … » (nom entier dans le titre). Sous 640 px : règles du téléphone ci-dessous. */
@media (min-width: 641px) {
    .topbar.topbar-page { flex-wrap: wrap; }
    .topbar-page > .topbar-main { flex: 1 1 20rem; }
    .topbar-page h1 { overflow-wrap: anywhere; }
    .topbar-page .breadcrumb { flex-wrap: nowrap; min-width: 0; }
    .topbar-page .breadcrumb li { flex-shrink: 0; white-space: nowrap; }
    .topbar-page .breadcrumb li:not(:first-child) { flex-shrink: 1; min-width: 0; }
    .topbar-page .breadcrumb li:not(:first-child) > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* En-tête de page du backoffice (.topbar-page, includes/admin_header.php) sur téléphone (≤ 640 px) : sous la barre du
   haut (composant 88, menu et cloche y sont), ligne 1 = fil d'Ariane (une ligne, coupé par « … »), puis titre et état,
   sous-titre, actions en pleine largeur. Une colonne en minmax(0, 1fr) : jamais de colonne écrasée. */
@media (max-width: 640px) {
    .topbar.topbar-page { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 6px 10px; }
    .topbar-page > .topbar-main { display: contents; }
    .topbar-page > .topbar-main > * { grid-column: 1 / -1; min-width: 0; }
    .topbar-page .breadcrumb { flex-wrap: nowrap; overflow: hidden; margin: 0; }
    .topbar-page .breadcrumb li { flex-shrink: 0; white-space: nowrap; }
    .topbar-page .breadcrumb li:not(:first-child) { flex-shrink: 1; min-width: 0; }   /* trois niveaux (« Noter un échange ») : le nom du milieu se coupe aussi */
    .topbar-page .breadcrumb li:not(:first-child) > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-page > .topbar-actions { grid-column: 1 / -1; margin-left: 0; }
    .topbar-page > .topbar-actions > * { flex: 1 1 auto; }   /* côte à côte s'ils tiennent, sinon l'un sous l'autre */
    .topbar-page > .topbar-actions > form > .btn { width: 100%; }
    .topbar-page > .topbar-actions .btn { justify-content: center; }
}

/* 3. Rangée de chiffres clés (.kpis / .kpi, plus haut) : précision sous le chiffre, lien sur toute la carte */
.kpi-hint { margin-top: 4px; font-size: var(--t-xs); color: var(--muted); line-height: 1.35; }
a.kpi { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.kpi:hover { border-color: var(--primary-soft); box-shadow: var(--shadow-lg); }
.kpi-label .ta-tag { margin-left: 6px; vertical-align: 1px; }
/* Chiffre clé réservé à TA INFO : étiquette sous le chiffre (le libellé n'est jamais coupé par elle) */
.kpi-ta { margin-top: 6px; line-height: 1; }
/* 54. Tuile « à faire » à 0 : une phrase grise à la place du chiffre, sans couleur d'alerte */
.kpi.kpi-zero .kpi-value, .kpis.kpis-n6 .kpi.kpi-zero .kpi-value { margin-top: 10px; font-family: var(--font-ui); font-size: var(--t-md); font-weight: 600; line-height: 1.3; color: var(--muted); }

/* 4. Carte : actions de l'en-tête, lignes « libellé / valeur » séparées par un filet */
.card-header .card-act { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-header .card-sub { flex-basis: 100%; margin-top: -4px; font-size: var(--t-xs); color: var(--muted); }
.rows { list-style: none; margin: 0; padding: 0; }
/* Règle 11 (`ux/pages-legeres`) : libellé sur une ligne (« … », infobulle posée par assets/nav.js quand il est coupé) ;
   une valeur qui ne tient pas à côté passe sous son libellé (retour à la ligne de la rangée), jamais coupée au milieu
   d'un montant (espaces insécables de ta_eur() / ta_dur()) */
.rows > li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rows > li:last-child { border-bottom: 0; }
.rows .rows-lbl { flex: 0 1 auto; color: var(--text-soft); min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .rows-val { flex: 1 1 auto; margin-left: auto; font-weight: 600; color: var(--title); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: break-word; min-width: 0; }
.rows .rows-val .td-muted { font-weight: 400; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.card-link { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-ui); font-weight: 600; color: var(--primary); text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-empty { margin: 0; color: var(--muted); }
.card-wait { color: var(--muted); font-size: var(--t-sm); }
/* Adresse e-mail, code, montant : jamais coupés au milieu (règle 11) */
.no-cut { white-space: nowrap; }

/* 53. Réservé à TA INFO : ce que le client ne voit pas, regroupé à la fin de la carte, une seule étiquette */
.ta-block { margin-top: 10px; padding: 2px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.ta-block-head { margin: 8px 0 0; font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; color: var(--muted); }
.ta-block-head .ta-tag { margin-left: 2px; }
.ta-block > .rows > li:last-child { border-bottom: 0; }

/* 55. Ligne vide : une phrase grise et son action, sur une ligne */
.empty-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.empty-line-txt { margin: 0; color: var(--muted); }
.empty-line-act { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.empty-line-act > details.fold[open] { flex-basis: 100%; }
.empty-line:has(details.fold[open]) .empty-line-act { flex-basis: 100%; }
/* Carte vide entière : titre, phrase et action sur la ligne de l'en-tête (ui_card_line()) */
.card.card-line > .card-header { border-bottom: 0; flex-wrap: wrap; gap: 6px 14px; }
.card.card-line .empty-line-txt { font-size: var(--t-sm); }
/* 113. Relances à venir (admin/impayes.php, 24/11/2026) : factures d'un rappel empilées, numéro et montant sur une ligne ;
   colonne d'état bornée pour laisser la largeur au client et aux factures (au-delà du téléphone : tableau replié, composant 89) */
.up-invs { display: flex; flex-direction: column; gap: var(--s-2); }
.up-inv-main { white-space: nowrap; }
.up-total { font-size: var(--t-xs); }
.up-table .up-why, .up-table .up-skip-who { overflow-wrap: anywhere; }   /* adresses en cause toutes écrites, retour à la ligne */
@media (max-width: 640px) { table.up-skip.table-fold { --fc: fit-content(45%); } }
@media (min-width: 641px) { table.up-table:not(.up-skip) td:nth-child(4) { width: 17rem; } table.up-table:not(.up-skip) td:first-child { white-space: nowrap; } table.up-skip td:nth-child(3) { width: 17rem; } }
/* 112. État vide dans une carte bord à bord (24/11/2026) : la ligne vide posée seule dans la carte (tableau vide sous une barre
   de filtres) et la cellule d'un tableau vide bord à bord prennent la marge d'un corps de carte, phrase alignée sur le titre */
.card > .empty-line { padding: 24px; }
.card > .table-wrap td.td-empty { padding: 24px; }

/* 50. Saisie repliée : le bouton ouvre le formulaire sur place ; ouvert, le formulaire prend sa place (Annuler replie) */
details.fold > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { display: none; }
details.fold > .fold-body > form > .form-actions, details.fold > .fold-body .fold-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* 51. Lignes de compte d'un outil (carte « Fournisseurs ») : saisie ouverte sous la ligne, toute la largeur */
.acct-list { list-style: none; margin: 0; padding: 0; }
.acct-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.acct-line:first-child { padding-top: 0; }
.acct-line:last-child { border-bottom: 0; padding-bottom: 0; }
.acct-anchor { display: block; width: 0; height: 0; scroll-margin-top: 90px; }
.acct-main { flex: 1 1 280px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.acct-name { font-family: var(--font-ui); font-weight: 600; color: var(--title); }
.acct-state { color: var(--text); }
.acct-svcs { color: var(--text-soft); font-size: var(--t-sm); }
.acct-off { color: var(--muted); }
.acct-line > details.fold { flex: 0 0 auto; }
.acct-line > details.fold[open] { flex: 1 0 100%; order: 5; }
.acct-line > details.fold > .fold-body { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
@media (max-width: 640px) { .acct-main { flex-basis: 100%; } }

/* 5. Grille de cartes : colonnes de 360 px au moins ; une carte peut couvrir deux colonnes */
/* Règle 3 (docs/design.md) : pas de trou — une colonne, puis deux colonnes égales à partir de 1 180 px,
   cartes d'une même rangée à la même hauteur ; quand les cartes en demi-largeur sont en nombre impair,
   la dernière d'entre elles prend toute la largeur (les cartes pleine largeur, .span-2 / .span-all, ne
   comptent pas : placement « dense », les demi-cartes comblent les rangées) ; l'ordre des cartes est
   choisi par la page pour équilibrer les colonnes. */
.card-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); grid-auto-flow: row dense; align-items: stretch; margin-bottom: 20px; }
.card-grid > * { min-width: 0; }
.card-grid > .card { margin-bottom: 0; }
.card-grid > .span-all { grid-column: 1 / -1; }
@media (min-width: 1180px) {
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-grid > .span-2 { grid-column: 1 / -1; }
    .card-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }   /* navigateurs sans « of S » */
}
@supports selector(:nth-child(1 of .a)) {
    @media (min-width: 1180px) {
        .card-grid > :last-child:nth-child(odd):not(.span-2):not(.span-all) { grid-column: auto; }
        .card-grid > :nth-last-child(1 of :not(.span-2, .span-all)):nth-child(odd of :not(.span-2, .span-all)) { grid-column: 1 / -1; }
    }
}

/* 6. Tableau : ligne de groupe (grise) et sous-total (bleu clair) */
tbody tr.row-group th, tbody tr.row-group td { padding: 10px 14px; background: var(--surface-3); color: var(--title); font-family: var(--font-ui); font-weight: 600; text-align: left; }   /* mêmes marges que les cellules : le titre du groupe s'aligne sur les lignes */
tbody tr.row-sub td { background: var(--primary-soft); font-weight: 600; color: var(--title); }
tbody tr.row-group:hover, tbody tr.row-sub:hover { background: inherit; }

/* 7. Jauge : barre bleue arrondie, texte « X utilisées sur Y » au-dessus */
.gauge-block { margin: 4px 0 10px; }
.gauge-text { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.gauge-text strong { color: var(--title); font-weight: 600; }
.gauge-text .gauge-right { color: var(--muted); font-size: var(--t-sm); }
.gauge { height: 10px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.gauge.gauge-lg { height: 12px; }
.gauge > span { display: block; height: 100%; border-radius: 6px; background: var(--primary); }
.gauge.gauge-warn > span { background: var(--warning); }   /* backoffice seulement (pack presque épuisé) */
.gauge.gauge-bad > span { background: var(--danger); }     /* backoffice seulement (dépassement) */
.gauge-sub { margin-top: 6px; font-size: var(--t-xs); color: var(--muted); }

/* 8. Histogramme mensuel (12 mois) : bleu = contrat, orange = hors contrat ; durée écrite au-dessus de
      chaque barre ; ligne pointillée du crédit mensuel ; généré par le serveur (ui_histogram()) */
.histo { margin: 0; }
.histo-area { padding-top: 20px; }
.histo-bars { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; height: 140px; border-bottom: 1px solid var(--line); }
.histo-col { position: relative; display: flex; flex-direction: column-reverse; justify-content: flex-start; height: 100%; min-width: 0; }
.histo-val { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; line-height: 1.1; color: var(--text-soft); font-variant-numeric: tabular-nums; pointer-events: none; }
.histo-val .hv-s { display: none; }
.histo{container-type:inline-size}@container (max-width:760px){.histo-area{padding-top:34px}.histo-col:nth-child(even)>.histo-val{margin-bottom:1.15em}}@container (max-width:480px){.histo-area{padding-top:48px}.histo-col:nth-child(even)>.histo-val{margin-bottom:0}.histo-col:nth-child(3n+2)>.histo-val{margin-bottom:1.15em}.histo-col:nth-child(3n)>.histo-val{margin-bottom:2.3em}}
.histo-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed var(--muted); pointer-events: none; z-index: 1; }
/* Libellé de la ligne du crédit : dans une colonne à droite des barres (.histo-gut), centré sur la hauteur de la ligne,
   jamais sur une barre ; la colonne prend la largeur du libellé (copie invisible .histo-gut-w) */
.histo-has-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; }
.histo-has-line > .histo-area { grid-column: 1; grid-row: 1; min-width: 0; }
.histo-has-line > .histo-gut { grid-column: 2; grid-row: 1; padding-top: 20px; }
.histo-has-line > .histo-labels { grid-column: 1; grid-row: 2; }
.histo-has-line > .histo-legend { grid-column: 1 / -1; grid-row: 3; }
.histo-gut-w, .histo-line-lbl { font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; white-space: nowrap; }
.histo-gut-w { display: block; height: 0; overflow: hidden; visibility: hidden; padding: 0 2px; }
.histo-gut-in { position: relative; height: 140px; }
.histo-line-lbl { position: absolute; left: 0; transform: translateY(50%); padding: 0 2px; color: var(--text-soft); line-height: 1.2; }
.histo-legend .lg-line { width: 14px; height: 0; border-radius: 0; border-top: 1.5px dashed var(--muted); }
.histo-seg { display: block; width: 100%; min-height: 0; }
.histo-seg-a { background: var(--chart-a); }
.histo-seg-b { background: var(--chart-b); }
.histo-seg-n { background: var(--chart-n); }
.histo-seg-c, .histo-legend .lg-c { background: repeating-linear-gradient(135deg, var(--chart-c) 0 4px, var(--surface) 4px 5.5px); }   /* hachures : se distingue sans la couleur */
.histo-col > .histo-seg:last-child { border-radius: 4px 4px 0 0; }
.histo-labels { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; margin-top: 6px; }
.histo-labels > span { text-align: center; font-size: var(--t-xs); color: var(--muted); white-space: nowrap; overflow: hidden; }
.histo-labels .hl-s { display: none; }
.histo-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: var(--t-xs); color: var(--text-soft); }
.histo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.histo-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.histo-legend .lg-a { background: var(--chart-a); }
.histo-legend .lg-b { background: var(--chart-b); }
.histo-legend .lg-n { background: var(--chart-n); }
.histo-empty { margin: 0; color: var(--muted); font-size: var(--t-sm); }
/* 28. Graphique de mesure (ui_linechart()) : même famille que l'histogramme — couleurs --chart-a / --chart-b,
      axes en petit gris, légende commune ; courbe de la moyenne et bande min–max en SVG étiré, trait constant */
.lchart { margin: 0; }
.lchart-box { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 8px; align-items: start; padding-top: 6px; }
.lchart-y { position: relative; height: 150px; min-width: 2.4em; font-family: var(--font-ui); font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.lchart-y .ly { position: absolute; right: 0; transform: translateY(50%); line-height: 1; white-space: nowrap; }
.lchart-y .ly-w { display: block; visibility: hidden; height: 0; overflow: hidden; white-space: nowrap; }   /* largeur de la colonne */
.lchart-main { min-width: 0; }
.lchart-plot { position: relative; height: 150px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.lchart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.lchart-gl { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4; }
.lchart-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.lchart-line.lc-a { stroke: var(--chart-a); }
.lchart-line.lc-b { stroke: var(--chart-b); }
.lchart-line.lc-n { stroke: var(--chart-n); }
.lchart-line.lc-c { stroke: var(--chart-c); stroke-dasharray: 6 4; }   /* part en attente : grise et pointillée */
.lchart-band { stroke: none; opacity: .18; }
.lchart-band.lc-a { fill: var(--chart-a); }
.lchart-band.lc-b { fill: var(--chart-b); }
.lchart-band.lc-n { fill: var(--chart-n); }
.lchart-band.lc-c { fill: var(--chart-c); }
.lchart-x { position: relative; height: 16px; margin-top: 5px; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
/* Graduations : seul le libellé lui-même est posé (enfant direct) ; ses deux textes (long, court du téléphone) restent
   dans le fil, sinon un libellé proche d'un bord se centrait sur ce bord au lieu de s'y aligner et sortait de la carte */
.lchart-x > span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.lchart-x > span.lx-first { transform: none; }
.lchart-x > span.lx-last { transform: translateX(-100%); }
.lchart-x .lx-s { display: none; }
.histo-legend .lg-band { background: var(--chart-a); opacity: .25; }
.lchart-data { margin-top: 8px; }
.lchart-data > summary { cursor: pointer; font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; color: var(--primary); width: max-content; }
.lchart-data > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.lchart-data .table-wrap { margin-top: 8px; max-height: 320px; overflow: auto; }
.lchart-data table.num-table tbody th[scope="row"], .lchart-data table.num-table td, .lchart-data table.num-table thead th { padding: 7px 12px; font-size: var(--t-xs); }
/* 29. Frise de disponibilité (ui_strip()) : une bande, un segment par période d'état */
.strip-fig { margin: 0; }
.strip { position: relative; height: 18px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.strip > span { position: absolute; top: 0; bottom: 0; min-width: 1px; }
.st-up { background: var(--success); }
.st-part { background: var(--warning); }
.st-down { background: var(--danger); }
.st-none { background: var(--surface-3); }
.strip-legend i.st-none { box-shadow: inset 0 0 0 1px var(--line); }
/* 28 (variante compacte) : graphes en grille .chart-grid — deux par ligne à partir de 720 px, un sur téléphone ;
   chaque cellule : titre .chart-head (nom, état, valeur actuelle) puis le graphe ; légende commune au-dessus */
.lchart-sm .lchart-y, .lchart-sm .lchart-plot { height: 96px; }
.chart-grid { display: grid; gap: 22px 28px; grid-template-columns: minmax(0, 1fr); }
.chart-cell { min-width: 0; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-bottom: 2px; }
.chart-head h3 { margin: 0; min-width: 0; font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 600; color: var(--title); overflow-wrap: anywhere; }
.chart-head .state { font-size: var(--t-xs); }
.chart-now { flex-basis: 100%; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-grid-legend { margin: 0 0 14px; }
/* Tableau des valeurs d'un graphe compact : titres de colonnes sur deux lignes au besoin, cellules serrées (demi-largeur) */
.lchart-sm .lchart-data table.num-table thead th.num { white-space: normal; }
.lchart-sm .lchart-data table.num-table tbody th[scope="row"], .lchart-sm .lchart-data table.num-table td,
.lchart-sm .lchart-data table.num-table thead th { padding: 6px 8px; }
@media (min-width: 720px) { .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 30. Carte d'état (ui_status_card()) : état, faits courts et alertes d'un équipement en une carte compacte */
.status-card { container-type: inline-size; }
.status-card-body { display: grid; gap: 16px 32px; grid-template-columns: minmax(0, 1fr); }
.status-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0 0 4px; }
.status-now .state { font-size: var(--t-md); }
.status-since { font-size: var(--t-xs); color: var(--muted); }
.status-h { margin: 0 0 8px; font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.status-side .todo-none { margin: 0; }
@container (min-width: 640px) { .status-card-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
/* 31. État vide (ui_empty()) : ce qui manque et quand il viendra, centré dans sa carte */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 26px 16px; }
.empty-ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 50%; background: var(--primary-pale); color: var(--primary); }
.empty-title { margin: 0; font-family: var(--font-ui); font-size: var(--t-md); font-weight: 600; color: var(--title); }
.empty-text { margin: 0; font-size: var(--t-sm); color: var(--muted); }
@media (max-width: 640px) {   /* téléphone : durée courte (« 1h05 ») et initiale du mois */
    .histo-val { font-size: var(--t-xs); }
    .histo-val .hv-l, .histo-labels .hl-l { display: none; }
    .histo-val .hv-s { display: inline; }
    .histo-labels .hl-s { display: block; }
    .histo-bars, .histo-labels { gap: 4px; }
    .histo-has-line { column-gap: 4px; }
    .histo-gut-w, .histo-line-lbl { font-size: var(--t-xs); }
    .lchart-y, .lchart-plot { height: 120px; }
    .lchart-sm .lchart-y, .lchart-sm .lchart-plot { height: 90px; }
    .lchart-x .lx-l { display: none; }
    .lchart-x .lx-s { display: inline; }
    .lchart-data table.num-table tbody th[scope="row"], .lchart-data table.num-table td, .lchart-data table.num-table thead th { padding: 6px 8px; }
}

/* 39. Journal d'activité (ui_timeline()) : liste datée de sources mêlées, la plus récente en haut — icône sur pastille
      ronde (bleu : échange saisi ; orange : demande ; gris : intervention, facture), source en capitales et date à droite,
      titre en gras, texte sur plusieurs lignes, pied (auteur, action). Filet vertical entre les icônes. */
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 0 0 18px; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; background: var(--line); }
.tl-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; }
.tl-blue { background: var(--primary-pale); color: var(--primary); }
.tl-orange { background: var(--warning-bg); color: var(--warning-text); }
.tl-gray { background: var(--surface-3); color: var(--text-soft); }
.tl-main { min-width: 0; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.tl-src { font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tl-when { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-meta { margin-left: auto; font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }   /* durée d'une intervention : sa colonne, jamais dans le titre */
.tl-title { margin: 2px 0 0; font-weight: 600; color: var(--title); overflow-wrap: anywhere; }
.tl-title a { color: inherit; }
.tl-body { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--text); font-size: var(--t-sm); line-height: 1.5; }
.tl-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; font-size: var(--t-xs); color: var(--muted); }
.tl-foot form { margin: 0; }
.tl-more { display: flex; justify-content: center; padding-top: 4px; }
/* Échange modifié (migration 58) : mention à côté de l'auteur ; « Modifier » (saisie repliée, composant 50) ouvert sous la ligne, toute la
   largeur de l'élément, texte et taille du formulaire rétablis (le pied est en petit gris) ; « Supprimer » reste sur la ligne */
.tl-edited { font-style: italic; }
.tl-foot > details.fold[open] { order: 5; flex-basis: 100%; }
.tl-foot > details.fold > .fold-body { margin-top: 6px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: var(--t-md); }
.tl-foot > details.fold > summary.btn-link { padding-left: 0; padding-right: 0; }
@media (max-width: 640px) { .tl-foot > .tl-by, .tl-foot > .tl-edited { flex-basis: 100%; } }   /* téléphone : auteur, mention, puis les actions ensemble */

/* 69. Brouillon repris (assets/draft.js) : en tête du formulaire, mention du brouillon gardé sur l'appareil et « Effacer le brouillon » ;
       saisie repliée : pastille « Brouillon » sur son bouton */
.draft-note { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin: 0 0 12px; }
.quick-note > .draft-note { margin-bottom: 0; }   /* grille de la saisie rapide : son écart suffit */
.draft-note .draft-clear { padding: 0; min-height: 0; color: inherit; font-weight: 600; text-decoration: underline; }
.draft-tag { margin-left: 6px; }
@media (max-width: 640px) { .draft-note .draft-clear { min-height: 44px; } }

/* 40. Saisie rapide (« Noter un échange » ; téléphone et application installée d'abord) : une colonne, cibles de 48 px,
      choix du type en boutons qui passent à la ligne (choix segmenté, composant 23), date et heure sur une ligne,
      texte qui prend la largeur, bouton principal en pleine largeur sous 640 px ; fiche rappelée en tête (nom et état). */
.quick-note { display: grid; gap: 14px; max-width: 640px; }
.quick-note .form-group { margin: 0; }
.quick-note .seg { flex-wrap: wrap; }
.quick-note .seg-opt span { min-height: 44px; display: inline-flex; align-items: center; }
.quick-note textarea.form-control { min-height: 140px; max-width: none; }
.quick-note .form-control { max-width: none; }
.quick-when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.quick-for { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-weight: 600; color: var(--title); }
.quick-find { display: grid; gap: 8px; max-width: 640px; }
.quick-find .ss-list { position: static; max-height: none; }
@media (max-width: 640px) {
    .quick-note .form-actions .btn { width: 100%; justify-content: center; min-height: 48px; }
    .quick-when { grid-template-columns: minmax(0, 1fr); }
}

/* 41. Contacts d'une fiche (CRM) : une personne par rangée — nom en gras, rôle en étiquette, « Ne plus contacter » (pastille
      rouge : interdit), fonction, liens directs (e-mail, téléphone, mobile : cibles de 44 px sur téléphone), compte lié, notes ;
      « Modifier » et « Ajouter » en formulaire dépliable (details.crm-edit) sous la rangée, sur toute la largeur de la carte.
      Rangée « ne plus contacter » : filet rouge à gauche. Liste du CRM : nom en lien, ville dessous. */
.crm-contacts { list-style: none; margin: 0 0 14px; padding: 0; }
.crm-contact { padding: 12px 0 12px 12px; border-left: 3px solid transparent; border-bottom: 1px solid var(--line); }
.crm-contact:first-child { padding-top: 0; }
.crm-contact.is-dnc { border-left-color: var(--danger-line); }
.crm-contact-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--title); overflow-wrap: anywhere; }
.crm-contact-sub { margin: 2px 0 0; font-size: var(--t-sm); color: var(--muted); overflow-wrap: anywhere; }
.crm-contact-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; font-size: var(--t-sm); }
.crm-contact-links a { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.crm-contact-notes { margin: 6px 0 0; font-size: var(--t-sm); color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
/* Contact lu de l'outil de facturation (migration 58) : « Reprendre les données … » discret, à la ligne sur téléphone */
.crm-resync { margin: 2px 0 0; }
.crm-resync .btn-link { padding-left: 0; padding-right: 0; white-space: normal; text-align: left; height: auto; }
.crm-edit { margin-top: 8px; }
.crm-edit > summary { list-style: none; display: inline-flex; cursor: pointer; }
.crm-edit > summary::-webkit-details-marker { display: none; }
.crm-edit[open] > summary { margin-bottom: 10px; }
.crm-edit > form { margin: 0 0 8px; }
.crm-add { margin-top: 0; }
.crm-form .form-control { max-width: var(--field-max, 420px); }
.crm-form textarea.form-control { max-width: none; }
.crm-del { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.crm-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 16px; }
.crm-cols .form-actions { grid-column: 1 / -1; }
.crm-name { font-weight: 600; overflow-wrap: anywhere; }
.crm-city { display: block; font-size: var(--t-xs); }
.crm-journal-hint { margin: 0 0 14px; }
.crm-order { max-width: 96px; }   /* ordre d'une étape, délai en jours (Paramètres, onglet Commercial) */
.crm-pick .ss-opt { padding: 0; }
.crm-pick a { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; color: inherit; text-decoration: none; }
@media (max-width: 640px) {
    .crm-contact { padding-left: 10px; }
    .crm-contact-links a { min-height: 44px; }
    .crm-form .form-actions .btn { min-height: 44px; }   /* boutons des formulaires du CRM (et « Demander un devis ») : cible tactile */
}

/* 42. Tableau par étapes (affaires du CRM) : une colonne par étape — titre, nombre exact (pastille grise), total HT —, puis ses
      cartes (titre en lien, fiche, montant en chiffres tabulaires, date de décision, étiquettes). Colonnes côte à côte qui
      passent à la ligne (170 px au moins chacune : 7 étapes sur une ligne à partir de 1 600 px environ) ; une seule colonne
      sous 640 px : liste groupée par étape. Date dépassée d'une affaire en cours : orange (action à faire). Aucun défilement. */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 14px; align-items: start; margin: 0 0 18px; }
.board-col { min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; }
.board-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0 0 8px; }
.board-head h2 { margin: 0; font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 600; color: var(--title); overflow-wrap: anywhere; }
.board-total { margin-left: auto; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.board-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 10px; min-width: 0; }
.board-title { display: block; font-weight: 600; overflow-wrap: anywhere; line-height: 1.35; }
.board-sub { margin: 2px 0 0; font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
.board-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-top: 6px; font-size: var(--t-xs); color: var(--muted); }
.board-amount { font-weight: 600; color: var(--title); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-late { color: var(--warning-text); font-weight: 600; }
.board-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.board-empty { margin: 4px 0; font-size: var(--t-xs); color: var(--muted); }
.board-more { margin: 8px 0 0; font-size: var(--t-xs); }
@media (max-width: 640px) {
    .board { gap: 10px; }
    .board-title { min-height: var(--tap); }
    .board-more a { display: inline-flex; align-items: center; min-height: var(--tap); }
}

/* 18. Tableau de chiffres (détail mois par mois, relevés, journaux) : première colonne = le mois ou la
       date, toujours visible (collée à gauche quand le tableau défile, sans .table-stack) ; filets
       verticaux légers entre colonnes ; lignes alternées ; chiffres à droite en chasse fixe ; ligne de
       total (tfoot) en bleu clair. <table class="num-table"> dans un .table-wrap ; th scope="row". */
table.num-table th, table.num-table td { border-left: 1px solid var(--surface-3); }
table.num-table tr > :first-child { border-left: 0; }
table.num-table th.num, table.num-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.num-table tbody th[scope="row"] { padding: 10px 14px; text-align: left; white-space: nowrap; font-weight: 600; font-size: var(--t-sm); color: var(--title); }
table.num-table tbody td { padding-top: 10px; padding-bottom: 10px; }
table.num-table tbody tr:not(:last-child) th { border-bottom: 1px solid var(--line); }
table.num-table tfoot th, table.num-table tfoot td { padding: 11px 14px; background: var(--primary-soft); color: var(--title); font-weight: 600; text-align: left; }
table.num-table tfoot td.num { text-align: right; }
/* Variation (composant 33) : hausse verte, baisse rouge, stable grise ; texte signé, chiffres tabulaires */
.delta { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }
.delta-flat, .delta-none { color: var(--muted); font-weight: 400; }
/* Codes d'installation eSIM (composant 34, assets/esim.js) : code QR (image, toujours sur fond clair), codes à saisir
   avec « Copier », avertissement, mode d'emploi repliable, actions ; feuille imprimée à part (.esim-sheet, backoffice) */
.esim-box { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 14px; }
.esim-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.esim-head strong { display: inline-flex; align-items: center; gap: 6px; font: 600 var(--t-md) var(--font-ui); color: var(--title); }
.esim-until { font-size: var(--t-xs); color: var(--muted); }
.esim-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 22px; align-items: start; }
.esim-qr { margin: 0; justify-self: center; text-align: center; }
.esim-qr img { display: block; width: 220px; height: 220px; max-width: 100%; background: var(--qr-bg); border-radius: var(--radius-xs); image-rendering: pixelated; }
.esim-qr figcaption { max-width: 220px; margin-top: 6px; font-size: var(--t-xs); color: var(--muted); }
.esim-codes { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.esim-codes dt { font: 600 var(--t-xs) var(--font-ui); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.esim-codes dd { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.esim-val { min-width: 0; max-width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface);
            color: var(--text); font: var(--t-sm) var(--font-mono); overflow-wrap: anywhere; user-select: all; }
.esim-code-full .esim-val { font-size: var(--t-xs); }
.esim-copied { font-size: var(--t-xs); color: var(--success); }
.esim-box .esim-warn, .esim-box details.esim-howto { margin: 0; }
.esim-howto .help-body p { margin: 0 0 8px; }
.esim-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.esim-none { margin: 8px 0 0; font-size: var(--t-xs); color: var(--muted); }
@media (max-width: 560px) { .esim-body { grid-template-columns: minmax(0, 1fr); } }
.esim-sheet { display: none; }
@media print {
    body.esim-printing > *:not(.esim-sheet) { display: none !important; }
    body.esim-printing { background: var(--qr-bg); }
    body.esim-printing .esim-sheet { display: block; color: var(--qr-fg); background: var(--qr-bg); font: 11pt/1.45 var(--font-body); }
    .esim-sheet h1 { margin: 0 0 4px; font: 20pt var(--font-title); color: var(--qr-fg); }
    .esim-sheet-sub { margin: 0 0 16px; font-size: 11pt; }
    .esim-sheet-body { display: flex; gap: 8mm; align-items: flex-start; margin-bottom: 8mm; break-inside: avoid; }
    .esim-sheet-body img { width: 55mm; height: 55mm; image-rendering: pixelated; }
    .esim-sheet dl { margin: 0; }
    .esim-sheet dt { font: 600 9pt var(--font-ui); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; }
    .esim-sheet dd { margin: 2px 0 0; font: 11pt var(--font-mono); overflow-wrap: anywhere; }
    .esim-sheet-warn { padding: 3mm 4mm; border: 1px solid var(--qr-fg); }
    .esim-sheet-howto p { margin: 0 0 6px; }
    .esim-sheet-foot { margin-top: 10mm; font: 600 10pt var(--font-ui); }
}
table.num-table .num-sub { display: block; font-size: var(--t-xs); font-weight: 400; color: var(--muted); white-space: nowrap; }
table.num-table:not(.table-stack) > * > tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
table.num-table:not(.table-stack) > tbody > tr:nth-child(even) > :first-child { background: var(--zebra); }
table.num-table:not(.table-stack) > tbody > tr:hover > :first-child { background: var(--primary-pale); }
table.num-table:not(.table-stack) > thead > tr > :first-child { background: var(--primary-pale); }
table.num-table:not(.table-stack) > tfoot > tr > :first-child { background: var(--primary-soft); }

/* 36. Action dépliable d'une ligne de tableau (« Ranger dans… » des lignes non classées du pilotage) :
       <table class="num-table table-stack row-act-table"> ; une ligne = <tbody class="row-act-group"> :
       <tr>… <td class="row-act-cell"><details class="row-act" data-row-act="ID"><summary class="btn btn-ghost btn-sm"
       aria-controls="ID">…</summary></details></td></tr> puis <tr class="row-act-row" id="ID" hidden><td colspan="N">
       <form class="row-act-form" method="get">champs + bouton contour « Voir l'effet »</form></td></tr>.
       Le formulaire s'ouvre SOUS la ligne, sur toute la largeur de la carte (jamais coupé au bord droit) : la ligne
       d'action est montrée par assets/admin.js (événement toggle, focus sur le premier champ, Échap referme) et, sans
       script, par :has() ; l'envoi mène à une page de confirmation (effet calculé), jamais à une écriture directe (révisé
       par fix/retouches-2 : le formulaire était dans la dernière cellule et débordait d'une carte en demi-largeur) */
.row-act-cell { width: 1%; vertical-align: middle; }
.row-act > summary { list-style: none; cursor: pointer; white-space: nowrap; }
.row-act > summary::-webkit-details-marker { display: none; }
.row-act[open] > summary { background: var(--surface-3); }
.row-act-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.row-act-form > * { min-width: 0; }
.row-act-form .form-control { width: auto; max-width: 240px; height: 33px; min-height: 0; padding-top: 0; padding-bottom: 0; font-size: var(--t-xs); }
.row-act-form .row-act-word { flex: 1 1 200px; max-width: var(--field-max); }
.row-act-lbl { font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.row-act-what { font-size: var(--t-sm); color: var(--text-soft); overflow-wrap: anywhere; }
table.row-act-table > tbody > tr { background: var(--surface); }
table.row-act-table > tbody:nth-of-type(even) > tr { background: var(--zebra); }
table.row-act-table > tbody:hover > tr { background: var(--primary-pale); }
table.row-act-table tbody th[scope="row"], table.row-act-table .num-sub { white-space: normal; overflow-wrap: anywhere; }
table.row-act-table thead th { white-space: normal; }   /* en-têtes sur deux lignes au besoin : le tableau tient dans une demi-carte (1 180 px et plus) */
table.row-act-table td.row-act-cell { padding-left: 8px; padding-right: 12px; }
table.row-act-table > tbody > tr.row-act-row > td { padding: 10px 14px 12px; border-top: 1px dashed var(--line); }
table.row-act-table > tbody:has(details.row-act[open]) > tr.row-act-row { display: table-row; }   /* sans script */
/* Tableau de chiffres qui porte une action de ligne : table.num-table.table-stack (pas de première colonne collante, qui
   couvrirait l'action) ; sous 640 px, une carte par ligne : référence et libellé (th) en tête, chiffres en data-label, action dessous */
@media (max-width: 640px) {
    table.num-table.table-stack tbody th[scope="row"] { display: block; padding: 6px 0 8px !important; white-space: normal; overflow-wrap: anywhere; border: 0 !important; background: none; }
    table.num-table.table-stack .num-sub { white-space: normal; overflow-wrap: anywhere; }
    table.table-stack td.row-act-cell { display: block; width: auto; text-align: left; }
    .row-act-form .form-control { flex: 1 1 180px; max-width: 100%; }
    /* ligne d'action : collée sous la carte de sa ligne */
    table.row-act-table > tbody.row-act-group { margin-bottom: 10px; }
    table.row-act-table > tbody.row-act-group > tr { margin-bottom: 0; }
    table.row-act-table > tbody.row-act-group > tr.row-act-row { border-top: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 4px 14px 12px; }
    table.row-act-table > tbody.row-act-group > tr.row-act-row > td { display: block; padding: 8px 0 0 !important; border: 0 !important; text-align: left; }
    table.row-act-table > tbody.row-act-group > tr.row-act-row > td::before { content: none; }
    table.row-act-table > tbody.row-act-group:has(tr.row-act-row:not([hidden])) > tr:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; border-bottom-style: dashed; }
    table.row-act-table > tbody:has(details.row-act[open]) > tr.row-act-row { display: block; }
}

/* 19. Carte repliable : <details class="card card-fold"><summary class="card-header">…</summary>…</details> ;
       fermée par défaut (contenu secondaire : détail d'un calcul, liste non urgente) */
details.card-fold > summary { cursor: pointer; list-style: none; }
details.card-fold > summary::-webkit-details-marker { display: none; }
details.card-fold > summary h2, details.card-fold > summary h3 { flex: 1; margin: 0; font-family: var(--font-ui); font-weight: 600; font-size: var(--t-md); color: var(--title); }
details.card-fold:not([open]) > summary { border-bottom: 0; }
details.card-fold > summary:hover h2, details.card-fold > summary:hover h3 { color: var(--primary); }
details.card-fold > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
details.card-fold .fold-chev { transition: transform .15s; flex-shrink: 0; }
details.card-fold[open] .fold-chev { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { details.card-fold .fold-chev { transition: none; } }

/* 9. Pastilles au code couleur FIXE : rouge = problème en cours, orange = action à faire,
      bleu = nouveauté, gris = simple compteur. Toujours le nombre exact (ui_count()), jamais
      « Nombreux » ni « 99+ » (docs/design.md, règle 1). */
.pill {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0;
    min-width: 22px; padding: 1px 8px; border-radius: 11px;
    font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.pill-red    { background: var(--danger-strong); color: var(--on-danger); }
.pill-orange { background: var(--warning-bg); color: var(--warning-text); box-shadow: inset 0 0 0 1px var(--warning-line); }
.pill-blue   { background: var(--btn-bg); color: var(--on-primary); }
.pill-gray   { background: var(--surface-3); color: var(--text-soft); }

/* 10. Point d'état : services qui peuvent tomber (internet) */
.state { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-weight: 600; font-size: var(--t-sm); white-space: nowrap; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.state-up .state-dot, .state-dot.state-up { background: var(--success); }
.state-down .state-dot, .state-dot.state-down { background: var(--danger); }
.state-warn .state-dot, .state-dot.state-warn { background: var(--warning); }
.state-up { color: var(--success); }
.state-down { color: var(--danger); }
.state-warn { color: var(--warning-text); }
.state-none { color: var(--muted); }

/* 11. Étiquette « TA INFO » : donnée visible par l'administrateur seulement */
.ta-tag {
    display: inline-block; padding: 0 5px; border-radius: 4px; background: var(--surface-3); color: var(--muted);
    font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; line-height: 1.6;
    text-transform: uppercase; white-space: nowrap; vertical-align: 1px;
}

/* 12. Aide repliable « À quoi sert cette page ? » : fermée par défaut */
details.help {
    margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
    font-size: var(--t-sm); line-height: 1.55; color: var(--text-soft);
}
details.help > summary {
    display: flex; align-items: center; gap: 8px; padding: 10px 16px; min-height: var(--tap); cursor: pointer; list-style: none;
    font-family: var(--font-ui); font-weight: 600; color: var(--primary); border-radius: var(--radius-sm);
}
details.help > summary::-webkit-details-marker { display: none; }
details.help > summary::after {
    content: ''; width: 8px; height: 8px; margin-left: auto; flex-shrink: 0;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s;
}
details.help[open] > summary::after { transform: rotate(45deg); }
details.help > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
details.help > .help-body { padding: 0 16px 14px; }   /* texte sur toute la largeur de l'aide */
details.help .help-body p { margin: 0 0 8px; }
details.help .help-body p:last-child { margin-bottom: 0; }
/* Listes à puces de l'aide : puce au bord gauche du texte des paragraphes, texte de chaque point aligné après elle (le socle
   remet à zéro les marges des listes : la puce sortait du cadre, à gauche de l'alignement des paragraphes) */
details.help .help-body ul { list-style: none; margin: 0 0 8px; }
details.help .help-body ul:last-child { margin-bottom: 0; }
details.help .help-body ul > li { position: relative; padding-left: 1.1em; }
details.help .help-body ul > li + li { margin-top: 4px; }
details.help .help-body ul > li::before { content: "•"; position: absolute; left: 0.15em; color: var(--muted); }

/* 13. Bloc « À traiter » : point de couleur (code des pastilles), texte, action */
.todo { list-style: none; margin: 0; padding: 0; }
.todo > li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo > li:last-child { border-bottom: 0; padding-bottom: 0; }
.todo > li:first-child { padding-top: 0; }
.todo-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin-top: 7px; background: var(--muted); }
.todo-dot.dot-red    { background: var(--danger); }
.todo-dot.dot-orange { background: var(--warning); }
.todo-dot.dot-blue   { background: var(--primary); }
.todo-dot.dot-gray   { background: var(--muted); }
.todo-main { flex: 1; min-width: 0; }
.todo-main strong { color: var(--title); font-weight: 600; }
.todo-main .todo-sub { display: block; font-size: var(--t-xs); color: var(--muted); }
.todo-act { flex-shrink: 0; align-self: center; font-family: var(--font-ui); font-weight: 600; color: var(--primary); text-decoration: none; white-space: nowrap; }
.todo-act:hover { text-decoration: underline; }
/* Action sur place (« Actualiser ») : bouton sans fond, même apparence que le lien d'action */
.todo-btn { background: none; border: 0; padding: 0; font-size: inherit; line-height: inherit; cursor: pointer; }
.todo-btn:disabled { color: var(--muted); cursor: progress; text-decoration: none; }
.todo-btn + .todo-act { margin-left: 4px; }
/* Téléphone : les actions passent sous le texte (alignées sur lui), le texte garde toute la largeur */
@media (max-width: 640px) {
    .todo > li { flex-wrap: wrap; row-gap: 4px; }
    .todo-main { flex-basis: calc(100% - 19px); }
    .todo-main + .todo-act { margin-left: 19px; }
    .todo-act { align-self: auto; }
}
.todo-none { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--success); font-weight: 600; }
/* Liste de tâches (composant 43, CRM) : case de 44 px qui coche « fait » en un geste, titre, échéance et fiche */
.task-list { list-style: none; margin: 0; padding: 0; }
.task-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.task-item:last-child { border-bottom: 0; }
.task-check { margin: 0; flex-shrink: 0; display: block; }
.task-box { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 0 0 -11px; padding: 0;
    background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer; color: var(--on-primary); }
span.task-box { cursor: default; }
.task-tick { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 2px solid var(--field-border);
    border-radius: var(--radius-xs); background: var(--surface); color: transparent; transition: background-color .12s, border-color .12s; }
button.task-box:hover .task-tick { border-color: var(--primary); }
.task-box:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.task-item.is-done .task-tick { background: var(--success); border-color: var(--success); color: var(--on-primary); }
.task-item.is-late .task-tick { border-color: var(--danger-line); }
.task-main { flex: 1; min-width: 0; padding-top: 10px; }
.task-title { font-family: var(--font-ui); font-weight: 600; color: var(--title); text-decoration: none; overflow-wrap: anywhere; }
.task-title:hover, .task-title:focus-visible { color: var(--primary); text-decoration: underline; }
.task-item.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.task-meta { margin: 2px 0 0; font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
.task-meta .due-soon { color: var(--text-soft); }
.task-details { margin: 12px 0 0; white-space: normal; overflow-wrap: anywhere; color: var(--text); }
/* Notifications sur l'appareil (composant 44, « Mon compte ») : état de cet appareil, bouton d'activation (pleine largeur, texte
   à la ligne sous 640 px), explications ; l'attribut hidden prime sur .btn et .alert (display imposé) */
.push-here { display: grid; gap: 12px; justify-items: start; margin-bottom: 16px; }
.push-here [hidden] { display: none !important; }
.push-here .alert { justify-self: stretch; margin: 0; }
.push-state { margin: 0; font-weight: 600; color: var(--title); }
@media (max-width: 640px) { .push-here .btn { width: 100%; min-height: 44px; white-space: normal; text-align: center; } }
/* Clés d'accès (composant 58) : bouton « Activer … sur cet appareil » pleine largeur et texte à la ligne sous 640 px */
.pk-add { margin-bottom: 16px; }
@media (max-width: 640px) { .pk-add .btn { width: 100%; min-height: 44px; white-space: normal; text-align: center; justify-content: center; } }
/* Cet appareil a déjà sa clé (composant 58) : état, nom de la clé, lien discret « Ajouter une autre clé » à la place du bouton */
.pk-here { display: grid; gap: 4px; justify-items: start; }
.pk-here .form-hint { margin: 0; }
.pk-state { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--title); }
.pk-state .ico { flex: none; color: var(--success); }
.pk-here .btn-link { margin-top: 4px; font-size: var(--t-sm); color: var(--muted); }
.pk-here .btn-link:hover { color: var(--primary); }
/* Double authentification (composant 70, includes/mfa_page.php, assets/mfa.js) : état, inscription de l'application (étapes,
   code QR toujours sur fond clair, clé en chasse fixe, code à 6 chiffres), codes de secours à ranger (liste, Copier, Imprimer) */
.mfa-sub { margin: 18px 0 8px; font: 600 var(--t-sm) var(--font-ui); color: var(--title); }
.card-body > .mfa-sub:first-of-type { margin-top: 12px; }
.mfa-state { margin: 0 0 8px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--title); }
.mfa-state .ico { flex: none; color: var(--success); }
.mfa-form { margin: 8px 0; }
.mfa-form + .form-hint { margin-top: 4px; }
.mfa-enroll { margin-top: 8px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.mfa-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.mfa-enroll-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px 22px; align-items: start; }
.mfa-qr { margin: 0; justify-self: center; text-align: center; }
.mfa-qr img { display: block; width: 200px; height: 200px; max-width: 100%; background: var(--qr-bg); border-radius: var(--radius-xs); image-rendering: pixelated; }
.mfa-qr figcaption { max-width: 200px; margin-top: 6px; font-size: var(--t-xs); color: var(--muted); }
.mfa-qr-wait { width: 200px; max-width: 100%; margin: 0; padding: 80px 0; font-size: var(--t-xs); color: var(--muted); }
.mfa-key { min-width: 0; }
.mfa-secret { display: inline-block; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: var(--surface);
              color: var(--text); font: var(--t-sm) var(--font-mono); letter-spacing: .04em; overflow-wrap: anywhere; user-select: all; }
.mfa-enroll .form-group > .mfa-code-input { max-width: 220px; font-size: var(--t-xl); letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.mfa-enroll .mfa-form { margin: 0; }
.mfa-codes { margin: 12px 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px 28px; counter-reset: mfa; }
.mfa-codes li { counter-increment: mfa; display: flex; align-items: baseline; gap: 8px; }
.mfa-codes li::before { content: counter(mfa) "."; min-width: 1.6em; text-align: right; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.mfa-codes code { font: var(--t-md) var(--font-mono); letter-spacing: .06em; color: var(--text); user-select: all; }
.mfa-codes-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.mfa-copied { font-size: var(--t-xs); color: var(--success); }
.mfa-sheet { display: none; }
@media (max-width: 560px) {
    .mfa-enroll-body { grid-template-columns: minmax(0, 1fr); }
    .mfa-codes { grid-template-columns: minmax(0, 1fr); }
    .mfa-form .btn, .mfa-codes-acts .btn { width: 100%; min-height: 44px; white-space: normal; justify-content: center; text-align: center; }
}
@media print {
    body.mfa-printing > *:not(.mfa-sheet) { display: none !important; }
    body.mfa-printing { background: var(--qr-bg); }
    body.mfa-printing .mfa-sheet { display: block; color: var(--qr-fg); background: var(--qr-bg); font: 11pt/1.45 var(--font-body); }
    .mfa-sheet h1 { margin: 0 0 4px; font: 20pt var(--font-title); color: var(--qr-fg); }
    .mfa-sheet ol { margin: 8mm 0; padding-left: 8mm; columns: 2; font: 13pt var(--font-mono); }
    .mfa-sheet li { margin: 0 0 3mm; }
    .mfa-sheet-warn { padding: 3mm 4mm; border: 1px solid var(--qr-fg); }
}

/* 14. Formulaires dans des cartes : libellés en capitales 12 px, champs limités (~420 px) */
.form-group > .form-control, .form-group > select.form-control, .form-group > .form-row .form-control { max-width: var(--field-max); }
.form-group > textarea.form-control { max-width: 640px; }
.form-control.form-wide, .form-group > .form-control.form-wide { max-width: none; }
/* Textes (introductions de cartes, aides, précisions, indications sous un champ) : toute la largeur
   de leur cadre, aucune limite. Seuls les champs restent limités (ci-dessus) ; l'indication d'un champ
   part de son bord gauche (même groupe) et passe à la ligne au bord de la carte ou de la colonne. */

/* Menu : ligne de 42 px (règle .nav-item), icône 20 px, pastille ou point d'état à droite */
.nav-item .pill, .nav-item .state-dot { margin-left: auto; }
.nav-item .state-dot { width: 8px; height: 8px; }
.nav-sub-item .pill, .nav-sub-item .state-dot { margin-left: auto; }

/* 15. Navigation (docs/design.md § 4) : ligne de menu = icône 20 px + libellé + pastille ou point
       d'état à droite ; états repos, survol, page en cours (bleu pâle, texte et icône bleus), focus. */
.nav-item[hidden], .pill[hidden], .state-dot[hidden] { display: none !important; }
/* Ancre visée (ex. propositions.php#historique) : visible sous l'en-tête collant */
.content details[id], .content section[id], .content .card[id], .content fieldset[id] { scroll-margin-top: 96px; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Backoffice : logo + pastille « Admin » */
.sidebar-brand-admin { display: flex; align-items: center; justify-content: center; gap: 10px; }
.sidebar-brand-admin img { width: 118px; margin: 0; }
.brand-tag {
    display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--primary-pale); color: var(--primary);
    font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
/* Recherche de client du backoffice (Ctrl K / Cmd K) : dans la barre du haut (composant 88), liste sous le champ */
.ss-toggle { display: none; }
.ss-box { position: relative; }
.ss-box input {
    width: 100%; height: 44px; padding: 0 50px 0 32px; border: 1px solid var(--field-border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font-family: var(--font-body); font-size: var(--t-sm);
}
.ss-box input::placeholder { color: var(--placeholder); }
.ss-box input::-webkit-search-cancel-button { display: none; }
.ss-box input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-pale); }
.ss-ico { position: absolute; left: 12px; top: 22px; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; }
.ss-kbd {
    position: absolute; right: 8px; top: 22px; transform: translateY(-50%); pointer-events: none;
    padding: 0 4px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2);
    color: var(--muted); font-family: var(--font-ui); font-size: var(--t-xs); line-height: 1.5;
}
.ss-list {
    list-style: none; margin: 6px 0 0; padding: 4px; max-height: 340px; overflow-y: auto;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow);
}
.ss-list[hidden] { display: none; }
.ss-opt {
    display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: var(--radius-xs); cursor: pointer;
    color: var(--text); font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 500;
}
.ss-opt .ss-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-opt .ss-off { flex-shrink: 0; font-size: var(--t-xs); color: var(--muted); }
.ss-opt.ss-more { color: var(--primary); font-size: var(--t-xs); }
.ss-opt:hover, .ss-opt[aria-selected="true"] { background: var(--primary-pale); color: var(--primary); }
.ss-msg { padding: 8px 9px; color: var(--muted); font-size: var(--t-xs); }
/* Espace client : carte de la société (initiales, nom), « Changer de société » */
.org-card { margin: 12px 10px 0; padding: 10px; border: 1px solid var(--sidebar-border); border-radius: var(--radius-sm); flex-shrink: 0; }
.org-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.org-ava {
    width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 9px;
    background: var(--primary-pale); color: var(--primary); font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600;
}
.org-info { min-width: 0; display: flex; flex-direction: column; }
.org-name {
    color: var(--sidebar-text-strong); font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 600; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-num { color: var(--sidebar-muted); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.org-card .org-switch { margin-top: 8px; }
.org-card .org-switch > summary { gap: 6px; border: 0; padding: 6px 4px; color: var(--sidebar-active-text); font-weight: 600; font-size: var(--t-xs); }
/* Encart « Besoin d'aide ? » (bas du menu du portail) */
.help-box {
    margin: 0 0 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--primary-pale);
    color: var(--sidebar-text); font-size: var(--t-xs); line-height: 1.4;
}
.help-box strong { display: block; margin-bottom: 2px; color: var(--sidebar-text-strong); font-family: var(--font-ui); font-size: var(--t-sm); }
.help-box p { margin: 0 0 8px; color: var(--sidebar-muted); }
.help-box p a { color: var(--primary); font-weight: 600; text-decoration: none; }
.help-box .btn { width: 100%; justify-content: center; background: var(--surface); }
/* Lien vers l'Aide sous « Contacter le support » (ux/chiffres-menus : l'Aide est aussi dans le menu du compte) */
.help-box-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; min-height: 32px; color: var(--primary); font-size: var(--t-xs); font-weight: 600; text-decoration: none; }
.help-box-link:hover { text-decoration: underline; }
/* Écran d'ordinateur peu haut (portable 1 440 × 900, seconde étape du lot 5) : menu du portail resserré pour que toutes ses entrées
   tiennent au-dessus de « Besoin d'aide ? » et du compte (règle 5 : ces deux blocs restent visibles) ; aucun texte retiré */
@media (min-width:1024px) and (max-height:960px){
.sidebar:has(.help-box) .sidebar-brand{padding-top:calc(10px + env(safe-area-inset-top));padding-bottom:6px}
.sidebar:has(.help-box) .nav-item{min-height:34px;padding-top:4px;padding-bottom:4px}
.sidebar:has(.help-box) .org-card{margin-top:6px;padding:8px 10px}
.sidebar:has(.help-box) .nav-section{padding-top:10px;padding-bottom:4px}
.sidebar:has(.help-box) .sidebar-nav{padding-top:6px;padding-bottom:6px}
.help-box{padding:10px 12px}.help-box p{margin-bottom:6px}.help-box-link{margin-top:2px;min-height:28px}
}

/* ── Menu qui défile (composant 45) : dégradé tant qu'il reste des entrées cachées (classes posées par assets/nav.js) ;
   masque du menu lui-même, sans couleur : il s'efface vers son fond, clair ou sombre ── */
.sidebar-nav.has-more-below { -webkit-mask-image: linear-gradient(to bottom, currentColor calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, currentColor calc(100% - 36px), transparent); }
.sidebar-nav.has-more-above { -webkit-mask-image: linear-gradient(to top, currentColor calc(100% - 36px), transparent); mask-image: linear-gradient(to top, currentColor calc(100% - 36px), transparent); }
.sidebar-nav.has-more-above.has-more-below { -webkit-mask-image: linear-gradient(to bottom, transparent, currentColor 36px, currentColor calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, transparent, currentColor 36px, currentColor calc(100% - 36px), transparent); }
/* Page d'une entrée du menu du compte affichée (Mon équipe, Aide, Mes appareils) : le bloc du compte la signale */
.user-info.is-current { background: var(--sidebar-active-bg); }
.um-item[aria-current="page"] { color: var(--sidebar-active-text); font-weight: 600; }

/* ── Se repérer (composant 46) et Ce qui a changé (composant 47) : en tête de l'Aide ── */
.find-way { margin: 0 0 24px; }
.find-way > h2 { margin: 0 0 4px; font-family: var(--font-title); font-weight: 600; font-size: var(--t-xl); color: var(--title); }
.find-group h3, .find-where h3 { margin: 16px 0 8px; font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.find-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 900px) { .find-list { grid-template-columns: 1fr 1fr; } }
.find-list li { min-width: 0; padding: 6px 14px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.find-link { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--primary); text-decoration: none; font-family: var(--font-ui); font-size: var(--t-md); }
.find-link:hover strong { text-decoration: underline; }
.find-link svg { flex: none; }
.find-what { margin: 0; color: var(--text); font-size: var(--t-sm); overflow-wrap: anywhere; }
/* « La fiche d'un client » (backoffice) : un onglet par carte, nom sans lien (il faut un client), sous-onglets dessous */
.find-name { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; color: var(--title); font-family: var(--font-ui); font-size: var(--t-md); }
.find-name svg { flex: none; }
.find-list .find-sub { margin: 8px 0 0; padding: 0 0 0 18px; list-style: disc; font-size: var(--t-sm); }
.find-list .find-sub li { padding: 0; background: none; border: 0; border-radius: 0; }
.find-list .find-sub li + li { margin-top: 4px; }
.find-note { margin: 10px 0 0; color: var(--muted); font-size: var(--t-sm); }
.find-where dl { display: grid; grid-template-columns: max-content 1fr; gap: 0 18px; align-items: center; margin: 0; }
.find-where dt { color: var(--text); }
.find-where dd { margin: 0; }
.find-where dd a { display: inline-flex; align-items: center; min-height: 44px; color: var(--primary); font-weight: 600; }
@media (max-width: 640px) { .find-where dl { grid-template-columns: 1fr; } .find-where dt { margin-top: 8px; font-weight: 600; } }
.what-moved { display: flex; gap: 10px; align-items: flex-start; }
.what-moved > svg { flex: none; margin-top: 2px; }
.what-moved ul { margin: 4px 0 0; padding-left: 18px; }
.what-moved li + li { margin-top: 2px; }
.help-ico { display: none; }
/* Compte (bas du menu) : initiales, nom, rôle */
.user-details .name, .user-details .uname, .user-details .urole { display: block; }
.user-details .urole { color: var(--sidebar-muted); font-size: var(--t-xs); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-who { padding: 6px 10px 2px; color: var(--muted); font-size: var(--t-xs); overflow-wrap: anywhere; }
/* Téléphone : barre du haut (menu, société + page, compte) ; application installée : barre du bas */
.m-bar, .pwa-bar { display: none; }

/* ══ Tablette (769 – 1023 px) : menu réduit aux icônes ══════════════════ */
@media (max-width: 1023px) {
    :root { --sidebar-w: 64px; }
    .sidebar-brand img, .sidebar-brand p, .sidebar-brand .sub, .sidebar-brand .cname, .org-switch,
    .nav-section, .user-details, .user-caret { display: none; }
    .org-info, .org-switch, .help-box, .brand-tag, .brand-link { display: none; }   /* lien du logo : masqué avec lui */
    html[data-theme="dark"] .sidebar-brand img.brand-logo-dark { display: none; }   /* logo masqué aussi en sombre */
    .um-form.um-orgs { display: contents; }
    .nav-item  { justify-content: center; padding: 10px; }
    .user-info { justify-content: center; padding: 8px; }
    /* Menu du compte à droite du menu réduit : en position fixe, sinon le menu latéral (overflow
       caché) le coupe et il reste invisible ; défilant s'il est plus haut que l'écran */
    .user-menu { position: fixed; left: calc(var(--sidebar-w) + 8px); right: auto; bottom: 8px; width: 230px;
                 max-height: calc(100dvh - 16px); overflow-y: auto; }
    .nav-item .nav-label, .nav-sub { display: none; }
    .topbar  { padding-left: 18px; padding-right: 18px; }
    .content { padding: 22px 18px; }
}

/* ══ Téléphone (≤ 768 px) : menu en tiroir ═════════════════════════════ */
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    /* Tiroir fermé : masqué aussi pour le clavier et les lecteurs d'écran (visibility), une fois sorti
       de l'écran (délai = durée du glissement) ; ouvert : visible tout de suite. La tabulation commence
       ainsi par l'en-tête de la page. */
    .sidebar {
        width: 280px; transform: translateX(-100%); z-index: 200; box-shadow: none; visibility: hidden;
        transition: transform .25s cubic-bezier(.4,0,.2,1), visibility 0s linear .25s;
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-drawer); visibility: visible; transition: transform .25s cubic-bezier(.4,0,.2,1); }
    .sidebar-brand img.brand-logo-light, .sidebar-brand p, .sidebar-brand .sub, .sidebar-brand .cname, .org-switch { display: block !important; }
    .um-form.um-orgs { display: none; }
    .sidebar-brand img.brand-logo-dark { display: none !important; }
    html[data-theme="dark"] .sidebar-brand img.brand-logo-light { display: none !important; }
    html[data-theme="dark"] .sidebar-brand img.brand-logo-dark  { display: block !important; }
    .nav-section, .user-details, .user-caret { display: block !important; }
    .org-switch, .help-box { display: block !important; }
    .org-info { display: flex !important; }
    .brand-tag { display: inline-block !important; }
    .brand-link { display: block !important; }
    .ss-kbd { display: none; }
    .ss-box input { font-size: var(--t-md); }   /* 16 px : pas de zoom automatique d'iOS */
    .org-card { margin: 12px 10px 0 !important; padding: 10px !important; }
    .m-bar {
        display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; z-index: 120;
        min-height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0;
        background: var(--surface); border-bottom: 1px solid var(--line);
    }
    .m-btn {
        width: var(--tap); height: var(--tap); flex-shrink: 0; display: flex; align-items: center; justify-content: center;
        border: 1.5px solid var(--field-border); border-radius: var(--radius-sm); background: transparent; color: var(--primary); cursor: pointer;
    }
    .m-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
    .m-org, .m-page { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .m-org { color: var(--title); font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 600; }
    .m-page { color: var(--muted); font-size: var(--t-xs); }
    .m-ava {
        width: var(--tap); height: var(--tap); flex-shrink: 0; border: 0; border-radius: 50%; cursor: pointer;
        background: var(--sidebar-avatar-bg); color: var(--sidebar-avatar-text); font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600;
    }
    .m-bar ~ .main-wrap { padding-top: calc(56px + env(safe-area-inset-top)); }
    .m-bar ~ .main-wrap .sticky-heads { padding-top: 0; }
    .m-bar ~ .main-wrap .topbar-sticky { position: static; padding-top: 10px; }
    .m-bar ~ .main-wrap .topbar .btn-sidebar-toggle { display: none; }
    .nav-item .nav-label { display: inline !important; }
    .nav-sub { display: block !important; }   /* sous-menu aussi dans le tiroir */
    .topbar-sticky { position: static; padding-top: calc(10px + env(safe-area-inset-top)); }
    /* Dans le tiroir : au-dessus du bouton du compte (la position fixe de la tablette serait
       rapportée au tiroir, qui a une transformation, et sortirait de l'écran) */
    .user-menu { position: absolute !important; left: 0 !important; right: 0 !important; bottom: calc(100% + 6px) !important; width: auto !important; max-height: none; }
    .nav-item  { justify-content: flex-start !important; padding: 9px 11px !important; min-height: 44px; }
    .user-info { justify-content: flex-start !important; padding: 9px 10px !important; }
    .btn-sidebar-toggle { display: flex; }
    .topbar { padding: 10px 16px; gap: 8px; min-height: 56px; flex-wrap: wrap; }
    .topbar h1 { font-size: var(--t-xl); }
    .content { padding: 16px; }
    /* Cartes sur téléphone : marges de côté de 16 px (maquette), le contenu garde sa largeur */
    .card-header, .card-body { padding-left: var(--s-4); padding-right: var(--s-4); }
    .card > .empty-line { padding-left: var(--s-4); padding-right: var(--s-4); }   /* composant 112 */
    .card > .table-wrap td.td-empty { padding: 24px var(--s-4) !important; text-align: left; }
    .modal { padding: 20px 16px; }
}
/* ── Safari d'iOS 26 (branche fix/mobile-ios) ─────────────────────────────────────────────────
   Safari 26 ignore theme-color : il peint la zone de l'heure (et le bas de l'écran) avec le fond
   d'un élément fixe ou collant au bord de l'écran, sinon avec celui de body (fond de page). Chaque règle
   ci-dessous est indépendante et peut être retirée seule. Règles iOS de CLAUDE.md respectées : zone
   cliquable du tiroir transparente, jamais display ni fond sombre, pas de body{overflow:hidden}. */
/* iOS 26 — 1. Backoffice et « Mon équipe » sous 768 px : la barre de titre reste collée en haut,
   sur fond de carte (blanc, sombre en thème sombre), sa marge haute couvre la zone de l'heure
   (env(safe-area-inset-top), règle « Téléphone » ci-dessus) : Safari reprend ce fond. Le tiroir
   (z-index 200) et sa zone cliquable (190) restent au-dessus de la barre (50). */
@media (max-width: 768px) {
    .topbar-sticky { position: sticky; top: 0; background: var(--bg); }
}
/* iOS 26 — 2. Tiroir ouvert jusqu'en bas de l'écran, derrière la barre de Safari (100lvh), au lieu
   de s'arrêter au-dessus (100dvh). Le bas du menu (compte) reste au-dessus de cette barre :
   padding-bottom = 100lvh − 100dvh (0 quand elle est repliée) ; la zone de l'indicateur d'accueil
   est déjà réservée par .sidebar-footer (env(safe-area-inset-bottom)). Navigateur sans lvh/dvh :
   déclarations ignorées, 100vh comme avant. */
@media (max-width: 768px) {
    .sidebar { height: 100vh; height: 100lvh; padding-bottom: calc(100lvh - 100dvh); }
}
/* Tablette (menu réduit aux icônes) : la pastille d'alerte d'une entrée (lien internet en
   panne) déborderait de la colonne ; elle devient un point rouge sur l'icône. Le nombre
   reste dans la page pour les lecteurs d'écran (taille de police nulle, pas display:none). */
@media (min-width: 769px) and (max-width: 1023px) {
    .help-ico { display: flex; }
    .org-card { margin: 10px 8px 0; padding: 4px; border: 0; display: flex; justify-content: center; }
    .nav-item .pill, .nav-item .state-dot {
        position: absolute; top: 6px; left: calc(50% + 3px); width: 9px; height: 9px; min-width: 0; padding: 0; margin: 0;
        border-radius: 50%; font-size: 0; line-height: 0; overflow: hidden; box-shadow: 0 0 0 2px var(--sidebar-bg);
    }
    .nav-item .pill-orange { background: var(--warning); }
    .nav-item { position: relative; }
}
/* Application installée (PWA) sur téléphone : barre du bas, Accueil + 3 premières entrées du menu */
@media (display-mode: standalone) and (max-width: 768px) {
    .pwa-bar {
        display: flex; gap: 4px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line);
    }
    .pwa-item {
        flex: 1; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        border-radius: var(--radius-sm); color: var(--muted); font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; text-decoration: none;
    }
    .pwa-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .pwa-item.active { background: var(--primary-pale); color: var(--primary); }
    .pwa-bar ~ .main-wrap { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ══ Cloche de notifications (composant 48, migration 50) ═══════════════════════════════════════════════════
   Bouton de 44 px dans la barre du haut (backoffice, « Mon équipe », espace client), nombre exact de notifications non lues
   en pastille bleue (nouveauté) ; panneau sous le bouton (360 px au plus), plein écran en largeur sous 640 px, au-dessus de
   la barre collée ; notification non lue : texte en gras et point bleu. Clavier : Échap ferme, le focus revient au bouton. */
.bell { position: relative; flex-shrink: 0; margin-left: auto; }
.topbar-actions + .bell, .topbar-actions .bell { margin-left: 0; }
.bell-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
    border: 1.5px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface); color: var(--primary); cursor: pointer;
}
.bell-btn:hover, .bell-btn[aria-expanded="true"] { background: var(--primary-pale); }
.bell-n { position: absolute; top: -6px; right: -6px; min-width: 20px; justify-content: center; }
.bell-n[hidden] { display: none; }
.bell-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 120; width: min(360px, calc(100vw - 32px));
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.bell-panel[hidden] { display: none; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.bell-list { list-style: none; margin: 0; padding: 0; max-height: min(420px, 60vh); overflow-y: auto; }
.bell-list li { border-bottom: 1px solid var(--line); }
.bell-list a { display: block; padding: 10px 12px 10px 26px; color: var(--text); text-decoration: none; position: relative; min-height: 44px; }
.bell-list a:hover, .bell-list a:focus-visible { background: var(--primary-pale); }
.bell-list .is-unread a { font-weight: 600; }
.bell-list .is-unread a::before { content: ''; position: absolute; left: 10px; top: 17px; width: 8px; height: 8px; border-radius: 50%; background: var(--btn-bg); }
.bell-when { display: block; margin-top: 2px; font-size: var(--t-xs); font-weight: 400; color: var(--muted); }
.bell-empty { padding: 14px 12px; color: var(--muted); }
.bell-all { display: block; padding: 10px 12px; text-align: center; font-weight: 600; }
@media (max-width: 640px) {
    .bell-panel { position: fixed; left: 16px; right: 16px; top: calc(64px + env(safe-area-inset-top)); width: auto; }
}
/* Portail : cloche de la barre de l'ordinateur cachée sous 768 px (celle de la barre du téléphone prend le relais) */
.m-bar .bell { margin-left: 0; }
.m-bar .bell-btn { width: var(--tap); height: var(--tap); }   /* cible de 44 px (lot 3) */
@media (max-width: 768px) { .bell-desk { display: none; } .m-bar .bell-panel { position: fixed; left: 16px; right: 16px; top: calc(60px + env(safe-area-inset-top)); width: auto; } }
/* Panneau ouvert : la barre du téléphone (z-index 120) passe au-dessus de l'en-tête de la page (.sticky-heads, élément d'une
   boîte flex : son z-index 150 compte même en position statique), sans dépasser le tiroir (190 / 200) */
.m-bar:has(.bell-btn[aria-expanded="true"]) { z-index: 170; }
/* Page « Toutes mes notifications » : même liste, en carte */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li { border-bottom: 1px solid var(--line); }
.notif-list li:last-child { border-bottom: 0; }
.notif-list a { display: block; padding: 12px 18px 12px 34px; color: var(--text); text-decoration: none; position: relative; }
.notif-list a:hover { background: var(--primary-pale); }
.notif-list .is-unread a { font-weight: 600; }
.notif-list .is-unread a::before { content: ''; position: absolute; left: 16px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--btn-bg); }

/* ── Composant 60 : frise d'une commande (« En cours de mise en service », feat/kiss-commandes) ─────────────────────
   Portail (Mobile, Internet) et backoffice (Services → Mobile, Internet) ; assets/orders.js. Jetons du socle seulement. */
.order-card { margin-bottom: 16px; }
.order-list { list-style: none; margin: 0; padding: 0; }
.order-item { padding: 14px 18px; border-top: 1px solid var(--line); }
.order-item:first-child { border-top: 0; }
.order-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.order-name { font-weight: 700; color: var(--title); }
.order-meta { color: var(--muted); font-size: var(--t-sm); }
/* « Voir la fiche » (portail, même lien que le tableau) à droite de l'en-tête ; étape en cours sur une ligne */
.order-open { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: var(--t-sm); font-weight: 600; color: var(--primary); text-decoration: none; }
.order-open:hover { text-decoration: underline; }
.order-open svg { flex: none; }
.order-now { margin: 6px 0 0; font-size: var(--t-sm); font-weight: 600; color: var(--text); }
.order-port { margin: 8px 0 0; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--primary-pale); color: var(--primary); border: 1px solid var(--info-line); font-size: var(--t-sm); }
.order-proc { margin-top: 12px; }
.order-proc-title { margin: 0 0 6px; font-size: var(--t-sm); font-weight: 600; color: var(--text-soft); }
.order-kiss { display: block; font-size: var(--t-xs); color: var(--text-mute); }
.order-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.order-step { position: relative; display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; align-items: start; }
.order-dot { width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; }
.order-step.is-done .order-dot { border-color: var(--success); background: var(--success); color: var(--on-primary); }
.order-step.is-done .order-dot svg { width: 12px; height: 12px; }
.order-step.is-current .order-dot { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 3px var(--primary-pale); }
.order-step-name { font-size: var(--t-sm); color: var(--text); }
.order-step.is-todo .order-step-name { color: var(--muted); }
.order-step.is-current .order-step-name { font-weight: 600; color: var(--title); }
.order-step-date { display: block; font-size: var(--t-xs); color: var(--muted); }
.order-port-form { margin-top: 10px; }
@media (min-width: 900px) {
    .order-steps { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; }
    .order-step { grid-template-columns: 1fr; row-gap: 6px; }
    .order-step:not(:last-child)::after { content: ""; position: absolute; top: 11px; left: 26px; right: -6px; border-top: 2px solid var(--line); }
    .order-step.is-done:not(:last-child)::after { border-top-color: var(--success-line); }
}

/* ── Composant 61 : code affiché à la demande (code PIN par défaut, RIO) ── */
.code-ask { margin-top: 10px; }
.code-shown { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.code-shown[hidden] { display: none; }
.code-label { display: block; font-size: var(--t-xs); color: var(--muted); }
.code-value { display: inline-block; margin: 4px 0; font: 600 var(--t-xl) var(--font-mono); letter-spacing: .08em; color: var(--title); overflow-wrap: anywhere; user-select: all; }
.code-shown .form-hint { margin: 4px 0 8px; }

/* ── Composant 7 (suite) : enveloppe d'heures du client — jauge, dépassement, phrases (déplacé d'assets/dashboard.css, sans
   changement, pour le rapport mensuel du backoffice) ── */
/* Jauge du client : bleu jusqu'au crédit (100 %), part au-delà en orange, jamais de rouge (docs/design.md, Jauge) */
.iv-gauge { display: flex; height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; margin: 10px 0 8px; }
.iv-gauge > span { display: block; height: 100%; flex: none; }
.iv-gauge > .iv-gauge-in { border-radius: 5px; background: var(--primary); }
.iv-gauge-has-over > .iv-gauge-in { border-radius: 5px 0 0 5px; }
.iv-gauge > .iv-gauge-over { border-radius: 0 5px 5px 0; background: var(--warning); box-shadow: inset 2px 0 0 var(--surface); }   /* filet de la couleur de la carte à la limite du crédit */
/* Dépassement : une ligne par fait (docs/design.md, composant 7) ; pastille orange devant la première, les suivantes alignées sur son texte */
.iv-over { list-style: none; margin: 6px 0 0; padding: 0; font-size: var(--t-sm); color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.iv-over li { margin: 2px 0 0; padding-left: 18px; }
.iv-over li:first-child { display: flex; align-items: baseline; gap: 8px; padding-left: 0; margin-top: 0; }
.iv-env-more { margin: 2px 0 0; font-size: var(--t-sm); color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.iv-over-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--warning); transform: translateY(1px); }   /* rappelle la part orange de la jauge */
.iv-env-line { margin: 0; font-size: var(--t-sm); color: var(--text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.iv-env-sub { margin: 4px 0 0; font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }

/* ── Composant 62 : rapport mensuel (migration 55) — page du portail (« Mes documents ») et du backoffice ── */
.rp-page { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.rp-page > .kpis, .rp-page > .card-grid, .rp-page > .alert, .rp-page > .card { margin: 0; }
.rp-head { min-width: 0; }
.rp-lead { margin: 0; font-family: var(--font-ui); font-size: var(--t-lg); font-weight: 600; color: var(--title); line-height: 1.4; overflow-wrap: anywhere; }
.rp-meta { margin: 4px 0 0; font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
.rp-grid { margin: 0; }
.rp-envs { margin-bottom: 20px; }
.rp-sub { margin: 18px 0 8px; font-family: var(--font-ui); font-size: var(--t-sm); font-weight: 600; color: var(--title); }
.rp-sub:first-child { margin-top: 0; }
.rp-note { margin: 8px 0 0; font-size: var(--t-xs); color: var(--muted); overflow-wrap: anywhere; }
.rp-more { margin: 14px 0 0; font-size: var(--t-sm); }
.rp-more a { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.rp-table .rp-cell-main { display: block; overflow-wrap: anywhere; }
table.rp-table th, table.rp-table td { padding-left: 10px; padding-right: 10px; }   /* cinq colonnes dans une demi-carte, sans défiler */
table.rp-table tbody th[scope="row"] { white-space: normal; }
table.rp-table tbody th[scope="row"] .num-sub { white-space: normal; }   /* précision sous le nom (« Connu du … au … ») : passe à la ligne dans une demi-carte */
.rp-alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rp-alerts li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; min-width: 0; }
.rp-alert-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warning); transform: translateY(1px); }   /* alerte suivie : orange */
.rp-alert-dot.is-red { background: var(--danger); }   /* injoignable : rouge (règle 1) */
.rp-alert-main { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.rp-alert-sub { grid-column: 2; font-size: var(--t-xs); color: var(--muted); }
.rp-docs .doc-ico { color: var(--primary); }
.rp-admin-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 18px; }
/* Réglages de la fiche : « Modifier » (saisie repliée) et « Aperçu » sur une ligne ; la saisie ouverte passe dessous, pleine largeur */
.rp-set-acts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 14px; }
.rp-set-acts > details.fold[open] { order: 2; flex-basis: 100%; }
/* Case sans objet (réglage d'une partie du rapport, destinataire sans adresse valable) : grisée, la phrase dit pourquoi */
.check-line.is-off { cursor: default; color: var(--muted); }
.check-line.is-off input { opacity: .55; }
table.rp-table .num-sub.text-danger { color: var(--danger); }   /* échéance dépassée : rouge (règle 1) */
table.rp-table .num-sub.text-warn { color: var(--warning-text); }   /* à prévoir (30 jours) : orange */
table.rp-iv .num-sub { white-space: normal; }
@media (max-width: 640px) {
    .rp-lead { font-size: var(--t-md); }
    .rp-page { gap: 16px; }
    /* Interventions : une ligne date + durée, l'intitulé dessous ; pas d'en-tête de colonnes */
    table.rp-iv thead { display: none; }
    table.rp-iv, table.rp-iv tbody, table.rp-iv tfoot { display: block; width: 100%; }
    table.rp-iv tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); background: none; }
    table.rp-iv tbody tr:nth-child(even) { background: none; }
    table.rp-iv tr > * { display: block; padding: 0 !important; border: 0 !important; background: none !important; }
    table.rp-iv .rp-iv-d { grid-column: 1; grid-row: 1; font-size: var(--t-xs); color: var(--muted); }
    table.rp-iv .rp-iv-n { grid-column: 2; grid-row: 1; text-align: right; }
    table.rp-iv .rp-iv-t { grid-column: 1 / -1; grid-row: 2; margin-top: 2px; }
    table.rp-iv tfoot tr { grid-template-columns: minmax(0, 1fr) auto; margin-top: 6px; padding: 10px 12px; border: 0; border-radius: var(--radius-xs); background: var(--primary-soft); }
    table.rp-iv tfoot .rp-iv-t { grid-row: 1; grid-column: 1; margin: 0; }
}

/* ── Composant 63 : messages d'information de TA INFO (migration 56) — bandeau du portail, liste, formulaire du backoffice ── */
/* Bandeau : alerte du socle (n° « Alertes ») à la couleur du type — bleu information, orange maintenance prévue, rouge incident en
   cours, vert incident résolu — ; titre, texte (retours à la ligne, liens https), période d'une maintenance, « Masquer » (croix) */
.info-wrap { display: grid; gap: 10px; }
.main.info-wrap { padding-bottom: 0; }
.info-wrap .alert { margin: 0; }
.info-banner { display: flex; align-items: flex-start; gap: 10px; }
.info-banner::after { content: none; }
.info-banner > .ico:first-child { float: none; flex: none; margin-top: 2px; }
.alert.info-banner > .ico:first-child + div { margin-left: 0; }   /* rangé par la grille flexible, pas par la marge des alertes */
.info-banner-main { flex: 1 1 auto; min-width: 0; }
.info-banner-head, .info-banner-text, .info-banner-when, .info-banner-more { margin: 0; overflow-wrap: anywhere; }
.info-kind { font-family: var(--font-ui); font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.info-banner-text { margin-top: 4px; color: var(--text); }
.info-banner-when, .info-banner-more { margin-top: 4px; font-size: var(--t-xs); }
.info-banner-x { flex: none; margin: -6px -8px -6px 0; }
.info-banner-x .btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; color: inherit; }
@media (max-width: 640px) { .info-banner-x .btn { width: 44px; height: 44px; } }
/* Liste « Messages de TA INFO » du portail */
.info-list { list-style: none; margin: 0; padding: 0; }
.info-item { padding: 14px 22px; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.info-item:first-child { border-top: 0; }
.info-item-head { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; color: var(--title); overflow-wrap: anywhere; }
.info-item-when { margin: 4px 0 0; font-size: var(--t-xs); color: var(--muted); }
.info-item-text { margin: 8px 0 0; color: var(--text); overflow-wrap: anywhere; }
@media (max-width: 640px) { .info-item { padding: 12px 16px; } }
/* Backoffice : liste des messages, choix des clients avec recherche, récapitulatif avant publication */
.info-pick { max-height: 260px; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--field-border); border-radius: var(--radius-sm); background: var(--surface); }
.info-pick .check-line[hidden] { display: none; }
.info-recap { display: grid; gap: 10px; }
.info-preview { padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.info-row-sub { display: block; font-size: var(--t-xs); color: var(--muted); }

/* ── « À regarder » (composant 73 de docs/design.md, ui_watch()) : une liste de points, chacun une rangée entière cliquable ──
   Pastille d'icône : orange (action à faire, alerte suivie), rouge (panne, retard). Action à droite : bouton plein quand la
   personne doit agir, contour sinon. Sous 640 px : l'action laisse la place à un chevron, jamais de bouton sous la rangée. */
.watch > .card-header h2 { flex: 0 1 auto; }
.watch-list { list-style: none; margin: 0; padding: 0; }
.watch-item + .watch-item { border-top: 1px solid var(--line); }
.watch-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 64px; padding: 12px 20px; color: var(--text); text-decoration: none; }
.watch-row:hover { background: var(--surface-2); }
.watch-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.watch-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--warning-text); }
.watch-item.is-bad .watch-ico { background: var(--danger-bg); color: var(--danger); }
.watch-body { display: grid; gap: 2px; min-width: 0; }
.watch-body strong { font-family: var(--font-ui); font-size: var(--t-md); font-weight: 600; color: var(--title); }
.watch-text { font-size: var(--t-sm); color: var(--text-soft); }
.watch-chev { display: none; color: var(--muted); }
@media (max-width: 640px) {
    .watch-row { gap: 12px; padding: 12px 16px; }
    .watch-cta { display: none; }
    .watch-chev { display: inline-flex; }
}

/* ── Cibles tactiles sur téléphone : 44 px au moins (réglage --tap) ──────────────────────────────────────────────────
   Les petits boutons (ligne de tableau, bandeau), les liens d'en-tête de carte et le lien d'un bandeau d'information
   reprennent la hauteur d'une cible tactile ; au-delà de 768 px, ils gardent leur taille compacte (--tap-sm). */
@media (max-width: 768px) {
    .btn-sm, td .btn, td .btn-primary, td .btn-outline, td .btn-ghost, td .btn-danger { min-height: var(--tap); }
    .btn-icon.btn-sm, td .btn-icon { width: var(--tap); min-height: var(--tap); }
    .card-link { min-height: var(--tap); }
    .info-banner-more a { display: inline-flex; align-items: center; min-height: var(--tap); }
}

/* ── Ajustements d'affichage (composant 91 de docs/design.md, après la mise en production du 14/11/2026) ─────────────────
   1. Blocs empilés du contenu : 20 px entre deux cartes, tableaux par étapes, chiffres clés, aides et messages posés l'un sous
      l'autre, même séparés par un script (spécificité nulle : une classe .mt-… ou .mb-… de la page garde la main ; les marges se
      fondent, jamais doublées). */
.content > :where(.card, .board, .kpis, .card-grid, .alert, details.help, .table-wrap, form, section) ~ :where(.card, .board, .kpis, .card-grid, details.help, section) { margin-top: 20px; }
.info-banners { display: grid; gap: 12px; margin-bottom: 16px; }
.info-banners > .alert { margin: 0; }
/* 2. Libellés des chiffres clés en entier, sur deux lignes au besoin (plus de « … ») */
.kpis .kpi-label { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; text-wrap: balance; }
@media (max-width: 640px) {
    /* 3. Tableau par étapes : une seule colonne sur téléphone (liste groupée par étape) */
    .board { grid-template-columns: minmax(0, 1fr); }
    /* 4. Tableau de chiffres : première colonne (collante) de 9,5 rem au plus, sur plusieurs lignes ; les montants restent visibles */
    table.num-table:not(.table-stack) > * > tr > :first-child { width: 9.5rem; min-width: 9.5rem; max-width: 9.5rem; white-space: normal; overflow-wrap: break-word; }
    table.num-table:not(.table-stack) > * > tr > :first-child .num-sub { white-space: normal; }
}
/* 5. Histogramme étroit (480 px de large au plus) : valeur écrite à la verticale au-dessus de sa barre, jamais sur la voisine */
@container (max-width: 480px) {
    .histo-area { padding-top: 62px; }
    .histo-col > .histo-val, .histo-col:nth-child(n) > .histo-val { margin-bottom: 0; writing-mode: vertical-rl; transform: translateX(-50%) rotate(180deg); line-height: 1; }
}
/* 6. Étapes (composant des étapes) sur une colonne : une date posée directement dans l'étape passe sous son nom, jamais dans
      la colonne de 22 px du point (« 13/11/2026 / à / 15:15 » sur trois lignes dans la fiche d'un e-mail envoyé) */
@media (max-width: 899px) { .order-step > .order-step-date { grid-column: 2; } }
/* ── 90. E-mails envoyés (suivi des envois, migration 62) : backoffice et portail (docs/design.md, composant 90) ── */
.mail-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-3); }
.mail-f { display: flex; flex-direction: column; gap: 4px; flex: 0 1 180px; min-width: 0; }
.mail-f-q { flex: 1 1 240px; }
.mail-f-lbl { font-size: var(--t-xs); color: var(--muted); }
.mail-f .form-control { width: 100%; }
.mail-f-pb { flex: 0 0 auto; }
.mail-f-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.mail-count { margin: 0 0 var(--s-2); font-size: var(--t-sm); color: var(--muted); }
.mail-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mail-muted { color: var(--muted); }
.mail-mono { font-family: var(--font-mono); font-size: var(--t-xs); overflow-wrap: anywhere; }
.mail-rcpt { font-weight: 600; overflow-wrap: anywhere; }
.mail-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-4); }
.mail-state-txt { margin: 0; flex: 1 1 280px; color: var(--text); }
.mail-steps { margin-bottom: var(--s-4); }
.order-step.is-current.is-warn .order-dot { border-color: var(--warning); background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }
.order-step.is-current.is-fail .order-dot { border-color: var(--danger); background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.mail-siblings { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.mail-siblings li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); overflow-wrap: anywhere; }
.mail-raw-head { margin: 0 0 var(--s-2); font-size: var(--t-sm); }
.mail-raw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.mail-raw-list li { display: grid; gap: 2px; }
.mail-raw-when { font-size: var(--t-xs); color: var(--muted); }
.mail-pv-note { margin: 0 0 var(--s-2); font-size: var(--t-sm); color: var(--muted); }
.mail-pv-frame { display: block; width: 100%; height: 520px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); }
.mail-pv-msg { margin: var(--s-2) 0 0; font-size: var(--t-sm); color: var(--muted); }
.mail-pv-err { color: var(--danger); }
.mail-cons th[scope="row"] { font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.mail-cons-total th, .mail-cons-total td { border-top: 2px solid var(--line); }
.mail-cons-note { margin: var(--s-2) 0 0; font-size: var(--t-xs); color: var(--muted); }
.mail-hook { padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.mail-hook-name { margin: 0 0 var(--s-2); }
.mail-hook-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.mail-senders-form textarea { font-family: var(--font-mono); font-size: var(--t-sm); }
@media (max-width: 640px) {
    .mail-f, .mail-f-q { flex: 1 1 100%; }
    .mail-pv-frame { height: 420px; }
}
/* Cibles tactiles (règle « Cibles tactiles » ci-dessus) : liens des tableaux, de l'en-tête des cartes, du retour et des autres envois */
@media (max-width: 768px) {
    .mail-page td a, .mail-page th a, .mail-page .card-act a, .mail-siblings a, .mail-back a {
        display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap);
    }
}

/* ── Passe iPhone du 15/11/2026 (composant 93 de docs/design.md) : captures à 390 px regardées une à une ────────────────────── */
/* Lien d'action d'une cellule empilée (« Renvoyer l'invitation ») : à la ligne au besoin dans un tableau replié, la colonne voisine garde la place */
@media (max-width:640px){
.table-fold .fold-row>:not(.c-x) .cell-stack .btn-link{white-space:normal;text-align:left}
.table-fold .fold-row>.td-nowrap:not(.c-x) .badge{white-space:nowrap}   /* cellule « td-nowrap » (date et retard d'une échéance) : étiquette sur une ligne */
/* Tableau de chiffres replié (Pilotage) : plus de première colonne collante de 9,5 rem ni de fond propre, la grille la dimensionne */
table.num-table.table-fold.table-fold>*>tr>:first-child:first-child{position:static;width:auto;min-width:0;max-width:none;background:transparent}
table.num-table.table-fold.table-fold>*>tr>*{border-left:0;border-bottom:0}
table.num-table.table-fold>tfoot>tr{background:var(--primary-soft)}
td .cell-ellipsis{max-width:none;white-space:normal;overflow-wrap:anywhere}   /* adresse entière sur téléphone (« Dernières connexions »), plus coupée par « … » */
}
/* Champ suivi de son bouton (.fields-row) : le bouton garde sa largeur, le champ prend le reste (menu « 13 mois (par défaut) » entier) */
.fields-row>.form-group:not(:has(.form-control,.check-line)){flex:0 0 auto;min-width:0}

/* 94. Documents d'une fiche du CRM (migration 67 ; crm_ui_files_card(), includes/crm_ui.php) : une ligne par document — titre en lien
      de téléchargement (icône, gras, coupé n'importe où), précision grise dessous (extension, taille, date, déposant), bouton
      « Supprimer » (icône, cible tactile) à droite sur les deux lignes ; « Déposer un document » replié sous la liste (composant 50). */
.crm-files { list-style: none; margin: 0; padding: 0; }
.crm-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.crm-file:first-child { padding-top: 0; }
.crm-file-name { grid-column: 1; display: inline-flex; align-items: flex-start; gap: 8px; min-width: 0; font-weight: 600; color: var(--primary); text-decoration: none; overflow-wrap: anywhere; }
.crm-file-name svg { flex: 0 0 auto; margin-top: 2px; }
.crm-file-name:hover span { text-decoration: underline; }
.crm-file-meta { grid-column: 1; display: block; padding-left: 24px; font-size: var(--t-xs); overflow-wrap: anywhere; }
.crm-file-del { grid-column: 2; grid-row: 1 / span 2; margin: 0; }
.crm-file-del .btn { min-width: var(--tap); min-height: var(--tap); justify-content: center; }
.crm-files-add { margin-top: 12px; }

/* 95. Numéro donné par un agent (migration 67 ; crm_ui_contact_agent(), includes/crm_ui.php) : sous les liens du contact, phrase grise
      précédée de la mention orange, puis « Numéro vérifié » (bouton contour) ; cible tactile sur téléphone. */
.crm-num-agent { margin: 4px 0 0; }
.crm-num-agent .crm-contact-sub svg { vertical-align: -2px; color: var(--warning-text); }
.crm-num-agent form { margin: 6px 0 0; }
@media (max-width: 768px) { .crm-num-agent .btn { min-height: var(--tap); } }

/* 97. Boîte à outils réseau (admin/reseau.php ; rendu includes/net_tools_ui.php) : champ de recherche et choix du port dans une carte
      (filtres .list-filters sans filet bas : seuls dans leur carte), résultats en cartes, lignes et tableaux du socle ; valeurs des
      enregistrements en chasse fixe coupées n'importe où (TXT et clés DKIM longs, jamais de défilement horizontal de la page) ;
      réponse brute repliée (composant 19) dans un bloc à hauteur bornée qui défile seul. */
.net-page .list-filters { border-bottom: 0; }
.net-page .card-foot .list-filters { padding: 0; background: none; }
.net-port .form-label { margin: 0; }
.net-mono { font-family: var(--font-mono); font-size: var(--t-xs); overflow-wrap: anywhere; word-break: break-word; }
a .net-mono { color: inherit; }
.net-raw { margin: 0; max-height: 420px; overflow: auto; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2);
           color: var(--text); font: var(--t-xs) / 1.5 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.net-result .rows-val { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .net-page .list-filters .btn { flex: 1 1 100%; justify-content: center; min-height: var(--tap); }
    .net-raw { max-height: 320px; }
}
.net-page .card-foot .list-filters { flex: 1 1 100%; }
.net-dns-table td:first-child, .net-dns-table td.num, .net-dkim-table td:first-child, .net-dkim-table td:nth-child(2) { white-space: nowrap; }
.net-result .badge { white-space: nowrap; }

/* 98. Boîte à outils : outils de calcul (admin/reseau.php, onglets Mots de passe, Sous-réseaux, Crontab, Adresse MAC ; rendu
      includes/net_box_ui.php) : mêmes cartes de saisie que le composant 97 (zone de texte en chasse fixe pour les adresses MAC
      collées), cases à cocher en grille, mots de passe en champs en lecture seule suivis de « Copier » (.field-row, composant 82),
      prochaines exécutions en liste simple, précision en gris. */
.net-search-area textarea.form-control { flex: 1 1 100%; width: 100%; min-height: 76px; resize: vertical; font: var(--t-xs) / 1.5 var(--font-mono); }
.net-pw-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px var(--s-3); }
.net-pw-list { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.net-pw-out.form-control { font-size: var(--t-sm); letter-spacing: .02em; }
.net-list { margin: 0; padding-left: 18px; }
.net-list li + li { margin-top: 2px; }
.net-note { color: var(--muted); }
.net-page fieldset.form-group { border: 0; margin: 0; padding: 0; min-width: 0; }
@media (max-width: 640px) { .net-pw .field-row .btn { min-height: var(--tap); } }
.net-page .card-body.card-foot { margin-top: 0; padding-top: 0; }
.net-page .list-filters .net-hint { flex: 1 1 100%; margin: 0; }
.net-ex { white-space: nowrap; }
.net-result .rows-val .net-list { list-style: none; padding: 0; text-align: right; }
.net-nowrap-table td:first-child, .net-nowrap-table td:nth-child(2) .net-mono { white-space: nowrap; }

/* Composant 99 (boîte à outils, 21/11/2026) : mise en page resserrée des résultats.
   Lignes clé / valeur (ui_rows()) : à partir de 640 px, libellé et valeur côte à côte (libellé de 9 à 16 rem, valeur
   alignée à gauche juste après), au lieu de la valeur repoussée au bord droit d'une carte large ; en dessous, inchangé. */
@media (min-width: 640px) {
    .net-page .rows > li { display: grid; grid-template-columns: minmax(9rem, 16rem) minmax(0, 1fr); gap: 2px var(--s-4); justify-content: start; }
    .net-page .rows .rows-val { margin-left: 0; text-align: left; }
    .net-page .rows-val .net-list { text-align: left; }
}
/* Choix fermé d'un pied de carte (« Découper en », port) : largeur de son plus long choix, jamais coupé */
.net-page .net-port select.form-control { flex: 0 1 auto; max-width: 100%; }
/* Sous-onglets du domaine : collés à la carte de saisie et aux résultats (espacement de la pile) */
.net-page .tabbar-sub { margin: -8px 0 -6px; }
/* Valeur d'enregistrement (net_ui_val()) : un mot-clé par bloc (« -all », « include:… ») jamais coupé au milieu ; long et plus
   large que la colonne, il se coupe entre ses morceaux (après « . », « : », « = »… : .net-seg), jamais à un tiret ; un morceau plus
   large que la colonne (clé DKIM) n'importe où ; soulignement des liens repris (il ne descend pas dans un bloc en ligne) */
.net-tok, .net-seg { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
a .net-tok, a .net-seg { text-decoration: underline; text-underline-offset: 3px; }
/* Téléphone : un enregistrement passe sous son libellé, aligné à gauche (jamais en escalier contre le bord droit) */
@media (max-width: 639.98px) {
    .net-page .rows-val:has(.net-mono) { flex-basis: 100%; margin-left: 0; text-align: left; }
}
/* Étiquettes des résultats (taille d'une clé DKIM, état d'un serveur) sur une ligne ; pied de carte sous un tableau (sélecteur
   DKIM) détaché du tableau */
.net-page .badge, .net-page .table-fold .fold-row > td .badge { white-space: nowrap; }
/* Tableau DNS replié (téléphone) : type et flèche sur une ligne, valeur dessous sur toute la largeur de la ligne (un nom de
   domaine courant tient sur une ligne, coupure d'abord aux espaces) */
@media (max-width: 640px) {
    .net-page .net-rec-table.table-fold > thead > tr { grid-template-columns: auto minmax(0, 1fr) var(--ft); column-gap: var(--s-3); }
    .net-page .net-rec-table.table-fold .fold-row { grid-template-columns: minmax(0, 1fr) var(--ft); }
    .net-page .net-rec-table.table-fold .fold-row > td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; padding: 0 12px 10px; }
}
.net-page .table-wrap + .card-body.card-foot { padding-top: var(--s-4); }
/* Générateur de mots de passe : case « Facile à retenir » au-dessus des réglages ; réglages du mode non choisi masqués
   et désactivés (hidden + disabled : ni affichage, ni saisie, ni focus) */
.net-pw-mode { margin-bottom: var(--s-3); }
.net-pw-special { margin-top: var(--s-2); }
/* Force des mots de passe tirés (composant 114, sur la jauge du composant 7) : mot en gras de la couleur de la jauge */
.gauge.gauge-good > span { background: var(--success); }
.net-pw-strength { margin: var(--s-3) 0 var(--s-1); }
.net-pw-strength .gauge-text strong { color: var(--primary); font-size: var(--t-md); }
.net-pw-strength[data-level="0"] .gauge-text strong { color: var(--danger); }
.net-pw-strength[data-level="1"] .gauge-text strong { color: var(--warning); }
.net-pw-strength[data-level="3"] .gauge-text strong, .net-pw-strength[data-level="4"] .gauge-text strong { color: var(--success); }   /* case « Ajouter un caractère spécial », sous le nombre de mots */
.net-pw legend.form-label { padding: 0; }
/* Réglages de l'autre mode (aléatoire / facile à retenir) masqués, avertissement caché : [hidden] l'emporte sur l'affichage
   des briques (.form-row, .form-group, .form-hint). */
.net-pw [hidden] { display: none; }
/* Téléphone : « Copier » réduit à son icône (texte rendu le temps du « Copié ») et police du plancher, pour qu'une phrase de
   4 mots (29 caractères au plus) tienne entière dans son champ à 390 px. */
@media (max-width: 640px) {
  .net-pw .field-row { gap: var(--s-1); }
  .net-pw-out.form-control { font-size: var(--t-xs); letter-spacing: 0; padding-left: var(--s-2); padding-right: var(--s-1); }
  .net-pw-copy { min-width: var(--tap); justify-content: center; }
  .net-pw-copy:not(.is-copied) span { display: none; }
}
/* Précision d'un enregistrement sous sa valeur (tableau DNS à trois colonnes) */
.net-dns-table .net-sub { display: block; margin-top: 2px; color: var(--muted); font-size: var(--t-xs); }

/* 100. Plan d'adressage (migration 70 ; admin/adressage.php, fiche client onglet Parc et réseau, « Mon réseau » ; rendu
      includes/ipplan_ui.php) : plages et adresses IPv4 en chasse fixe jamais coupées (IPv6 et noms DNS, longs : coupés n'importe où) ; étiquettes d'un réseau à la suite de sa plage, sur une ligne chacune ;
      libellé en gras, note interne en gris dessous ; réseau contenu dans un autre en retrait (trois niveaux au plus) ; actions d'une
      ligne (« Modifier » replié, « Retirer ») côte à côte, la saisie ouverte sur toute la largeur ; plages et adresses libres en
      liste simple. Sur téléphone : tableaux repliés du composant 89, actions à 44 px. */
.ip-mono { font-family: var(--font-mono); font-size: var(--t-xs); white-space: nowrap; }
.ip-mono-6 { white-space: normal; overflow-wrap: anywhere; }   /* IPv6 et noms DNS : longs, coupés plutôt que de déborder */
.ip-net { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); max-width: 100%; min-width: 0; }
.ip-net.ip-d1 { padding-left: var(--s-4); }
.ip-net.ip-d2 { padding-left: calc(var(--s-4) * 2); }
.ip-net.ip-d3 { padding-left: calc(var(--s-4) * 3); }
.ip-badges { display: inline-flex; flex-wrap: wrap; gap: var(--s-1); max-width: 100%; min-width: 0; }
.ip-badges > * { max-width: 100%; min-width: 0; }   /* 22/11 : une étiquette ne sort jamais de sa cellule (nom de client long) */
.ip-badges .badge { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ip-shared-d > summary { list-style: none; cursor: pointer; display: inline-flex; max-width: 100%; }
.ip-shared-d > summary::-webkit-details-marker { display: none; }
.ip-shared-d > summary:hover .badge, .ip-shared-d > summary:focus-visible .badge { text-decoration: underline; }
.ip-shared-l { list-style: none; margin: var(--s-1) 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--s-1) / 2); font-size: var(--t-xs); }
.ip-shared-l li { min-width: 0; }
.ip-shared-l a { display: block; overflow-wrap: anywhere; }
.ip-note { display: block; margin-top: 2px; color: var(--muted); font-size: var(--t-xs); overflow-wrap: anywhere; }
.ip-note-k { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: var(--t-xs); }   /* « Note interne » devant la note (backoffice) */
.ip-shared { display: inline-flex; max-width: 100%; min-width: 0; text-decoration: none; }
.ip-shared .badge { display: flex; max-width: 100%; white-space: normal; overflow-wrap: anywhere; border-radius: var(--radius-sm); }   /* 22/11 : nom long sur deux lignes, entier, jamais hors de la cellule */   /* nom long : coupé en « … », nom entier au survol */   /* étiquette « Même plage chez … » : mène au plan de l'autre client (backoffice) */
.ip-shared:hover .badge, .ip-shared:focus-visible .badge { text-decoration: underline; }
.ip-site-note { margin: 0; padding: var(--s-3) var(--s-4) 0; }
.ip-acts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-2); }
.ip-acts > details.fold[open] { flex: 1 1 100%; }
.ip-acts:has(> details.fold[open]) > form { display: none; }   /* pendant une modification : « Retirer » caché (revient à « Annuler ») */
.card-header:has(.card-act > .ip-acts > details.fold[open]) { flex-wrap: wrap; }   /* « Modifier » ouvert dans l'en-tête d'une carte : la saisie prend toute la largeur */
.card-header:has(.card-act > .ip-acts > details.fold[open]) .card-act { flex: 1 1 100%; margin-left: 0; }
.card-header:has(.card-act > .ip-acts > details.fold[open]) .ip-acts { width: 100%; }
.ip-new { display: none; }   /* « Nouveau site… » / « Nouveau VLAN… » choisis dans le formulaire d'un réseau : leurs champs paraissent */
form:has(select[name="site_id"] option[value="new"]:checked) .ip-new-site, form:has(select[name="vlan_id"] option[value="new"]:checked) .ip-new-vlan { display: grid; }
.ip-acts form.m-0 { margin: 0; }
.ip-add { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-2); }   /* « Ajouter » de la carte du plan : « Ajouter un réseau » en bouton principal, les autres en contour ; une colonne sur téléphone */
.ip-add > details.fold[open] { flex: 1 1 100%; }
.ip-add .form-group > .form-control, .ip-acts .form-group > .form-control, #ip-zones .form-group > .form-control { max-width: none; }   /* saisies du plan : chaque champ sur toute sa colonne, listes et note comprises (mêmes bords) */
@media (max-width: 640px) {   /* « Ajouter un réseau » sur toute la largeur, les trois autres côte à côte, compacts */
    .ip-add > details.fold:first-child { flex: 1 1 100%; }
    .ip-add > details.fold:first-child > summary { display: flex; width: 100%; justify-content: center; }
    .ip-add > details.fold > summary { min-height: var(--tap); }
    /* Note interne d'une ligne de tableau : une ligne, coupée en « … » (en entier au survol et sur la fiche du réseau) */
    .ip-table .ip-note { width: 0; min-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* width 0 : ne pousse jamais la colonne */
}
.ip-portal + .ip-add { margin-top: var(--s-3); }
.ip-use { min-width: 8rem; max-width: 14rem; }
.ip-table .ip-use { max-width: none; min-width: 0; }   /* 22/11 : jamais plus large que sa colonne */   /* dans un tableau : la barre va au bout de sa colonne, pourcentage au-dessus de sa fin */
/* Carte « Réseaux » du plan : une section par site (en-tête d'une ligne : nom, nombre ou « Aucun réseau », Modifier / Retirer) */
.ip-sec + .ip-sec { border-top: 1px solid var(--line); }
.ip-sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-3) var(--s-4); background: var(--surface-2); }
.ip-sec-t { display: inline-flex; align-items: center; gap: var(--s-2); margin: 0; font-size: var(--t-md); color: var(--title); overflow-wrap: anywhere; }
.ip-sec-n { color: var(--muted); font-size: var(--t-sm); }
.ip-sec-head > .ip-acts { margin-left: auto; }
.ip-sec-head:has(> .ip-acts > details.fold[open]) > .ip-acts { flex: 1 1 100%; margin-left: 0; }
.ip-sec .ip-site-note { padding: var(--s-2) var(--s-4) 0; }
.ip-sec:not(:has(.ip-sec-head)) .table-wrap { margin-top: 0; }
.ip-table td[data-label=""] .ip-acts { justify-content: flex-end; flex-wrap: nowrap; }   /* colonne des actions (titre lu seulement) : boutons alignés à droite */
/* Carte « Réseaux » : largeurs selon la largeur de la CARTE (requête de conteneur), pas de l'écran (22/11 : à 1 024 et 1 280 px, les largeurs
   fixes dépassaient la carte et le libellé tombait à 0 px). Sous 640 px : tableau replié (composant 89), rien de ceci. */
.ip-nets-card { container-type: inline-size; }
@media (min-width: 641px) {
    @container (min-width: 1100px) {
        /* Colonnes alignées d'une section à l'autre : plage, occupation et actions de largeur fixe, le libellé prend le reste */
        table.ip-nets { table-layout: fixed; width: 100%; }
        table.ip-nets th:first-child { width: 13rem; }
        table.ip-nets th:nth-child(n+3):nth-last-child(n+3 of :not(.c-tog)) { width: 8rem; }   /* Usage, VLAN, Passerelle (adresse entière) */
        table.ip-nets th:nth-last-child(2 of :not(.c-tog)) { width: 8.5rem; }   /* occupation (la flèche du tableau replié, .c-tog, ne compte pas) */
        table.ip-nets th:nth-last-child(1 of :not(.c-tog)) { width: 13.5rem; }   /* Modifier, Retirer */
    }
    @container (max-width: 1099.98px) {
        /* Carte moyenne : VLAN et Passerelle masqués (sur la fiche du réseau), « Modifier » et « Retirer » en icône (nom lu, title) */
        table.ip-nets { table-layout: fixed; width: 100%; }
        table.ip-nets.ip-hm3 :is(th, td):nth-child(3), table.ip-nets.ip-hm4 :is(th, td):nth-child(4), table.ip-nets.ip-hm5 :is(th, td):nth-child(5) { display: none; }
        table.ip-nets th:first-child { width: 12rem; }
        table.ip-nets th:nth-child(n+3):nth-last-child(n+3 of :not(.c-tog)) { width: 7rem; }
        table.ip-nets th:nth-last-child(2 of :not(.c-tog)) { width: 8rem; }
        table.ip-nets th:nth-last-child(1 of :not(.c-tog)) { width: 7.5rem; }
        table.ip-nets td[data-label=""] .btn > span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
        table.ip-nets td[data-label=""] .btn { min-width: var(--tap); min-height: var(--tap); justify-content: center; }
    }
}
@media (min-width: 900px) {
    /* « Modifier » ouvert dans une ligne de tableau : la saisie s'ouvre en panneau sous le bouton, pas dans la cellule */
    .ip-table td:has(> .ip-acts > details.fold[open]) { position: relative; }
    .ip-table td > .ip-acts > details.fold[open] > .fold-body { position: absolute; right: var(--s-4); top: calc(100% - var(--s-2)); z-index: 30; width: min(44rem, 70vw);
        padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); text-align: left; }
}   /* barre d'occupation d'une plage (jauge du composant 7) dans une cellule ou une ligne de fiche */
.ip-use .gauge-block { margin: 0; }
.ip-use .gauge-text { margin-bottom: 4px; font-size: var(--t-sm); }
.ip-use-mini { display: none; }   /* téléphone : occupation en trait fin sous la plage (la barre complète est dans la ligne repliée) */
@media (max-width: 640px) {
    .ip-use-mini { display: block; flex: 1 1 100%; max-width: 9rem; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
    .ip-use-mini > span { display: block; height: 100%; background: var(--primary); }
    .ip-use-mini.is-warn > span { background: var(--warning); }
}
@media (max-width: 640px) { .ip-portal form, .ip-portal form .btn { width: 100%; } }   /* bouton de la case : même largeur que les « Ajouter » */
.ip-portal { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-3); }
.ip-portal form { margin: 0; }
/* Reprise NetBox : un bloc par groupe (entité et VRF) ; à attribuer et proposé : filet orange ; contenu du groupe repliable */
.ip-grps { display: grid; gap: var(--s-3); }
.ip-grp { padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.ip-grp.is-todo, .ip-grp.is-proposed { border-left: 3px solid var(--warning); }
.ip-grp-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.ip-grp-name { font-weight: 600; overflow-wrap: anywhere; }
.ip-grp .form-group { margin-bottom: var(--s-2); }
.ip-grp .form-group > .form-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ip-grp-more > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; color: var(--primary); }
.ip-grp-items { margin: var(--s-2) 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--t-sm); }
.ip-grp-items li { overflow-wrap: anywhere; }
.ip-zone-sugg { border-bottom: 1px solid var(--line); }
.ip-zone-sugg p { margin: 0 0 var(--s-2); }
.ip-zone-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); }
@media (max-width: 640px) { .ip-zone-acts .btn { width: 100%; justify-content: center; } }
.ip-grp-why { margin: 0 0 var(--s-2); font-size: var(--t-sm); color: var(--text); overflow-wrap: anywhere; }
.ip-back { margin: 0; font-size: var(--t-sm); }
.ip-back a { display: inline-flex; align-items: center; gap: 4px; }
.ip-free-t { margin: 0 0 var(--s-2); font-size: var(--t-sm); }
.ip-free-list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-2); }
.ip-free-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2); }
.ip-free-len { min-width: 3rem; color: var(--muted); font-size: var(--t-xs); }
/* Plages libres (composant 105) : « Trouver une plage libre » en tête de « Ajouter un réseau », ligne « Libre » de « Tous les réseaux » filtré par zone */
.ip-find { margin: var(--s-3) 0 var(--s-4); padding: 0 0 var(--s-4); border-bottom: 1px solid var(--line); }
.ip-find-f { margin: 0 0 var(--s-3); }
.ip-find .ip-free-list { margin-top: var(--s-2); }
.ip-free-in { flex: 1 1 100%; color: var(--muted); font-size: var(--t-sm); overflow-wrap: anywhere; }
.ip-free-r { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-width: 0; overflow-wrap: anywhere; }
.ip-nets-f .form-control { flex: 1 1 12rem; }
/* « Tous les réseaux » (composant 105) : au-delà de 640 px, plage libre et état sur une ligne, colonne Plan assez large pour un nom
   long ; carte de moins de 1 100 px (écran de 1 024 px) : colonne État masquée (un réseau pas en service porte déjà son étiquette) */
.ip-all-card { container-type: inline-size; }
@media (min-width: 641px) {
    table.ip-all :is(.ip-free-from, .ip-free-to) { white-space: nowrap; }   /* pastille et début ensemble, « à fin » ensemble */
    table.ip-all :is(th, td):nth-child(5) { white-space: nowrap; }
    @container (min-width: 1100px) {
        table.ip-all .ip-free-r { flex-wrap: nowrap; white-space: nowrap; }
        table.ip-all td:nth-child(2) { min-width: 11rem; }
    }
    /* Carte moyenne (écran de 1 024 px) : la place va au libellé. État masqué (étiquette sur le réseau qui n'est pas en service), plage
       libre sur deux lignes au plus (pastille et début, puis « à fin »), colonne Plan d'au moins 8rem, Réseau et Plan à la largeur de leur contenu */
    @container (max-width: 1099.98px) {
        table.ip-all :is(th, td):nth-child(5) { display: none; }
        table.ip-all td:nth-child(2) { min-width: 8rem; }
        table.ip-all :is(th, td):nth-child(3) { width: 100%; }
    }
}
.ip-portal + .empty-line { margin-top: var(--s-3); }   /* carte « Adresses attribuées » vide : état puis la ligne vide, dans le même bloc */
.ip-sub-t { margin: 0; padding: var(--s-4) var(--s-4) var(--s-2); font-size: var(--t-sm); color: var(--title); }
.ip-net-card .ip-badges { margin-bottom: var(--s-3); }
/* Fiche d'un réseau hors plan : ce que ça veut dire et deux gestes (accepter l'écart, ajouter une zone) */
.ip-gap-box { margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); border-left: 3px solid var(--warning); border-radius: var(--radius-sm); background: var(--surface-2); }
.ip-gap-txt { margin: 0 0 var(--s-2); overflow-wrap: anywhere; }
.ip-gap-acts { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.ip-gap-acts form { margin: 0; }
.ip-gap-undo { margin: 0 0 var(--s-3); }
@media (max-width: 640px) { .ip-gap-acts .btn, .ip-gap-acts form { width: 100%; justify-content: center; min-height: var(--tap); } }
/* Adresses attribuées (migration 71) : case devant l'adresse, « Attribuer à… » sous le tableau, filtre par client */
.ip-pick { display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; }
.ip-pick input { width: 1.05rem; height: 1.05rem; margin: 0; flex: none; accent-color: var(--primary); }
.ip-assign { border-top: 1px solid var(--line); }
.ip-assign-f { margin: 0; }
.ip-assign-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.ip-assign-row .form-control { flex: 1 1 14rem; max-width: 24rem; }
.ip-filter { margin-top: var(--s-2); }
@media (max-width: 640px) {
    .ip-pick input { width: 1.25rem; height: 1.25rem; }
    .ip-assign-row .form-control, .ip-assign-row .btn { flex: 1 1 100%; max-width: none; min-height: var(--tap); justify-content: center; }
}
@media (max-width: 640px) {
    .ip-acts .btn, .ip-acts summary.btn, .ip-free { min-height: var(--tap); }
    .ip-free { display: inline-flex; align-items: center; }
    .ip-portal form, .ip-portal .btn { width: 100%; justify-content: center; min-height: var(--tap); }
}
/* Fiche d'un réseau : lignes clé / valeur côte à côte à partir de 640 px (même règle que le composant 99) */
@media (min-width: 640px) {
    .ip-net-card .rows > li { display: grid; grid-template-columns: minmax(9rem, 16rem) minmax(0, 1fr); gap: 2px var(--s-4); justify-content: start; }
    .ip-net-card .rows .rows-val { margin-left: 0; text-align: left; }
}
/* Téléphone : valeurs réservées à TA INFO (plan général, note interne : longues) sous leur libellé, alignées à gauche */
@media (max-width: 639.98px) {
    .ip-net-card .ta-block .rows-val { flex-basis: 100%; margin-left: 0; text-align: left; }
}
/* Téléphone : première colonne (plage ou adresse) à la mesure de son contenu, jusqu'à 45 % ; le libellé prend le reste */
@media (max-width: 640px) {
    @supports (grid-template-columns: subgrid) {
        .table-fold.ip-table.fold-k2.fold-w2 { grid-template-columns: fit-content(45%) var(--fw) var(--ft); }
    }
    .ip-table .ip-mono { padding-right: var(--s-2); }
}

/* ── 107. Carnet d'adresses du CRM sur les téléphones (migration 74 ; backoffice : « Mon compte », contact d'une fiche) ── */
/* « Mon compte », carte #carnet : mot de passe d'un nouvel accès (une fois), adresse et identifiant à copier, mode d'emploi */
.cdv-new > div { min-width: 0; flex: 1; }
.cdv-creds { display: grid; gap: 6px; margin: 10px 0 4px; }
.cdv-cred .form-label { margin-bottom: 2px; }
.cdv-cred .api-token-row { display: flex; gap: 8px; margin: 0; }
.cdv-cred .form-control { flex: 1; min-width: 0; font-size: var(--t-xs); }
.cdv-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.cdv-acts form { margin: 0; }
.cdv-steps { margin: 8px 0 0; padding-left: 1.2rem; font-size: var(--t-sm); }
.cdv-steps li + li { margin-top: 6px; }
.cdv-add { margin-top: 12px; }
.cdv-add .seg { flex-wrap: wrap; }
.cdv-add fieldset.form-group { border: 0; padding: 0; margin-left: 0; margin-right: 0; min-width: 0; }   /* groupe de choix : aucun cadre */
#carnet .form-hint + .empty-line { margin-top: 8px; }
/* Contact d'une fiche : modifications venues d'un téléphone (dernière en une ligne, détail replié, « Rétablir ») */
.cdv-hist { margin: 4px 0 0; }
.cdv-hist .crm-contact-sub svg { vertical-align: -2px; }
.cdv-hist-more > summary { display: inline-block; cursor: pointer; font-size: var(--t-sm); margin-top: 2px; }
.cdv-hlist { list-style: none; margin: 6px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--border); }
.cdv-h + .cdv-h { margin-top: 8px; }
.cdv-h-t { margin: 0; font-size: var(--t-sm); color: var(--muted); }
.cdv-chg { list-style: none; margin: 2px 0 0; padding: 0; font-size: var(--t-sm); overflow-wrap: anywhere; }
.cdv-f { font-weight: 600; }
.cdv-old { color: var(--muted); text-decoration: line-through; }
.cdv-h form { margin: 4px 0 0; }
@media (max-width: 640px) {
    .cdv-cred .api-token-row { flex-direction: column; }
    .cdv-acts > .btn, .cdv-acts form, .cdv-acts form .btn { width: 100%; }
    .cdv-hist .btn-link, .cdv-hist-more > summary { min-height: var(--tap); display: inline-flex; align-items: center; }
}

/* ══ 108. Reprise et observation des demandes (Paramètres, onglet Demandes ; 23/11/2026, capture de Tristan) ══
   Reprise : jauge du composant 7 (état en gras, compte à droite, attente dessous), chiffres clés (composant 3), points à
   regarder (messages d'état, composant 76) en pleine largeur, puis le détail en tableau de chiffres (composant 18) sur deux colonnes à partir de 1 280 px.
   Observation : état et interrupteur dans l'en-tête de la carte, état vide du composant 31. */
.imp-progress { margin: 16px 0 18px; }
.imp-progress .gauge-text strong { font-size: var(--t-md); }
.imp-report > .kpis { margin-bottom: 16px; }
.imp-body { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.imp-acts { display: grid; gap: 10px; align-content: start; }
.imp-acts > .alert, .imp-acts > details { margin: 0; }
.imp-anoms { margin: 0; padding-left: 1.2rem; font-size: var(--t-sm); overflow-wrap: anywhere; }
/* Détail : deux tableaux de chiffres côte à côte à partir de 1 280 px (à 1 024 px, une colonne de 319 px est trop étroite) ; dessous, le second suit le premier sans répéter l'en-tête */
.imp-detail-cols { display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.imp-detail-cols > .table-wrap + .table-wrap thead { display: none; }
@media (min-width: 1280px) {
    .imp-detail-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .imp-detail-cols > .table-wrap + .table-wrap thead { display: table-header-group; }
}
.imp-detail { width: 100%; }
.imp-detail tbody th[scope="row"], .imp-detail .num-sub { white-space: normal; }
.obs-card .card-header h2 .badge { margin-left: 4px; vertical-align: 2px; }
.obs-card .card-header { flex-wrap: wrap; row-gap: 8px; }
.obs-card .card-act { margin: 0; }
.obs-card .kpis { margin-bottom: 16px; }
.obs-table .obs-dom { font-weight: 600; color: var(--title); }
.obs-table .obs-auth { font-size: var(--t-sm); color: var(--muted); }
/* Messages au client (carte pleine largeur) : deux messages par ligne à partir de 1 024 px, zone de texte de toute la colonne */
.dm-mail-msgs { display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .dm-mail-msgs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dm-mail-msgs > fieldset { min-width: 0; margin: 0 0 16px; padding: 10px 16px 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.dm-mail-msgs > fieldset > legend { padding: 0 6px; margin-left: -6px; }
.dm-mail-msgs textarea.form-control { max-width: none; }
/* Menu flottant (composant 109, demande de Tristan du 24/11/2026) : à partir de 769 px, le menu latéral est une carte
   détachée des bords de l'écran (marge --sidebar-gap en haut, à gauche et en bas, coins arrondis, bordure et ombre de
   carte) posée sur le fond de page ; le contenu commence à --sidebar-gap à droite du menu. Backoffice, espace client et « Mon équipe ». Téléphone (≤ 768 px) : tiroir inchangé,
   collé aux bords (règles iPhone de CLAUDE.md : Safari reprend le fond d'un élément fixe au bord de l'écran). */
@media (min-width: 769px) {
    .sidebar {
        top: var(--sidebar-gap); left: var(--sidebar-gap);
        height: calc(100vh - 2 * var(--sidebar-gap)); height: calc(100dvh - 2 * var(--sidebar-gap));
        border: 1px solid var(--sidebar-border); border-radius: var(--radius); box-shadow: var(--shadow);
    }
    .main-wrap { margin-left: calc(var(--sidebar-w) + 2 * var(--sidebar-gap)); }   /* même marge à droite du menu : une bande pleine largeur (onglets) ne le touche pas */
}
@media (min-width: 769px) and (max-width: 1023px) {
    .user-menu { left: calc(var(--sidebar-w) + var(--sidebar-gap) + 8px); bottom: calc(var(--sidebar-gap) + 8px); }   /* menu du compte à droite du menu réduit */
}
/* Texte un cran plus petit à partir de 769 px (composant 110, tailles dans assets/reglages.css) : sur un écran tactile (iPad),
   un champ de saisie garde 16 px, sinon Safari zoome la page au toucher du champ. Spécificité nulle : une taille posée par
   une classe garde la main. */
@media (min-width: 769px) and (pointer: coarse) {
    :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: var(--t-field); }
}
/* Menu plus serré à partir de 769 px (composant 110) : entrées en texte secondaire (14 px), 36 px de haut ; téléphone : tiroir
   inchangé (44 px, cible tactile). */
@media (min-width: 769px) {
    .nav-item { font-size: var(--t-sm); min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
}
/* Menu flottant du portail sur un écran peu haut (composant 110, à partir de 1 024 px de large et jusqu'à 960 px de haut) : la
   carte perd 24 px de hauteur (marges du menu flottant) ; logo, titres de groupe et entrées resserrés pour que les entrées
   tiennent au moins aussi bien qu'avant au-dessus de « Besoin d'aide ? » et du compte (1 440 × 900 : toutes) ; aucun texte retiré. */
@media (min-width: 1024px) and (max-height: 960px) {
    .sidebar:has(.help-box) .sidebar-brand img { width: 112px; margin-bottom: var(--s-1); }
    .sidebar:has(.help-box) .nav-item { min-height: var(--s-8); padding-top: 3px; padding-bottom: 3px; margin-bottom: 1px; }
    .sidebar:has(.help-box) .nav-section { padding-top: var(--s-2); padding-bottom: 3px; }
    .sidebar:has(.help-box) .nav-sub-item { padding-top: var(--s-1); padding-bottom: var(--s-1); }
}
/* Coins en squircle (composant 111, demande de Tristan du 24/11/2026) : boutons et grandes formes (cartes, chiffres clés,
   fenêtres, menu flottant) dessinés en superellipse par les navigateurs qui connaissent corner-shape (Chrome, Edge, Opera,
   Chrome sur Android) ; ailleurs (Safari, iPhone, Firefox), rien ne change. L'arrondi est agrandi (jetons --radius-squircle,
   --radius-sm-squircle) : à rayon égal, un squircle paraît plus carré. Pastilles, étiquettes, champs et cases restent ronds. */
@supports (corner-shape: squircle) {
    html :is(.btn, .btn-primary, .btn-outline, .btn-ghost, .btn-danger, .btn-danger-solid, .btn-icon,
             .icon-btn, .btn-sidebar-toggle, .m-btn) { corner-shape: squircle; border-radius: var(--radius-sm-squircle); }
    html :is(.btn-sm, .btn-icon.btn-sm, td .btn, td .btn-primary, td .btn-outline, td .btn-ghost, td .btn-danger, td .btn-icon) { border-radius: var(--radius-xs-squircle); }
    html :is(.card, .table-card, .kpi, .modal, .redir-status-card, .redir-action-card, .help-toc, .home-status, .svc-soon) {
        corner-shape: squircle; border-radius: var(--radius-squircle);
    }
    @media (min-width: 769px) { html .sidebar { corner-shape: squircle; border-radius: var(--radius-squircle); } }
}
