/* ================================================================
   Cover AR PWA - système de design
   Base noir/blanc/gris (marque). La partie "app" personnalisée par
   tenant (tableau de bord, simulateur, calculateur, ainsi que /admin
   depuis ce lot) n'expose que 4 rôles de couleur : arrière-plan, texte,
   accent (titres/boutons - seul rôle piloté par le tenant), texte de
   bouton (contraste calculé côté PHP, voir App\Helpers\Couleur). L'auth
   et le back-office plateforme (/heaven) restent seuls non brandés par
   design - même apparence pour tous, quel que soit le tenant.
   ================================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; line-height: 1.6; }

:root {
    /* Neutres (marque) - gris chaud (légère dominante beige/brune), pas gris
       froid/bleuté : évite l'effet "clinique" tout en restant noir/blanc/gris. */
    --gris-50:  #f5f2ed;
    --gris-100: #f3f1ee;
    --gris-200: #e6e2dc;
    --gris-300: #d3ccc3;
    --gris-500: #8a8177;
    --gris-700: #4a443d;
    --gris-900: #211d19;
    --blanc:    #ffffff;

    /* Rôles fonctionnels */
    --fond:        var(--blanc);       /* surfaces : cartes, feuilles, champs */
    --fond-page:   var(--gris-50);     /* arrière-plan de page - jamais identique aux surfaces posées dessus */
    --texte:       var(--gris-900);
    --texte-doux:  var(--gris-500);
    --bordure:     var(--gris-200);
    --accent:       var(--tenant-primaire, var(--gris-900));
    --accent-teinte: color-mix(in srgb, var(--accent) 12%, var(--fond));
    --texte-bouton: var(--tenant-texte-bouton, var(--blanc));

    /* Fixe (jamais inversé en mode sombre) - chrome utilitaire volontairement
       toujours sombre : barre /heaven (super-admin), bandeau d'installation iOS. */
    --chrome-fond:  #211d19;
    --chrome-texte: #ffffff;

    /* États */
    --danger:  #dc2626;
    --danger-fond: #fef2f2;
    --succes:  #16a34a;
    --succes-fond: #f0fdf4;
    --attention: #b45309;
    --attention-fond: #fffbeb;

    /* Espacement (échelle 4px) */
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
    --s-5: 24px; --s-6: 32px; --s-8: 48px;

    /* Rayons - généreux, comme dans la maquette validée */
    --r-sm: 12px; --r-md: 18px; --r-lg: 26px; --r-xl: 34px; --r-full: 999px;

    /* Ombres - diffuses, jamais de glow coloré, mais perceptibles : sur un fond
       de page déjà légèrement teinté (--fond-page), une ombre trop discrète ne
       lit plus du tout comme de la profondeur. */
    --ombre-sm: 0 1px 3px rgba(33,29,25,.07);
    --ombre-md: 0 2px 8px rgba(33,29,25,.06), 0 10px 28px -8px rgba(33,29,25,.14);
    --ombre-lg: 0 12px 20px -6px rgba(33,29,25,.12), 0 24px 48px -16px rgba(33,29,25,.22);

    /* Mouvement - easing "spring" avec léger dépassement (interactions courtes),
       easing standard sans dépassement (panneaux/feuilles plus grands) */
    --ease: cubic-bezier(.16,1,.3,1);
    --ease-spring: cubic-bezier(.34,1.56,.64,1);
    --dur-fast: 150ms;
    --dur-normal: 250ms;

    /* Mode sombre volontairement désactivé : la personnalisation tenant (accent
       + logo) n'est pensée que pour un fond clair fixe - pas de bascule
       automatique avec le thème système. */
    color-scheme: light;
}

/* ================================================================
   Reset & base
   ================================================================ */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    /* Police système uniquement, comme dans la maquette validée - vrai San
       Francisco sur Mac/iPhone/iPad, Segoe UI sur Windows : aucune police web
       ne peut imiter l'une ou l'autre, autant utiliser la vraie. */
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    background: var(--fond-page);
    color: var(--texte);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

h1, h2, h3, h4 { margin: 0 0 var(--s-2); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p  { margin: 0 0 var(--s-3); }

a { color: inherit; }

::selection { background: var(--accent); color: var(--texte-bouton); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ================================================================
   Formulaires
   ================================================================ */

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: var(--s-4) 0 var(--s-2);
    color: var(--texte);
}

input[type=text], input[type=email], input[type=password], input[type=search],
input[type=number], input[type=file], select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--bordure);
    border-radius: var(--r-sm);
    font: inherit;
    font-size: 15px;
    background: var(--fond);
    color: var(--texte);
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
    min-height: 44px;
}

input[type=color] {
    width: 56px;
    height: 44px;
    padding: 4px;
    border: 1.5px solid var(--bordure);
    border-radius: var(--r-md);
    background: var(--fond);
    cursor: pointer;
}

/* Le sélecteur natif <input type=color> n'expose pas toujours la saisie
   hexadécimale en premier (dépend du navigateur/OS) - ce champ texte à côté
   permet de taper/coller un code directement, synchronisé avec le sélecteur. */
.champ-couleur { display: flex; align-items: center; gap: var(--s-2); }
.champ-couleur input[type=color] { flex: none; }
.champ-couleur input[type=text] { flex: 1; min-width: 0; text-transform: lowercase; }

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

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

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

label > input[type=checkbox] { width: auto; min-height: 0; }

.champ-hint { font-size: 12px; color: var(--texte-doux); margin-top: var(--s-1); }

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-3); }
@media (max-width: 480px) { .grille-2 { grid-template-columns: 1fr; } }
.field label { margin-top: 0; }

/* ================================================================
   Boutons & liens
   ================================================================ */

.btn, .btn-secondaire {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    width: 100%;
    min-height: 46px;
    padding: 12px 20px;
    margin-top: var(--s-4);
    border: none;
    border-radius: var(--r-sm);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    transition: transform var(--dur-fast) var(--ease-spring), opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.btn {
    background: var(--accent);
    color: var(--texte-bouton);
}

.btn:hover { opacity: .92; }
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* "Tinted" - teinte de l'accent en fond, texte dans l'accent, jamais de
   bordure grise : le bouton secondaire caractéristique d'iOS. */
.btn-secondaire {
    background: color-mix(in srgb, var(--accent) 12%, var(--fond));
    color: var(--accent);
    border: none;
}

.btn-secondaire:hover { background: color-mix(in srgb, var(--accent) 18%, var(--fond)); }
.btn-secondaire:active { transform: scale(.96); }

/* Action destructive (ex. désactiver un utilisateur). */
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .92; }
.btn-danger:active { transform: scale(.96); }

