/* ═══════════════════════════════════════════════════════════════════════════
   ui-refresh.css — REFONTE UI « CLARTÉ » (non destructive)  ·  v2
   ───────────────────────────────────────────────────────────────────────────
   Inspiration : Kanakku / DreamsERP + capture CRYPTAIN.
   Objectif : interface claire, aérée, joviale — pas de simples angles arrondis
   mais un vrai langage visuel (espace, profondeur douce, hiérarchie typo,
   pastilles d'icônes, hero). Marque JP Facilities (#ed6707) + police Antenna.

   PRINCIPE : chargée APRÈS styles.css → gagne par ordre de cascade. Restyle les
   classes EXISTANTES, aucun `!important`. Le tableau de bord reçoit en plus un
   hero + des pastilles d'icônes KPI (petit ajout de markup dans index.html).
   Thème CLAIR = défaut (index.html + init.js). Réversible : retirer le <link>.

   ⚠ PWA : après toute modif, bumper le `?v=` du <link> ET CACHE_VERSION (sw.js).
   Rappel : styles.css est dark-first (:root = sombre, [data-theme="light"] = clair).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── 1) TOKENS ─────────────────────────────────────────────────────────────── */
/* Tokens conformes au handoff Claude Design (design_handoff_maintenanceos/README.md).
   Alias README → noms de tokens de l'app (les règles style-maquette fonctionnent). */
