/* ============================================================================
   DockedCRM - couche PRODUIT du design système (F10 socle, portage T4).
   Consomme les tokens de marque de prysmial-tokens.css (copie canonique, shasum
   épinglé par tests/design-socle.test.mjs). Règles transverses de la charte :
     1. AUCUNE couleur en dur ici : tout passe par var(--pr-*) ou un color-mix()
        documenté avec son ratio mesuré (les ratios appartiennent au COUPLE
        teinte+fond papier chaud : changer un fond invalide les pourcentages).
     2. UN SEUL accent d'action (iris). Azur/mint = décor et sémantique.
        Les dégradés = filets/halos, jamais le fond d'une zone de lecture.
     3. DEUX valeurs par état : --X (non-texte, 3:1), --X-text (texte, 4.5:1).
        --pr-ink-faint jamais en texte (2.84:1, échoue AA).
     4. Focus en OUTLINE, jamais en box-shadow, jamais retiré sans remplacement.
     5. Serif = signature (wordmark, nom d'espace, heroes), jamais un paragraphe.
     6. Pas de carte dans une carte : sous-blocs séparés par un filet, rangées
        posées sur --pr-mist-soft (blanc sur blanc ne se voit pas).
     7. font-family: inherit sur TOUS les contrôles (sans lui Chrome rend les
        boutons en Arial, bug mesuré en prod amont).
   Cette feuille est GLOBALE : les panels sont injectés par innerHTML dans
   #zone-panel, un <style> de panel ferait FOUC et doublons a chaque navigation.
   ============================================================================ */

@import url("prysmial-tokens.css"); /* DOIT rester la première règle */

/* ---- Fontes auto-hébergées (CSP font-src 'self', zéro CDN, hors-ligne) --------
   Les 8 woff2 sont des VARIABLE FONTS (table fvar vérifiée au portage). La source
   amont déclarait Inter « 300 600 » et employait 620-750 : le navigateur
   SYNTHÉTISAIT ces graisses. Ici : 300 800, l'axe réel couvre. */