.lien { color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; }
.lien:hover { text-decoration: underline; }

/* Bouton <button> stylé comme .lien - actions inline dans un tableau (ex.
   colonne actions de superadmin/factures.php) où un vrai lien <a> n'a pas de
   sens (l'action déclenche un POST, pas une navigation GET). */
.lien-bouton { background: none; border: none; padding: 0; margin: 0; cursor: pointer; color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600; font-family: inherit; }
.lien-bouton:hover { text-decoration: underline; }

.pied { text-align: center; margin-top: var(--s-5); font-size: 13px; color: var(--texte-doux); }

/* Instructions d'installation iOS (page de connexion) - repliées par défaut,
   captures d'écran réelles fournies par l'utilisateur (voir assets/img/install/). */
.installer-ios { margin-top: var(--s-5); text-align: center; }
.installer-ios summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); }
.installer-ios summary:hover { text-decoration: underline; }
.installer-ios__intro { margin: var(--s-3) 0 0; font-size: 13px; color: var(--texte-doux); }
.installer-ios__etapes {
    display: flex; gap: var(--s-4); margin-top: var(--s-4);
    overflow-x: auto; padding: var(--s-1) var(--s-1) var(--s-2);
    text-align: left;
}
.installer-ios__etape { flex: 0 0 140px; }
.installer-ios__etape img {
    display: block; width: 100%; border-radius: var(--r-md);
    border: 1px solid var(--bordure); box-shadow: var(--ombre-sm);
}
.installer-ios__etape figcaption {
    display: flex; align-items: flex-start; gap: var(--s-2);
    margin-top: var(--s-2); font-size: 12px; color: var(--texte);
}
.installer-ios__numero {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: var(--r-full);
    background: var(--accent); color: var(--texte-bouton);
    font-size: 10px; font-weight: 700;
}

/* Boutons compacts (tableaux, barres de filtre, formulaires en ligne) -
   capsules pleinement arrondies plutôt que des rectangles à coins coupés. */
.table-admin .btn, .table-admin .btn-secondaire,
.filtre-bar .btn, .filtre-bar .btn-secondaire {
    border-radius: var(--r-full);
}

/* ================================================================
   Alertes / badges
   ================================================================ */

.alerte {
    padding: 13px 16px;
    border-radius: var(--r-md);
    font-size: 14px;
    margin-bottom: var(--s-4);
    border: 1px solid transparent;
}

.alerte-erreur { background: var(--danger-fond); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alerte-succes { background: var(--succes-fond); color: var(--succes); border-color: color-mix(in srgb, var(--succes) 25%, transparent); }
.alerte-attention { background: var(--attention-fond); color: var(--attention); border-color: color-mix(in srgb, var(--attention) 25%, transparent); }
.alerte-attention a { color: inherit; font-weight: 700; }

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
    padding: 4px 10px;
    border-radius: var(--r-full);
    background: var(--gris-100);
    color: var(--texte-doux);
    white-space: nowrap;
}
.badge-actif      { background: var(--succes-fond); color: var(--succes); }
.badge-attention  { background: var(--attention-fond); color: var(--attention); }
.badge-danger     { background: var(--danger-fond); color: var(--danger); }

.badge-verif { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-top: var(--s-2); padding: 6px 12px; border-radius: var(--r-full); }
.badge-verif.ok      { background: var(--succes-fond); color: var(--succes); }
.badge-verif.attente { background: var(--gris-100); color: var(--texte-doux); }

/* ================================================================
   Pages centrées (connexion, inscription...)
   ================================================================ */

.page-centree {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--s-5) var(--s-4);
}

/* Lueur radiale à l'accent derrière la carte - seulement quand un tenant est
   résolu (sinon --accent retombe sur le neutre, sans intérêt en fond). */
.page-centree--brandee {
    background: radial-gradient(120% 70% at 50% 0%, var(--accent-teinte), transparent 65%);
}

.carte {
    width: 100%;
    max-width: 420px;
    background: var(--fond);
    border-radius: var(--r-lg);
    box-shadow: var(--ombre-md);
    padding: var(--s-6) var(--s-5);
}

.carte-large { max-width: 640px; }

/* Sélecteur de langue (CDC i18n) - partials/selecteur_langue.php, réutilisé
   sur le tunnel auth (sous la carte) et sur la page Compte (dans la liste). */
.selecteur-langue { margin-top: var(--s-5); text-align: center; }
.selecteur-langue select {
    width: auto; min-height: 0; margin-top: 0; padding: 6px 10px;
    font-size: 12.5px; font-weight: 600; color: var(--texte-doux);
    background: var(--fond); border: 1px solid var(--bordure); border-radius: var(--r-full);
}
.compte-item-langue-form { margin-left: auto; }
.compte-item--langue select {
    width: auto; min-height: 0; padding: 6px 10px;
    font-size: 13px; font-weight: 600; color: var(--texte); background: var(--gris-100);
    border: none; border-radius: var(--r-full);
}

.carte h1 { font-size: 23px; margin-bottom: 4px; }

.sous-titre { color: var(--texte-doux); font-size: 14px; margin: 0 0 var(--s-5); }
h1 + .sous-titre, h2 + .sous-titre { margin-top: -4px; }

.marque-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
    font-weight: 800;
    font-size: 17px;
    letter-spacing: -.01em;
    position: relative; z-index: 1;
}
.marque-hero img {
    height: 64px; width: 64px; border-radius: 20px; object-fit: cover;
    box-shadow: var(--ombre-lg);
}

/* Page d'inscription (self-service, non brandée) - panneau marketing
   accolé au formulaire, plutôt qu'une carte de connexion nue : c'est la
   seule page publique qui doit convaincre un prospect, pas seulement
   authentifier un utilisateur existant. Fond sombre (--gris-900, la même
   neutralité noir/blanc/gris que le reste de la marque) plutôt qu'une
   nouvelle couleur : le contraste vient de la lumière, pas d'un accent. */
.carte-marketing { max-width: 1040px; padding: 0; overflow: hidden; }

.inscription-grid { display: grid; grid-template-columns: 1fr; }