:root{
  --radius:12px;
  --surface:var(--bg2); --surface-2:var(--bg3); --surface-3:var(--bg4);
  --text-2:var(--text2); --text-3:var(--text3); --border-2:var(--border2);
}
[data-theme="light"]{                    /* CLAIR (défaut) — valeurs EXACTES du README */
  --brand:#ed6707; --brand-dark:#c04f00; --brand-light:#ff8a2f; --brand-050:#fff4ec; --brand-100:#ffe6d5;
  --bg:#f4f6fb; --bg2:#ffffff; --bg3:#f8fafc; --bg4:#eef2f8;
  --text:#141a2b; --text2:#5b6577; --text3:#8a93a6;
  --border:#e8ecf3; --border2:#dbe1ec;
  --green:#16b364; --green-bg:#e7f8ef; --red:#f04438; --red-bg:#fdeceb;
  --amber:#f79009; --amber-bg:#fef3e5; --blue:#2e90fa; --blue-bg:#e9f3ff;
  --violet:#875bf7; --violet-bg:#f1ecfe;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow-md:0 6px 20px -6px rgba(16,24,40,.12);
  --shadow-lg:0 18px 40px -12px rgba(16,24,40,.18);
  --shadow-soft:var(--shadow-md); --shadow-xs:var(--shadow-sm);   /* compat sections existantes */
  --ring:0 0 0 4px rgba(237,103,7,.14);
  --accent:#ed6707; --accent2:#c04f00; --accent-bg:var(--brand-050); --accent-strong:#9a3f00;
}
[data-theme="dark"]{                     /* SOMBRE — valeurs EXACTES du README */
  --brand:#ff8a2f; --brand-dark:#c04f00; --brand-light:#ffa657; --brand-050:rgba(237,103,7,.14); --brand-100:rgba(237,103,7,.22);
  --bg:#0f1117; --bg2:#161b27; --bg3:#1b2130; --bg4:#232b3c;
  --text:#f1f3f8; --text2:#b4bcd0; --text3:#828ba1;
  --border:rgba(255,255,255,.09); --border2:rgba(255,255,255,.16);
  --green:#3ddc84; --green-bg:rgba(22,179,100,.16); --red:#ff6b5e; --red-bg:rgba(240,68,56,.16);
  --amber:#ffb020; --amber-bg:rgba(247,144,9,.16); --blue:#5aa9ff; --blue-bg:rgba(46,144,250,.16);
  --violet:#a486ff; --violet-bg:rgba(135,91,247,.18);
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 8px 24px -8px rgba(0,0,0,.55);
  --shadow-lg:0 20px 44px -14px rgba(0,0,0,.6);
  --shadow-soft:var(--shadow-md); --shadow-xs:var(--shadow-sm);
  --ring:0 0 0 4px rgba(237,103,7,.22);
  --accent:#ff8a2f; --accent2:#c04f00; --accent-bg:var(--brand-050); --accent-strong:#ffb37a;
}
/* ─── Apparence commutable : data-look="moderne"(défaut) | "classique" ─── */
[data-look]{
  --radc:18px; --radc2:16px; --r-hero:24px; --radius-lg:var(--radc);
  --hero-bg:linear-gradient(120deg,#ed6707 0%,#c04f00 55%,#7a3200 100%);
}
[data-look="classique"]{
  --radc:8px; --radc2:8px; --r-hero:10px;
  --hero-bg:linear-gradient(120deg,#ed6707,#c04f00);
  --shadow-sm:0 1px 2px rgba(16,24,40,.06);
  --shadow-md:0 2px 6px rgba(16,24,40,.10);
  --shadow-lg:0 4px 14px -4px rgba(16,24,40,.22);
}
[data-look="classique"][data-theme="light"]{ --bg:#eef2f9; --bg3:#f5f8fd; --bg4:#e9eef7; --border:#e0e6f0; --border2:#cfd8e6; }
/* ─── Densité commutable : data-density="comfort"(défaut) | "compact" ─── */
[data-density]{ --pad-content:26px; }
[data-density="compact"]{ --pad-content:15px; }
/* Zone de contenu : padding piloté par la DENSITÉ */
.content{ padding:var(--pad-content, 22px); }
/* Hero (dashboard) : rayon + fond pilotés par l'APPARENCE */
.dash-hero{ border-radius:var(--r-hero, 24px); background:var(--hero-bg); }
body{ font-size:14px; letter-spacing:.1px; }

/* ─── 2) SIDEBAR — plus d'air, état actif net, hover calme ────────────────────── */
.sidebar{ width:252px; }
.logo{ padding:22px 20px; gap:13px; }
.logo-img{ width:44px; height:44px; border-radius:13px; }
.logo-name{ font-size:16.5px; letter-spacing:-.3px; }
.nav{ padding:14px 12px; }
/* « Gras fin » : Antenna n'a pas de vrai gras → on mise sur la COULEUR foncée + le
   TRACKING (letter-spacing) plutôt que sur l'épaisseur. PAS de text-stroke (ça
   remplissait/collait les lettres), taille contenue, lettres bien aérées. */
.nav-group{ font-size:10.5px; font-weight:700; letter-spacing:1.4px; padding:14px 12px 7px; color:var(--text); margin-top:8px; border-top:1px solid var(--border); }
.nav-group:first-child{ border-top:none; margin-top:0; padding-top:2px; }
.nav-item{ padding:10px 12px; border-radius:11px; gap:12px; font-size:13.5px; margin-bottom:3px; }
.nav-item svg{ width:18px; height:18px; }
.nav-item:hover{ background:var(--bg3); }
/* IMPORTANT — « la colonne bouge au survol » : styles.css applique
   .nav-item:hover{transform:translateX(2px)} → chaque item glisse de 2px.
   On neutralise via un sélecteur porté par #app-sidebar (spécificité 1,2,0 >
   la base 0,2,0) : gagne à coup sûr, indépendamment de l'ordre de chargement.
   On coupe aussi la transition sur transform pour éviter toute animation. */
#app-sidebar .nav-item:hover,
#app-sidebar .nav-item{ transform:none; transition:background .16s, color .16s; }
.sidebar.collapsed .nav-item{ border-radius:11px; }
.nav-item.active{
  background:var(--accent-bg);
  color:var(--accent-strong);            /* sombre : #ff8a2f */
  font-weight:600;
  box-shadow:inset 3px 0 0 var(--accent);
}
[data-theme="light"] .nav-item.active{ color:#9a3f00; }   /* clair : littéral (AA), non dépendant d'un var() */
.nav-badge{ height:20px; min-width:20px; border-radius:999px; font-size:10.5px; }
.sidebar-bottom{ padding:12px; }
.user-card{ border-radius:12px; padding:9px 10px; }
.avatar{ border-radius:12px; }           /* avatar carré-arrondi façon références */

/* ─── 3) TOPBAR — plus haute, recherche en pilule, boutons ronds ──────────────── */
.topbar{ height:66px; padding:0 26px; gap:12px; }
.topbar-title{ font-size:17px; letter-spacing:-.3px; }
.topbar-title-icon{ width:34px; height:34px; border-radius:11px; }
.search-box{ height:42px; border-radius:999px; padding:0 16px; background:var(--bg3); border-color:transparent; }
.search-box:focus-within{ background:var(--bg2); border-color:var(--accent); box-shadow:0 0 0 3px rgba(237,103,7,.28); }
.theme-toggle{ width:40px; height:40px; border-radius:999px; }
.topbar-avatar{ border-radius:12px; }

/* ─── 4) BOUTONS — pilule douce, primaire en dégradé de marque ───────────────── */
.btn{ border-radius:11px; padding:8px 16px; font-weight:600; }
.btn-primary{
  background:linear-gradient(135deg, var(--brand), var(--brand-dark));
  border-color:var(--brand-dark);
  box-shadow:0 8px 18px -8px rgba(237,103,7,.55);
}
.btn-primary:hover{
  background:linear-gradient(135deg, var(--brand-light), var(--brand));
  border-color:var(--brand);
  box-shadow:0 10px 22px -8px rgba(237,103,7,.6);
}

/* ─── 5) CARTES — grand rayon, ombre douce, entêtes aérés ────────────────────── */
.card{ border-radius:var(--radius-lg); box-shadow:var(--shadow-soft); border-color:var(--border); }
.card-header{ padding:18px 22px 0; }
.card-title{ font-size:15px; font-weight:700; letter-spacing:-.2px; }
.card-body{ padding:18px 22px; }
.grid-2, .grid-3c{ gap:18px; }

/* ─── 6) KPI — cartes « stat » avec pastille d'icône (icône = markup index.html) ─ */
.kpi-grid{ gap:18px; margin-bottom:22px; }
.kpi{ padding:22px; border-radius:var(--radius-lg); box-shadow:var(--shadow-soft); }
.kpi:hover{ transform:translateY(-3px); }
.kpi.blue:hover  { box-shadow:0 14px 30px -14px rgba(237,103,7,.38); border-color:rgba(237,103,7,.28); }
.kpi.red:hover   { box-shadow:0 14px 30px -14px rgba(239,68,68,.38);  border-color:rgba(239,68,68,.28); }
.kpi.green:hover { box-shadow:0 14px 30px -14px rgba(34,197,94,.38);  border-color:rgba(34,197,94,.28); }
.kpi.yellow:hover{ box-shadow:0 14px 30px -14px rgba(234,179,8,.38);  border-color:rgba(234,179,8,.28); }
.kpi.orange:hover{ box-shadow:0 14px 30px -14px rgba(249,115,22,.38); border-color:rgba(249,115,22,.28); }
.kpi::before{ display:block; height:3px; }  /* liseré haut coloré rétabli (design tuile unifié) */
.kpi-arrow{ display:none; }              /* remplacé par la pastille d'icône */
/* Pastille d'icône, positionnée en haut à droite ; la couleur suit la classe du KPI */
.kpi-ico{ position:absolute; top:20px; right:20px; width:44px; height:44px; border-radius:14px;
          display:flex; align-items:center; justify-content:center; }
.kpi-ico svg{ width:22px; height:22px; stroke-width:2; }
.kpi.blue   .kpi-ico{ background:var(--accent-bg); color:var(--accent); }
.kpi.red    .kpi-ico{ background:var(--red-bg);    color:var(--red); }
.kpi.orange .kpi-ico{ background:var(--orange-bg); color:var(--orange); }
.kpi.yellow .kpi-ico{ background:var(--yellow-bg); color:var(--yellow); }
.kpi-label{ font-size:12.5px; font-weight:600; text-transform:none; letter-spacing:0;
            color:var(--text2); margin-bottom:10px; padding-right:56px; }
.kpi-value{ font-size:32px; font-weight:700; letter-spacing:-1px; }
.kpi-delta{ font-size:12.5px; margin-top:6px; }

/* ─── 7) HERO du tableau de bord (markup .dash-hero ajouté dans index.html) ───── */
.dash-hero{
  position:relative; overflow:hidden; color:#fff;
  border-radius:22px; padding:28px 32px; margin-bottom:20px;
  background:linear-gradient(120deg, #ff7d1f 0%, #ed6707 44%, #a84400 100%);
  box-shadow:0 20px 44px -18px rgba(237,103,7,.6);
}
.dash-hero::after{                       /* halo décoratif */
  content:""; position:absolute; right:-70px; top:-90px; width:300px; height:300px;
  border-radius:50%; background:radial-gradient(circle, rgba(255,255,255,.20), transparent 70%);
}
.dash-hero h1{ font-size:23px; font-weight:700; letter-spacing:-.4px; margin-bottom:6px; }
.dash-hero p{ opacity:.94; max-width:600px; font-size:14px; line-height:1.5; }
.dash-hero .btn{
  margin-top:16px; background:#fff; color:var(--brand-dark); border:none;
  box-shadow:0 8px 20px -8px rgba(0,0,0,.35); position:relative; z-index:1;
}
.dash-hero .btn:hover{ background:#fff; transform:translateY(-1px); }

/* ─── 8) RACCOURCIS — chips arrondis, propres ────────────────────────────────── */
.shortcuts-bar{ gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.sc-btn{
  border-radius:999px; padding:8px 15px; font-weight:600; font-size:13px;
  border:1px solid var(--border); background:var(--bg2); box-shadow:var(--shadow-xs);
  transition:transform .12s, box-shadow .16s, background .16s;
}
.sc-btn:hover{ transform:translateY(-1px); box-shadow:var(--shadow-soft); }

/* ─── 9) BADGES / PASTILLES ──────────────────────────────────────────────────── */
.badge{ border-radius:999px; padding:4px 11px; font-weight:600; }

/* ─── 10) TABLES — entête allégé (fini le liseré accent épais + ombre) ────────── */
table.erp th{
  border-bottom:1px solid var(--border); box-shadow:none; background:var(--bg2);
  padding:12px 14px; color:var(--text3); text-transform:uppercase; letter-spacing:.5px;
}
table.erp td{ padding:12px 14px; }
table.erp tr:hover td{ background:var(--bg3); }

/* ─── 11) MODALES ────────────────────────────────────────────────────────────── */
.modal{ border-radius:var(--radius-lg); }
.modal-hdr{ padding:18px 22px; }
.modal-body{ padding:20px 22px; }

/* ─── 12) ACCESSIBILITÉ — focus clavier visible (WCAG 2.4.7) ──────────────────── */
.btn:focus-visible, .btn-primary:focus-visible, .btn-sm:focus-visible,
.btn-icon:focus-visible, .theme-toggle:focus-visible, .pbi-btn:focus-visible,
.sc-btn:focus-visible, .form-input:focus-visible, .form-select:focus-visible,
.form-textarea:focus-visible, .chat-input:focus-visible, a:focus-visible{
  outline:2px solid var(--accent); outline-offset:2px; box-shadow:0 0 0 4px var(--bg);
}

/* ─── 13) IMPRESSION — ne pas réintroduire l'ombre que styles.css retire ──────── */
@media print{ .card, .kpi{ box-shadow:none; } .dash-hero{ box-shadow:none; } }

/* ─── 14) RESPONSIVE — sidebar cachée déjà gérée par styles.css ; on garde ──────
   la recherche fluide et le hero compact sur petit écran. */
@media (max-width:640px){
  .dash-hero{ padding:22px 20px; }
  .dash-hero h1{ font-size:20px; }
  .kpi-value{ font-size:28px; }
}

/* ─── 15) FORMULAIRES — présents dans toutes les modales (fort levier de cohérence)
   Labels en casse normale (fini le TOUT-MAJUSCULE), champs arrondis, focus avec anneau. */
.form-row{ margin-bottom:16px; }
.form-label{ text-transform:none; letter-spacing:0; font-size:12px; font-weight:600; color:var(--text2); margin-bottom:6px; }
.form-input, .form-select, .form-textarea{
  border-radius:var(--radius); padding:10px 14px; border-color:var(--border);
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus{
  border-color:var(--accent); background:var(--bg2); box-shadow:0 0 0 3px rgba(237,103,7,.18);
}
.chat-input{ border-radius:12px; padding:11px 15px; }
.chat-input:focus{ border-color:var(--accent); box-shadow:0 0 0 3px rgba(237,103,7,.18); }
.modal-hdr-title{ font-size:16px; font-weight:700; letter-spacing:-.2px; }

/* ─── 16) MENU PROFIL — coins doux + ombre cohérente ─────────────────────────── */
.profile-menu{ border-radius:16px; box-shadow:var(--shadow-soft); border-color:var(--border); padding:7px; }

/* ═══════════════════════════════════════════════════════════════════════════
   17) FINITIONS MODULES — issues de la cartographie parallèle de tout l'app.
   Objectif : purger les reliquats « pensés sombre » (ombres noires dures, glow
   néon, angles vifs 6-8px, TOUT-MAJUSCULE, hovers à liseré accent brut) qui
   détonnaient en thème clair. Tout est basé sur les tokens, sans !important.
   ═══════════════════════════════════════════════════════════════════════════ */

/* 17a — Champs : cases/radios à la marque, switch lisible, placeholder/désactivé */
input[type="checkbox"], input[type="radio"]{ accent-color:var(--accent); cursor:pointer; }
.switch .slider{ background:var(--border2); }
.switch .slider:before{ box-shadow:0 1px 2px rgba(16,24,40,.25); }
.form-input::placeholder, .form-textarea::placeholder{ color:var(--text3); }
.form-input:disabled, .form-select:disabled, .form-textarea:disabled{ background:var(--bg4); opacity:.6; cursor:not-allowed; }
.chat-input{ border-color:var(--border); }

/* 17b — Menus, notifications, info-bulles : ombres douces, coins cohérents */
.profile-menu-item{ border-radius:10px; }
.profile-menu-badge{ border-radius:999px; }
.notif-item{ border-radius:12px; }
.notif-item.unread{ box-shadow:var(--shadow-xs); }
.notif-icon{ border-radius:12px; }
.tip .tipbox{ border:1px solid var(--border); border-radius:11px; box-shadow:var(--shadow-soft); }
.help-tip-box{ border:1px solid var(--border); border-radius:11px; box-shadow:var(--shadow-soft); }
/* Tiroir « colonnes » (injecté par col-manager.js APRÈS cette feuille) → on cible
   l'id pour gagner malgré l'ordre ; ombre orientée vers la gauche (vient de droite). */
#col-drawer{ border-top-left-radius:var(--radius-lg); border-bottom-left-radius:var(--radius-lg);
             box-shadow:-18px 0 40px -20px rgba(16,24,40,.28); }
#col-drawer .cd-x{ border-radius:999px; }

/* 17c — Barres d'outils & filtres (Interventions, Contrats, Rapports, ST, Users) */
#bulk-bar{ border-top:1px solid var(--border); box-shadow:0 -1px 0 var(--border), 0 -12px 30px -14px rgba(16,24,40,.22); }
.more-menu{ border-radius:14px; border-color:var(--border); box-shadow:var(--shadow-soft); }
.more-menu button{ border-radius:9px; }
#filter-banner{ background:var(--accent-bg); border:1px solid rgba(237,103,7,.18); border-radius:var(--radius); color:var(--accent-strong); }
.view-switcher{ border-radius:var(--radius); padding:3px; gap:2px; border-color:var(--border); }
.view-switcher .vs-btn{ border-radius:9px; padding:6px 12px; font-weight:600; }
.view-switcher .vs-btn.active{ box-shadow:var(--shadow-xs); }
.page-top-block .form-select, .page-top-block input.form-input{ border-radius:var(--radius); border-color:var(--border); }
#selection-bar{ border-radius:var(--radius); border-color:var(--border); }

/* 17d — Encarts statistiques & bandeaux (hover = lift doux, pas de glissement) */
.alert-strip{ border-radius:var(--radius); padding:11px 15px; }
.alert-strip:hover{ transform:translateY(-1px); box-shadow:var(--shadow-soft); }
.sum-card{ border-radius:var(--radius); padding:14px 16px; }
.sum-card:hover{ background:var(--bg2); border-color:var(--border2); transform:translateY(-2px); box-shadow:var(--shadow-soft); }
.stat-row{ border-radius:var(--radius); padding:10px; }
.stat-bar{ height:7px; border-radius:999px; }
.stat-fill{ border-radius:999px; }
.status-insight-label{ border-radius:999px; padding:2px 9px; }

/* 17e — Cartes de modules & éléments flottants/mobiles (fini le glow néon) */
.page-fab{ border:none; box-shadow:0 12px 26px -10px rgba(237,103,7,.5), 0 2px 6px rgba(16,24,40,.12); }
.page-fab:hover{ box-shadow:0 16px 30px -10px rgba(237,103,7,.55), 0 4px 10px rgba(16,24,40,.16); }
.sidebar-collapse-btn{ border-radius:11px; }
.sidebar-collapse-btn:hover{ border-color:var(--border2); }
.rapport-card:hover{ border-color:var(--border2); box-shadow:var(--shadow-soft); }
.contrat-card:hover{ border-color:var(--border2); box-shadow:var(--shadow-soft); }
.bottom-nav{ box-shadow:0 -2px 12px rgba(16,24,40,.06); }
.doc-article-icon{ border-radius:11px; }
.doc-access{ border-radius:11px; }

/* ═══════════════════════════════════════════════════════════════════════════
   18) RÉCONCILIATION KPI — deux systèmes coexistaient :
       · .kpi-tile  (design unifié des MODULES, dev parallèle : cadre gris +
                     liseré haut coloré via --kpc)
       · .kpi + .kpi-ico  (cartes du TABLEAU DE BORD, refonte « Clarté »)
   Aucune collision CSS (classes distinctes) mais deux looks. On les fond dans
   UNE famille : on polit .kpi-tile (Clarté) et on donne aux cartes .kpi la MÊME
   mécanique de couleur (--kpc + liseré haut), en gardant leur pastille d'icône
   comme variante « riche » du dashboard. `color-mix` est déjà utilisé par
   .kpi-tile dans styles.css → support navigateur acquis.
   ═══════════════════════════════════════════════════════════════════════════ */

/* 18a — Tuiles compactes des modules → look Clarté (rayon doux + ombre + lift) */
.kpi-tile{ border-radius:14px; box-shadow:var(--shadow-soft); }
.kpi-tile[onclick]:hover{ transform:translateY(-2px); box-shadow:var(--shadow-soft); }

/* 18b — Cartes KPI du dashboard : on branche --kpc par couleur puis on applique
   le MÊME liseré haut coloré que .kpi-tile (identité visuelle partagée). */
.kpi.blue  { --kpc:var(--accent); }
.kpi.red   { --kpc:var(--red);    }
.kpi.orange{ --kpc:var(--orange); }
.kpi.yellow{ --kpc:var(--yellow); }
.kpi{ border-top:3px solid color-mix(in srgb, var(--kpc, var(--accent)) 45%, var(--border)); }
.kpi:hover{ border-top-color:color-mix(in srgb, var(--kpc, var(--accent)) 72%, var(--border)); }

/* ═══════════════════════════════════════════════════════════════════════════
   19) SIDEBAR FIXE PARTOUT (choix user : « fixe pas flexible, on réduit au besoin »)
   styles.css rend la sidebar « flexible » : off-canvas automatique sous 1024px
   (position:fixed + translateX(-100%) + hamburger) et repli MANUEL réservé au
   desktop (@media min-width:1025px). Ici on la fige : colonne TOUJOURS visible,
   largeur fixe, à toutes les tailles ; le repli « Réduire » (→ rail d'icônes)
   devient disponible partout. Sélecteurs par ID (#app-sidebar = 1,0,0) → priment
   sur les règles @media (0,1,0) SANS !important, quel que soit le point de rupture.
   ═══════════════════════════════════════════════════════════════════════════ */

/* a) Toujours en flux, largeur fixe, jamais hors-champ ni rétrécie */
#app-sidebar{ position:relative; left:auto; top:auto; bottom:auto; transform:none;
              width:252px; z-index:auto; box-shadow:none; transition:width .22s ease, background .3s; }

/* b) Aides mobiles désormais superflues (la sidebar est toujours présente) */
#sidebar-toggle{ display:none; }     /* hamburger */
#sidebar-overlay{ display:none; }    /* voile sombre off-canvas */
#bottom-nav{ display:none; }         /* barre de navigation basse mobile */

/* c) Bouton « Réduire » visible à toutes les tailles (dé-gate le desktop-only) */
#app-sidebar .sidebar-collapse-btn{ display:inline-flex; }

/* d) Mode réduit (rail d'icônes) rendu disponible PARTOUT
      — répliqué du bloc desktop de styles.css (mêmes valeurs → desktop inchangé). */
#app-sidebar.collapsed{ width:64px; }
#app-sidebar.collapsed .logo{ justify-content:center; padding:10px 6px; gap:0; }
#app-sidebar.collapsed .logo > div,
#app-sidebar.collapsed .logo-name{ display:none; }
#app-sidebar.collapsed .logo-img{ width:36px; height:36px; padding:2px; }
#app-sidebar.collapsed .nav{ padding:6px 4px; overflow:hidden; }
#app-sidebar.collapsed .nav-group{ display:none; }
#app-sidebar.collapsed .nav-item.ng-hidden{ display:flex; }
#app-sidebar.collapsed .nav-item{ justify-content:center; padding:8px 4px; gap:0; position:relative; border-radius:11px; overflow:visible; }
#app-sidebar.collapsed .nav-item > svg{ width:20px; height:20px; }
#app-sidebar.collapsed .nav-item > *:not(svg):not(.nav-badge){ display:none; }
#app-sidebar.collapsed .nav-badge{ position:absolute; top:2px; right:4px; min-width:18px; height:18px; padding:0 5px; border-radius:9px; border:2px solid var(--bg2); }
#app-sidebar.collapsed .user-card{ justify-content:center; padding:4px; gap:0; }
#app-sidebar.collapsed .user-card > div:not(.avatar){ display:none; }
#app-sidebar.collapsed .sidebar-bottom{ padding:6px 4px; }
#app-sidebar.collapsed .sidebar-collapse-btn{ justify-content:center; padding:8px; }
#app-sidebar.collapsed .sidebar-collapse-lbl{ display:none; }
#app-sidebar.collapsed .sidebar-collapse-icon{ transform:rotate(180deg); }

/* ═══════════════════════════════════════════════════════════════════════════
   20) PAGE « MON PROFIL » — améliorations VISIBLES
   a) Carte Identité : en-tête « héro » (bandeau dégradé de marque) + avatar
      cerclé qui déborde + rôle en pastille → remplit le vide, look profil moderne.
   b) Lignes de notification : nettement visibles (fond doux + bordure), lift au
      survol, et TINTÉES en pêche quand la notif est ACTIVE (repère d'état clair).
   ═══════════════════════════════════════════════════════════════════════════ */

/* a) En-tête héro de la carte Identité */
.card-body.profil-identite{ padding-top:0; position:relative; }
.profil-cover{
  height:92px; margin:0 -22px 0; border-radius:16px 16px 0 0;
  background:linear-gradient(120deg,#ff7d1f 0%,#ed6707 55%,#a84400 100%);
}
.profil-avatar-lg{
  margin:-56px auto 12px; border:4px solid var(--bg2);
  box-shadow:0 10px 24px -8px rgba(16,24,40,.28); position:relative; z-index:1;
}
.profil-role-badge{
  display:inline-block; background:var(--accent-bg); color:var(--accent-strong);
  font-weight:600; font-size:12px; padding:4px 12px; border-radius:999px; margin-bottom:16px;
}

/* b) Lignes de notification — styles portés par la CLASSE (pas d'inline) pour que
   :hover et :has(:checked) gagnent la cascade (l'inline background aurait primé). */
.notif-row{ padding:12px 14px; background:var(--bg3); border:1px solid var(--border);
            border-radius:12px; transition:background .15s, border-color .15s, box-shadow .15s; }
.notif-row:hover{ border-color:var(--border2); box-shadow:var(--shadow-soft); }
.notif-row:has(input:checked){ background:var(--accent-bg); border-color:rgba(237,103,7,.30); }
.notif-row input[type="checkbox"]{ width:18px; height:18px; }

/* ═══════════════════════════════════════════════════════════════════════════
   21) ASSEMBLAGE « accueil » — style réf. (cartes arrondies) porté dans l'app,
   adapté aux TOKENS de l'app → natif + theme-aware (clair ET sombre).
   Remplace le hero du dashboard : pastille profil (dégradé marque) + jauge en
   éventail (câblées sur les vraies données via dashboard.js).
   ═══════════════════════════════════════════════════════════════════════════ */
.jp-home{ display:grid; grid-template-columns:1.5fr 1fr; gap:18px; margin-bottom:22px; align-items:stretch; }
@media (max-width:900px){ .jp-home{ grid-template-columns:1fr; } }

/* Pastille profil */
.jp-profile{ display:flex; align-items:center; gap:14px; }
.jp-profile .jp-av{
  width:58px; height:58px; border-radius:50%; flex-shrink:0; color:#fff; font-weight:700; font-size:18px;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--brand),var(--brand-dark)); box-shadow:var(--shadow-soft);
}
.jp-profile-pill{
  flex:1; display:flex; align-items:center; justify-content:space-between; gap:12px;
  background:linear-gradient(135deg,var(--brand),var(--brand-dark)); color:#fff;
  border-radius:999px; padding:14px 22px; box-shadow:0 16px 30px -14px rgba(237,103,7,.55);
}
.jp-profile-pill h2{ font-size:17px; font-weight:700; letter-spacing:-.2px; line-height:1.1; }
.jp-profile-pill p{ font-size:12.5px; opacity:.92; margin-top:2px; }
.jp-profile-pill .jp-cta{
  background:rgba(255,255,255,.22); color:#fff; border:none; border-radius:999px;
  padding:9px 16px; font:inherit; font-weight:700; font-size:12.5px; cursor:pointer; white-space:nowrap; transition:background .15s;
}
.jp-profile-pill .jp-cta:hover{ background:rgba(255,255,255,.32); }

/* Carte jauge */
.jp-gauge-card{
  background:var(--bg2); border:1px solid var(--border); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-soft); padding:16px 20px 12px;
  display:flex; flex-direction:column; align-items:center;
}
.jp-gauge-title{ align-self:flex-start; font-size:13px; font-weight:700; color:var(--text2); }
.jp-gauge-wrap{ position:relative; width:100%; max-width:300px; }
.jp-gauge-wrap svg{ width:100%; height:auto; display:block; }
.jp-gauge-center{ position:absolute; left:0; right:0; bottom:2px; text-align:center; }
.jp-gauge-center .big{ font-size:32px; font-weight:700; letter-spacing:-1px; color:var(--text); line-height:1; }
.jp-gauge-center .lbl{ font-size:12px; color:var(--text2); margin-top:2px; }

/* Hero-bannière du dashboard — conforme README §Écran 1 (remplace la pastille) */
.jp-hero{
  border-radius:var(--r-hero, 24px); padding:28px 32px; color:#fff; position:relative; overflow:hidden;
  background:var(--hero-bg); box-shadow:var(--shadow-lg);
  display:flex; flex-direction:column; justify-content:center;
}
.jp-hero::after{ content:""; position:absolute; right:-70px; top:-90px; width:300px; height:300px;
  border-radius:50%; background:radial-gradient(circle, rgba(255,255,255,.20), transparent 70%); }
.jp-hero h1{ font-size:24px; font-weight:700; letter-spacing:-.4px; margin-bottom:8px; position:relative; z-index:1; }
.jp-hero p{ opacity:.94; max-width:560px; font-size:14px; line-height:1.5; position:relative; z-index:1; }
.jp-hero-cta{
  margin-top:18px; align-self:flex-start; background:#fff; color:var(--brand-dark);
  border:none; border-radius:999px; padding:11px 20px; font:inherit; font-weight:700; font-size:13.5px;
  cursor:pointer; box-shadow:0 8px 20px -8px rgba(0,0,0,.3); position:relative; z-index:1; transition:transform .12s;
}
.jp-hero-cta:hover{ transform:translateY(-1px); }

/* ═══════════════════════════════════════════════════════════════════════════
   22) PILLS DE STATUT + COMMUTATEUR DE VUES (README §Écrans : Interventions,
   Rapports, Sous-traitants, DC4). On RESTYLE le système EXISTANT
   (.badge + .dot + .vs-btn via statusBadge() dans utils.js) — aucun changement JS.
   ═══════════════════════════════════════════════════════════════════════════ */
.badge{ padding:5px 11px; border-radius:999px; font-weight:700; gap:6px; }
.badge .dot{ width:7px; height:7px; border-radius:50%; background:currentColor; flex-shrink:0; }
.badge.b-red   { background:var(--red-bg);    color:var(--red); }
.badge.b-green { background:var(--green-bg);  color:var(--green); }
.badge.b-yellow{ background:var(--amber-bg);  color:var(--amber); }   /* jaune → ambre (README) */
.badge.b-blue  { background:var(--blue-bg);   color:var(--blue); }
.badge.b-gray  { background:var(--bg4);       color:var(--text2); }
.badge.b-orange{ background:var(--brand-050); color:var(--accent-strong); }

/* Commutateur de vues (Tableau / Grille / Détails) — onglet actif = surface + ombre
   (segmented moderne), au lieu de l'aplat orange plein. */
.view-switcher .vs-btn.active{ background:var(--surface); color:var(--text); box-shadow:var(--shadow-sm); }
.view-switcher .vs-btn.active:hover{ background:var(--surface); }

/* ═══════════════════════════════════════════════════════════════════════════
   23) FINITIONS PAR ÉCRAN (handoff Claude Design — produites via workflow, une
   passe par module). Restyle des classes RÉELLES rendues par les modules ;
   scopé #page-* ; tokens uniquement ; 0 !important.
   NB : certains éléments (avatars, pills DC4, badge IA) sont en STYLES INLINE
   dans le JS → non atteignables en CSS (listés dans docs/COORDINATION-UI.md
   pour une passe JS côté Claude Design).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 23a) CLIENTS (#page-clients) — la liste réelle est un TABLEAU (pas des cartes) ── */
#page-clients .bystrt-tag{ border-radius:999px; padding:3px 10px; font-size:11px; background:var(--bg3); border-color:var(--border2); color:var(--text2); line-height:1.4; }
#page-clients .r-btn{ width:30px; height:30px; padding:0; border-radius:999px; border-color:var(--border); background:var(--bg2); transition:background .15s, border-color .15s, transform .12s, box-shadow .16s; }
#page-clients .r-btn:hover{ background:var(--accent-bg); border-color:var(--accent); transform:translateY(-1px); box-shadow:var(--shadow-xs); }
#page-clients table.erp tbody tr td{ transition:box-shadow .12s; }
#page-clients table.erp tbody tr:hover td:first-child{ box-shadow:inset 3px 0 0 var(--accent); }

/* ── 23b) RAPPORTS (#page-rapports) — cartes-lignes (vue grille) + vignette PDF ── */
/* Vues « Grille » de TOUS les modules — MÊME disposition PARTOUT (demande utilisateur).
   Interventions (.int-grid), Rapports (.rapport-grid), Sous-traitants + Utilisateurs
   (.users-grid) : grille responsive multi-colonnes, cartes ≥320px, gap uniforme, cartes
   alignées en haut. Écrase les densités hétérogènes de styles.css (int 280 / users 260
   / rapport 260) → cohérence. Les boutons .r-actions passent déjà en 2×2 si étroit. */
.int-grid, .rapport-grid, .users-grid{
  grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));
  gap:16px;
  align-items:stretch;    /* cartes de MÊME hauteur par rangée */
  align-content:start;    /* rangées calées EN HAUT, dimensionnées au CONTENU (sinon elles s'étirent à la hauteur de la page → cartes géantes) */
}
#page-rapports .rapport-card{ position:relative; display:flex; flex-direction:column; background:var(--bg2); border:1px solid var(--border); border-radius:var(--radc2); box-shadow:var(--shadow-sm); padding:16px 18px 16px 74px; transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
/* Boutons d'action collés EN BAS → quand la carte est étirée à la hauteur commune,
   l'espace en trop se met au-dessus des boutons (rendu uniforme, pas de gros vide visuel). */
#page-rapports .rapport-card .r-actions{ margin-top:auto; }
#page-rapports .rapport-card:hover{ border-color:var(--border2); box-shadow:var(--shadow-md); transform:translateY(-1px); }
#page-rapports .rapport-card::before{ content:"PDF"; position:absolute; left:18px; top:16px; width:42px; height:52px; display:flex; align-items:center; justify-content:center; background:var(--red-bg); color:var(--red); border-radius:10px; font-size:10px; font-weight:800; letter-spacing:.6px; }
#page-rapports .rapport-card.unread{ border-left:1px solid var(--border); box-shadow:inset 3px 0 0 0 var(--accent), var(--shadow-sm); }
#page-rapports .rapport-card.unread:hover{ box-shadow:inset 3px 0 0 0 var(--accent), var(--shadow-md); }
#page-rapports .rapport-card .r-title{ font-size:14px; font-weight:700; color:var(--text); letter-spacing:-.1px; margin-bottom:2px; }
#page-rapports .rapport-card .r-meta{ font-size:12px; color:var(--text3); margin-bottom:0; }
#page-rapports .rapport-card .badge.b-blue{ background:var(--amber-bg); color:var(--amber); }
#page-rapports .rapport-card .r-ai-preview{ background:var(--bg3); border:1px solid var(--border); border-radius:10px; }
#page-rapports .rapport-card .ai-tag{ background:var(--violet-bg); color:var(--violet); border-radius:999px; padding:2px 8px; }
#page-rapports .rapport-card .r-actions .r-btn{ min-height:38px; border-radius:11px; background:var(--bg2); border:1px solid var(--border); color:var(--text2); font-weight:600; }
#page-rapports .rapport-card .r-actions .r-btn:hover{ background:var(--brand-050); border-color:var(--accent); color:var(--accent-strong); }
#page-rapports .table-wrap .r-btn{ width:38px; height:38px; padding:0; border-radius:11px; background:var(--bg2); border:1px solid var(--border); color:var(--text2); }
#page-rapports .table-wrap .r-btn:hover{ background:var(--brand-050); border-color:var(--accent); color:var(--accent-strong); }

/* ── 23c) PLANNING (#page-planning) — commutateur, en-têtes jours, chips (vue Mois) ── */
.planning-filters-row .planning-tab, #planning-content .planning-tab{ border:1px solid var(--border); background:var(--bg3); color:var(--text2); border-radius:999px; padding:6px 15px; font-weight:600; transition:background .15s, color .15s, border-color .15s, box-shadow .15s; }
.planning-filters-row .planning-tab:hover, #planning-content .planning-tab:hover{ background:var(--bg4); color:var(--text); border-color:var(--border2); }
.planning-filters-row .planning-tab.active, #planning-content .planning-tab.active{ background:var(--accent); color:#fff; border-color:var(--accent); font-weight:700; box-shadow:var(--shadow-sm); }
#planning-period{ color:var(--text); text-transform:capitalize; letter-spacing:.2px; }
.planning-day-headers-grid.is-month-mode{ border-bottom:1px solid var(--border); }
.planning-day-headers-grid.is-month-mode .pd-cell{ background:transparent; color:var(--text3); text-transform:uppercase; letter-spacing:.6px; font-size:11px; font-weight:700; padding:8px 4px; border-radius:0; }
#planning-content .plan-event-badge{ padding:2px 7px; border-radius:6px; font-size:10.5px; font-weight:600; line-height:1.35; letter-spacing:.1px; box-shadow:var(--shadow-xs); }
#planning-content .plan-event-badge:hover{ filter:brightness(1.08); box-shadow:var(--shadow-sm); }
#planning-content .planning-body-grid.is-month-mode{ row-gap:8px; column-gap:8px; }

/* ── 23d) ASSISTANT IA (#page-ia) — fil centré, bulles de marque, saisie pilule ── */
#page-ia .card-header{ border-bottom:1px solid var(--border); }
#page-ia .card-title{ letter-spacing:-.2px; }
#page-ia .chat-messages{ max-width:860px; width:100%; margin-inline:auto; padding:22px 20px; gap:14px; }
#page-ia .msg-bubble{ padding:11px 15px; font-size:13.5px; line-height:1.6; box-shadow:var(--shadow-sm); }
#page-ia .msg.user .msg-bubble{ background:linear-gradient(135deg, var(--brand), var(--brand-dark)); color:#fff; border:none; border-radius:16px 16px 4px 16px; }
#page-ia .msg.ai .msg-bubble{ background:var(--bg3); border:1px solid var(--border); color:var(--text); border-radius:16px 16px 16px 4px; }
#page-ia .ai-indicator{ color:var(--accent-strong); font-weight:600; }
#page-ia .typing-dots span{ background:var(--accent); }
#page-ia .chat-input-row{ padding:16px 18px; gap:10px; align-items:flex-end; }
#page-ia .chat-input{ background:var(--bg3); border:1px solid var(--border2); border-radius:999px; padding:13px 20px; min-height:52px; }
#page-ia .chat-input:focus{ background:var(--bg2); border-color:var(--accent); box-shadow:0 0 0 3px rgba(237,103,7,.18); }
#page-ia #ia-send-btn{ border-radius:999px; height:52px; min-width:52px; padding:0 24px; font-weight:700; align-self:flex-end; }
#page-ia #ia-stop-btn{ border-radius:999px; height:52px; padding:0 20px; font-weight:700; }
#page-ia .chat-input-row .btn.btn-sm{ border-radius:999px; width:40px; }
#page-ia .card-body > .btn.btn-sm{ border-radius:999px; border:1px solid var(--border); background:var(--bg2); box-shadow:var(--shadow-xs); font-weight:600; padding:9px 14px; transition:transform .12s, box-shadow .16s, background .16s, border-color .16s; }
#page-ia .card-body > .btn.btn-sm:hover{ background:var(--bg3); border-color:var(--border2); transform:translateY(-1px); box-shadow:var(--shadow-sm); }

/* ── 23e) SOUS-TRAITANTS (#page-soustraitants) + DC4 (#page-dc4) ── */
#page-soustraitants table.erp-users th{ padding:12px 14px; font-size:10px; color:var(--text3); text-transform:uppercase; letter-spacing:.5px; border-bottom:1px solid var(--border); background:var(--bg2); }
#page-soustraitants table.erp-users th:hover{ color:var(--text); }
#page-soustraitants table.erp-users td{ padding:12px 14px; border-bottom:1px solid var(--border); font-variant-numeric:tabular-nums; }
#page-soustraitants table.erp-users tr:hover td{ background:var(--bg3); }
#page-soustraitants .ug-card{ border-radius:var(--radc); border:1px solid var(--border); box-shadow:var(--shadow-xs); transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
#page-soustraitants .ug-card:hover{ border-color:var(--border2); box-shadow:var(--shadow-md); }
#page-soustraitants .ug-avatar{ border-radius:var(--radc2); box-shadow:var(--shadow-sm); }
#page-dc4 table.erp td{ font-variant-numeric:tabular-nums; }

/* ── 23f) Avatars (classe .av-thumb ajoutée dans avatars.js) + badge statut IA ──
   Avatars : ombre douce (taille/rayon restent pilotés par le JS via o.size/o.radius).
   Badge IA : inline violet retiré dans index.html → pastille de marque. */
.av-thumb{ box-shadow:var(--shadow-xs); }
#page-ia #ia-page-badge{ background:var(--brand-050); color:var(--accent-strong); border:none; }

/* ═══ 24) Bouton(s) « Assistant IA » (.btn-ai) → orange de la MARQUE ═══
   styles.css les rend en dégradé violet/indigo (#6366f1→#8b5cf6). L'utilisateur
   veut l'orange du programme. Spécificité .btn.btn-ai (0,2,0) > .btn-ai (0,1,0). */
.btn.btn-ai{
  background:linear-gradient(135deg, var(--brand), var(--brand-dark));
  color:#fff; border:none;
  box-shadow:0 8px 18px -8px rgba(237,103,7,.5);
}
.btn.btn-ai:hover{
  opacity:1; filter:brightness(1.05);
  box-shadow:0 10px 22px -8px rgba(237,103,7,.6);
}

/* ═══════════════════════════════════════════════════════════════════════════
   25) FINITIONS PAR ÉCRAN (lot Planning / Clients / Liaison ST)
   Additif aux §23. Scopé #page-*, tokens app, 0 !important, clair + sombre.
   --muted n'existe pas dans l'app → repli var(--text3).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 25a) PLANNING (#page-planning) — grille du MOIS : cases-jour ──
   Cadre neutre + numéro discret ; le jour courant (.is-today) porte une
   PASTILLE ronde orange sur son numéro. Les inline background/border/radius/
   padding/color de la case et du numéro sont retirés côté JS (planning.js)
   pour laisser ce CSS s'appliquer (règle 0 !important de la surcouche). */
#page-planning .cal-cell{
  min-height:120px;
  padding:10px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;                 /* petit radius (les cartes app = --radc 18px, trop rond ici) */
  transition:box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
#page-planning .cal-cell:hover{
  border-color:var(--brand);
  box-shadow:var(--shadow-sm);
}
#page-planning .cal-daynum{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;                         /* taille fixe → pas de saut de mise en page today/non-today */
  height:26px;
  margin-bottom:4px;
  font-size:12.5px;
  font-weight:600;
  line-height:1;
  color:var(--muted, var(--text3));   /* numéro discret */
}
#page-planning .cal-cell.is-today{
  background:var(--brand-050);
  border-color:var(--brand);
}
#page-planning .cal-cell.is-today .cal-daynum{
  border-radius:999px;
  background:var(--brand);
  color:#fff;
  font-weight:700;
  box-shadow:var(--shadow-sm);
}
[data-theme="dark"] #page-planning .cal-cell.is-today{
  background:rgba(237,103,7,.18);
}
/* Événements du mois : fini le mur d'aplats pleins. Fond teinté clair + texte
   FONCÉ lisible + barre de statut à gauche (statut posé en classe pev-* par
   planning.js, l'inline background/color est retiré pour laisser ce CSS agir). */