@font-face{font-family:"Inter";font-style:normal;font-weight:300 800;font-display:swap;src:url("fonts/inter-latin.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Inter";font-style:normal;font-weight:300 800;font-display:swap;src:url("fonts/inter-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Playfair Display";font-style:normal;font-weight:400 700;font-display:swap;src:url("fonts/playfair-latin.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Playfair Display";font-style:normal;font-weight:400 700;font-display:swap;src:url("fonts/playfair-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Playfair Display";font-style:italic;font-weight:400 600;font-display:swap;src:url("fonts/playfair-latin-italic.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Playfair Display";font-style:italic;font-weight:400 600;font-display:swap;src:url("fonts/playfair-latin-ext-italic.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"JetBrains Mono";font-style:normal;font-weight:400 500;font-display:swap;src:url("fonts/jetbrainsmono-latin.woff2") format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"JetBrains Mono";font-style:normal;font-weight:400 500;font-display:swap;src:url("fonts/jetbrainsmono-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}

/* ---- Tokens sémantiques du produit (ne font que POINTER vers --pr-*) ---------- */
:root {
  /* Accent d'ACTION : iris seul. azur/mint décoratifs. */
  --accent: var(--pr-iris);
  --accent-ink: var(--pr-white);
  --accent-text: var(--pr-iris-ink);
  --accent-wash: var(--pr-iris-wash);
  --solid: var(--pr-ink);          /* bouton plein encre : blanc dessus = 19:1 */
  --solid-ink: var(--pr-white);
  --grad: var(--pr-gradient-iris); /* accents décoratifs uniquement */

  /* Fonds et lignes */
  --bg: var(--pr-paper);
  --bg-2: var(--pr-mist-soft);
  --surface: var(--pr-white);
  --surface-2: var(--pr-mist-soft);
  --border: var(--pr-mist);
  --border-2: color-mix(in srgb, var(--pr-mist) 84%, var(--pr-ink-faint));
  /* Bordure de CHAMP : 86 % et pas 88 (3.01:1 mesuré au pire des trois fonds, WCAG 1.4.11) */
  --border-field: color-mix(in srgb, var(--pr-ink-faint) 86%, var(--pr-ink));
  --border-card: color-mix(in srgb, var(--pr-ink) 9%, transparent);
  --border-card-2: color-mix(in srgb, var(--pr-ink) 10%, transparent);

  /* Texte */
  --text: var(--pr-ink);
  --text-2: var(--pr-ink-muted);
  --text-3: var(--pr-ink-tertiary); /* PAS ink-faint : échoue AA */

  /* États : version texte dérivée (ratios mesurés sur papier chaud, ne pas retoucher
     les pourcentages sans re-mesurer) */
  --ok: var(--pr-ok);     --ok-text:   color-mix(in srgb, var(--pr-ok) 62%, var(--pr-ink));
  --warn: var(--pr-warn); --warn-text: color-mix(in srgb, var(--pr-warn) 68%, var(--pr-ink));
  --err: var(--pr-err);   --err-text:  color-mix(in srgb, var(--pr-err) 90%, var(--pr-ink));

  /* Rayons : comble les trous de la source amont (--r-md/--r-xl y étaient consommés
     mais jamais définis, les coins des heroes tombaient à 0) */
  --r-sm: var(--pr-r-sm);   /* 10px */
  --r: var(--pr-r);         /* 14px */
  --r-md: 12px;
  --r-lg: var(--pr-r-lg);   /* 20px */
  --r-xl: 24px;
  --r-slab: 8px;            /* grandes dalles : hero, workspace, shell */
  --r-pill: var(--pr-r-pill);

  /* Ombres : idem, --shadow-md manquait amont. Teintées encre FROIDE (#0b0f19),
     jamais noires (sur un papier froid, une ombre neutre paraît grise et sale). */
  --shadow-sm: var(--pr-shadow-sm);
  --shadow-md: 0 1px 2px rgb(11 15 25 / 0.05), 0 10px 24px -14px rgb(11 15 25 / 0.2);
  --shadow: var(--pr-shadow);
  --shadow-lg: var(--pr-shadow-lg);
  --shadow-primary: 0 1px 2px rgb(11 15 25 / 0.07), 0 12px 24px -16px rgb(106 71 255 / 0.8);
  --shadow-inset-field: inset 0 1px 0 rgb(11 15 25 / 0.025);

  /* Typo : Inter porte tout le texte, Playfair signe les titres. Le produit
     consomme désormais le TOKEN au lieu de redéclarer la pile : jusqu'à la révision
     du 2026-08-20, --pr-sans nommait « Instrument Sans », que ce produit n'embarque
     pas, et la couche produit contournait le token en silence. */
  --sans: var(--pr-sans);
  --serif: var(--pr-serif);
  --mono: var(--pr-mono);
  --ring: color-mix(in srgb, var(--accent) 26%, transparent);

  /* Filet de marque : le dégradé irisé du site à SIX arrêts, pas une tricolore
     approchée. Le magenta d'ouverture et le cyan avant le vert sont ce que réfracte
     réellement le prisme du hero : les retirer donne un dégradé, pas CELUI-LÀ. */
  --dk-prism: var(--pr-gradient-iris);
  --dk-prism-wash: var(--pr-gradient-prism-wash);
}

/* ---- Base ---------------------------------------------------------------------- */
body {
  margin: 0; font-family: var(--sans); font-size: 14px;
  color: var(--text);
  background: var(--pr-gradient-prism-wash), var(--bg);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-wash); color: var(--pr-ink); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[x-cloak] { display: none !important; }
a { color: var(--accent-text); }

h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; margin: 0 0 8px; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.015em; margin: 0 0 6px; }
h4 { font-size: 13px; font-weight: 650; margin: 0 0 6px; }
small { color: var(--text-2); }
code, pre, .mono { font-family: var(--mono); }
.tabular { font-variant-numeric: tabular-nums; }

/* ---- Contrôles de formulaire ----------------------------------------------------- */
button {
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  cursor: pointer;
  transition: background var(--pr-dur-fast) var(--pr-ease-glide),
              border-color var(--pr-dur-fast) var(--pr-ease-glide),
              transform var(--pr-dur-fast) var(--pr-ease-glide);
}
button:hover { background: var(--surface); }
button.primary {
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  border-color: transparent; box-shadow: var(--shadow-primary);
}
button.primary:hover { background: var(--pr-iris-ink); transform: translateY(-1px); }
button:disabled { opacity: 0.45; cursor: default; }
button:disabled:hover { transform: none; background: var(--surface-2); }
button.primary:disabled:hover { background: var(--accent); }
button.ghost { background: var(--surface); }
button.danger {
  color: var(--err-text); background: var(--surface);
  border-color: color-mix(in srgb, var(--err-text) 28%, var(--border));
}
button.danger:hover { background: color-mix(in srgb, var(--err) 8%, var(--surface)); }
button.btn-mini { padding: 4px 10px; font-size: 11.5px; border-radius: 9px; }
button.link, button.linkish {
  background: none; border: none; padding: 0; border-radius: 4px;
  color: var(--accent-text); text-decoration: underline; font-size: inherit;
}

input, textarea, select {
  font-family: inherit; font-size: 14px; color: var(--text);
  padding: 12px 13px; border-radius: 11px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--pr-ink-faint) 55%, var(--pr-mist));
  box-shadow: var(--shadow-inset-field);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
/* Bague de CHAMP en box-shadow (esthétique) : elle s'AJOUTE à la bague outline globale
   de :focus-visible, elle ne la remplace jamais (règle n°4 de la charte). */
input:focus, textarea:focus, select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring);
}
select { min-height: 42px; }

.field { margin-bottom: 14px; }
.field .label, .label {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 6px;
}
.field input, .field textarea, .field select { width: 100%; box-sizing: border-box; }
.value { font-size: 14px; }
label.field { display: block; }

/* Cases à cocher / radios : PAS des champs texte. Sans ce reset elles héritent du
   padding 12px et de la bordure des inputs et se déforment. accent-color = le seul
   accent d'action (iris), via token. */
input[type="checkbox"], input[type="radio"] {
  width: 16px; height: 16px; padding: 0; margin: 0;
  accent-color: var(--accent); box-shadow: none; flex: none;
}
input[type="file"] { padding: 8px 0; border: none; background: none; box-shadow: none; }
/* étiquette à case : texte 13px secondaire, case alignée */
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }

/* rangée de création compacte (multi-champs + bouton, remplace les formulaires nus) */
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-row input, .form-row select { flex: 1 1 150px; min-width: 0; }
.form-row button { flex: none; }

/* grille de champs pour les fiches longues ; .pleine étale un champ (textarea) */
.form-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); column-gap: 14px; }
.field.pleine { grid-column: 1 / -1; }