.inscription-marketing {
    background: var(--gris-900);
    color: #fff;
    padding: var(--s-6) var(--s-5);
    display: flex;
    flex-direction: column;
    gap: var(--s-5);
}
.inscription-eyebrow {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: var(--r-full);
    background: rgba(255,255,255,.1);
    color: rgba(255,255,255,.85);
}
.inscription-marketing h1 { color: #fff; font-size: 25px; margin-bottom: var(--s-2); }
.inscription-marketing .sous-titre { color: rgba(255,255,255,.72); font-size: 14.5px; margin-bottom: 0; }

.inscription-benefices { list-style: none; display: flex; flex-direction: column; gap: var(--s-4); }
.inscription-benefice { display: flex; gap: var(--s-3); align-items: flex-start; }
.inscription-benefice-icone {
    flex: none;
    width: 36px; height: 36px;
    border-radius: var(--r-md);
    background: rgba(255,255,255,.1);
    display: flex; align-items: center; justify-content: center;
}
.inscription-benefice-icone svg { width: 18px; height: 18px; fill: #fff; }
.inscription-benefice-texte { display: block; }
.inscription-benefice-texte strong { display: block; font-size: 14px; margin-bottom: 2px; }
.inscription-benefice-desc { display: block; font-size: 13px; color: rgba(255,255,255,.65); line-height: 1.5; }

.inscription-confiance {
    margin-top: auto;
    padding-top: var(--s-4);
    border-top: 1px solid rgba(255,255,255,.14);
    font-size: 12.5px;
    color: rgba(255,255,255,.55);
}

.inscription-champ { padding: var(--s-6) var(--s-5); }
.inscription-champ h2 { font-size: 21px; margin-bottom: 4px; }

/* Aperçu en direct de l'étape 1 (personnalisation) - reproduction fidèle du
   bandeau héros réel de l'app (.dash-hero, tableau de bord), pour que le
   prospect se projette dans "son" application dès l'inscription plutôt que
   d'imaginer le résultat. Classes dédiées plutôt que réutilisation directe de
   .dash-hero : ce composant porte aussi des règles propres à la coquille
   applicative (ex. le rail latéral desktop qui lui ajoute une marge à
   768px+, voir plus bas) qui n'ont pas de sens ici, dans une carte
   d'inscription autonome - seule la recette visuelle (dégradé, typographie)
   est reprise, pas le composant lui-même. */
.apercu-app {
    margin-top: var(--s-5);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--ombre-md);
}
.apercu-hero {
    --accent: var(--gris-900);
    --texte-bouton: #fff;
    padding: 22px var(--s-4) 26px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(165deg,
        color-mix(in srgb, var(--accent) 94%, black 6%) 0%,
        var(--accent) 55%,
        color-mix(in srgb, var(--accent) 88%, white 12%) 100%);
    color: var(--texte-bouton);
    transition: background var(--dur-normal) var(--ease);
}
.apercu-hero::after {
    content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%;
    background: color-mix(in srgb, var(--texte-bouton) 10%, transparent);
    top: -90px; right: -50px; pointer-events: none;
}
.apercu-hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.apercu-hero-marque { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13.5px; opacity: .92; min-width: 0; }
.apercu-hero-marque img { width: 24px; height: 24px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.apercu-hero-marque span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apercu-hero-avatar {
    width: 32px; height: 32px; border-radius: var(--r-full); flex-shrink: 0;
    background: color-mix(in srgb, var(--texte-bouton) 20%, transparent);
    display: flex; align-items: center; justify-content: center;
}
.apercu-hero-avatar svg { width: 16px; height: 16px; fill: var(--texte-bouton); }
.apercu-hero h1 { position: relative; z-index: 1; font-size: 23px; margin: 20px 0 3px; font-weight: 800; color: var(--texte-bouton); text-align: center; }
.apercu-hero .sous-titre { position: relative; z-index: 1; color: color-mix(in srgb, var(--texte-bouton) 82%, transparent); margin-bottom: 0; font-size: 13px; text-align: center; }
.apercu-feuille { background: var(--fond-page); border-radius: var(--r-xl) var(--r-xl) 0 0; margin-top: -18px; height: 26px; position: relative; z-index: 3; }

@media (min-width: 860px) {
    .inscription-grid { grid-template-columns: 380px 1fr; align-items: stretch; }
}

/* En dessous de 860px, les descriptions des bénéfices s'effacent (garder le
   panneau court avant le formulaire) et la grille passe en 2 colonnes. */
@media (max-width: 859px) {
    .inscription-benefices { flex-direction: row; flex-wrap: wrap; gap: var(--s-4) var(--s-3); }
    .inscription-benefice { width: calc(50% - var(--s-2)); flex-direction: column; align-items: flex-start; }
    .inscription-benefice-desc { display: none; }
}

/* ================================================================
   Chrome utilitaire - back-office plateforme non brandé (/heaven)
   ================================================================ */

.app-shell { min-height: 100dvh; display: flex; flex-direction: column; background: var(--fond-page); }

.app-header {
    background: var(--chrome-fond);
    color: var(--chrome-texte);
    padding: var(--s-4) var(--s-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
}

.app-header .marque { display: flex; align-items: center; gap: var(--s-2); font-weight: 700; font-size: 15px; }
.app-header .marque img { height: 26px; width: 26px; border-radius: var(--r-sm); object-fit: cover; }
.app-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1); }
.app-header nav a { color: var(--chrome-texte); opacity: .78; text-decoration: none; font-size: 13.5px; font-weight: 600; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); transition: opacity var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.app-header nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }

.app-content { flex: 1; padding: var(--s-5) var(--s-4) var(--s-8); max-width: 1000px; margin: 0 auto; width: 100%; }
@media (min-width: 768px) { .app-content { padding: var(--s-6) var(--s-5) var(--s-8); } }

/* Contrôle segmenté façon iOS : capsule grise, segment actif porté par une
   pastille pleine (fond + ombre légère) plutôt qu'un simple soulignement. */