#page-planning .plan-event-badge{
  display:block;
  padding:4px 8px;
  border-radius:7px;
  border-left:3px solid var(--text3);
  background:var(--bg3);
  color:var(--text);
  font-size:11.5px;
  line-height:1.3;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#page-planning .plan-event-badge strong{ font-weight:600; }
#page-planning .plan-event-badge.pev-retard,
#page-planning .plan-event-badge.pev-urgent{ background:var(--red-bg);    border-left-color:var(--red); }
#page-planning .plan-event-badge.pev-planifier{ background:var(--yellow-bg); border-left-color:var(--yellow); }
#page-planning .plan-event-badge.pev-ajour{     background:var(--green-bg);  border-left-color:var(--green); }
#page-planning .plan-event-badge.pev-rdv{       background:var(--brand-050); border-left-color:var(--brand); }

/* ── 25b) CLIENTS (#page-clients) — polissage « Clarté » du TABLEAU (on GARDE le tableau) ──
   Carte englobante nette, entête discret, survol chaud, pastille de statut
   harmonisée (hook .cli-badge posé dans clients.js à la place des emojis). */
#page-clients .card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radc);
  box-shadow:var(--shadow-sm);
  overflow:hidden;                    /* rogne les coins arrondis sous l'entête collant */
}
#page-clients table.erp thead th{
  background:var(--bg3);              /* --surface===--bg2 → bg3 pour une bande d'entête visible */
  color:var(--text3);
  font-size:11px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.5px;
  border-bottom:1px solid var(--border);
  box-shadow:none;
}
#page-clients table.erp thead th[onclick]:hover{ color:var(--text); }
#page-clients table.erp tbody td{
  border-bottom:1px solid var(--border);
  font-variant-numeric:tabular-nums;
}
#page-clients table.erp tbody tr:last-child td{ border-bottom:none; }
#page-clients table.erp tbody tr:hover td{
  background:color-mix(in srgb, var(--accent) 6%, var(--surface));
}
[data-theme="dark"] #page-clients table.erp tbody tr:hover td{
  background:color-mix(in srgb, var(--accent) 14%, var(--surface));
}
/* Pastille de STATUT : pilule douce + point coloré via ::before (remplace 🟢/⚪) */
#page-clients .cli-badge{
  display:inline-flex; align-items:center; gap:6px;
  padding:3px 10px; border-radius:999px;
  font-size:11px; font-weight:600; line-height:1.4; white-space:nowrap;
}
#page-clients .cli-badge::before{
  content:""; width:7px; height:7px; border-radius:999px;
  background:currentColor; flex:0 0 auto;
}
#page-clients .cli-badge-actif{ background:var(--green-bg); color:var(--green); }
#page-clients .cli-badge-inactif{ background:var(--bg3); color:var(--text3); }
[data-theme="dark"] #page-clients .cli-badge-inactif{ background:var(--bg4); }
#page-clients .av-thumb{ box-shadow:var(--shadow-sm); }
/* Sites RETIRABLES dans la fiche client (vue détail #cli-detail-sites) : puce + bouton ✕.
   Le ✕ appelle removeClientSite() (clients.js) → PUT ?allowClear=1 sans toucher aux interventions. */