/* barre de filtres au-dessus d'une liste */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.toolbar .field { margin-bottom: 0; }

/* ---- Shell : bandeau + sidebar + zone de contenu --------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.top {
  grid-column: 1 / -1;
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 0 24px; box-sizing: border-box;
  background: color-mix(in srgb, var(--pr-panel) 92%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.logo { display: block; flex: none; }
.lg-iris { stop-color: var(--pr-iris); }
.lg-azur { stop-color: var(--pr-azur); }
.lg-mint { stop-color: var(--pr-mint); }
.wordmark {
  font-family: var(--serif); font-size: 21px; font-weight: 500;
  letter-spacing: -0.005em; color: var(--text);
}
.top .deconnexion { margin-left: auto; display: flex; gap: 8px; }

.nav {
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 64px; height: calc(100vh - 64px); box-sizing: border-box;
  overflow-y: auto;
  padding: 24px 14px 18px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--pr-panel) 72%, transparent);
}
.nav-espace {
  font-family: var(--serif); font-size: 21px; font-weight: 500;
  letter-spacing: -0.01em; margin: 0 0 2px; padding: 0 12px;
}
.nav-titre {
  font-size: 11.5px; color: var(--text-3); margin: 0 0 10px; padding: 0 12px;
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-height: 41px; padding: 0 12px 0 14px;
  border-radius: 11px; border: 1px solid transparent;
  background: transparent; box-shadow: none;
  font-size: 13px; font-weight: 520; color: var(--text-2);
  text-align: left; width: 100%; box-sizing: border-box;
}
.nav-item:hover { color: var(--text); background: var(--pr-mist-soft); }
/* Pastille d'urgences (T-D2) : compte ce qui appelle un geste. margin-right laisse la
   place au point iris de l'item actif (::after, right: 12px). */
.nav-badge {
  margin-left: auto; margin-right: 10px; flex: none;
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 640; font-variant-numeric: tabular-nums;
  background: var(--accent); color: var(--surface);
}
.nav-icon {
  width: 21px; height: 21px; display: grid; place-items: center; flex: none;
  font-size: 14px; color: var(--pr-ink-faint); /* décoratif : faint autorisé */
}
/* Actif, la signature de l'UI : fond blanc + DEUX repères iris (filet gauche, point droit) */
.nav-item.actif {
  color: var(--text); background: var(--surface);
  border-color: color-mix(in srgb, var(--pr-ink) 7%, transparent);
  box-shadow: var(--shadow-sm);
}
.nav-item.actif .nav-icon { color: var(--accent); }
.nav-item.actif::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 19px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-item.actif::after {
  content: ""; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: var(--r-pill);
  background: var(--accent);
}
main#zone-panel {
  padding: 32px clamp(20px, 4vw, 56px) 56px;
  min-width: 0;
}