.onglets {
    display: flex; gap: 2px; background: var(--gris-100); padding: 3px;
    border-radius: var(--r-full); margin-bottom: var(--s-5);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.onglets a {
    flex-shrink: 0; padding: var(--s-2) var(--s-4); text-decoration: none;
    color: var(--texte-doux); font-size: 13.5px; font-weight: 600;
    border-radius: var(--r-full); transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.onglets a.actif { color: var(--accent); background: var(--fond); box-shadow: var(--ombre-sm); }
.onglets a:hover:not(.actif) { color: var(--texte); }
/* Onglet bloqué (Router::admin_abonnement_actif) : ni lien, ni hover. */
.onglets span.onglet-off { flex-shrink: 0; padding: var(--s-2) var(--s-4); font-size: 13.5px; font-weight: 600; border-radius: var(--r-full); color: var(--gris-300); cursor: not-allowed; }

/* ================================================================
   Tableau de bord - bandeau héros teinté à l'accent + stats flottantes
   ================================================================ */

/* Bandeau héros unifié : rendu par app_shell_header.php en tout premier dans
   .shell (avant .dash-feuille/.shell-main, pas imbriqué dedans) - donc en
   pleine largeur nativement, aucun repli de marge négative nécessaire. */
.dash-hero {
    padding: 22px var(--s-4) 30px;
    position: relative; overflow: hidden;
    background: linear-gradient(165deg,
        color-mix(in srgb, var(--accent) 94%, black 6%) 0%,
        var(--accent) 55%,
        color-mix(in srgb, var(--accent) 88%, white 12%) 100%);
    color: var(--texte-bouton);
}
.dash-hero::after {
    content: ''; position: absolute; width: 240px; height: 240px; border-radius: 50%;
    background: color-mix(in srgb, var(--texte-bouton) 10%, transparent);
    top: -120px; right: -60px; pointer-events: none;
}
.dash-hero-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.dash-hero-marque { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13.5px; opacity: .92; min-width: 0; }
.dash-hero-marque img { width: 24px; height: 24px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.dash-hero-marque span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-hero-avatar {
    width: 32px; height: 32px; border-radius: var(--r-full); flex-shrink: 0;
    background: color-mix(in srgb, var(--texte-bouton) 20%, transparent);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
/* color/font-weight explicites (pas seulement hérités) : sur simulateur/
   calculateur, base.css charge APRÈS app.css et redéclare son propre h1
   (font-weight, color) avec la même spécificité element - sans ceci, son
   h1{font-weight:600;color:var(--color-text)} gagnerait par ordre de source
   et le titre du héros perdrait son gras et son contraste sur fond accent. */
.dash-hero h1 { position: relative; z-index: 1; font-size: 27px; margin: 22px 0 3px; font-weight: 800; color: var(--texte-bouton); }
.dash-hero .sous-titre { position: relative; z-index: 1; color: color-mix(in srgb, var(--texte-bouton) 82%, transparent); margin-bottom: var(--s-5); }

/* Simulateur / calculateur / compte : titre centré, un peu plus d'air en bas
   (pas de salutation personnelle ni de rangée de stats à équilibrer comme
   sur l'accueil). */
.dash-hero--centre h1, .dash-hero--centre .sous-titre { text-align: center; }
.dash-hero--centre h1 { margin-bottom: var(--s-2); }
.dash-hero--centre { padding-bottom: 38px; }
.dash-hero--centre .dash-stats { margin-top: var(--s-2); }

.dash-stats {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    background: color-mix(in srgb, var(--texte-bouton) 14%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid color-mix(in srgb, var(--texte-bouton) 18%, transparent);
    border-radius: var(--r-md);
    padding: var(--s-3) var(--s-4);
}
.dash-stats .item { text-align: center; }
.dash-stats .item .n { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1; }
.dash-stats .item .l { font-size: 10px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.dash-stats .sep { width: 1px; height: 24px; background: color-mix(in srgb, var(--texte-bouton) 22%, transparent); }
/* Un seul stat (ex. crédits sur le simulateur) : pas de répartition à gauche,
   contenu centré dans le bloc translucide. */
.dash-stats:has(> .item:only-child) { justify-content: center; }

/* Feuille de contenu qui glisse sur le bas plat du bandeau héros (mêmes
   proportions que la maquette : chevauchement de 18px, coins arrondis).
   Enveloppe <main class="shell-main">, qui garde son propre padding/largeur
   max pour le contenu - .dash-feuille ne fournit que le fond/l'arrondi. */
.dash-feuille {
    background: var(--fond-page);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    margin-top: -18px;
    padding-top: 6px;
    position: relative; z-index: 3;
}

@media (min-width: 768px) {
    /* Navigation restée en barre du bas (comme mobile, voir .shell-nav) :
       plus de rail latéral à décaler - .dash-hero/.shell-main sont juste
       recentrés dans un conteneur plus large (1100px), avec le fond de page
       visible de part et d'autre sur un très grand écran. Coins carrés
       (pas de border-radius en haut, décision explicite) plutôt qu'une carte
       arrondie flottante. */
    .dash-hero { max-width: 1100px; margin-left: auto; margin-right: auto; border-radius: 0; padding: 40px var(--s-6) 30px; }
    .dash-feuille { border-radius: 0; }
}

/* ================================================================
   Tableau de bord - activité récente
   ================================================================ */

.dash-activite { background: var(--fond); border: 1px solid var(--bordure); border-radius: var(--r-lg); box-shadow: var(--ombre-sm); padding: 4px; margin-bottom: var(--s-2); }
.dash-activite-ligne { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-bottom: 1px solid var(--bordure); text-decoration: none; color: var(--texte); }
.dash-activite-ligne:last-child { border-bottom: none; }
.dash-activite-vignette {
    width: 44px; height: 44px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, var(--bordure)), var(--bordure));
}
.dash-activite-texte { flex: 1; min-width: 0; }
.dash-activite-texte .t { font-size: 13.5px; font-weight: 700; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-activite-texte .s { font-size: 12px; color: var(--texte-doux); }
.dash-vide { text-align: center; padding: var(--s-5) var(--s-4); color: var(--texte-doux); font-size: 13.5px; }

.section-label { font-size: 11px; font-weight: 700; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 var(--s-3); }

/* Grille d'outils du tableau de bord - toujours 2 colonnes, y compris mobile
   (contrairement à .grille-modules, qui s'empile sous 460px environ). */
.grille-outils { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-bottom: var(--s-6); }
.outil-carte {
    background: var(--fond); border-radius: var(--r-md); padding: var(--s-4) var(--s-3);
    box-shadow: var(--ombre-sm); border: 1px solid var(--bordure);
}
.outil-icone {
    width: 38px; height: 38px; border-radius: 12px; background: var(--accent-teinte); color: var(--accent);
    display: flex; align-items: center; justify-content: center; margin-bottom: var(--s-3);
}
.outil-icone svg { width: 20px; height: 20px; }
.outil-carte h4 { margin: 0 0 3px; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.outil-carte p { margin: 0 0 var(--s-2); font-size: 11.5px; color: var(--texte-doux); line-height: 1.4; }
.pastille-dispo {
    display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700;
    color: var(--succes); background: var(--succes-fond); padding: 3px 8px; border-radius: var(--r-full);
}
.pastille-dispo::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--succes); }

/* Sans abonnement actif (Router::abonnement_actif) : outil grisé, non cliquable */
.outil-carte--indisponible { opacity: .55; }
.pastille-dispo--off { color: var(--texte-doux); background: var(--gris-100); }
.pastille-dispo--off::before { background: var(--texte-doux); }

/* ================================================================
   Cartes de modules / grilles
   ================================================================ */

.grille-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s-4); margin-top: var(--s-5); }

.module-carte {
    background: var(--fond);
    border: 1px solid var(--bordure);
    border-radius: var(--r-xl);
    padding: var(--s-5);
    transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
a > .module-carte:hover, .module-carte:has(a:hover) { transform: translateY(-2px); box-shadow: var(--ombre-md); border-color: var(--gris-300); }
a:active > .module-carte, .module-carte:has(a:active) { transform: scale(.98); }

.module-icone {
    width: 44px; height: 44px; border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: var(--s-3); flex-shrink: 0;
    background: var(--accent-teinte); color: var(--accent);
}
.module-icone svg { width: 22px; height: 22px; }

.module-carte h3 { margin: 0 0 var(--s-1); font-size: 15px; }
.module-carte p { margin: 0; font-size: 13px; color: var(--texte-doux); }
.module-carte .etat { display: inline-block; margin-top: var(--s-3); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-full); background: var(--gris-100); color: var(--texte-doux); }

.liste-espaces { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.espace-btn {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: var(--s-4); border: 1.5px solid var(--bordure); border-radius: var(--r-md);
    background: var(--fond); text-decoration: none; color: var(--texte); font-weight: 600;
    transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.espace-btn:hover { border-color: var(--gris-300); }
.espace-btn:active { transform: scale(.99); }
.espace-btn .role { font-size: 12px; font-weight: 500; color: var(--texte-doux); }

/* ================================================================
   Filtres & tableaux (back-offices)
   ================================================================ */

.filtre-bar { display: flex; gap: var(--s-3); align-items: flex-end; margin-bottom: var(--s-5); flex-wrap: wrap; }
.filtre-bar label { margin: 0 0 var(--s-2); }
.filtre-bar .btn, .filtre-bar .btn-secondaire { width: auto; margin-top: 0; }

.table-admin-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--bordure); border-radius: var(--r-lg); background: var(--fond); }
.table-admin { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table-admin th, .table-admin td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--bordure); text-align: left; vertical-align: middle; }
.table-admin th { background: var(--gris-50); font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); }
.table-admin tr:last-child td { border-bottom: none; }
.table-admin input[type=text], .table-admin input[type=number], .table-admin input[type=color],
.table-admin select, .table-admin textarea { padding: 8px 10px; font-size: 13px; min-height: 38px; }
.table-admin textarea { min-height: 44px; }
.table-admin .btn, .table-admin .btn-secondaire { width: auto; padding: 7px 14px; margin-top: 0; font-size: 12.5px; min-height: 34px; }
/* .btn-danger (ex. désactiver un utilisateur) reste pleine largeur même dans
   .table-admin - une action irréversible-ish comme celle-ci ne doit pas se
   noyer parmi les boutons compacts du panneau (voir règle ci-dessus). */