#cli-detail-sites .cli-site-chip{
  display:inline-flex; align-items:center; gap:6px;
  margin:2px 6px 2px 0; padding:4px 5px 4px 11px;
  border-radius:999px; background:var(--surface-2); border:1px solid var(--border);
  color:var(--text2); font-size:12px; line-height:1.4;
}
#cli-detail-sites .cli-site-del{
  display:inline-flex; align-items:center; justify-content:center;
  width:18px; height:18px; padding:0; border:none; border-radius:999px;
  background:transparent; color:var(--text3); font-size:11px; line-height:1; cursor:pointer;
  transition:background .12s ease, color .12s ease;
}
#cli-detail-sites .cli-site-del:hover{ background:var(--red-bg); color:var(--red); }

/* ── 25b-bis) CLIENTS (#page-clients) — RYTHME + LISIBILITÉ du tableau (additif à §25b) ──
   Ajoute seulement : hauteur de ligne régulière, clamp 2 lignes de l'adresse + des notes
   (.cli-clamp posé en JS), dé-emphase des cellules vides « — » (.cli-dash posé en JS),
   zébrage 1 ligne/2 très discret. Ne redéclare rien de §25b. Tokens, 0 !important, clair+sombre. */
#page-clients table.erp tbody td{ vertical-align:top; line-height:1.45; }
#page-clients .cli-clamp{
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2;
  overflow:hidden; overflow-wrap:anywhere; max-width:260px; line-height:1.4;
}
#page-clients .cli-dash{ color:var(--text3); font-weight:400; }
#page-clients tbody tr:nth-child(even) td{ background:color-mix(in srgb, var(--text) 3%, transparent); }
[data-theme="dark"] #page-clients tbody tr:nth-child(even) td{ background:color-mix(in srgb, var(--text) 6%, transparent); }