/* ---- Login ------------------------------------------------------------------------ */
#login {
  min-height: 100vh; display: grid; place-items: center;
  padding: 24px; box-sizing: border-box;
}
.login-carte {
  width: min(100%, 470px); box-sizing: border-box;
  padding: 32px; border-radius: var(--r-lg);
  background: var(--pr-panel); border: 1px solid var(--border-card);
  box-shadow: var(--shadow-lg);
}
/* Bascule entre les deux formes de connexion (token d'instance / compte). Un BOUTON,
   pas un <a> : il ne navigue pas, il change l'ecran. Un lien qui ne mene nulle part
   ment au lecteur d'ecran et au clic du milieu. Le focus reste en `outline` : c'est une
   propriete distincte, qu'aucune ombre decorative posee plus tard ne peut ecraser. */
.lien-bas {
  display: block; width: 100%; margin-top: 14px; padding: 8px;
  background: none; border: 0; border-radius: var(--r-sm);
  font-family: inherit; font-size: 13px; color: var(--text-2);
  text-decoration: underline; cursor: pointer;
}
.lien-bas:hover { color: var(--text); background: var(--surface-2); }

.login-carte h1 {
  font-family: var(--serif); font-size: 32px; font-weight: 500;
  letter-spacing: -0.02em; margin: 0 0 4px;
}
.login-carte .sub { margin: 0 0 22px; }
.login-carte button.primary { width: 100%; margin-top: 4px; }

/* ---- Bandeau mode dégradé (recette deux-valeurs : fond lavis, filet 3px, texte -text) */
.bandeau-degrade {
  padding: 10px 16px; font-weight: 600; font-size: 13px;
  background: color-mix(in srgb, var(--pr-err) 8%, var(--pr-panel));
  border-left: 3px solid var(--pr-err);
  color: var(--err-text);
}

/* ---- Bandeau canal de mise à jour (portage delta T-D8) : même recette deux-valeurs
   que le mode dégradé ci-dessus, teinte ACCENT (annonce, pas une panne) ; .securite
   bascule sur la teinte -err (non reportable, elle mérite l'alerte). */
.bandeau-maj {
  padding: 10px 16px; font-size: 13px; display: flex; align-items: center;
  flex-wrap: wrap; gap: 4px 6px;
  background: color-mix(in srgb, var(--accent) 8%, var(--pr-panel));
  border-left: 3px solid var(--accent);
  color: var(--accent-text);
}
.bandeau-maj.securite {
  background: color-mix(in srgb, var(--pr-err) 8%, var(--pr-panel));
  border-left-color: var(--pr-err);
  color: var(--err-text);
}
.bandeau-maj .maj-sub { opacity: .78; }
.bandeau-maj .maj-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.bandeau-maj .maj-msg { width: 100%; font-size: 12px; opacity: .85; }

/* ---- Gabarit de VUE (le pattern central de chaque panel) --------------------------
   <section class="view">
     <header class="view-hero"> kicker + h2 + .sub </header>
     <div class="view-workspace"> toolbar / split / listes / detail-shell </div>
   </section> */