.table-admin .btn-danger { width: 100%; }
.table-admin .archive-row { opacity: .5; }

/* Interrupteur (toggle switch) - même esprit que .sim-toggle-switch du
   simulateur/calculateur (assets/css/simulateur-vendor/simulateur.css),
   décliné avec les tokens app.css pour les listes admin (ex. activation
   d'une catégorie, admin/categories.php et /heaven). Case à cocher réelle
   (accessible, focus visible) habillée en piste + curseur coulissant ;
   soumet son formulaire au changement plutôt qu'un clic sur un bouton texte. */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input {
    position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1;
}
.toggle-switch-piste {
    position: absolute; inset: 0; background: var(--bordure); border-radius: var(--r-full);
    transition: background var(--dur-fast) var(--ease);
    pointer-events: none;
}
.toggle-switch-piste::after {
    content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; box-shadow: var(--ombre-sm);
    transition: transform var(--dur-fast) var(--ease-spring);
}
.toggle-switch input:checked + .toggle-switch-piste { background: var(--accent); }
.toggle-switch input:checked + .toggle-switch-piste::after { transform: translateX(18px); }
.toggle-switch input:focus-visible + .toggle-switch-piste { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-switch input:disabled { cursor: not-allowed; }
.toggle-switch input:disabled + .toggle-switch-piste { opacity: .5; }

/* Version empilée (cartes) sous 640px - réservée aux tables les plus utilisées
   côté tenant (admin/utilisateurs, admin/categories), via la classe
   .table-admin--empilable + un attribut data-label sur chaque <td>. Les
   tables super-admin plus denses gardent le défilement horizontal ci-dessus. */
@media (max-width: 640px) {
    .table-admin--empilable thead { display: none; }
    .table-admin--empilable, .table-admin--empilable tbody, .table-admin--empilable tr, .table-admin--empilable td { display: block; width: 100%; }
    .table-admin--empilable tr { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--bordure); }
    .table-admin--empilable tr:last-child { border-bottom: none; }
    .table-admin--empilable td { border-bottom: none; padding: 6px 0; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); text-align: right; }
    .table-admin--empilable td[data-label]::before {
        content: attr(data-label); font-weight: 700; font-size: 10.5px; text-transform: uppercase;
        letter-spacing: .04em; color: var(--texte-doux); text-align: left; flex-shrink: 0;
    }
    /* Colonne identité (nom + email, ex. admin/utilisateurs.php) : pas de
       data-label, alignée à gauche comme une ligne normale plutôt que
       poussée à droite comme les colonnes valeur/action. */
    .table-admin--empilable td:has(.identite-utilisateur) { justify-content: flex-start; text-align: left; }
}

/* Identité utilisateur (nom en gras + email) sur une seule ligne, aussi bien
   en colonne de table normale (desktop) qu'empilée (mobile, voir ci-dessus) -
   ex. admin/utilisateurs.php. .identite-utilisateur-ligne regroupe l'identité
   et le chevron (voir .colonne-chevron plus bas) sur la même ligne, chevron
   toujours calé en haut (align-items: flex-start) même si le texte passe sur
   2 lignes ou que le panneau en dessous s'ouvre. */