/* ── 26) INTERVENTIONS (#page-interventions) — colonne « Actions » : boutons plus grands + alignés ──
   Cluster d'actions (éditer / cloner / rapport / résumé IA / supprimer) : conteneur .int-actions
   (posé dans interventions.js à la place du flex inline gap:3px). Boutons carrés uniformes 32px,
   icône plus lisible, gap régulier ; wrap propre et centré si la colonne est étroite. */
#page-interventions .int-actions{
  display:flex; flex-wrap:nowrap; align-items:center; justify-content:flex-start; gap:6px;
}
/* Réserve la largeur pour les 5 boutons sur UNE seule rangée (la table défile déjà en X). */
#page-interventions table.erp td[data-label="Actions"],
#page-interventions table.erp th:last-child{ min-width:198px; }
#page-interventions .int-actions .r-btn{
  width:32px; height:32px; padding:0; font-size:15px; line-height:1; flex:0 0 auto;
  display:inline-flex; align-items:center; justify-content:center;
}
#page-interventions .int-actions .int-act-del{ color:var(--red); }
#page-interventions .int-actions .int-act-del:hover{ background:var(--red-bg); border-color:var(--red); color:var(--red); }

/* ── 27) Marqueur « élément RESTAURÉ » (.restored-pill) — transversal (tous modules) ──
   Pastille discrète « ↩ » posée par restoredBadge() (core/restorations.js) dans la
   cellule Statut/État existante. Tooltip = « Restauré le JJ/MM/AAAA depuis <source> ».
   Classe nouvelle → non scopée (aucun conflit). Thème clair + sombre via tokens. */