.view {
  max-width: 1120px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 16px;
  /* Entrée de vue à l'injection innerHTML (mouvement T4b). Durées/easing par tokens :
     prefers-reduced-motion les met à 0 dans prysmial-tokens.css, rien à refaire ici.
     ⚠ KB : `both` fait POSSÉDER opacity/transform à l'animation après sa fin : aucune
     autre règle ne doit poser ces deux propriétés sur .view (elle serait ignorée). */
  animation: view-in var(--pr-dur-slow) var(--pr-ease-prism) both;
}
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
.view-hero {
  position: relative; overflow: hidden;
  padding: 26px 28px 24px; border-radius: var(--r-slab);
  background: var(--dk-prism-wash), var(--pr-panel);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
}
.view-hero::before { /* filet prisme 3px, la marque */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--dk-prism);
}
.view-hero::after { /* chevron du sigle en filigrane */
  content: "\203A"; position: absolute; right: 18px; top: 50%;
  transform: translateY(-58%);
  font-size: 104px; line-height: 1; font-weight: 700; opacity: 0.13;
  color: var(--accent); pointer-events: none;
}
.view-hero h2 {
  font-size: clamp(28px, 3vw, 38px); font-weight: 620;
  letter-spacing: -0.045em; line-height: 1.05; margin: 10px 0 6px;
}
.section-kicker {
  display: inline-block; margin: 0;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 10px; font-weight: 750; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--accent-text);
}
.sub { font-size: 14px; color: var(--text-2); line-height: 1.55; max-width: 670px; margin: 0; }
.view-workspace {
  display: flex; flex-direction: column; gap: 14px;
  padding: clamp(16px, 2vw, 22px); border-radius: var(--r-slab);
  background: var(--surface);
  border: 1px solid var(--border-card-2);
  box-shadow: var(--shadow-sm);
}
.view-workspace .msg:empty { display: none; }

/* ---- Cartes ------------------------------------------------------------------------ */
.section-card {
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border-card); box-shadow: var(--shadow-sm);
  padding: clamp(17px, 2.2vw, 24px);
}
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.section-head p { font-size: 13px; color: var(--text-2); margin: 0; }
.detail-shell {
  border-radius: var(--r-slab); border: 1px solid var(--border-card-2);
  background: var(--surface); box-shadow: var(--shadow-sm);
  overflow: hidden; padding: 0;
}
.detail-shell-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; background: var(--pr-mist-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--pr-ink) 8%, transparent);
}
.detail-shell-head h3 { font-size: 14.5px; margin: 0; }
.detail-shell-head .btn-mini { margin-left: auto; }
.detail-shell-body {
  display: flex; flex-direction: column; gap: 16px;
  padding: clamp(16px, 2vw, 22px);
}
/* Pas de carte dans une carte : les sous-blocs deviennent des sections à filet */
.detail-card.flat + .detail-card.flat { border-top: 1px solid var(--border); padding-top: 16px; }

/* ---- Split liste / fiche + rangées -------------------------------------------------- */
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; }
/* variante deux colonnes égales (formulaire | liste) : rdv, time, todos, invoicing */
.split-egal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.client-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.client-row {
  position: relative; display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 44px; padding: 0 12px; box-sizing: border-box;
  border-radius: 10px; border: 1px solid transparent; background: transparent;
  box-shadow: none; font-size: 13px; text-align: left; color: var(--text);
}
.client-row:hover {
  border-color: color-mix(in srgb, var(--pr-ink) 8%, transparent);
  background: color-mix(in srgb, var(--pr-white) 65%, transparent);
}
.client-row.actif {
  background: var(--surface); box-shadow: var(--shadow-sm);
  border-color: color-mix(in srgb, var(--pr-ink) 7%, transparent);
}
.client-row.actif::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 19px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.liste-rangs { display: flex; flex-direction: column; gap: 6px; }
.read-row, .doc-row {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--pr-mist-soft); /* posées DANS une carte blanche */
  border: 1px solid var(--border-card);
  font-size: 13px;
}
/* rangée multi-lignes (briefs, messages de fil) : même peau, contenu empilé */
.read-row.bloc { flex-direction: column; align-items: stretch; gap: 6px; }
.titre-rang { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.read-row p { margin: 0; font-size: 13px; color: var(--text-2); }

/* ---- Chips et badges ----------------------------------------------------------------- */
.status-chip {
  display: inline-block; padding: 5px 9px; border-radius: var(--r-pill);
  background: var(--accent-wash); color: var(--accent-text);
  font-size: 11px; font-weight: 700;
}
.cstatut {
  display: inline-block; padding: 3px 7px; border-radius: var(--r-pill);
  background: var(--pr-mist-soft); color: var(--text-2);
  font-size: 9.5px; font-weight: 650;
}
/* Variantes sémantiques : le fond reste mist-soft, PLUS CLAIR que le papier chaud des
   ratios mesurés (--X-text y tient 4.5:1) : assombrir le fond invaliderait la mesure,
   l'éclaircir ne fait que monter le contraste (règle n°4 de la charte : un ratio
   appartient au couple teinte+fond, ici on reste du côté sûr du couple). */
.cstatut.ok { color: var(--ok-text); }
.cstatut.warn { color: var(--warn-text); }
.cstatut.err { color: var(--err-text); }
.doc-badge {
  display: inline-block; padding: 3px 8px; border-radius: var(--r-pill);
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--accent-wash); color: var(--accent-text);
}
.doc-badge.neutre { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

/* ---- Messages et états ----------------------------------------------------------------
   .msg est le canal de feedback inline (.msg.err / .msg.ok). L'alias .erreur de la
   migration T4 a été retiré en T4b : les 13 volets sont tous passés à .msg.err
   (tests/design-panels.test.mjs le garantit pour tout volet futur). */
.msg { font-size: 12px; min-height: 15px; margin: 0; }
.msg.err { color: var(--err-text); }
.msg.ok { color: var(--ok-text); }
.guide-note {
  padding: 12px 14px; border-radius: var(--r-slab);
  background: var(--pr-mist-soft); border: 1px solid var(--pr-mist);
  font-size: 13px; color: var(--text-2);
}
.guide-note .label { color: var(--accent-text); margin-bottom: 4px; }
.empty {
  display: grid; place-content: center; gap: 8px; text-align: center;
  min-height: 380px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border-card);
  color: var(--text-3); font-size: 12.5px;
}
.empty .glyphe { font-size: 26px; opacity: 0.5; }
.empty-compact { color: var(--text-3); font-size: 12.5px; margin: 0; }
li.empty-compact { list-style: none; }
/* aide discrète sous un titre ou un contrôle */
.hint { font-size: 12px; color: var(--text-2); margin: 0; }
/* tâche faite, texte barré (remplace le :style inline du volet todos) */
.raye { text-decoration: line-through; color: var(--text-3); }