.identite-utilisateur-ligne { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; }
.identite-utilisateur { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.identite-utilisateur strong { font-weight: 700; }
.identite-utilisateur span { color: var(--texte-doux); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }

/* Carte pleine largeur sur mobile (ex. formulaire d'invitation
   admin/utilisateurs.php), largeur contenue redonnée à partir du desktop. */
.carte-invitation { max-width: none; }
@media (min-width: 641px) {
    .carte-invitation { max-width: 420px; }
}

/* Panneau repliable mobile (ex. admin/utilisateurs.php) : sur une ligne
   .table-admin--empilable, certaines colonnes (rôle, statut, action) sont
   masquées par défaut et regroupées derrière un chevron plutôt que toutes
   empilées - trop de lignes sinon pour une simple gestion d'utilisateur sur
   petit écran. Sur desktop (table normale), .colonne-panel reste une colonne
   comme une autre et .colonne-chevron n'a pas lieu d'être. */
.colonne-chevron { display: none; }

@media (max-width: 640px) {
    .table-admin--empilable .colonne-panel { display: none; }
    .table-admin--empilable tr.panel-ouvert .colonne-panel { display: flex; }
    .table-admin--empilable .colonne-chevron { display: flex; flex-shrink: 0; }
    .chevron-toggle {
        padding: 6px;
        color: var(--texte-doux); display: flex; align-items: center; justify-content: center;
        transition: transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
    }
    .chevron-toggle svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; }
    tr.panel-ouvert .chevron-toggle { transform: rotate(90deg); color: var(--accent); }

    /* Toute la zone identité (pas seulement le chevron) ouvre le panneau -
       voir .panneau-declencheur dans admin/utilisateurs.php. */
    .panneau-declencheur { cursor: pointer; }
    .panneau-declencheur:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* Catégories (admin/categories.php) : icône+nom et interrupteur sur UNE
   seule ligne sur mobile plutôt qu'empilés comme un tableau classique - pas
   de libellé "CATÉGORIE" ni de description, l'interrupteur suffit à lire
   l'état. Règles scopées à .table-admin--categorie (pas .table-admin--empilable
   en général, qui sert aussi à admin/utilisateurs.php avec un tout autre
   comportement mobile). */
@media (max-width: 640px) {
    .table-admin--categorie tr { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
    .table-admin--categorie td { display: block; width: auto; padding: 0; text-align: left; }
    .table-admin--categorie td[data-label]::before { display: none; }
    .categorie-description { display: none; }
}

/* ================================================================
   Statistiques (super-admin)
   ================================================================ */

.stats-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-3); margin: var(--s-5) 0; }
.stat-carte { background: var(--fond); border: 1px solid var(--bordure); border-radius: var(--r-lg); padding: var(--s-4); }
.stat-carte .valeur { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat-carte .libelle { font-size: 12px; color: var(--texte-doux); margin-top: var(--s-1); }

/* ================================================================
   PWA - bandeau d'installation (iOS : instructions ; Android/desktop :
   déclenche l'invite native capturée via beforeinstallprompt)
   ================================================================ */

.install-banner {
    position: fixed; left: var(--s-3); right: var(--s-3); bottom: calc(var(--s-3) + env(safe-area-inset-bottom));
    z-index: 999; display: none; align-items: center; justify-content: space-between; gap: var(--s-3);
    background: var(--chrome-fond); color: var(--chrome-texte); padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md); font-size: 13px; box-shadow: var(--ombre-lg);
}
.install-banner-actions { display: flex; align-items: center; gap: var(--s-2); flex-shrink: 0; }
.install-banner-action {
    background: var(--blanc); color: var(--gris-900); border: none; border-radius: var(--r-full);
    padding: 8px 16px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.install-banner-close {
    background: rgba(255,255,255,.15); border: none; color: var(--chrome-texte); border-radius: var(--r-sm);
    width: 28px; height: 28px; flex-shrink: 0; cursor: pointer; font-size: 14px;
}

/* ================================================================
   Coquille applicative tenant (tableau de bord, simulateur, calculateur)
   Navigation unifiée : barre d'onglets fixe en bas, mobile ET desktop
   (décision explicite - plus de rail latéral). Seul --accent est piloté
   par le tenant.
   ================================================================ */

.shell { min-height: 100dvh; background: var(--fond-page); }

.shell-main { padding: var(--s-4) var(--s-4) calc(88px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; width: 100%; }

/* Navigation : bottom-tab-bar mobile */
.shell-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    display: flex; justify-content: space-around; align-items: stretch;
    background: var(--fond); /* repli si color-mix() non supporté */
    background: color-mix(in srgb, var(--fond) 90%, transparent);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: .5px solid var(--bordure);
    padding-bottom: env(safe-area-inset-bottom);
    /* Voir .shell-topbar : force sa propre couche GPU pour éviter la
       disparition/clignotement pendant le scroll sur iOS Safari. */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}
.shell-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px 7px; min-height: 58px;
    background: none; border: none; cursor: pointer;
    text-decoration: none; color: var(--texte-doux); font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: -.005em;
    transition: color var(--dur-fast) var(--ease);
}
/* Sans abonnement actif (Router::abonnement_actif) : onglet grisé, non cliquable
   (span plutôt que a, voir app_shell_footer.php). */
.shell-nav-item--indisponible { opacity: .4; cursor: not-allowed; }

.shell-nav-icon {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 28px; border-radius: var(--r-full);
    background: transparent; transition: background var(--dur-fast) var(--ease-spring);
}
.shell-nav-icon svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.7; fill: none; transition: transform var(--dur-fast) var(--ease-spring); }
.shell-nav-item.actif { color: var(--accent); }
.shell-nav-item.actif .shell-nav-icon { background: var(--accent-teinte); }
.shell-nav-item:active .shell-nav-icon svg { transform: scale(.82); }

/* Desktop : même barre d'onglets en bas qu'en mobile (voir .shell-nav
   ci-dessus, aucune règle spécifique desktop) - seul le conteneur de contenu
   s'élargit et se recentre (voir .dash-hero pour son pendant sur le bandeau
   héros), avec le fond de page visible de part et d'autre au-delà de 1100px. */
@media (min-width: 768px) {
    .shell-main { max-width: 1100px; margin: 0 auto; padding: var(--s-6) var(--s-6) calc(88px + env(safe-area-inset-bottom)); }
}