.restored-pill{
  display:inline-flex; align-items:center; justify-content:center;
  width:18px; height:18px; margin-left:6px; vertical-align:middle;
  border-radius:999px; background:var(--brand-050); color:var(--brand);
  border:1px solid var(--brand-100); font-size:11px; line-height:1; cursor:help; flex:0 0 auto;
}
.restored-pill .restored-ic{ transform:translateY(-.5px); }
.restored-pill:hover{ background:var(--brand-100); }

/* ── 28) Modales d'ÉDITION (« Modifier / Éditer / Nouveau ») — plus d'air, largeur BORNÉE ──
   Problème : plusieurs formulaires sont trop SERRÉS (largeur inline ~480-600px).
   Astuce : on cible SEULEMENT les modales qui contiennent un formulaire (.form-row)
   via :has(), et on impose une min-width. min-width n'étant PAS posé en inline, il
   CONTRAINT la largeur inline (width:NNNpx) SANS !important. Plafond raisonnable
   (min(860px, 94vw)) → confortable mais jamais géant ; capé au viewport sur petit écran.
   Les dialogues de confirmation (sans .form-row) ne sont PAS touchés. */
.modal-bg .modal:has(.form-row){ min-width:min(860px, 94vw); }
/* Un peu plus d'air vertical entre les rangées de formulaire dans ces modales. */
.modal-bg .modal:has(.form-row) .modal-body{ padding:22px 24px; }