/* ---- Table de données (réglages) -------------------------------------------------------
   Tête en étiquette 10px uppercase, rangées sur mist-soft à coins arrondis : la table vit
   DANS la carte blanche du workspace, des rangées blanches ne se verraient pas (règle n°6). */
table.donnees { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
table.donnees th {
  font-size: 10px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--text-3); text-align: left; padding: 0 12px;
}
table.donnees td {
  background: var(--pr-mist-soft); font-size: 13px; padding: 10px 12px;
  border-top: 1px solid var(--border-card); border-bottom: 1px solid var(--border-card);
}
table.donnees td:first-child { border-left: 1px solid var(--border-card); border-radius: var(--r-md) 0 0 var(--r-md); }
table.donnees td:last-child { border-right: 1px solid var(--border-card); border-radius: 0 var(--r-md) var(--r-md) 0; }

/* lecteur audio du volet dictée : jamais plus large que sa rangée */
audio { display: block; width: 100%; max-width: 420px; }

/* ---- Rangée de saisie du gabarit (formulaire inline champ + bouton) ------------------- */
.barre-saisie { display: flex; gap: 8px; align-items: stretch; }
.barre-saisie input { flex: 1; min-width: 0; }
/* une question tient sur deux lignes : meme rangee, champ multiligne (volet assistant) */
.barre-saisie textarea { flex: 1; min-width: 0; resize: vertical; }

/* ---- Tuiles KPI (finances) : un chiffre, son étiquette, son aide --------------------------
   Recette GÉNÉRIQUE de la feuille globale (aucun CSS de module dans le shell, décision
   lego n°15) : tout panel qui veut une rangée de chiffres la réutilise telle quelle.
   .ok / .danger colorent le CHIFFRE seulement : deux tuiles voisines peuvent porter des
   verdicts opposés sans que la rangée crie. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi {
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--pr-mist-soft); border: 1px solid var(--border-card);
}
.kpi strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.kpi.ok strong { color: var(--ok-text); }
.kpi.danger strong { color: var(--err-text); }

/* ---- Responsive ------------------------------------------------------------------------ */
@media (max-width: 920px) {
  .app-shell { display: block; }
  .nav {
    position: sticky; top: 64px; z-index: 15;
    flex-direction: row; align-items: center; gap: 4px;
    height: auto; padding: 8px 12px; overflow-x: auto;
    border-right: none; border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--pr-panel) 92%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .nav-espace, .nav-titre { display: none; }
  .nav-item { width: auto; white-space: nowrap; min-height: 38px; }
  .nav-item.actif::after { display: none; }
  .split, .split-egal { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  main#zone-panel { padding: 18px 14px 40px; }
  .view-hero { padding: 20px 18px; }
  .view-hero::after { display: none; }
}