/* Page Compte : profil + listes d'actions (remplace l'ancien menu en feuille) */
.compte-profil {
    display: flex; align-items: center; gap: var(--s-3);
    background: var(--fond); border-radius: var(--r-lg); box-shadow: var(--ombre-sm);
    padding: var(--s-4); margin-bottom: var(--s-5);
}
.compte-avatar {
    width: 48px; height: 48px; border-radius: var(--r-full); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-teinte); color: var(--accent); font-weight: 800; font-size: 16px;
}
.compte-profil-texte { min-width: 0; flex: 1; }
.compte-profil-texte .nom { font-weight: 700; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compte-profil-texte .email { color: var(--texte-doux); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-role {
    flex-shrink: 0; font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: var(--r-full);
    background: var(--gris-100); color: var(--texte-doux);
}

.compte-liste {
    background: var(--fond); border-radius: var(--r-lg); box-shadow: var(--ombre-sm); overflow: hidden;
}
.compte-item {
    display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left;
    padding: var(--s-4); border: none; background: none; border-bottom: 1px solid var(--bordure);
    color: var(--texte); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
    text-decoration: none; transition: background var(--dur-fast) var(--ease);
}
.compte-liste > .compte-item:last-child { border-bottom: none; }
.compte-item:hover { background: var(--gris-50); }
.compte-item.danger { color: var(--danger); }
.compte-item svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.75; fill: none; flex-shrink: 0; }
.compte-item-chevron { margin-left: auto; width: 16px !important; height: 16px !important; stroke: var(--texte-doux) !important; }
/* Sans abonnement actif (Router::admin_abonnement_actif) : entrée grisée, non cliquable */
.compte-item--off { opacity: .5; cursor: not-allowed; }
.compte-item--off:hover { background: none; }

/* ================================================================
   Composants de contenu - simulateur/calculateur/historique/détail/devis
   (chargés via $chargerVendorCss, voir app_shell_header.php). Fusionnés ici
   depuis l'ex-base.css/dashboard.css/contenu.css : ce n'était plus qu'une
   deuxième feuille de style séparée qui n'avait plus lieu d'être une fois
   ses variables réduites à de simples alias des tokens ci-dessus. Alias
   conservés (--color-xxx, --spacing-xxx, --radius-xxx, --shadow-xxx, --transition-xxx),
   utilisés par simulateur.css/alerts.css et les <style> de calculateur -
   les renommer partout n'aurait rien changé visuellement, seulement multiplié
   les risques d'erreur pour un fichier en moins.
   .btn est volontairement scopé sous .shell-main : ailleurs (connexion,
   /admin, /heaven, compte), .btn est LE bouton pleine largeur d'app.css
   ci-dessus ; ici, système différent avec variantes (.btn-primary/-outline/
   -full/-sm/-lg) utilisé par des dizaines de boutons compacts en ligne -
   sans ce scope, même sélecteur, même spécificité, le dernier chargé
   gagnerait partout et casserait l'un des deux usages.
   ================================================================ */

:root {
    --color-primary: var(--accent);
    --color-secondary: color-mix(in srgb, var(--accent) 85%, black);
    --color-primary-light: var(--accent-teinte);
    --color-background: var(--fond);
    --color-surface: var(--gris-100);
    --color-border: var(--bordure);
    --color-text: var(--texte);
    --color-text-muted: var(--gris-700);
    --color-text-light: var(--texte-doux);

    --color-success: var(--succes);
    --color-error: var(--danger);
    --color-warning: var(--attention);

    --spacing-xs: var(--s-1);
    --spacing-sm: var(--s-2);
    --spacing-md: var(--s-4);
    --spacing-lg: var(--s-5);
    --spacing-xl: var(--s-6);
    --spacing-xxl: var(--s-8);

    --radius-sm: var(--r-sm);
    --radius-md: var(--r-md);
    --radius-lg: var(--r-lg);
    --radius-xl: var(--r-xl);

    --shadow-sm: var(--ombre-sm);
    --shadow-md: var(--ombre-md);
    --shadow-lg: var(--ombre-lg);

    --transition-fast: var(--dur-fast) var(--ease);
    --transition-normal: var(--dur-normal) var(--ease);
    --transition-slow: 400ms var(--ease);

    --bp-sm: 576px;
    --bp-md: 768px;
    --bp-lg: 992px;
    --bp-xl: 1200px;
}

/* ── Messages flash ── */
.flash-messages { margin-bottom: var(--spacing-lg); }
.flash-message { padding: var(--spacing-md); border-radius: var(--radius-md); margin-bottom: var(--spacing-sm); display: flex; align-items: flex-start; gap: var(--spacing-sm); }
.flash-success { background-color: var(--succes-fond); color: var(--succes); border: 1px solid color-mix(in srgb, var(--succes) 25%, transparent); }
.flash-error { background-color: var(--danger-fond); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.flash-warning { background-color: var(--attention-fond); color: var(--attention); border: 1px solid color-mix(in srgb, var(--attention) 25%, transparent); }
.flash-info { background-color: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.flash-content { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; }
.flash-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; padding: 0; margin-left: var(--spacing-sm); opacity: 0.7; }
.flash-close:hover { opacity: 1; }

/* ── Formulaires (calculateur/simulateur - pas les mêmes classes que
   input[type=...] ci-dessus, propres aux vues reprises de Cover AR) ── */
.form-group { margin-bottom: var(--spacing-lg); }
.form-label { display: block; font-weight: 600; margin-bottom: var(--spacing-sm); color: var(--color-text); }
.form-input, .form-select, .form-textarea {
    width: 100%; padding: var(--spacing-md); border: 2px solid var(--color-border); border-radius: var(--radius-sm);
    font-size: 1rem; line-height: 1.5; transition: border-color var(--transition-fast);
    background-color: var(--color-background); color: var(--color-text);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.form-input::placeholder { color: var(--color-text-light); }
.form-help { font-size: 0.875rem; color: var(--color-text-muted); margin-top: var(--spacing-sm); }
.form-error { border-color: var(--color-error); }
.form-error-message { color: var(--color-error); font-size: 0.875rem; margin-top: var(--spacing-sm); }

/* ── Boutons vendor (scopés .shell-main, voir note ci-dessus) - .btn-primary/
   -secondary/-outline uniquement : le JS du simulateur/calculateur ne pose
   jamais de .btn nue, toujours combinée à l'un de ces modificateurs. Une
   règle sur ".shell-main .btn" nue collisionnait avec le .btn "plein accent"
   du reste de l'app (plus spécifique dans .shell-main, qui englobe
   désormais tout le shell y compris /admin) et l'écrasait silencieusement
   (fond transparent, largeur auto) - voir .btn/.btn-secondaire plus haut. ── */
.shell-main .btn-primary, .shell-main .btn-secondary, .shell-main .btn-outline {
    display: inline-block; font-weight: 700; color: var(--color-text); text-align: center; vertical-align: middle;
    cursor: pointer; background-color: transparent; border: 1px solid transparent; padding: 12px 24px; font-size: 14px;
    line-height: 1.5; border-radius: var(--radius-sm); text-decoration: none; width: auto; min-height: 0; margin-top: 0;
    transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.shell-main .btn-primary:active:not(:disabled), .shell-main .btn-secondary:active:not(:disabled), .shell-main .btn-outline:active:not(:disabled) { transform: scale(.98); }
.shell-main .btn-primary:disabled, .shell-main .btn-secondary:disabled, .shell-main .btn-outline:disabled { opacity: 0.6; cursor: not-allowed; }
.shell-main .btn-primary { background-color: var(--color-primary); color: var(--tenant-texte-bouton, #fff); border-color: var(--color-primary); }
.shell-main .btn-primary:hover:not(:disabled) { background-color: var(--color-secondary); border-color: var(--color-secondary); color: var(--tenant-texte-bouton, #fff); }
.shell-main .btn-secondary { background-color: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.shell-main .btn-secondary:hover:not(:disabled) { background-color: var(--color-primary); color: var(--tenant-texte-bouton, #fff); }
.shell-main .btn-outline { background-color: transparent; color: var(--color-text); border-color: var(--color-border); }
.shell-main .btn-outline:hover:not(:disabled) { background-color: var(--color-surface); border-color: var(--color-secondary); }
.shell-main .btn-full { width: 100%; }
.shell-main .btn-sm { padding: var(--spacing-sm) var(--spacing-md); font-size: 0.875rem; min-height: 36px; }
.shell-main .btn-lg { padding: var(--spacing-lg) var(--spacing-xl); font-size: 1.125rem; min-height: 52px; }

/* ── Cartes et sections ── */
.card { background: var(--color-background); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: var(--spacing-lg); border-bottom: 1px solid var(--color-border); }
.card-body { padding: var(--spacing-lg); }
.card-footer { padding: var(--spacing-lg); border-top: 1px solid var(--color-border); background-color: var(--color-surface); }

/* ── Tableaux (calculateur/simulateur) ── */
.table-container { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.table { width: 100%; border-collapse: collapse; background: var(--color-background); }
.table th, .table td { padding: var(--spacing-md); text-align: left; border-bottom: 1px solid var(--color-border); }
.table th { background-color: var(--color-surface); font-weight: 600; color: var(--color-text); }
.table tr:last-child td { border-bottom: none; }
.table-striped tbody tr:nth-child(even) { background-color: var(--color-surface); }

/* ── Statuts et badges (calculateur/simulateur) ── */
.status { display: inline-flex; align-items: center; padding: var(--spacing-xs) var(--spacing-sm); border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-actif, .status-active { background-color: var(--succes-fond); color: var(--succes); }
.status-suspendu, .status-suspended { background-color: var(--attention-fond); color: var(--attention); }
.status-annule, .status-cancelled { background-color: var(--danger-fond); color: var(--danger); }
.status-nouveau, .status-new { background-color: #d1ecf1; color: #0c5460; }
.status-en-cours, .status-in-progress { background-color: var(--attention-fond); color: var(--attention); }
.status-resolu, .status-resolved { background-color: var(--succes-fond); color: var(--succes); }

/* ── Utilitaires (calculateur/simulateur) ── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: var(--spacing-sm); } .mt-2 { margin-top: var(--spacing-md); } .mt-3 { margin-top: var(--spacing-lg); } .mt-4 { margin-top: var(--spacing-xl); }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: var(--spacing-sm); } .mb-2 { margin-bottom: var(--spacing-md); } .mb-3 { margin-bottom: var(--spacing-lg); } .mb-4 { margin-bottom: var(--spacing-xl); }
.d-none { display: none; } .d-block { display: block; } .d-flex { display: flex; } .d-grid { display: grid; }
@media (min-width: 768px) {
    .d-md-none { display: none; } .d-md-block { display: block; } .d-md-flex { display: flex; } .d-md-grid { display: grid; }
}
@media (max-width: 767px) {
    .card-body { padding: var(--spacing-md); }
    .table th, .table td { padding: var(--spacing-sm); font-size: 0.875rem; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.fade-in { animation: fadeIn var(--transition-normal); }
.slide-in { animation: slideIn var(--transition-normal); }

/* ── Écrans simulateur/historique/détail - en-tête + cartes de section ── */
.dashboard { max-width: 1200px; margin: 0 auto; padding: 1.5rem; animation: dashboardFadeIn 600ms ease-out; }
@keyframes dashboardFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 2rem; }

/* Même traitement de surface que .compte-liste/.compte-profil (profil) et
   .dash-activite (accueil) : pas de bordure, élévation par ombre seule,
   rayon "grande carte" (--r-lg) plutôt que le rayon plus serré des tuiles
   (--outil-carte). Pas de bandeau d'en-tête teinté non plus : sur le reste
   de l'app, une carte est toujours un seul bloc blanc continu. */
.section-card {
    background: var(--color-background); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow 300ms ease;
    animation: fadeInScale 0.6s ease-out; animation-fill-mode: both;
}
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.section-card:hover { box-shadow: var(--shadow-md); }

.section-header { display: flex; justify-content: space-between; align-items: center; padding: var(--spacing-lg) var(--spacing-lg) 0; }
.section-title { font-size: 14px; font-weight: 700; margin: 0; letter-spacing: -.01em; color: var(--color-text); }
.section-content { padding: var(--spacing-lg); }

@media (max-width: 767px) {
    .dashboard { padding: 1rem 0.5rem; }
    .section-header { padding: 1rem 1rem 0; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .section-content { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .dashboard, .section-card { animation: none; }
    .section-card:hover { transform: none; }
}
@media print {
    .dashboard { padding: 0; animation: none; }
    .section-card { box-shadow: none; border: 1px solid #000000; animation: none; page-break-inside: avoid; }
}