/* ── 25c) LIAISON SOUS-TRAITANT (#page-contrats) — langage « Clarté » ──
   L'écran « Liaison sous-traitant » = module Contrats (page #page-contrats,
   PAS #page-soustraitants qui est le référentiel ST). La liste RÉELLEMENT
   affichée est la vue « par sous-traitant » (.bystrt-* dans #view-contrats-bystrt).
   .open = ligne dépliée ; .cg-card = renderer NON monté (code mort) → stylé
   par cohérence si la grille est un jour recâblée, sans effet visible aujourd'hui. */
#page-contrats #view-contrats-bystrt{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radc); box-shadow:var(--shadow-sm); overflow:hidden; }
#page-contrats .bystrt-thead{ color:var(--text3); }
#page-contrats .bystrt-row{ transition:background .15s ease, box-shadow .15s ease; }
#page-contrats .bystrt-row:hover{ background:var(--brand-050); box-shadow:inset 3px 0 0 var(--accent); }
#page-contrats .bystrt-row-wrap.open .bystrt-row{ background:var(--brand-050); }
#page-contrats .bystrt-name{ color:var(--text); }
#page-contrats .bystrt-small{ color:var(--text3); }
#page-contrats .r-btn{ border-radius:8px; border:1px solid var(--border); background:var(--surface); color:var(--text2); transition:background .15s, border-color .15s, color .15s, transform .12s, box-shadow .16s; }
#page-contrats .r-btn:hover{ background:var(--brand-050); border-color:var(--accent); color:var(--accent-strong, var(--accent)); transform:translateY(-1px); box-shadow:var(--shadow-sm); }
/* Carte .cg-card (renderer non monté — voir note ci-dessus) */
#page-contrats .cg-card{ background:var(--surface); border:1px solid var(--border); border-radius:var(--radc); box-shadow:var(--shadow-sm); overflow:hidden; transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
#page-contrats .cg-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-md); border-color:var(--border2); }
#page-contrats .cg-card-top{ padding:14px 16px 10px; border-bottom:1px solid var(--border); }
#page-contrats .cg-card-body{ padding:14px 16px; }
#page-contrats .cg-card-footer{ padding:10px 16px; border-top:1px solid var(--border); background:var(--bg3); display:flex; align-items:center; gap:8px; }
#page-contrats .cg-lbl{ color:var(--text3); text-transform:uppercase; letter-spacing:.4px; font-size:10px; }
#page-contrats .cg-val{ color:var(--text); }
[data-theme="dark"] #page-contrats .r-btn:hover{ color:var(--brand-light); }

/* ═══════════════════════════════════════════════════════════════════════════
   26) LIAISON SOUS-TRAITANT (#page-contrats) — REFONTE « Clarté » de la liste
   « par sous-traitant » (.bystrt-*), au langage du handoff Claude Design.
   100% CSS : le markup porte déjà toutes les classes ; on surcharge les valeurs
   de styles.css par spécificité (#page-contrats …). Tokens app, clair + sombre.
   Réfs Claude Design (l'écran n'était pas maquetté) : « Vue Détails » des
   Interventions + Tableau Sous-traitants → avatar CARRÉ à initiales, pills 999px
   à point de couleur, entête discret, chips en pilules, fiches-détail aérées.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Entête de colonnes : discret, majuscules, posé sur surface-2 */
#page-contrats .bystrt-thead{
  background:var(--surface-2); color:var(--text3);
  font-size:11px; letter-spacing:.6px; padding:12px 16px;
  border-bottom:1px solid var(--border);
}
/* Lignes ST : plus aérées ; survol neutre + rail marque ; dépliée = teinte marque */
#page-contrats .bystrt-row{ padding:12px 16px; }
#page-contrats .bystrt-row:hover{ background:var(--surface-2); box-shadow:inset 3px 0 0 var(--brand); }
#page-contrats .bystrt-row-wrap.open .bystrt-row{ background:var(--brand-050); box-shadow:inset 3px 0 0 var(--brand); }
#page-contrats .bystrt-row-wrap.selected,
#page-contrats .bystrt-row-wrap.selected .bystrt-row{ background:var(--brand-050); }

/* Avatar CARRÉ à initiales (Claude Design), dégradé marque + ombre douce */
#page-contrats .bystrt-avatar{ border-radius:11px; box-shadow:var(--shadow-sm); }
#page-contrats .bystrt-name{ color:var(--text); font-weight:700; }
#page-contrats .bystrt-big{ color:var(--text); }

/* Pills de statut : 999px + POINT de couleur en tête, tints sémantiques
   (remplace le petit rectangle 3px). Vaut pour la ligne ST ET les fiches-détail. */
#page-contrats .bystrt-status{
  display:inline-flex; align-items:center; gap:6px;
  padding:3px 10px; border-radius:999px;
  font-size:11px; font-weight:700; margin-top:3px;
}
#page-contrats .bystrt-status::before{
  content:""; width:7px; height:7px; border-radius:999px; background:currentColor; flex:0 0 auto;
}
#page-contrats .bystrt-status.green{  color:var(--green); background:var(--green-bg); }
#page-contrats .bystrt-status.orange{ color:var(--amber); background:var(--amber-bg); }
#page-contrats .bystrt-status.red{    color:var(--red);   background:var(--red-bg); }
#page-contrats .bystrt-status.gray{   color:var(--text3); background:var(--surface-3); }

/* Chips équipements : pilules douces */
#page-contrats .bystrt-tag{
  border-radius:999px; background:var(--surface-2); border:1px solid var(--border);
  color:var(--text2); font-size:10.5px; padding:3px 10px;
}
#page-contrats .bystrt-tag.more{ background:transparent; color:var(--text3); font-style:normal; }

/* Détail déplié : fiches-cartes aérées (Claude Design « Vue Détails »), pleine largeur */
#page-contrats .bystrt-detail{ background:var(--surface-2); border-top:1px solid var(--border); padding:10px 16px 16px; }
#page-contrats .bystrt-detail-row{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radc2);
  box-shadow:var(--shadow-sm); padding:14px 18px; gap:14px 20px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
#page-contrats .bystrt-detail-row:hover{ border-color:var(--border2); box-shadow:var(--shadow-md); }
#page-contrats .bystrt-detail-row.selected{ border-color:var(--brand); background:var(--brand-050); }
#page-contrats .bystrt-detail-ref{ color:var(--accent); }
#page-contrats .bystrt-detail-nom{ color:var(--text); }
#page-contrats .bystrt-detail-lbl{ color:var(--text3); }
#page-contrats .bystrt-detail-val{ color:var(--text); }
#page-contrats .bystrt-detail-num{
  background:var(--surface-2); border:1px solid var(--border); border-radius:999px; color:var(--text3);
}

/* Détail déplié en TABLEAU — aligne « Liaison sous-traitant » sur l'affichage
   « Liaison clients » (.cc-eq-*). Les lignes gardent la classe .bystrt-detail-row
   (utilisée par la sélection JS) mais passent d'une fiche-carte à une ligne de tableau. */
#page-contrats .bystrt-eqt{
  border:1px solid var(--border); border-radius:var(--radc2,8px); overflow:hidden; background:var(--surface);
}
#page-contrats .bystrt-eqt-head,
#page-contrats .bystrt-eqt .bystrt-detail-row{
  display:grid;
  grid-template-columns:32px 46px 1.7fr 1.2fr 100px 100px 100px 150px 64px;
  gap:8px 14px; align-items:center; padding:8px 12px; margin:0;
}
#page-contrats .bystrt-eqt-head{
  font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.4px;
  color:var(--text3); background:var(--surface-2); border-bottom:1px solid var(--border);
}
#page-contrats .bystrt-eqt .bystrt-detail-row{
  background:var(--surface); border:0; border-bottom:1px solid var(--border);
  border-radius:0; box-shadow:none; font-size:12.5px; transition:background .15s ease;
}
#page-contrats .bystrt-eqt .bystrt-detail-row:last-child{ border-bottom:0; }
#page-contrats .bystrt-eqt .bystrt-detail-row:hover{ background:rgba(237,103,7,.05); box-shadow:none; }
#page-contrats .bystrt-eqt .bystrt-detail-row.selected{ background:var(--brand-050,rgba(237,103,7,.08)); border-color:var(--border); }
#page-contrats .bystrt-eqt-cb{ display:flex; align-items:center; justify-content:center; }
/* Équipement = titre de la ligne (info d'abord). La réf CTRSTR-… est MASQUÉE
   de l'affichage (clé interne uniquement : data-ref, édition, bon de commande, DC4). */
#page-contrats .bystrt-eqt-equip{ min-width:0; }
#page-contrats .bystrt-eqt-equip-main{ font-size:12.5px; font-weight:600; color:var(--text); line-height:1.3; overflow-wrap:anywhere; }
#page-contrats .bystrt-eqt-site{ font-size:11.5px; color:var(--text2); line-height:1.35; overflow-wrap:anywhere; }
#page-contrats .bystrt-eqt-interv{ font-size:11.5px; color:var(--text); }
#page-contrats .bystrt-eqt-act{ display:flex; gap:4px; justify-content:center; }
@media (max-width:1100px){
  #page-contrats .bystrt-eqt-head{ display:none; }
  #page-contrats .bystrt-eqt .bystrt-detail-row{ grid-template-columns:32px 44px 1fr 1fr; gap:4px 10px; }
}

/* ── Modale de confirmation/saisie (appConfirm/appPrompt) TOUJOURS au-dessus ──
   Les overlays custom (ex. dossier d'archive #archv-overlay z-index:9000, chatbot
   .cb-panel:9999) passaient devant la confirmation (.modal-bg:200) → boutons
   « Annuler/Restaurer » cachés derrière. On force #modal-app-dialog tout en haut. */
#modal-app-dialog{ z-index:10050; }
