/* ============================================================================
   app-da.css — Refonte de DIRECTION ARTISTIQUE du PANEL ADMIN, cohérente avec le
   portail client (clair, indigo + émeraude, cartes douces). Chargée APRÈS app.css
   → surcharge par cascade. Non-destructif : aucune règle existante ni logique
   modifiée. Retrait = supprimer le <link> dans index.html.
   ============================================================================ */

/* ---- Palette : on surcharge les variables de app.css ---- */
:root {
  --bg: #f1f2ec;
  --panel: #ffffff;
  --panel-soft: #f7f7f3;
  --border: #e7e8e1;
  --muted: #6b7280;
  --text: #15171c;
  --ink: #15171c;
  --blue: #5b50e0;      /* accent principal → indigo */
  --cyan: #5b50e0;      /* l'ancien turquoise → indigo */
  --green: #10b981;     /* succès → émeraude */
  --violet: #5b50e0;
  --amber: #c77700;
  --red: #e0564f;
  --shadow: 0 14px 34px rgba(17, 22, 34, .07);
  --accent: #5b50e0;
  --accent-soft: #ecebfd;
}

body { background: var(--bg); }

/* ---- FOND admin : warm UNI, sans le dégradé bleuté ni la grille teal d'app.css
   (qui posait `body:has(.admin-top-shell){ background: …#eef5f8… !important }`).
   Contenu = --bg (#f1f2ec, chaud) ; le menu reste #fbfbf8 → léger contraste
   chaud, zéro bleu. ---- */
body:has(.admin-top-shell) {
  background: var(--bg) !important;
  background-image: none !important;
  background-size: auto !important;
}

/* ---- En-tête : clair, doux, accent indigo ---- */
.admin-header {
  background: #ffffff !important;
  box-shadow: 0 1px 0 var(--border), 0 10px 26px rgba(17, 22, 34, .05) !important;
  border-bottom: 1px solid var(--border);
}
.admin-brand strong { color: var(--ink) !important; }
.admin-brand span { color: var(--accent) !important; }
/* Header : BLANC PUR comme le menu (app.css le teintait en bleuté via
   `body:has(.admin-top-shell) .admin-header{ background: rgba(247,251,253,.97) }`
   ligne ~5681). Même sélecteur + !important, chargé après → gagne. */
body:has(.admin-top-shell) .admin-header {
  background: #ffffff !important;
  border-bottom-color: var(--border) !important;
}

/* ---- Onglets : pills claires, actif indigo plein ---- */
.top-nav button,
.top-nav .nav-more-toggle {
  background: #f0f0ea !important;
  border: 1px solid transparent !important;
  color: #4b5160 !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}
.top-nav button:hover,
.top-nav .nav-more-toggle:hover {
  background: #e6e6dd !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}
.top-nav button.active,
.top-nav .nav-more-toggle.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
  box-shadow: none !important;
}
.nav-more-menu {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow) !important;
}
.nav-more-menu button { color: var(--ink) !important; }

/* Menu arborescent : par défaut (barre horizontale / mobile) les sections sont « transparentes »
   (display:contents) → les entrées s'affichent en ligne comme avant ; les libellés de section
   n'apparaissent qu'en mode sidebar (≥1181px, réglé plus bas). */
.nav-section { display: contents; }
.nav-section-toggle { display: none; }
.nav-section-items { display: contents; }

/* ---- Bouton « Process ÉQUIPE » → indigo cohérent ---- */
.process-quick-btn {
  background: linear-gradient(135deg, #6a5fe6 0%, #5b50e0 58%, #4a40c8 100%) !important;
  border-color: #4a40c8 !important;
  color: #fff !important;
  box-shadow: 0 14px 32px rgba(91, 80, 224, .32) !important;
  border-radius: 14px !important;
}
.process-quick-btn span,
.process-quick-btn strong { color: #fff !important; }

/* ---- Recherche + champs : focus indigo ---- */
.global-search > input:focus,
input:focus, textarea:focus, select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(91, 80, 224, .14) !important;
  outline: none;
}

/* ---- Barre d'actions (haut droite) ---- */
.admin-userbar .btn { border-radius: 10px; }

/* ---- Cartes métriques (.stat) : arrondi + ombre douce ---- */
.stat {
  background: var(--panel) !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow);
}

/* ---- Panneaux / cartes (.panel) : arrondi + ombre douce ---- */
.panel {
  border-radius: 16px !important;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.panel-head { margin-bottom: 14px; }

/* ---- Boutons ---- */
.btn { border-radius: 10px; }
.btn.primary { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.btn.blue { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.btn.green { background: var(--green) !important; border-color: var(--green) !important; color: #fff !important; }

/* ---- Badges / pills : arrondis ---- */
.pill { border-radius: 999px; }

/* ---- Modales : arrondi + ombre douce ---- */
.modal { border-radius: 16px !important; box-shadow: 0 24px 60px rgba(17, 22, 34, .2) !important; }

/* ---- Pied de page ---- */
.app-footer { background: #fbfbf8 !important; border-top: 1px solid var(--border); }

/* ---- Contenu : fond warm hérité ---- */
#content, .content { background: transparent; }

/* ---- Connexion admin ---- */
.login { background: var(--bg) !important; }
.login-card { border-radius: 16px; box-shadow: var(--shadow); }

/* ============================================================================
   Surcharge du THÈME ADMIN ACTUEL (couche `body:has(.admin-top-shell)` de app.css,
   en cyan #13b8d1). On reprend les MÊMES sélecteurs (même spécificité) + !important,
   chargés après → l'indigo gagne. C'est ce qui restait en turquoise.
   ============================================================================ */
body:has(.admin-top-shell) .process-quick-btn {
  background: linear-gradient(135deg, #6a5fe6 0%, #5b50e0 58%, #4a40c8 100%) !important;
  border-color: #4a40c8 !important;
  color: #ffffff !important;
  box-shadow: 0 15px 32px rgba(91, 80, 224, .28) !important;
}
body:has(.admin-top-shell) .process-quick-btn strong { color: rgba(255, 255, 255, .82) !important; }

body:has(.admin-top-shell) .btn.primary,
body:has(.admin-top-shell) .home-action.primary,
body:has(.admin-top-shell) .dash-action.primary {
  background: linear-gradient(135deg, #6a5fe6 0%, #5b50e0 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 12px 24px rgba(91, 80, 224, .20) !important;
}
body:has(.admin-top-shell) .btn.blue,
body:has(.admin-top-shell) .dash-action.blue {
  background: #ecebfd !important;
  border-color: #d3cffa !important;
  color: #4036b0 !important;
}
body:has(.admin-top-shell) .global-search > input:focus {
  border-color: #5b50e0 !important;
  box-shadow: 0 0 0 4px rgba(91, 80, 224, .14) !important;
}
body:has(.admin-top-shell) .global-search-row:hover,
body:has(.admin-top-shell) .global-search-row:focus { border-color: #5b50e0 !important; }
body:has(.admin-top-shell) .nav-more-menu {
  border-color: var(--border) !important;
  box-shadow: var(--shadow) !important;
}
body:has(.admin-top-shell) .top-nav button.active,
body:has(.admin-top-shell) .top-nav .nav-more-toggle.active {
  background: #5b50e0 !important;
  color: #ffffff !important;
  border-color: #5b50e0 !important;
}
body:has(.admin-top-shell) .panel,
body:has(.admin-top-shell) .stat,
body:has(.admin-top-shell) .modal {
  border-color: var(--border) !important;
  box-shadow: var(--shadow) !important;
}

/* ============================================================================
   RÉAGENCEMENT : la barre d'onglets du haut devient un MENU LATÉRAL gauche,
   comme le dashboard client (items verticaux, actif indigo, regroupés
   logiquement). Desktop uniquement (≥1181px) — en mobile le hamburger natif
   d'Indy reste en place.
   ============================================================================ */
@media (min-width: 1181px) {
  /* La nav devient une sidebar fixe à gauche */
  body:has(.admin-top-shell) #adminTopNav.top-nav {
    position: fixed !important;
    left: 0 !important; top: 0 !important; right: auto !important;
    width: 250px !important; height: 100vh !important; max-height: 100vh !important;
    flex-direction: column !important; flex-wrap: nowrap !important;
    align-items: stretch !important; justify-content: flex-start !important;
    gap: 3px !important; padding: 16px 14px 20px !important; margin: 0 !important;
    background: #ffffff !important; border-right: 1px solid var(--border) !important;
    overflow-y: auto !important; overflow-x: hidden !important;
    z-index: 45 !important; box-shadow: none !important;
  }
  /* Items verticaux pleine largeur, alignés à gauche */
  body:has(.admin-top-shell) #adminTopNav.top-nav button,
  body:has(.admin-top-shell) #adminTopNav.top-nav .nav-more-toggle {
    width: 100% !important; justify-content: flex-start !important; text-align: left !important;
    background: transparent !important; border: 1px solid transparent !important;
    border-radius: 10px !important; color: #4b5160 !important; font-weight: 600 !important;
    padding: 10px 13px !important; min-height: 42px !important; box-shadow: none !important;
  }
  body:has(.admin-top-shell) #adminTopNav.top-nav button:hover,
  body:has(.admin-top-shell) #adminTopNav.top-nav .nav-more-toggle:hover {
    background: #f0f0ea !important; color: var(--ink) !important;
  }
  body:has(.admin-top-shell) #adminTopNav.top-nav button.active {
    background: var(--accent-soft) !important; color: #2a2580 !important; border-color: transparent !important;
  }

  /* CRUCIAL : neutralise tout ce qui crée un « containing block » sur les ancêtres
     (backdrop-filter, transform, filter…). Sinon la sidebar position:fixed se cale
     sur l'ancêtre au lieu du viewport (elle apparaissait à x268/y150). */
  body:has(.admin-top-shell) .app.admin-top-shell,
  body:has(.admin-top-shell) main.main,
  body:has(.admin-top-shell) .admin-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    filter: none !important;
    perspective: none !important;
    contain: none !important;
    will-change: auto !important;
  }

  /* On décale tout le contenu (en-tête + contenu + pied) pour la sidebar */
  body:has(.admin-top-shell) .main { padding-left: 250px !important; }

  /* ══ EN-TÊTE PROPRE : une seule barre alignée verticalement —
     [marque]  [recherche étirée]  [cluster d'actions à droite].
     La nav étant sortie en sidebar, le header n'a plus que ces zones. ══ */
  body:has(.admin-top-shell) .admin-header {
    display: flex !important; align-items: center !important; flex-wrap: nowrap !important;
    gap: 16px !important;
    grid-template-areas: none !important; grid-template-columns: none !important;
    padding: 10px 22px !important; min-height: 58px;
  }
  /* Marque : compacte, ne rétrécit pas (accent indigo géré plus bas) */
  body:has(.admin-top-shell) .admin-brand { flex: 0 0 auto !important; min-width: 0 !important; }

  /* Zone d'actions : occupe tout le reste ; passe à la ligne proprement si besoin */
  body:has(.admin-top-shell) .admin-userbar {
    flex: 1 1 auto !important; min-width: 0 !important; margin: 0 !important;
    display: flex !important; align-items: center !important; flex-wrap: wrap !important;
    justify-content: flex-end !important; gap: 8px !important;
  }
  /* Titre de page (rendu à 1px, cassé) : masqué — le titre est déjà dans le contenu */
  body:has(.admin-top-shell) .admin-userbar .admin-page-title { display: none !important; }

  /* Ordre : recherche à gauche (étirée) · Process · Live · boutons utilitaires (droite) */
  body:has(.admin-top-shell) .admin-userbar > * { order: 5 !important; }
  body:has(.admin-top-shell) .admin-userbar .global-search {
    order: 1 !important; flex: 1 1 160px !important;
    min-width: 150px !important; max-width: 760px !important; margin: 0 !important;
  }
  body:has(.admin-top-shell) .admin-userbar .process-quick-btn {
    order: 2 !important; flex: 0 0 auto !important; width: auto !important; min-width: 0 !important;
    min-height: 42px !important; padding: 6px 15px !important; margin: 0 !important;
  }
  body:has(.admin-top-shell) .admin-userbar .client-live-chip { order: 3 !important; flex: 0 0 auto !important; }
  /* Boutons utilitaires (Notifs / Portail / Préférences / Sortir) : compacts, homogènes */
  body:has(.admin-top-shell) .admin-userbar .btn.ghost,
  body:has(.admin-top-shell) .admin-userbar .desktop-notify-btn {
    min-height: 35px !important; padding: 0 9px !important; border-radius: 9px !important;
    font-size: 12px !important; font-weight: 600 !important; white-space: nowrap;
  }

  /* Menu arborescent : sections groupées dans la sidebar (libellé de thème + entrées) */
  body:has(.admin-top-shell) #adminTopNav .nav-section {
    display: block !important; width: 100% !important;
    margin-top: 6px !important; padding-top: 6px !important;
    border-top: 1px solid var(--border) !important;
  }
  body:has(.admin-top-shell) #adminTopNav .nav-section-toggle {
    display: flex !important; align-items: center !important; justify-content: space-between !important;
    width: 100% !important; background: transparent !important; border: 0 !important; box-shadow: none !important;
    cursor: pointer !important; font-size: 10.5px !important; font-weight: 800 !important;
    letter-spacing: .05em !important; text-transform: uppercase !important; color: #9aa0ad !important;
    padding: 7px 13px !important; border-radius: 8px !important; min-height: 0 !important;
  }
  body:has(.admin-top-shell) #adminTopNav .nav-section-toggle:hover { background: #f0f0ea !important; color: #6b7280 !important; }
  body:has(.admin-top-shell) #adminTopNav .nav-section-items { display: block !important; }
  body:has(.admin-top-shell) #adminTopNav .nav-section.collapsed .nav-section-items { display: none !important; }
  body:has(.admin-top-shell) #adminTopNav .nav-caret { transition: transform .15s ease; font-size: 9px; opacity: .65; }
  body:has(.admin-top-shell) #adminTopNav .nav-section.collapsed .nav-caret { transform: rotate(-90deg); }
  body:has(.admin-top-shell) #adminTopNav .nav-section button[data-nav] { width: 100% !important; }
}

/* Sous-titre de marque en indigo (restait turquoise) */
body:has(.admin-top-shell) .admin-brand span { color: var(--accent) !important; }

/* ============================================================================
   REFONTE « ÉPURÉE » — raffinement des COMPOSANTS PARTAGÉS du panel admin.
   Toutes les pages réutilisent ces briques (tables, panneaux, en-têtes, boutons
   d'action, cartes stat, barre du haut) → un seul nettoyage = toutes les pages
   plus claires, plus aérées, plus lisibles. CSS-only, non-destructif.
   Sélecteurs en `body:has(.admin-top-shell)` + !important pour battre, à
   spécificité égale et chargé après, la couche de thème turquoise d'app.css.
   ============================================================================ */

/* ---- Respiration générale du contenu ---- */
body:has(.admin-top-shell) .panel { padding: 22px 24px !important; margin-bottom: 18px; }
body:has(.admin-top-shell) .panel-head { margin-bottom: 16px !important; }
body:has(.admin-top-shell) .panel-head h2,
body:has(.admin-top-shell) .panel-head h3 { letter-spacing: -.01em; }

/* Sur-titres (eyebrow) : gris doux et espacé — fini le turquoise résiduel */
body:has(.admin-top-shell) .eyebrow,
body:has(.admin-top-shell) .panel-eyebrow {
  color: #8b909c !important; letter-spacing: .09em !important;
  font-size: 11px !important; font-weight: 700 !important;
}

/* ---- Tableaux : en-tête discret, lignes aérées, survol doux ---- */
body:has(.admin-top-shell) th,
body:has(.admin-top-shell) .table-head {
  background: #f7f7f2 !important;          /* opaque → en-têtes « sticky » restent nets */
  color: #8b909c !important;
  text-transform: uppercase; letter-spacing: .05em;
  font-size: 11px !important; font-weight: 700 !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid var(--border) !important;
}
body:has(.admin-top-shell) td {
  padding: 13px 14px !important;
  border-bottom-color: var(--border) !important;
  vertical-align: middle;
}
body:has(.admin-top-shell) tbody tr:hover td { background: #faf9f4 !important; }

/* ---- Boutons d'action : pills nettes et homogènes (couleurs sémantiques gardées) ---- */
body:has(.admin-top-shell) .btn { border-radius: 9px !important; font-weight: 600 !important; }
body:has(.admin-top-shell) .btn.small {
  border-radius: 8px !important; min-height: 31px !important;
  padding: 0 11px !important; font-size: 12px !important;
}
/* Groupe d'actions en cellule : espacement régulier, alignés proprement */
body:has(.admin-top-shell) td .btn.small,
body:has(.admin-top-shell) td .btn { margin: 3px 4px 0 0 !important; }

/* ---- Pastilles de statut : douces et lisibles ---- */
body:has(.admin-top-shell) .pill { border-radius: 999px !important; font-weight: 700 !important; }

/* ---- Cartes stat : accent INDIGO unifié (fini le turquoise), plus aérées ---- */
body:has(.admin-top-shell) .stat { padding: 18px 20px !important; }
body:has(.admin-top-shell) .stat::before { background: var(--accent) !important; }
body:has(.admin-top-shell) .stat strong { letter-spacing: -.02em; }

/* ---- Barre du haut : info « live clients » lisible, non comprimée ----
   NB : on ne touche PAS à padding-left → app.css réserve 28px à gauche pour la
   pastille d'état (.client-live-chip:not(.idle)). Sinon le point vert chevauche
   le texte. */
body:has(.admin-top-shell) .client-live-chip {
  line-height: 1.35 !important;
  font-size: 11px !important;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  padding-right: 13px !important;
  max-width: 150px;
  border-radius: 12px !important;
}

/* ---- En-tête « Comptabilité » : bandeau sombre retonifié en INDIGO (était
   dégradé vers le turquoise #0f766e — hors palette). ---- */
body:has(.admin-top-shell) .accounting-hero {
  background: linear-gradient(135deg, #14122e 0%, #1d1a44 52%, #4a40c8 100%) !important;
}

/* ---- En-tête : marque avec accent INDIGO (était un liseré teal #13b8d1) ---- */
body:has(.admin-top-shell) .admin-brand { border-left-color: var(--accent) !important; }

/* ---- Filtres de recherche : masqués par défaut (header dégagé) → s'ouvrent en
   petit panneau quand on FOCUS la recherche ET qu'elle est vide (donc pas de
   collision avec la liste de résultats, qui n'apparaît qu'en tapant). Pastilles
   « toggle » nettes (actif = indigo doux). Fonctionnalité 100% préservée. ---- */
body:has(.admin-top-shell) .global-search-filters { display: none !important; }
body:has(.admin-top-shell) .global-search:focus-within:has(input:placeholder-shown) .global-search-filters {
  display: flex !important; flex-wrap: wrap !important; gap: 6px !important;
  position: absolute !important; top: calc(100% + 6px) !important; left: 0 !important; right: auto !important;
  z-index: 60 !important; margin: 0 !important; padding: 10px 12px !important; min-width: 252px;
  background: #ffffff !important; border: 1px solid var(--border) !important; border-radius: 12px !important;
  box-shadow: var(--shadow) !important;
}
body:has(.admin-top-shell) .search-filter {
  display: inline-flex !important; align-items: center !important; gap: 5px !important;
  padding: 4px 11px !important; border: 1px solid var(--border) !important; border-radius: 999px !important;
  background: #ffffff !important; color: #6b7280 !important;
  font-size: 11.5px !important; font-weight: 600 !important;
  cursor: pointer; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
body:has(.admin-top-shell) .search-filter input {
  width: 13px !important; height: 13px !important; accent-color: var(--accent); margin: 0 !important;
}
body:has(.admin-top-shell) .search-filter:has(input:checked) {
  background: var(--accent-soft) !important; border-color: #c9c4f7 !important; color: #3a32a8 !important;
}

/* ---- Pastille « live clients » : on retire la ligne-teaser pour la rendre compacte (2 lignes) ---- */
body:has(.admin-top-shell) .client-live-chip small { display: none !important; }

/* ---- Barres d'outils (recherche + boutons d'action de page) : alignées, aérées ---- */
body:has(.admin-top-shell) .toolbar { gap: 10px !important; align-items: center; }

/* ============================================================================
   MUR DE RANGEMENT (page "Rangement" — slots + LED ESP32)
   ============================================================================ */
body:has(.admin-top-shell) .slot-grid {
  display: grid; grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 8px; margin-top: 16px;
}
@media (max-width: 1300px) { body:has(.admin-top-shell) .slot-grid { grid-template-columns: repeat(10, 1fr); } }
@media (max-width: 760px)  { body:has(.admin-top-shell) .slot-grid { grid-template-columns: repeat(5, 1fr); } }
body:has(.admin-top-shell) .slot {
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  padding: 9px 6px; min-height: 86px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-align: center; cursor: pointer; overflow: hidden;
  transition: transform .1s ease, box-shadow .12s ease, border-color .12s ease;
}
body:has(.admin-top-shell) .slot:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
body:has(.admin-top-shell) .slot.sel { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(91, 80, 224, .18); }
body:has(.admin-top-shell) .slot.status-empty { background: #faf9f4; }
body:has(.admin-top-shell) .slot .slot-num { font-size: 10.5px; font-weight: 800; color: #9aa0ab; letter-spacing: .02em; display: flex; align-items: center; gap: 5px; }
body:has(.admin-top-shell) .slot .slot-rack { font-size: 9px; font-weight: 700; color: var(--accent); background: rgba(91, 80, 224, .1); border-radius: 5px; padding: 1px 4px; }
body:has(.admin-top-shell) .slot.lit { border-color: var(--green) !important; box-shadow: 0 0 0 3px rgba(16, 185, 129, .25); }
body:has(.admin-top-shell) .slot .slot-tick { font-size: 12.5px; font-weight: 800; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:has(.admin-top-shell) .slot .slot-meta { font-size: 10px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:has(.admin-top-shell) .slot .slot-empty { font-size: 11px; color: #b3b8c2; font-style: italic; }
body:has(.admin-top-shell) .slot .pill { transform: scale(.82); margin: 1px 0; }
/* --- Mur physique : 5 racks × 5 étagères × 3 positions --- */
body:has(.admin-top-shell) .rack-wall { display: flex; gap: 14px; margin-top: 16px; overflow-x: auto; padding-bottom: 6px; }
body:has(.admin-top-shell) .rack-col { flex: 1 1 0; min-width: 156px; border: 1px solid var(--border); border-radius: 14px; background: #faf9f4; padding: 8px; }
body:has(.admin-top-shell) .rack-col-head { font-size: 12px; font-weight: 800; color: var(--accent); text-align: center; margin-bottom: 8px; letter-spacing: .02em; }
body:has(.admin-top-shell) .shelf-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
body:has(.admin-top-shell) .shelf-row:last-child { margin-bottom: 0; }
body:has(.admin-top-shell) .shelf-lvl { font-size: 9px; font-weight: 700; color: #9aa0ab; width: 46px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
body:has(.admin-top-shell) .shelf-size { font-size: 8px; font-weight: 800; border-radius: 4px; padding: 0 3px; align-self: flex-start; }
body:has(.admin-top-shell) .shelf-size.sz-grand { background: #e6f0ff; color: #185FA5; }
body:has(.admin-top-shell) .shelf-size.sz-petit { background: #eafbe9; color: #3B6D11; }
body:has(.admin-top-shell) .shelf-size.sz-moyen { background: #fdf0db; color: #854F0B; }
body:has(.admin-top-shell) .rg-size-line { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
body:has(.admin-top-shell) .rg-size-line strong { color: var(--ink); font-weight: 700; }
body:has(.admin-top-shell) .shelf-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; flex: 1; }
body:has(.admin-top-shell) .shelf-cell { border: 1px solid var(--border); border-radius: 8px; background: #fff; min-height: 42px; padding: 3px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; overflow: hidden; transition: transform .1s ease, box-shadow .12s ease, border-color .12s ease; }
body:has(.admin-top-shell) .shelf-cell:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
body:has(.admin-top-shell) .shelf-cell.vide { background: transparent; border-style: dashed; cursor: default; }
body:has(.admin-top-shell) .shelf-cell.sel { border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(91, 80, 224, .22); }
body:has(.admin-top-shell) .shelf-cell.lit { border-color: var(--green) !important; box-shadow: 0 0 0 2px rgba(16, 185, 129, .32); }
body:has(.admin-top-shell) .shelf-cell.status-empty { background: #f4f3ee; }
body:has(.admin-top-shell) .shelf-cell.libre { cursor: default; }
body:has(.admin-top-shell) .shelf-cell.libre:hover { transform: none; box-shadow: none; }
body:has(.admin-top-shell) .rg-hint { font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
body:has(.admin-top-shell) .rg-status-row { flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 4px; }
body:has(.admin-top-shell) .status-show-btn { display: inline-flex; align-items: center; gap: 6px; }
body:has(.admin-top-shell) .status-show-btn .ss-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
body:has(.admin-top-shell) .status-show-btn.on { border-color: var(--accent) !important; background: var(--accent-soft); font-weight: 700; }
body:has(.admin-top-shell) .shelf-cell.grp { font-weight: 700; }
body:has(.admin-top-shell) .shelf-cell.grp .cell-tick { color: var(--ink); }
body:has(.admin-top-shell) .sig-audit { display: grid; gap: 4px; margin: 8px 0; padding: 8px 10px; border: 0.5px solid var(--border); border-radius: 8px; background: #faf9f4; font-size: 12px; }
body:has(.admin-top-shell) .sig-audit > div { display: flex; justify-content: space-between; gap: 12px; }
body:has(.admin-top-shell) .sig-audit span { color: var(--muted); flex: 0 0 auto; }
body:has(.admin-top-shell) .sig-audit strong { color: var(--ink); font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:has(.admin-top-shell) .sig-audit .sig-ua strong { font-size: 10.5px; font-weight: 500; }
body:has(.admin-top-shell) .rg-legend { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; padding: 10px 12px; border: 0.5px solid var(--border); border-radius: 10px; background: #faf9f4; }
body:has(.admin-top-shell) .lg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--ink); }
body:has(.admin-top-shell) .lg-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 4px; }
body:has(.admin-top-shell) .lg-item { display: inline-flex; align-items: center; gap: 6px; }
body:has(.admin-top-shell) .lg-dot { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
body:has(.admin-top-shell) .lg-mode { width: 11px; height: 11px; border-radius: 999px; display: inline-block; flex: 0 0 auto; background: #6b7280; }
body:has(.admin-top-shell) .lg-mode.fast { animation: lgBlinkFast .4s steps(1, end) infinite; }
body:has(.admin-top-shell) .lg-mode.slow { animation: lgBlinkSlow 1.4s steps(1, end) infinite; }
@keyframes lgBlinkFast { 50% { opacity: .15; } }
@keyframes lgBlinkSlow { 50% { opacity: .15; } }
body:has(.admin-top-shell) .shelf-cell .cell-pos { font-size: 8.5px; font-weight: 800; color: #9aa0ab; }
body:has(.admin-top-shell) .shelf-cell .cell-tick { font-size: 10px; font-weight: 800; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:has(.admin-top-shell) .shelf-cell.status-new { border-left: 4px solid #005aff; }
body:has(.admin-top-shell) .shelf-cell.status-diagnostic { border-left: 4px solid #ffd700; }
body:has(.admin-top-shell) .shelf-cell.status-waiting_client { border-left: 4px solid #ff0096; }
body:has(.admin-top-shell) .shelf-cell.status-waiting_part { border-left: 4px solid #ff5a00; }
body:has(.admin-top-shell) .shelf-cell.status-repairing { border-left: 4px solid #9600ff; }
body:has(.admin-top-shell) .shelf-cell.status-ready { border-left: 4px solid #00dc3c; }
body:has(.admin-top-shell) .shelf-cell.status-irreparable { border-left: 4px solid #ff0000; }
body:has(.admin-top-shell) .shelf-cell.status-delivered, body:has(.admin-top-shell) .shelf-cell.status-cancelled { border-left: 4px solid #888; }

/* Slots allumés sur le mur : clignotement à l'écran, synchronisé couleur réelle (--lit-color)
   + vitesse (fixed/slow/fast). Plusieurs slots peuvent clignoter ensemble ; le serveur les
   éteint après 30 s (re-render via SSE storage_updated). */
body:has(.admin-top-shell) .shelf-cell.lit { border-color: var(--lit-color, #0078ff) !important; z-index: 1; }
body:has(.admin-top-shell) .shelf-cell.lit-fixed { box-shadow: 0 0 0 2px var(--lit-color, #0078ff), 0 0 12px 1px var(--lit-color, #0078ff); }
body:has(.admin-top-shell) .shelf-cell.lit-fast { animation: cellBlinkFast .5s steps(1, end) infinite; }
body:has(.admin-top-shell) .shelf-cell.lit-slow { animation: cellBlinkSlow 1.4s steps(1, end) infinite; }
@keyframes cellBlinkFast { 0%, 49% { box-shadow: 0 0 0 2px var(--lit-color, #0078ff), 0 0 16px 2px var(--lit-color, #0078ff); } 50%, 100% { box-shadow: 0 0 0 1px rgba(0,0,0,.04); } }
@keyframes cellBlinkSlow { 0%, 49% { box-shadow: 0 0 0 2px var(--lit-color, #0078ff), 0 0 16px 2px var(--lit-color, #0078ff); } 50%, 100% { box-shadow: 0 0 0 1px rgba(0,0,0,.04); } }
/* Attribution d'un dossier à un slot libre (clic sur case vide) */
body:has(.admin-top-shell) .modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
body:has(.admin-top-shell) .modal-head h3 { margin: 0; font-size: 16px; color: #2a2580; }
body:has(.admin-top-shell) .assign-list { display: grid; gap: 6px; margin-top: 10px; max-height: 52vh; overflow-y: auto; }
body:has(.admin-top-shell) .assign-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 10px 12px; border: 1px solid #e4e1f6; border-radius: 9px; background: #fff; cursor: pointer; font-size: 13px; }
body:has(.admin-top-shell) .assign-row:hover { border-color: var(--accent); background: #faf9ff; }
body:has(.admin-top-shell) .assign-row strong { color: #2a2580; font-weight: 800; }
body:has(.admin-top-shell) .assign-row .muted { font-size: 11.5px; }
body:has(.admin-top-shell) .esp-dot { width: 10px; height: 10px; border-radius: 999px; background: #cbd5e1; display: inline-block; flex: 0 0 auto; }
body:has(.admin-top-shell) .esp-dot.on { background: var(--green); box-shadow: 0 0 7px var(--green); }
body:has(.admin-top-shell) .esp-dot.off { background: #e24b4a; box-shadow: 0 0 7px rgba(226, 75, 74, .6); }
body:has(.admin-top-shell) .esp-dot.unknown { background: #cbd5e1; }
body:has(.admin-top-shell) .esp-indicator { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; border: 0.5px solid var(--border); background: #fff; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: border-color .12s ease, background .12s ease; }
body:has(.admin-top-shell) .esp-indicator:hover { border-color: #c9c8c0; }
body:has(.admin-top-shell) .esp-indicator.on { color: #0a7f57; border-color: rgba(16, 185, 129, .4); background: #f0fbf5; }
body:has(.admin-top-shell) .esp-indicator.off { color: #b42318; border-color: rgba(180, 35, 24, .35); background: #fdf3f2; }
body:has(.admin-top-shell) .rangement-controls { flex-wrap: wrap; gap: 7px; align-items: center; }
body:has(.admin-top-shell) .rg-ctrl-label { font-size: 12.5px; color: var(--muted); }
body:has(.admin-top-shell) .rg-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid #d3cffa; border-radius: 12px;
  padding: 10px 14px; margin: 12px 0; font-size: 13px;
}
body:has(.admin-top-shell) .rg-banner-actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* ============================================================================
   DA — écrans secondaires : on retire le fond bleuté résiduel d'app.css
   (`rgba(247,251,255,.97)` + bordures `rgba(123,151,176,…)`) sur modales,
   panneau banque, planning, et boîtes imbriquées. Surfaces principales en blanc,
   boîtes imbriquées en warm doux, bordures warm. Sélecteurs `body:has(...)` →
   spécificité supérieure aux `.admin-top-shell .x` d'app.css.
   ============================================================================ */
body:has(.admin-top-shell) .modal,
body:has(.admin-top-shell) .bank-panel,
body:has(.admin-top-shell) .planning-side,
body:has(.admin-top-shell) .kanban-column,
body:has(.admin-top-shell) .support-column,
body:has(.admin-top-shell) .mail-folder,
body:has(.admin-top-shell) .acct-chart {
  background: var(--panel) !important;
  border-color: var(--border) !important;
}
/* boîtes imbriquées (dans un panneau blanc) : warm doux pour rester distinctes */
body:has(.admin-top-shell) .detail-side,
body:has(.admin-top-shell) .mini-item,
body:has(.admin-top-shell) .relation-box,
body:has(.admin-top-shell) .support-card,
body:has(.admin-top-shell) .monitor-row {
  background: #f6f6f1 !important;   /* warm explicite : var(--panel-soft) est redéfini bleuté par app.css dans la coquille admin */
  border-color: var(--border) !important;
}
/* bordures bleutées génériques restantes dans la coquille admin */
body:has(.admin-top-shell) .modal-backdrop { background: rgba(17, 22, 34, .45) !important; }

/* Vue comptable des factures encaissées, ouverte depuis Factures. */
body:has(.paid-ledger-modal) .modal {
  width: min(1500px, calc(100vw - 32px)) !important;
  max-width: 1500px !important;
  max-height: calc(100vh - 32px) !important;
  overflow: auto !important;
}
.paid-ledger-modal { min-height: 260px; }
.paid-ledger-loading { display: grid; place-items: center; min-height: 220px; color: var(--muted); font-weight: 700; }
.paid-ledger-head { align-items: flex-start !important; }
.paid-ledger-head h2 { margin: 2px 0 4px; }
.paid-ledger-filters {
  display: grid; grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(145px, .7fr)) auto;
  gap: 10px; align-items: end; padding: 14px; margin: 12px 0;
  border: 1px solid var(--border); border-radius: 14px; background: #f6f6f1;
}
.paid-ledger-filters label { display: grid; gap: 5px; min-width: 0; }
.paid-ledger-filters label > span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.paid-ledger-filters input,
.paid-ledger-filters select { width: 100%; min-width: 0; }
.paid-ledger-summary { display: grid; grid-template-columns: repeat(3, minmax(130px, .55fr)) minmax(280px, 1.8fr); gap: 10px; margin-bottom: 12px; }
.paid-ledger-summary article { display: grid; gap: 4px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.paid-ledger-summary span { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.paid-ledger-summary strong { font-size: 19px; }
.paid-ledger-summary .paid-ledger-methods strong { font-size: 13px; line-height: 1.45; }
.paid-ledger-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 14px; }
.paid-ledger-table { min-width: 1050px; margin: 0 !important; }
.paid-ledger-table thead th { position: sticky; top: 0; z-index: 2; background: #f2f1eb !important; }
.paid-ledger-table tbody tr:hover { background: #faf9f4; }
@media (max-width: 950px) {
  .paid-ledger-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paid-ledger-search { grid-column: 1 / -1; }
  .paid-ledger-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .paid-ledger-summary .paid-ledger-methods { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  body:has(.paid-ledger-modal) .modal { width: 100vw !important; max-height: 100vh !important; border-radius: 0 !important; }
  .paid-ledger-filters { grid-template-columns: 1fr; }
  .paid-ledger-search { grid-column: auto; }
  .paid-ledger-summary { grid-template-columns: 1fr 1fr; }
  .paid-ledger-summary .paid-ledger-methods { grid-column: 1 / -1; }
}

/* ---- Emplacement (slot) + bouton « Allumer » sur les tickets ---- */
body:has(.admin-top-shell) .pill.slot-pill { background: var(--accent-soft) !important; color: #3a32a8 !important; border: 1px solid #d3cffa !important; }
body:has(.admin-top-shell) .slot-allumer { background: #e7f7ef !important; border-color: #bdebd2 !important; color: #0a7f57 !important; }
body:has(.admin-top-shell) .card-slot { margin: 4px 0 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---- Offre de rachat (modale admin) ---- */
body:has(.admin-top-shell) .buyback-modal .buyback-line { font-size: 15px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
body:has(.admin-top-shell) .buyback-modal .buyback-recap { display: grid; gap: 4px; margin: 10px 0; font-size: 13px; }
body:has(.admin-top-shell) .buyback-modal .buyback-recap b { color: var(--muted); min-width: 150px; display: inline-block; font-weight: 600; }
body:has(.admin-top-shell) .toolbar.wrap { flex-wrap: wrap; }

/* ---- Liste tickets : table à largeur FIXE → tout tient dans le panneau, la
   colonne Actions garde sa place et ses boutons passent à la ligne (plus rien
   de coupé à droite). ---- */
body:has(.admin-top-shell) .production-table { table-layout: fixed; width: 100%; }
body:has(.admin-top-shell) .production-table th:nth-child(1), body:has(.admin-top-shell) .production-table td:nth-child(1) { width: 18%; }
body:has(.admin-top-shell) .production-table th:nth-child(2), body:has(.admin-top-shell) .production-table td:nth-child(2) { width: 14%; }
body:has(.admin-top-shell) .production-table th:nth-child(3), body:has(.admin-top-shell) .production-table td:nth-child(3) { width: 14%; }
body:has(.admin-top-shell) .production-table th:nth-child(4), body:has(.admin-top-shell) .production-table td:nth-child(4) { width: 9%; }
body:has(.admin-top-shell) .production-table th:nth-child(5), body:has(.admin-top-shell) .production-table td:nth-child(5) { width: 8%; }
body:has(.admin-top-shell) .production-table th:nth-child(6), body:has(.admin-top-shell) .production-table td:nth-child(6) { width: 11%; }
body:has(.admin-top-shell) .production-table th:nth-child(7), body:has(.admin-top-shell) .production-table td:nth-child(7) { width: 9%; }
body:has(.admin-top-shell) .production-table th:nth-child(8), body:has(.admin-top-shell) .production-table td:nth-child(8) { width: 17%; }
body:has(.admin-top-shell) .production-table td { word-break: break-word; vertical-align: top; }
body:has(.admin-top-shell) .production-table .mini-select { width: 100%; min-width: 0; }
body:has(.admin-top-shell) td.table-actions { white-space: normal !important; }
body:has(.admin-top-shell) .ta-wrap { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
body:has(.admin-top-shell) .production-table-wrap { overflow-x: auto; }

/* ---- Conformité / journal d'audit ---- */
body:has(.admin-top-shell) .integrity-banner { border-radius: 14px; padding: 14px 16px; margin: 4px 0 18px; border: 1px solid #d8d5f3; background: var(--accent-soft); }
body:has(.admin-top-shell) .integrity-banner.ok { border-color: #b8e6c8; background: #effaf2; }
body:has(.admin-top-shell) .integrity-banner.ko { border-color: #f1c0c0; background: #fdf0f0; }
body:has(.admin-top-shell) .integrity-banner strong { display: block; font-size: 15px; margin-bottom: 2px; }
body:has(.admin-top-shell) .integrity-banner.ok strong { color: #1f7a44; }
body:has(.admin-top-shell) .integrity-banner.ko strong { color: #b02a2a; }
body:has(.admin-top-shell) .integrity-banner > span { font-size: 12.5px; color: #555; }
body:has(.admin-top-shell) .integrity-issues { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: #b02a2a; }
body:has(.admin-top-shell) .conformite-page h4 { margin: 6px 0 10px; font-size: 13px; color: #444; font-weight: 700; }
body:has(.admin-top-shell) .audit-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
body:has(.admin-top-shell) .audit-table th { text-align: left; padding: 7px 9px; border-bottom: 2px solid #ece9fb; color: var(--accent); font-weight: 700; white-space: nowrap; }
body:has(.admin-top-shell) .audit-table td { padding: 7px 9px; border-bottom: 1px solid #f1f0fa; vertical-align: top; }
body:has(.admin-top-shell) .audit-table tr:hover td { background: #faf9ff; }
body:has(.admin-top-shell) .audit-table .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #777; font-size: 11.5px; }
body:has(.admin-top-shell) .audit-table .pill { background: var(--accent-soft); color: #3a32a8; border: 1px solid #d3cffa; padding: 1px 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ---- Attestation de conformité ---- */
body:has(.admin-top-shell) .conf-tabs { display: flex; gap: 6px; margin: 4px 0 18px; border-bottom: 1px solid #ece9fb; }
body:has(.admin-top-shell) .conf-tab { appearance: none; border: 0; background: none; padding: 9px 14px; font-size: 13px; font-weight: 600; color: #777; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
body:has(.admin-top-shell) .conf-tab:hover { color: var(--accent); }
body:has(.admin-top-shell) .conf-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
body:has(.admin-top-shell) .attest-doc { border: 1px solid #e4e1f6; border-radius: 16px; padding: 20px 22px; margin-bottom: 22px; background: linear-gradient(180deg, #fbfaff, #fff); }
body:has(.admin-top-shell) .attest-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
body:has(.admin-top-shell) .attest-title { font-size: 19px; font-weight: 800; color: #2a2580; }
body:has(.admin-top-shell) .attest-sub { font-size: 12.5px; color: #777; margin-top: 2px; }
body:has(.admin-top-shell) .attest-score { text-align: center; min-width: 92px; border-radius: 14px; padding: 10px 8px; border: 2px solid; }
body:has(.admin-top-shell) .attest-score .score-pct { font-size: 26px; font-weight: 800; line-height: 1; }
body:has(.admin-top-shell) .attest-score .score-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; margin-top: 3px; opacity: .8; }
body:has(.admin-top-shell) .score-ok { border-color: #b8e6c8; background: #effaf2; color: #1f7a44; }
body:has(.admin-top-shell) .score-warn { border-color: #f1dcb0; background: #fdf7ec; color: #9a6a14; }
body:has(.admin-top-shell) .score-ko { border-color: #f1c0c0; background: #fdf0f0; color: #b02a2a; }
body:has(.admin-top-shell) .attest-meta { margin: 16px 0 0; font-size: 12.5px; color: #444; display: grid; gap: 4px; }
body:has(.admin-top-shell) .attest-meta b { color: #2a2580; font-weight: 700; }
body:has(.admin-top-shell) .attest-tally { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 0; }
body:has(.admin-top-shell) .tally { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 11px; }
body:has(.admin-top-shell) .tally.ok { background: #effaf2; color: #1f7a44; }
body:has(.admin-top-shell) .tally.warn { background: #fdf7ec; color: #9a6a14; }
body:has(.admin-top-shell) .tally.todo { background: #f1f0f5; color: #666; }
body:has(.admin-top-shell) .attest-caveat { margin: 14px 0 0; padding: 11px 13px; border-radius: 10px; background: #fdf7ec; border: 1px solid #f1dcb0; font-size: 12px; color: #6b4e12; line-height: 1.5; }
body:has(.admin-top-shell) .conf-cat { margin-bottom: 22px; }
body:has(.admin-top-shell) .conf-cat-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid #ece9fb; }
body:has(.admin-top-shell) .conf-cat-head h4 { margin: 0; font-size: 15px; color: #2a2580; font-weight: 800; }
body:has(.admin-top-shell) .cat-pct { font-size: 12px; font-weight: 800; border-radius: 8px; padding: 1px 8px; border: 1px solid; }
body:has(.admin-top-shell) .conf-item { border: 1px solid #ece9fb; border-radius: 10px; margin-bottom: 7px; overflow: hidden; background: #fff; }
body:has(.admin-top-shell) .conf-item > summary { display: flex; align-items: center; gap: 10px; padding: 10px 13px; cursor: pointer; list-style: none; font-size: 13px; }
body:has(.admin-top-shell) .conf-item > summary::-webkit-details-marker { display: none; }
body:has(.admin-top-shell) .conf-item > summary::after { content: '▸'; margin-left: auto; color: #bbb; transition: transform .15s; }
body:has(.admin-top-shell) .conf-item[open] > summary::after { transform: rotate(90deg); }
body:has(.admin-top-shell) .conf-item-title { font-weight: 600; color: #333; }
body:has(.admin-top-shell) .conf-badge { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px; white-space: nowrap; flex-shrink: 0; }
body:has(.admin-top-shell) .conf-badge.ok { background: #effaf2; color: #1f7a44; border: 1px solid #b8e6c8; }
body:has(.admin-top-shell) .conf-badge.warn { background: #fdf7ec; color: #9a6a14; border: 1px solid #f1dcb0; }
body:has(.admin-top-shell) .conf-badge.todo { background: #f1f0f5; color: #666; border: 1px solid #ddd; }
body:has(.admin-top-shell) .conf-badge.na { background: #f1f0f5; color: #999; border: 1px solid #e3e3e3; }
body:has(.admin-top-shell) .conf-item.conf-ok { border-left: 3px solid #3fa86a; }
body:has(.admin-top-shell) .conf-item.conf-warn { border-left: 3px solid #d6a13c; }
body:has(.admin-top-shell) .conf-item.conf-todo { border-left: 3px solid #bbb; }
body:has(.admin-top-shell) .conf-item-body { padding: 4px 14px 14px; border-top: 1px solid #f3f1fb; font-size: 12.5px; color: #444; line-height: 1.55; }
body:has(.admin-top-shell) .conf-field { margin: 11px 0 0; }
body:has(.admin-top-shell) .conf-field b { color: #2a2580; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; }
body:has(.admin-top-shell) .conf-field.proof { background: #f6fbf7; border-left: 2px solid #b8e6c8; padding: 7px 10px; border-radius: 0 7px 7px 0; }
body:has(.admin-top-shell) .conf-field.note { background: #faf9f4; border-left: 2px solid #e6dab8; padding: 7px 10px; border-radius: 0 7px 7px 0; color: #6b5a2e; }
body:has(.admin-top-shell) .conf-qa { margin: 11px 0 0; border: 1px dashed #d8d5f3; border-radius: 9px; padding: 8px 11px; background: #fbfaff; }
body:has(.admin-top-shell) .conf-qa .obj { margin: 0; color: #8a3b3b; }
body:has(.admin-top-shell) .conf-qa .rep { margin: 8px 0 0; color: #1f5a3a; }
body:has(.admin-top-shell) .conf-qa b { font-size: 11.5px; }
body:has(.admin-top-shell) .conf-src { margin: 10px 0 0; font-size: 10.5px; color: #999; word-break: break-word; }
body:has(.admin-top-shell) .live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
body:has(.admin-top-shell) .live-card { border: 1px solid #ece9fb; border-radius: 12px; padding: 13px 14px; background: #fff; }
body:has(.admin-top-shell) .live-card h5 { margin: 0 0 9px; font-size: 12px; color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
body:has(.admin-top-shell) .live-status { font-weight: 800; font-size: 13px; margin-bottom: 4px; }
body:has(.admin-top-shell) .live-status.ok { color: #1f7a44; }
body:has(.admin-top-shell) .live-status.ko { color: #b02a2a; }
body:has(.admin-top-shell) .live-card .kv { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 3px 0; border-bottom: 1px dotted #f0eefb; }
body:has(.admin-top-shell) .live-card .kv span { color: #666; }
body:has(.admin-top-shell) .live-card .kv b { color: #333; }
body:has(.admin-top-shell) .live-card .hash { margin-top: 6px; font-size: 10.5px; color: #888; word-break: break-all; }
body:has(.admin-top-shell) .live-card .mini-tbl { width: 100%; font-size: 12px; }
body:has(.admin-top-shell) .live-card .mini-tbl td { padding: 2px 0; }
body:has(.admin-top-shell) .live-card .mini-tbl td:last-child { text-align: right; color: #555; }
body:has(.admin-top-shell) .yn { font-size: 11.5px; font-weight: 700; }
body:has(.admin-top-shell) .yn.yes { color: #1f7a44; }
body:has(.admin-top-shell) .yn.no { color: #b06a2a; }
body:has(.admin-top-shell) .gaps-warn { margin-top: 7px; font-size: 11.5px; color: #9a6a14; background: #fdf7ec; border: 1px solid #f1dcb0; border-radius: 7px; padding: 6px 9px; }
body:has(.admin-top-shell) .audit-table tr.row-fail td { background: #fdf2f2; }
body:has(.admin-top-shell) .audit-table .pill.pill-fail { background: #fdeaea; color: #b02a2a; border-color: #f1c0c0; }
body:has(.admin-top-shell) .four-cond { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
body:has(.admin-top-shell) .four-cond .fc { border: 1px solid #e4e1f6; border-radius: 10px; padding: 10px 12px; background: #fff; }
body:has(.admin-top-shell) .four-cond .fc-pct { font-size: 18px; font-weight: 800; }
body:has(.admin-top-shell) .four-cond .fc-pct.score-ok { color: #1f7a44; }
body:has(.admin-top-shell) .four-cond .fc-pct.score-warn { color: #9a6a14; }
body:has(.admin-top-shell) .four-cond .fc-pct.score-ko { color: #b02a2a; }
body:has(.admin-top-shell) .four-cond .fc-name { font-weight: 700; font-size: 13px; color: #2a2580; margin: 2px 0 4px; }
body:has(.admin-top-shell) .four-cond .fc-stmt { font-size: 11px; color: #666; line-height: 1.4; }

/* ============================================================================
 * Page de connexion (publique) — refonte propre & lisible, contraste élevé.
 * Auto-suffisante (ne dépend pas des styles .public-* de base).
 * ==========================================================================*/
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; box-sizing: border-box;
  background: radial-gradient(1100px 620px at 82% -12%, #2c2356 0%, #141a2e 48%, #0d1220 100%);
  color: #e8edf6; font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.auth-shell *, .auth-shell *::before, .auth-shell *::after { box-sizing: border-box; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 30px; flex-wrap: wrap; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-dot { width: 13px; height: 13px; border-radius: 50%; background: linear-gradient(135deg, #7c6cff, #34d6e8); box-shadow: 0 0 16px rgba(124, 108, 255, .65); flex-shrink: 0; }
.auth-brand strong { display: block; font-size: 16px; color: #fff; font-weight: 800; letter-spacing: .01em; }
.auth-brand small { color: #9fb0c9; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.auth-topnav { display: flex; gap: 20px; align-items: center; }
.auth-topnav a { color: #c3cee0; text-decoration: none; font-weight: 650; font-size: 14px; }
.auth-topnav a:hover { color: #fff; }
.auth-grid { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 26px 30px 50px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.auth-eyebrow { display: inline-block; color: #7fe0ec; font-weight: 700; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; }
.auth-intro h1 { font-size: 58px; line-height: 1.04; margin: 16px 0 20px; color: #ffffff; font-weight: 800; letter-spacing: -.02em; }
.auth-intro p { font-size: 17px; line-height: 1.62; color: #c3cee0; max-width: 490px; margin: 0 0 30px; }
.auth-feats { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; max-width: 460px; }
.auth-feats li { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: baseline; padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, .09); }
.auth-feats strong { color: #a89bff; font-weight: 700; font-size: 14px; }
.auth-feats span { color: #aebbd0; font-size: 14px; }
.auth-card { background: rgba(18, 24, 42, .82); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .11); border-radius: 20px; padding: 28px 28px 24px; box-shadow: 0 26px 70px rgba(0, 0, 0, .45); }
.auth-card-head { margin-bottom: 20px; }
.auth-live { display: inline-flex; align-items: center; gap: 8px; color: #9fb0c9; font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.auth-live > span { width: 8px; height: 8px; border-radius: 50%; background: #3fd07a; box-shadow: 0 0 9px #3fd07a; }
.auth-card-head h2 { margin: 9px 0 0; font-size: 27px; color: #fff; font-weight: 800; letter-spacing: -.01em; }
.auth-tabs { display: flex; gap: 5px; background: rgba(255, 255, 255, .055); border: 1px solid rgba(255, 255, 255, .07); border-radius: 13px; padding: 5px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; appearance: none; border: 0; background: none; color: #b8c4d8; font-weight: 700; font-size: 14px; padding: 10px 6px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.auth-tabs button:hover { color: #fff; }
.auth-tabs button.active { background: linear-gradient(135deg, #6655ff, #7c6cff); color: #fff; box-shadow: 0 5px 16px rgba(108, 92, 255, .42); }
/* Champs et boutons du formulaire (issu de publicAuthForm) */
.auth-card form, .auth-card .public-form { display: grid; gap: 15px; margin: 0; }
.auth-card .field { display: block; }
.auth-card .field.wide { grid-column: 1 / -1; }
.auth-card .field label { display: block; color: #c3cee0; font-size: 13px; font-weight: 650; margin-bottom: 7px; }
.auth-card .field input { width: 100%; background: #f4f6fb; border: 1px solid #d7def0; border-radius: 11px; padding: 12px 14px; font-size: 15px; color: #1a2233; }
.auth-card .field input::placeholder { color: #97a3b8; }
.auth-card .field input:focus { outline: none; border-color: #7c6cff; box-shadow: 0 0 0 3px rgba(124, 108, 255, .28); background: #fff; }
.auth-card .btn { width: 100%; border-radius: 11px; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer; border: 1px solid transparent; transition: filter .15s, background .15s; }
.auth-card .btn.primary { background: linear-gradient(135deg, #6655ff, #7c6cff); color: #fff; border: 0; box-shadow: 0 8px 22px rgba(108, 92, 255, .35); }
.auth-card .btn.primary:hover { filter: brightness(1.08); }
.auth-card .btn:not(.primary):not(.ghost) { background: rgba(255, 255, 255, .07); color: #dbe3f2; border: 1px solid rgba(255, 255, 255, .17); }
.auth-card .btn:not(.primary):not(.ghost):hover { background: rgba(255, 255, 255, .12); }
.auth-card .btn.ghost { background: none; color: #9fb0c9; border: 0; text-decoration: underline; padding: 8px; font-weight: 600; }
.auth-card .btn.ghost:hover { color: #fff; }
.auth-card .msg { margin: 14px 0 0; font-size: 13px; color: #c3cee0; min-height: 18px; text-align: center; line-height: 1.5; }
.auth-card .msg.error { color: #ff9b9b; }
.auth-card .msg.ok { color: #7ee0a6; }
.auth-foot { text-align: center; padding: 22px 20px 26px; color: #8497b2; font-size: 12.5px; line-height: 1.6; border-top: 1px solid rgba(255, 255, 255, .07); }
.auth-foot strong { color: #c3cee0; }
.auth-foot a { color: #9fb0c9; text-decoration: none; }
.auth-foot a:hover { color: #fff; }
@media (max-width: 880px) {
  .auth-top { padding: 14px 16px; justify-content: center; }
  .auth-grid { grid-template-columns: 1fr; gap: 26px; padding: 14px 16px 32px; }
  .auth-intro { text-align: center; }
  .auth-intro h1 { font-size: 40px; }
  .auth-intro p { margin-left: auto; margin-right: auto; }
  .auth-feats { margin: 0 auto; }
  .auth-feats li { grid-template-columns: 110px 1fr; text-align: left; }
}

/* ---- Impression de l'attestation ---- */
@media print {
  body.conf-printing .no-print, body.conf-printing nav, body.conf-printing .admin-nav, body.conf-printing .admin-top-shell > *:not(main), body.conf-printing header { display: none !important; }
  body.conf-printing .conf-pane[hidden] { display: block !important; }
  body.conf-printing .conf-item-body { display: block !important; }
  body.conf-printing .conf-item, body.conf-printing .live-card, body.conf-printing .conf-qa { break-inside: avoid; }
  body.conf-printing .attest-doc { break-inside: avoid; }
}

/* ===================== PARE-FEU / SECURITY CONSOLE ===================== */
/* Base composants (anciennement dans app.css non déployé) */
.fw-pre {white-space:pre-wrap; font-family:ui-monospace,monospace; font-size:11px; background:rgba(127,127,127,.06); padding:10px; border-radius:8px; max-height:300px; overflow:auto; margin:6px 0;}
.fw-details summary {cursor:pointer; margin-top:12px; font-weight:700;}
.fw-grid2 {display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:12px 0;}
.fw-card {background:var(--panel); border:1px solid var(--border); border-radius:10px; padding:14px 16px; margin:12px 0;}
.fw-card h4 {margin:0 0 10px;}
.fw-chart {width:100%; height:130px; display:block;}
.fw-chart-empty {color:var(--muted); font-size:13px; padding:30px 0; text-align:center;}
.fw-bars {display:grid; gap:6px;}
.fw-bar-row {display:grid; grid-template-columns:minmax(90px,38%) 1fr auto; gap:8px; align-items:center; font-size:12px;}
.fw-bar-label {overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted);}
.fw-bar-track {background:rgba(127,127,127,.12); border-radius:5px; height:14px; overflow:hidden;}
.fw-bar-fill {display:block; height:100%; border-radius:5px;}
.fw-bar-val {font-weight:700; font-variant-numeric:tabular-nums;}
.pill.fw-sev2 {background:rgba(255,140,0,.16); color:#d97706;}
.pill.track-ok {background:rgba(0,200,80,.16); color:#0a8f43;}
.pill.track-fail {background:rgba(220,40,40,.16); color:#c62828;}
@media (max-width:760px){ .fw-grid2 {grid-template-columns:1fr;} }

/* ===== Security Console — DA dédiée (scope .fwos) ===== */
.fwos {background: radial-gradient(1100px 380px at 18% -10%, #14233f 0%, transparent 60%), linear-gradient(180deg,#0b1220,#0d1526); color:#dbe4f0; border-radius:14px; margin:-4px 0; overflow:hidden; box-shadow:0 10px 40px rgba(0,0,0,.35);}
.fwos *, .fwos *::before {box-sizing:border-box;}
.fwos-top {display:flex; justify-content:space-between; align-items:center; gap:16px; padding:16px 20px; background:linear-gradient(90deg,#0e1a30,#0b1220); border-bottom:1px solid rgba(120,160,220,.16); flex-wrap:wrap;}
.fwos-brand {display:flex; align-items:center; gap:12px;}
.fwos-logo {font-size:26px; filter:drop-shadow(0 0 8px rgba(60,130,246,.55));}
.fwos-title {font-size:17px; font-weight:800; letter-spacing:.3px; color:#fff;}
.fwos-sub {font-size:12px; color:#7f93ad; margin-top:2px;}
.fwos-status {display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
.fwos-ind {display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:800; letter-spacing:.5px; padding:6px 12px; border-radius:999px;}
.fwos-ind.on {background:rgba(0,200,80,.14); color:#3ee07f; border:1px solid rgba(62,224,127,.3);}
.fwos-ind.off {background:rgba(220,40,40,.14); color:#ff6b6b; border:1px solid rgba(255,107,107,.3);}
.fwos-dot {width:8px; height:8px; border-radius:50%; background:currentColor; animation:fwpulse 1.8s infinite;}
@keyframes fwpulse {0%{box-shadow:0 0 0 0 rgba(62,224,127,.5);} 70%{box-shadow:0 0 0 8px rgba(62,224,127,0);} 100%{box-shadow:0 0 0 0 rgba(62,224,127,0);}}
.fwos-chip {font-size:12px; color:#aab8cc; background:rgba(120,160,220,.08); border:1px solid rgba(120,160,220,.15); border-radius:8px; padding:5px 10px;}
.fwos-refresh {background:rgba(120,160,220,.1); border:1px solid rgba(120,160,220,.2); color:#dbe4f0; width:34px; height:34px; border-radius:9px; cursor:pointer; font-size:16px;}
.fwos-refresh:hover {background:rgba(120,160,220,.2);}
.fwos-tabs {display:flex; gap:4px; padding:10px 16px 0; background:#0b1220; border-bottom:1px solid rgba(120,160,220,.12); overflow-x:auto;}
.fwos-tab {display:inline-flex; align-items:center; gap:7px; padding:10px 16px; border:none; background:transparent; color:#8ba0bd; font-weight:700; font-size:13px; cursor:pointer; border-radius:10px 10px 0 0; border-bottom:2px solid transparent; white-space:nowrap;}
.fwos-tab:hover {color:#cdd9ea;}
.fwos-tab.active {color:#fff; background:linear-gradient(180deg,rgba(60,130,246,.18),transparent); border-bottom-color:#3c82f6;}
.fwos-body {padding:16px 20px;}
.fwos-foot {padding:10px 20px 16px; font-size:11px; color:#5f718b; border-top:1px solid rgba(120,160,220,.1);}
.fwos .simple-stat-grid {gap:12px;}
.fwos .stat, body:has(.admin-top-shell) .fwos .stat {background:linear-gradient(180deg,#11203a,#0e1a30) !important; border:1px solid rgba(120,160,220,.16) !important; border-radius:12px; padding:14px 16px; position:relative; overflow:hidden; box-shadow:none !important;}
.fwos .stat::before {content:""; position:absolute; top:0; left:0; right:0; height:3px; background:linear-gradient(90deg,#3c82f6,#22d3ee);}
.fwos .stat span {color:#8ba0bd; font-size:12px;}
.fwos .stat strong {color:#fff; font-size:22px;}
.fwos .fw-grid2 {margin:12px 0;}
.fwos .fw-card {background:#0e1a30; border:1px solid rgba(120,160,220,.14); border-radius:12px; padding:16px;}
.fwos .fw-card h4 {color:#e6eefb; margin:0 0 12px; font-size:12px; letter-spacing:.4px; text-transform:uppercase;}
.fwos .fw-chart-empty {color:#5f718b;}
.fwos .fw-bar-label {color:#9fb0c8;}
.fwos .fw-bar-track {background:rgba(120,160,220,.1);}
.fwos .fw-bar-val {color:#e6eefb;}
.fwos .audit-table {color:#cdd9ea;}
.fwos .audit-table th {color:#7f93ad; border-bottom:1px solid rgba(120,160,220,.18); font-size:11px; text-transform:uppercase;}
.fwos .audit-table td {border-bottom:1px solid rgba(120,160,220,.07);}
.fwos .audit-table tr:hover td {background:rgba(120,160,220,.05);}
.fwos .mini-list .kv {border-bottom:1px solid rgba(120,160,220,.08); padding:7px 0; color:#cdd9ea;}
.fwos .mini-list .kv strong {color:#fff;}
.fwos .empty {color:#5f718b;}
.fwos .fw-pre {background:#0a1322; color:#9fb0c8; border:1px solid rgba(120,160,220,.12);}
.fwos .search, .fwos input {background:#0a1322; border:1px solid rgba(120,160,220,.2); color:#dbe4f0;}
.fwos .btn {background:rgba(120,160,220,.12); border:1px solid rgba(120,160,220,.2); color:#dbe4f0;}
.fwos .btn.primary {background:#3c82f6; border-color:#3c82f6; color:#fff;}
.fwos .btn.warn {background:rgba(220,40,40,.16); border-color:rgba(255,107,107,.3); color:#ff8a8a;}
.fwos .pill {background:rgba(120,160,220,.12); color:#cdd9ea;}
.fwos .pill.track-fail {background:rgba(220,40,40,.2); color:#ff7b7b;}
.fwos .pill.fw-sev2 {background:rgba(255,140,0,.18); color:#ffb454;}
.fwos .pill.track-ok {background:rgba(0,200,80,.16); color:#5fe09a;}
.fwos .mono {color:#9fd0ff;}

/* ===================== DEVIS : helper marge par ligne ===================== */
.line-cost-helper { grid-column: 1 / -1; display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:2px; padding:7px 9px; border:1px dashed rgba(217,160,32,.55); border-radius:8px; background:rgba(245,190,60,.09); font-size:12px; }
.line-cost-helper .lch-tag { font-weight:900; color:#9a6b00; white-space:nowrap; }
.line-cost-helper .lch-field { display:inline-flex; align-items:center; gap:5px; font-weight:700; color:var(--muted); }
.line-cost-helper .lch-field input { width:90px; }
.line-cost-helper .lch-apply { white-space:nowrap; }
.line-cost-helper .lch-out { display:flex; gap:10px; flex-wrap:wrap; align-items:center; font-weight:800; margin-left:auto; color:var(--text); }
.line-cost-helper .lch-out strong { color:#0a8f43; }
.line-cost-helper .lch-out.lch-loss strong, .line-cost-helper .lch-out.lch-loss b { color:#c62828; }

/* ===================== VUE DÉTAIL : colonnes marge (interne) ===================== */
.doc-lines-table .margin-ok { color:#0a8f43; font-weight:800; }
.doc-lines-table .margin-loss { color:#c62828; font-weight:800; }
.doc-lines-table .margin-total-row td { border-top:2px solid var(--border); background:rgba(245,190,60,.10); font-weight:800; }

/* ===================== COMPTA : rapprochement Indy ===================== */
.recon-panel .recon-rows { display:flex; flex-direction:column; gap:3px; margin:6px 0; }
.recon-row { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:8px 12px; border-radius:9px; }
.recon-row > span { color:var(--muted); font-size:13.5px; }
.recon-row > b { font-variant-numeric:tabular-nums; font-weight:700; white-space:nowrap; }
.recon-row.total { background:rgba(120,120,120,.07); }
.recon-row.total > span, .recon-row.total > b { font-weight:800; }
.recon-row.add > span, .recon-row.add > b { color:#b45309; }
.recon-row.subtotal { border-top:1px dashed var(--border); background:rgba(99,102,241,.08); }
.recon-row.subtotal > span, .recon-row.subtotal > b { color:#4338ca; font-weight:800; }
.recon-row.residual.ok > b { color:#0a8f43; }
.recon-row.residual.warn > b { color:#c0392b; }
.recon-residual-box { margin-top:10px; border:1px solid var(--border); border-radius:11px; padding:4px 2px; }
.recon-drafts { margin:8px 0; }
.recon-drafts > summary { cursor:pointer; color:var(--muted); font-size:13px; padding:5px 2px; }
.recon-draft-list { list-style:none; margin:8px 0 0; padding:0; display:flex; flex-direction:column; gap:5px; }
.recon-draft-list li { display:flex; align-items:center; gap:12px; padding:7px 12px; background:var(--panel); border:1px solid var(--border); border-radius:9px; }
.recon-draft-list .rd-num { font-weight:700; min-width:135px; }
.recon-draft-list .rd-cli { flex:1; font-size:13px; }
.recon-draft-list li b { font-variant-numeric:tabular-nums; white-space:nowrap; }
.recon-indy { display:flex; align-items:flex-end; gap:10px; margin-top:12px; flex-wrap:wrap; }
.recon-indy-field { display:flex; flex-direction:column; gap:5px; font-size:13px; color:var(--muted); }
.recon-indy-field input { padding:9px 11px; border:1px solid var(--border); border-radius:9px; font-size:14px; min-width:170px; background:var(--panel); color:inherit; }
.recon-note { font-size:12.5px; margin:9px 0 0; line-height:1.5; }

/* ===================== ARCHIVE INDY : rattachement manuel ===================== */
.legacy-unmatched { display:flex; flex-direction:column; gap:8px; }
.lu-card { border:1px solid var(--border); border-radius:11px; padding:10px 12px; background:var(--panel); }
.lu-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.lu-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:13.5px; }
.lu-kind { font-size:11px; font-weight:700; letter-spacing:.04em; padding:2px 7px; border-radius:6px; background:rgba(99,102,241,.12); color:#4338ca; }
.lu-name { color:var(--muted); }
.lu-right { display:flex; align-items:center; gap:12px; }
.lu-ttc { font-variant-numeric:tabular-nums; white-space:nowrap; }
.lu-attach { margin-top:10px; padding-top:10px; border-top:1px dashed var(--border); display:flex; flex-direction:column; gap:8px; }
.lu-search-wrap input { width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:9px; font-size:14px; background:var(--panel); color:inherit; box-sizing:border-box; }
.lu-results { display:flex; flex-direction:column; gap:3px; margin-top:5px; }
.lu-res { display:flex; flex-direction:column; align-items:flex-start; gap:1px; text-align:left; padding:7px 11px; border:1px solid var(--border); border-radius:8px; background:var(--panel); cursor:pointer; width:100%; }
.lu-res:hover { border-color:#6366f1; background:rgba(99,102,241,.06); }
.lu-res-name { font-weight:600; font-size:13.5px; }
.lu-res-sub { font-size:12px; color:var(--muted); }
.lu-res-sub.warn { color:#b45309; }
.lu-res-empty { font-size:12.5px; color:var(--muted); padding:6px 2px; }
.lu-create { display:flex; flex-direction:column; gap:8px; padding:10px; border:1px solid var(--border); border-radius:9px; background:rgba(120,120,120,.04); }
.lu-create-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.lu-create-grid input { padding:8px 10px; border:1px solid var(--border); border-radius:8px; font-size:13.5px; background:var(--panel); color:inherit; }
@media (max-width:640px){ .lu-create-grid { grid-template-columns:1fr; } }
.legacy-pill { display:inline-block; font-size:11px; font-weight:700; padding:1px 7px; border-radius:6px; }
.legacy-pill.ok { background:rgba(10,143,67,.12); color:#0a8f43; }
.legacy-pill.warn { background:rgba(180,83,9,.12); color:#b45309; }

/* ===================== Cloud / transfert (admin) ===================== */
.cloud-disk { padding:14px 16px; }
.cloud-disk.low { border:1px solid #e08a1e; }
.cloud-disk-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; font-size:13.5px; gap:12px; flex-wrap:wrap; }
.cloud-bar { height:10px; border-radius:999px; background:rgba(120,120,120,.15); overflow:hidden; }
.cloud-bar-fill { height:100%; background:linear-gradient(90deg,#4f46e5,#7c3aed); }
.cloud-disk.low .cloud-bar-fill { background:#c0392b; }
.cloud-drop { border:2px dashed var(--border); border-radius:12px; padding:22px; text-align:center; color:var(--muted); background:rgba(120,120,120,.03); }
.cloud-drop.over { border-color:#6366f1; background:rgba(99,102,241,.06); }
.cloud-up-row { display:flex; flex-direction:column; gap:4px; margin-top:8px; font-size:13px; }
.cloud-up-top { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.cloud-up-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cloud-up-meta { flex:0 0 auto; font-size:12px; color:#6366f1; white-space:nowrap; }
.cloud-up-bar { height:8px; border-radius:999px; background:rgba(120,120,120,.15); overflow:hidden; }
.cloud-up-bar > div { height:100%; width:0; background:#6366f1; transition:width .15s; }
.cloud-up-row.done .cloud-up-bar > div { background:#0a8f43; }
.cloud-up-row.err .cloud-up-bar > div { background:#c0392b; }
.cloud-manage .cloud-file { display:flex; align-items:center; gap:10px; padding:7px 11px; border:1px solid var(--border); border-radius:9px; margin-bottom:6px; font-size:13px; }
.cloud-manage .cloud-file > span:first-child { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ===================== L'Empreinte (admin passeports) ===================== */
.emp-form { display:flex; flex-direction:column; gap:10px; max-width:640px; }
.emp-form label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); }
.emp-form input, .emp-form textarea { padding:8px 10px; border:1px solid var(--border); border-radius:8px; font-size:13.5px; background:var(--panel); color:inherit; font-family:inherit; }
.emp-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.emp-actions-cell { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
@media (max-width:640px){ .emp-form-grid { grid-template-columns:1fr; } }
.emp-vision { border:1px dashed var(--border); border-radius:10px; padding:12px; background:rgba(99,102,241,.05); display:flex; flex-direction:column; gap:8px; }
.emp-vision-head { font-weight:600; font-size:14px; }
.emp-vision p { margin:0; }
.emp-vision input[type=file], .emp-vision textarea { padding:7px 9px; border:1px solid var(--border); border-radius:8px; font-size:13px; background:var(--panel); color:inherit; font-family:inherit; }
#emp-vision-status.err { color:#c0392b; }
.emp-ai-current { font-size:12.5px; padding:6px 9px; border-radius:8px; background:rgba(99,102,241,.08); }
/* Éditeur de fiche détaillée (passeport) */
.emp-form-block { border:1px solid var(--border); border-radius:11px; padding:12px; background:rgba(120,120,120,.03); }
.emp-form-block-h { font-weight:700; font-size:13.5px; margin-bottom:8px; }
.empE-grp { margin-bottom:12px; }
.empE-grp:last-child { margin-bottom:0; }
.empE-grp-h { display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:12.5px; font-weight:600; color:var(--muted); margin-bottom:6px; }
.empE-empty { font-size:12px; display:block; padding:2px 0; }
.empE-row { display:flex; gap:6px; align-items:center; margin-bottom:6px; }
.empE-row.col { flex-direction:column; align-items:stretch; gap:5px; border:1px solid var(--border); border-radius:9px; padding:8px; }
.empE-row-top { display:flex; gap:6px; align-items:center; }
.empE-row input, .empE-row textarea { flex:1; min-width:0; padding:7px 9px; border:1px solid var(--border); border-radius:8px; font-size:13px; background:var(--panel); color:inherit; font-family:inherit; }
.empE-row .dt { flex:0 0 92px; }
.empE-row .rf, .empE-row .st { flex:0 0 30%; }
.empE-del { flex:0 0 auto; width:30px; height:30px; border:1px solid var(--border); border-radius:8px; background:var(--panel); color:#c0392b; cursor:pointer; font-size:13px; line-height:1; }
.empE-del:hover { background:rgba(192,57,43,.1); }
.empE-photos { display:grid; grid-template-columns:repeat(auto-fill,minmax(84px,1fr)); gap:7px; margin-bottom:8px; }
.empE-photo { position:relative; }
.empE-photo img { width:100%; height:84px; object-fit:cover; border-radius:9px; border:1px solid var(--border); }
.empE-photo button { position:absolute; top:3px; right:3px; width:22px; height:22px; border:none; border-radius:50%; background:rgba(0,0,0,.62); color:#fff; cursor:pointer; font-size:12px; line-height:1; }
.empE-upload { display:inline-block; cursor:pointer; font-size:13px; padding:7px 12px; border:1px dashed var(--border); border-radius:9px; background:var(--panel); }
.empE-upload input { display:none; }
/* Services & tarifs */
.svc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; }
.svc-card { border:1px solid var(--border); border-radius:12px; padding:14px; background:var(--panel); display:flex; flex-direction:column; gap:8px; }
.svc-card-head { display:flex; flex-direction:column; gap:2px; }
.svc-name { font-weight:600; font-size:15px; padding:6px 8px; border:1px solid var(--border); border-radius:8px; background:var(--panel); color:inherit; }
.svc-f { display:flex; flex-direction:column; gap:3px; font-size:12px; color:var(--muted); }
.svc-f input, .svc-f textarea, .svc-card select { padding:7px 9px; border:1px solid var(--border); border-radius:8px; font-size:13px; background:var(--panel); color:inherit; font-family:inherit; }
.svc-specs { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.svc-check { display:flex; align-items:center; gap:6px; font-size:13px; }
/* Arborescence cloud (dossiers) */
.cloud-tree-dir { margin:2px 0; }
.cloud-tree-dir > summary { cursor:pointer; display:flex; justify-content:space-between; gap:10px; padding:5px 8px; border-radius:8px; font-size:13px; list-style:none; }
.cloud-tree-dir > summary::-webkit-details-marker { display:none; }
.cloud-tree-dir > summary:hover { background:rgba(120,120,120,.08); }
.cloud-tree-dir > summary .cloud-tree-name { font-weight:600; }
.cloud-tree-children { margin-left:14px; padding-left:8px; border-left:1px solid var(--border); }
/* Overlay transfert global + menu clic droit */
.cloud-ov { position:fixed; right:18px; bottom:18px; width:360px; max-width:calc(100vw - 24px); background:var(--panel); border:1px solid var(--border); border-radius:14px; box-shadow:0 14px 40px rgba(0,0,0,.3); padding:14px 16px; z-index:9999; transform:translateY(140%); opacity:0; transition:transform .25s, opacity .25s; }
.cloud-ov.show { transform:translateY(0); opacity:1; }
.cloud-ov-head { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.cloud-ov-title { flex:1; font-size:14px; }
.cloud-ov-count { font-size:12px; color:var(--muted); }
.cloud-ov-x { border:none; background:transparent; font-size:18px; line-height:1; cursor:pointer; color:var(--muted); }
.cloud-ov-bar { height:9px; border-radius:6px; background:rgba(120,120,120,.2); overflow:hidden; }
.cloud-ov-bar > div { height:100%; width:0; background:#6366f1; border-radius:6px; transition:width .2s; }
.cloud-ov.done .cloud-ov-bar > div { background:#0a8f43; }
.cloud-ov.err .cloud-ov-bar > div { background:#c0392b; }
.cloud-ov-stats { font-size:12px; color:var(--muted); margin-top:6px; }
.cloud-ov-file { font-size:12.5px; margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cloud-ctx { position:fixed; z-index:10000; background:var(--panel); border:1px solid var(--border); border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.3); padding:5px; min-width:180px; }
.cloud-ctx-item { display:flex; align-items:center; gap:9px; width:100%; text-align:left; border:none; background:transparent; padding:9px 11px; border-radius:7px; font-size:13.5px; cursor:pointer; color:inherit; }
.cloud-ctx-item:hover { background:rgba(99,102,241,.12); }
.cloud-ctx-item.danger { color:#c0392b; }
.cloud-file-del { flex:0 0 auto; width:30px; height:30px; display:grid; place-items:center; border:1px solid var(--border); border-radius:8px; background:transparent; color:inherit; cursor:pointer; font-size:18px; line-height:1; }
.cloud-file-del:hover { border-color:var(--accent); background:rgba(99,102,241,.08); }

/* Explorateur de transferts : navigation dossier par dossier, adaptée aux gros volumes. */
.cloud-browser-title { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:14px 0 7px; }
.cloud-browser-title h4 { margin:0 0 2px; }
.cloud-browser-title span { color:var(--muted); font-size:12px; }
.cloud-browser { min-height:110px; border:1px solid var(--border); border-radius:12px; overflow:hidden; background:var(--surface, #fff); }
.cloud-browser-loading { padding:28px 16px; color:var(--muted); text-align:center; }
.cloud-browser-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border-bottom:1px solid var(--border); background:rgba(120,120,120,.035); }
.cloud-browser-breadcrumbs { display:flex; align-items:center; flex-wrap:wrap; gap:4px; min-width:0; }
.cloud-browser-crumb { appearance:none; border:0; background:transparent; color:var(--accent); padding:3px 4px; border-radius:6px; font:inherit; font-size:12px; cursor:pointer; max-width:210px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cloud-browser-crumb:not(.current):hover { background:rgba(99,102,241,.09); }
.cloud-browser-crumb.current { color:var(--ink); font-weight:700; cursor:default; }
.cloud-browser-sep { color:var(--muted); font-size:14px; }
.cloud-browser-totals { color:var(--muted); font-size:12px; white-space:nowrap; }
.cloud-browser-list { display:flex; flex-direction:column; }
.cloud-browser-row { display:grid; grid-template-columns:28px minmax(0,1fr) auto 34px; align-items:center; gap:9px; min-height:48px; padding:6px 9px 6px 12px; border-bottom:1px solid var(--border); }
.cloud-browser-row:last-child { border-bottom:0; }
.cloud-browser-row.folder { cursor:pointer; }
.cloud-browser-row:hover { background:rgba(99,102,241,.055); }
.cloud-browser-icon { font-size:18px; line-height:1; }
.cloud-browser-name { min-width:0; color:inherit; text-decoration:none; overflow:hidden; }
.cloud-browser-name strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.cloud-browser-name small { display:block; margin-top:2px; color:var(--muted); font-size:11px; }
.cloud-browser-size { color:var(--muted); font-size:12px; white-space:nowrap; }
.cloud-browser-pagination { display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; padding:10px 12px; border-top:1px solid var(--border); background:rgba(120,120,120,.025); }
.cloud-browser-pagination span { color:var(--muted); font-size:12px; }
.cloud-browser-pagination button:disabled { opacity:.45; pointer-events:none; }
@media (max-width:640px) {
  .cloud-browser-toolbar { align-items:flex-start; flex-direction:column; }
  .cloud-browser-totals { white-space:normal; }
  .cloud-browser-row { grid-template-columns:24px minmax(0,1fr) 30px; }
  .cloud-browser-size { display:none; }
}
.cloud-private-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-bottom:12px; }
.cloud-private-summary > span { display:flex; flex-direction:column; gap:3px; padding:12px; border:1px solid var(--border); border-radius:10px; color:var(--muted); font-size:12px; }
.cloud-private-summary strong { color:var(--text); font-size:15px; }
.cloud-upload-report { margin:10px 0; padding:11px 13px; border:1px solid var(--border); border-radius:10px; font-size:13px; }
.cloud-upload-report.success { border-color:rgba(10,143,67,.35); background:rgba(10,143,67,.08); color:#0a8f43; }
.cloud-upload-report.error { border-color:rgba(192,57,43,.38); background:rgba(192,57,43,.07); }
.cloud-upload-report p { margin:5px 0; }
.cloud-upload-report ul { margin:8px 0 0; padding-left:18px; max-height:180px; overflow:auto; }
.cloud-upload-report li { margin:5px 0; }
.cloud-upload-report li span { display:block; overflow-wrap:anywhere; }
.cloud-upload-report li small { color:var(--muted); }
@media (max-width:680px) {
  .cloud-private-summary { grid-template-columns:1fr; }
}

/* ===================== ATELIER : AtelierIQ (cerveau) ===================== */
.aiq-panel { border:1px solid var(--border); border-radius:12px; padding:12px 14px; margin:6px 0 16px; background:linear-gradient(180deg, rgba(99,102,241,.06), transparent); }
.aiq-loading { color:var(--muted); font-size:13px; padding:4px 0; }
.aiq-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.aiq-logo { font-weight:800; }
.aiq-head .btn.small { margin-left:auto; }
.aiq-empty { font-size:13px; margin:2px 0 0; }
.aiq-kpis { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.aiq-kpi { border:1px solid var(--border); border-radius:9px; padding:8px; text-align:center; background:var(--panel); }
.aiq-kpi b { display:block; font-size:17px; font-variant-numeric:tabular-nums; }
.aiq-kpi span { font-size:11px; color:var(--muted); }
.aiq-terms { margin-top:9px; font-size:12.5px; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.aiq-term { background:rgba(99,102,241,.1); color:#4338ca; border-radius:999px; padding:2px 9px; }
.aiq-samples { margin-top:9px; }
.aiq-samples summary { cursor:pointer; color:var(--muted); font-size:13px; }
.aiq-sample { padding:6px 0; border-top:1px dashed var(--border); font-size:13px; display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; }
.aiq-out { font-size:11px; font-weight:700; padding:1px 7px; border-radius:999px; white-space:nowrap; }
.aiq-out.aiq-delivered { background:rgba(10,143,67,.13); color:#0a8f43; }
.aiq-out.aiq-irreparable { background:rgba(192,57,43,.13); color:#c0392b; }
.aiq-diag { color:var(--muted); font-style:italic; width:100%; font-size:12px; }
.aiq-ai { margin-top:10px; border:1px solid #c7d2fe; background:rgba(99,102,241,.07); border-radius:10px; padding:11px; display:flex; flex-direction:column; gap:8px; }
.aiq-ai-top { display:flex; justify-content:space-between; align-items:center; }
.aiq-ai-badge { font-size:11px; font-weight:700; background:#4338ca; color:#fff; padding:2px 8px; border-radius:999px; }
.aiq-conf { font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; }
.aiq-conf-hi { background:rgba(10,143,67,.16); color:#0a8f43; }
.aiq-conf-mid { background:rgba(224,138,30,.18); color:#b45309; }
.aiq-conf-lo { background:rgba(192,57,43,.14); color:#c0392b; }
.aiq-ai-fault strong, .aiq-ai-part strong { display:block; font-size:15px; }
.aiq-ai-part { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.aiq-ai-proc ol, .aiq-ai-other ul { margin:4px 0 0; padding-left:20px; font-size:13px; line-height:1.5; }
.aiq-ai-err { color:#c0392b; font-size:13px; }
@media (max-width:560px){ .aiq-kpis { grid-template-columns:repeat(2,1fr); } }

/* ===================== ATELIER : workflow / SLA ===================== */
body:has(.admin-top-shell) .sla-kpi { border-left:4px solid var(--border) !important; }
body:has(.admin-top-shell) .sla-kpi.sla-k-overdue { border-left-color:#c0392b !important; }
body:has(.admin-top-shell) .sla-kpi.sla-k-risk { border-left-color:#e08a1e !important; }
body:has(.admin-top-shell) .sla-kpi.sla-k-blocked { border-left-color:#7c3aed !important; }
body:has(.admin-top-shell) .sla-kpi.sla-k-on_time { border-left-color:#0a8f43 !important; }
.sla-cols { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:6px; align-items:start; }
@media (max-width:1100px){ .sla-cols { grid-template-columns:1fr; } }
.sla-sub { margin:14px 0 6px; font-size:13px; color:var(--muted); font-weight:600; }
.sla-list { display:flex; flex-direction:column; gap:6px; }
.sla-row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border:1px solid var(--border); border-left-width:4px; border-radius:10px; background:var(--panel); }
.sla-row.sr-overdue { border-left-color:#c0392b; }
.sla-row.sr-risk { border-left-color:#e08a1e; }
.sla-row.sr-blocked { border-left-color:#7c3aed; }
.sla-row.sr-on_time { border-left-color:#0a8f43; }
.sla-row.sr-to_ack { border-left-color:#2563eb; }
.sla-row-main { flex:1; min-width:0; text-align:left; background:none; border:none; cursor:pointer; display:flex; flex-direction:column; gap:2px; padding:0; color:inherit; font:inherit; }
.sla-row-main strong { font-size:13.5px; }
.sla-row-title { font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%; }
.sla-row-right { display:flex; align-items:center; gap:8px; white-space:nowrap; }
.sla-pill { font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; }
.sp-overdue { background:rgba(192,57,43,.13); color:#c0392b; }
.sp-risk { background:rgba(224,138,30,.16); color:#b45309; }
.sp-blocked { background:rgba(124,58,237,.13); color:#7c3aed; }
.sp-on_time { background:rgba(10,143,67,.13); color:#0a8f43; }
.sp-waiting { background:rgba(100,116,139,.14); color:#475569; }
.sp-toack { background:rgba(37,99,235,.13); color:#2563eb; }
.sp-done { background:rgba(13,148,136,.14); color:#0d9488; }
.sla-countdown { font-variant-numeric:tabular-nums; font-weight:700; font-size:12.5px; color:#0a8f43; min-width:52px; text-align:right; }
.sla-countdown.past { color:#c0392b; }
.po-wrap { display:grid; grid-template-columns:1fr 320px; gap:16px; }
@media (max-width:760px){ .po-wrap { grid-template-columns:1fr; } }
.po-list { display:flex; flex-direction:column; gap:8px; }
.po-item { border:1px solid var(--border); border-radius:10px; padding:9px 11px; display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.po-item-main { display:flex; flex-direction:column; gap:2px; min-width:0; }
.po-item-right { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.po-eta { font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.po-status { font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; background:rgba(100,116,139,.13); color:#475569; }
.po-s-ordered { background:rgba(37,99,235,.13); color:#2563eb; }
.po-s-received { background:rgba(10,143,67,.13); color:#0a8f43; }
.po-s-needed { background:rgba(224,138,30,.16); color:#b45309; }
.po-form { display:flex; flex-direction:column; gap:8px; border:1px solid var(--border); border-radius:12px; padding:12px; background:rgba(120,120,120,.03); }
.po-form label, .sla-config label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); }
.po-form input, .sla-config input { padding:8px 10px; border:1px solid var(--border); border-radius:8px; font-size:13.5px; background:var(--panel); color:inherit; }
.po-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.po-check { flex-direction:row !important; align-items:center; gap:8px; }
.po-check input { width:auto; }
.sla-config { display:flex; flex-direction:column; gap:10px; max-width:560px; }

/* ===================== COMPTA : calculateurs de marge ===================== */
.margin-tools .panel-head { align-items:center; }
.margin-real { margin:4px 0 14px; }
.margin-real.empty { padding:14px; border:1px dashed var(--border); border-radius:10px; }
.margin-real-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.margin-trend { list-style:none; margin:10px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:8px; }
.margin-trend li { display:flex; gap:6px; align-items:baseline; border:1px solid var(--border); border-radius:8px; padding:5px 9px; font-size:12px; }
.margin-trend li b { color:#0a8f43; }
.calc-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.calc-card { border:1px solid var(--border); border-radius:12px; padding:13px 14px; background:var(--panel); display:flex; flex-direction:column; gap:8px; }
.calc-card h4 { margin:0; font-size:14px; }
.calc-card .calc-help { margin:0; font-size:11.5px; color:var(--muted); }
.calc-fields { display:flex; flex-wrap:wrap; gap:8px; }
.calc-fields label { display:flex; flex-direction:column; gap:3px; font-size:11px; font-weight:800; color:var(--muted); flex:1 1 90px; }
.calc-fields input, .calc-fields select { width:100%; }
.calc-out { margin-top:auto; border-top:1px solid var(--border); padding-top:8px; min-height:44px; }
.calc-big { font-size:22px; font-weight:900; color:#1a4fd6; }
.calc-big.calc-loss { color:#c62828; }
.calc-loss { color:#c62828; font-weight:800; }
.calc-lines { list-style:none; margin:4px 0 0; padding:0; display:flex; flex-wrap:wrap; gap:4px 14px; font-size:12px; }
.calc-lines.big { font-size:14px; gap:6px 16px; }
.calc-lines li { color:var(--muted); }
.calc-lines li b { color:var(--text); }
@media (max-width:900px){ .calc-grid { grid-template-columns:1fr 1fr; } .margin-real-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:560px){ .calc-grid { grid-template-columns:1fr; } .margin-real-grid { grid-template-columns:1fr; } }

/* ===================== SOUS-TRAITANCE ===================== */
.subcontract-banner { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:14px; padding:14px 16px; border:1px solid #f59e0b; border-left:5px solid #f59e0b; border-radius:12px; background:rgba(245,158,11,.10); }
.subcontract-banner strong { display:block; font-size:15px; }
.subcontract-banner span { color:var(--muted); font-size:13px; }
.contract-doc { max-height:62vh; overflow:auto; border:1px solid var(--border); border-radius:10px; padding:18px 22px; margin:14px 0; background:#fff; font-size:13px; line-height:1.55; }
.contract-doc h1 { font-size:18px; text-align:center; }
.contract-doc h2 { font-size:14px; margin-top:18px; border-bottom:1px solid var(--border); padding-bottom:3px; }
.contract-doc h3 { font-size:13px; }
.contract-doc ul { margin:6px 0 6px 18px; }
.contract-doc table.signatures { width:100%; margin-top:16px; border-collapse:collapse; }
.contract-doc table.signatures td { width:50%; vertical-align:top; border:1px solid var(--border); padding:10px; height:80px; }
.contract-sign { margin-top:8px; border-top:2px dashed var(--border); padding-top:14px; }

/* Aperçu "Voir son compte" (impersonation visuelle) */
.impersonate-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:#1a4fd6; color:#fff; padding:8px 16px; font-size:13px; font-weight:600; }
.impersonate-bar strong { font-weight:800; }
.impersonate-bar span { opacity:.85; font-weight:500; }
.impersonate-bar .btn { margin-left:auto; background:#fff; color:#1a4fd6; border:none; font-weight:800; }

/* Demande de révision de prix (devis) */
.review-request-box { margin:10px 0; padding:12px 14px; border:1px solid #f59e0b; border-left:5px solid #f59e0b; border-radius:10px; background:rgba(245,158,11,.10); }
.review-request-box strong { display:block; font-size:14px; }
.review-request-box p { margin:4px 0 0; }
.doc-lines-table tfoot .discount-row strong, .totals .discount-row strong { color:#c62828; }

/* ===================== CHAT STAFF (widget flottant) ===================== */
#staffChat { position: fixed; right: 20px; bottom: 20px; z-index: 4000; }
#staffChat .chat-bubble { position: relative; width: 56px; height: 56px; border-radius: 50%; background: var(--accent, #5b50e0); color: #fff; font-size: 24px; border: 0; cursor: pointer; box-shadow: 0 10px 28px rgba(17,22,34,.28); display: grid; place-items: center; }
#staffChat .chat-bubble:hover { filter: brightness(1.06); }
#staffChat .chat-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
#staffChat .chat-badge.inline { position: static; }
.chat-panel { position: absolute; right: 0; bottom: 70px; width: 360px; max-width: calc(100vw - 32px); height: 70vh; max-height: 560px; background: #fff; border: 1px solid var(--border, #e3e6ee); border-radius: 16px; box-shadow: 0 24px 60px rgba(17,22,34,.22); display: flex; flex-direction: column; overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; background: var(--accent,#5b50e0); color: #fff; }
.chat-head strong { font-size: 15px; flex: 1; }
.chat-head .btn.small { background: rgba(255,255,255,.22); border: 0; color: #fff; }
.chat-x { background: transparent; border: 0; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; padding: 0 4px; }
.chat-list { flex: 1; overflow: auto; padding: 6px; }
.chat-conv { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 8px; border: 0; background: transparent; cursor: pointer; border-radius: 10px; text-align: left; }
.chat-conv:hover { background: var(--accent-soft, #f1f0fd); }
.chat-conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-conv-title { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink,#1a1f2b); }
.chat-conv-prev { font-size: 12px; color: var(--muted,#7a8194); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; flex: 0 0 auto; }
.chat-empty { padding: 24px 16px; text-align: center; color: var(--muted,#7a8194); font-size: 13px; }
.chat-thread { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #f7f8fc; }
.chat-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.chat-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg-body { background: #fff; border: 1px solid var(--border,#e3e6ee); border-radius: 12px; padding: 7px 10px; }
.chat-msg.mine .chat-msg-body { background: var(--accent,#5b50e0); color: #fff; border-color: transparent; }
.chat-msg-author { font-size: 11px; font-weight: 800; color: var(--accent,#5b50e0); margin-bottom: 2px; }
.chat-msg-text { font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.chat-msg-time { font-size: 10px; opacity: .6; margin-top: 3px; text-align: right; }
.chat-media { max-width: 220px; max-height: 220px; border-radius: 8px; margin-top: 4px; display: block; }
.chat-composer { display: flex; align-items: center; gap: 6px; padding: 8px; border-top: 1px solid var(--border,#e3e6ee); }
.chat-composer textarea { flex: 1; resize: none; border: 1px solid var(--border,#e3e6ee); border-radius: 10px; padding: 8px; font: inherit; max-height: 90px; }
.chat-attach-btn { cursor: pointer; font-size: 20px; padding: 0 2px; }
.chat-attach-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px; }
.chat-attach-chips:empty { display: none; }
.chat-chip { background: var(--accent-soft,#f1f0fd); border-radius: 8px; padding: 3px 8px; font-size: 11px; }
.chat-chip button { border: 0; background: transparent; cursor: pointer; font-weight: 800; }
.chat-new-section { padding: 10px 8px; border-bottom: 1px solid var(--border,#e3e6ee); display: flex; flex-direction: column; gap: 6px; }
.chat-new-section > strong { font-size: 12px; text-transform: uppercase; color: var(--muted,#7a8194); }
.chat-group-pick { display: flex; flex-direction: column; gap: 4px; max-height: 150px; overflow: auto; }
.chat-pick { display: flex; align-items: center; gap: 8px; font-size: 13px; }
#noticeRoot { bottom: 92px !important; }

/* ---- Chat « façon Teams » : présence, réactions, réponses, plein écran ---- */
.chat-head-title { font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-tools { display: flex; align-items: center; gap: 2px; }
.chat-rail { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat-search-bar { padding: 8px; border-bottom: 1px solid var(--border,#e3e6ee); }
.chat-search { width: 100%; border: 1px solid var(--border,#e3e6ee); border-radius: 10px; padding: 7px 10px; font: inherit; box-sizing: border-box; }
.chat-conv.active { background: var(--accent-soft,#f1f0fd); }
.chat-avatar { position: relative; }
.chat-avatar .chat-dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #9aa1b2; border: 2px solid #fff; display: none; }
.chat-avatar.online .chat-dot { display: block; background: #2bb673; }

/* deux panneaux + plein écran */
.chat-main { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.chat-2pane { display: flex; flex: 1; min-height: 0; }
.chat-2pane .chat-rail { flex: 0 0 244px; border-right: 1px solid var(--border,#e3e6ee); }
.chat-2pane .chat-main { flex: 1; min-width: 0; }
#staffChat.chat-expanded .chat-panel { width: 760px; height: 82vh; max-height: 680px; }
.chat-empty-main { display: grid; place-items: center; height: 100%; padding: 40px; }
.chat-main-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border,#e3e6ee); background: #fff; }
.chat-main-head-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-main-head-info strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main-head-info small { font-size: 11px; color: var(--muted,#7a8194); }
.chat-main-head .chat-x { color: var(--muted,#7a8194); }

/* séparateur de jour + regroupement */
.chat-day { text-align: center; margin: 8px 0 2px; }
.chat-day span { background: rgba(120,127,145,.14); color: var(--muted,#7a8194); font-size: 11px; padding: 2px 10px; border-radius: 10px; }
.chat-msg.grouped { margin-top: -4px; }
.chat-msg-meta { display: flex; justify-content: flex-end; }

/* actions au survol */
.chat-actions { display: flex; gap: 2px; align-self: center; opacity: 0; transition: opacity .12s; }
.chat-msg:hover .chat-actions { opacity: 1; }
.chat-actions button { border: 1px solid var(--border,#e3e6ee); background: #fff; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-size: 12px; line-height: 1; padding: 0; }
.chat-actions button:hover { background: var(--accent-soft,#f1f0fd); }

/* réactions */
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.chat-react-chip { border: 1px solid var(--border,#e3e6ee); background: #fff; border-radius: 12px; padding: 1px 7px; font-size: 12px; cursor: pointer; line-height: 1.6; }
.chat-react-chip.mine { background: var(--accent-soft,#f1f0fd); border-color: var(--accent,#5b50e0); }
.chat-msg.mine .chat-react-chip { color: var(--ink,#1a1f2b); }
.chat-react-pop { position: fixed; z-index: 5000; background: #fff; border: 1px solid var(--border,#e3e6ee); border-radius: 24px; box-shadow: 0 12px 30px rgba(17,22,34,.22); padding: 4px 6px; display: flex; gap: 2px; }
.chat-react-pop.wide { flex-wrap: wrap; max-width: 264px; border-radius: 14px; }
.chat-react-pop button { border: 0; background: transparent; font-size: 20px; cursor: pointer; padding: 4px; border-radius: 8px; }
.chat-react-pop button:hover { background: var(--accent-soft,#f1f0fd); transform: scale(1.12); }

/* « en train d'écrire » */
.chat-typing { padding: 2px 14px; font-size: 12px; color: var(--muted,#7a8194); display: flex; align-items: center; gap: 6px; }
.chat-typing[hidden] { display: none; }
.chat-typing-dots { display: inline-flex; gap: 3px; }
.chat-typing-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent,#5b50e0); animation: chatBlink 1s infinite; }
.chat-typing-dots i:nth-child(2) { animation-delay: .2s; }
.chat-typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes chatBlink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; } }

/* réponse citée */
.chat-reply-preview { padding: 4px 8px 0; }
.chat-reply-preview[hidden] { display: none; }
.chat-reply-card { background: var(--accent-soft,#f1f0fd); border-left: 3px solid var(--accent,#5b50e0); border-radius: 8px; padding: 5px 8px; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chat-reply-card button { border: 0; background: transparent; cursor: pointer; font-weight: 800; font-size: 15px; }
.chat-quote { border-left: 3px solid rgba(120,127,145,.5); padding: 2px 8px; margin-bottom: 4px; font-size: 12px; opacity: .9; border-radius: 4px; background: rgba(120,127,145,.08); }
.chat-msg.mine .chat-quote { background: rgba(255,255,255,.18); border-left-color: rgba(255,255,255,.6); }

/* fichiers, mentions, édité, supprimé, accusé de lecture */
.chat-file { display: inline-flex; align-items: center; gap: 6px; background: rgba(120,127,145,.12); border-radius: 8px; padding: 6px 10px; margin-top: 4px; text-decoration: none; color: inherit; font-size: 13px; max-width: 230px; }
.chat-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file small { opacity: .7; flex: 0 0 auto; }
.chat-mention { color: var(--accent,#5b50e0); font-weight: 700; background: var(--accent-soft,#f1f0fd); border-radius: 4px; padding: 0 2px; }
.chat-msg.mine .chat-mention { color: #fff; background: rgba(255,255,255,.22); }
.chat-edited { font-size: 10px; opacity: .6; }
.chat-deleted { opacity: .65; font-style: italic; }
.chat-msg.deleted .chat-msg-body { background: transparent; border: 1px dashed var(--border,#e3e6ee); }
.chat-receipt { font-size: 10.5px; color: var(--muted,#7a8194); text-align: right; padding: 0 4px; }
.chat-receipt:empty { display: none; }
.chat-edit-form textarea { width: 100%; box-sizing: border-box; border-radius: 8px; border: 1px solid var(--border,#e3e6ee); padding: 6px; font: inherit; }
.chat-edit-actions { margin-top: 4px; display: flex; gap: 6px; }
.chat-emoji-btn { border: 0; background: transparent; font-size: 18px; cursor: pointer; padding: 0 2px; }

/* panneau de groupe */
.chat-group-panel { padding: 12px; overflow: auto; flex: 1; }
.chat-group-panel h4 { margin: 12px 0 6px; font-size: 12px; text-transform: uppercase; color: var(--muted,#7a8194); }
.chat-grp-row { display: flex; gap: 6px; }
.chat-grp-member { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
.chat-grp-member span { flex: 1; }
.chat-grp-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn.small.danger { background: #fce8e8; color: #c0392b; border: 1px solid #f3c0c0; }
.chat-new { flex: 1; overflow: auto; }

/* fermer une conversation + menu options */
.chat-conv { position: relative; }
.chat-conv-close { opacity: 0; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 16px; color: var(--muted,#7a8194); transition: opacity .12s; }
.chat-conv:hover .chat-conv-close { opacity: 1; }
.chat-conv-close:hover { background: rgba(229,72,77,.14); color: #e5484d; }
.chat-menu-pop { position: fixed; z-index: 5000; background: #fff; border: 1px solid var(--border,#e3e6ee); border-radius: 10px; box-shadow: 0 12px 30px rgba(17,22,34,.22); padding: 4px; display: flex; flex-direction: column; min-width: 212px; }
.chat-menu-pop button { border: 0; background: transparent; text-align: left; padding: 9px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink,#1a1f2b); }
.chat-menu-pop button:hover { background: var(--accent-soft,#f1f0fd); }

@media (max-width: 640px) {
  #staffChat.chat-expanded .chat-panel { width: calc(100vw - 24px); height: 82vh; }
  .chat-2pane .chat-rail { flex-basis: 150px; }
  .chat-media { max-width: 170px; }
}

/* Caisse : solde espèces temps réel mis en avant */
.cash-espece-row .stat:first-child { border: 1px solid #2bb673; box-shadow: 0 0 0 2px rgba(43,182,115,.12); }
.cash-espece-row .stat:first-child .stat-value, .cash-espece-row .stat:first-child strong { color: #1a7f43; }

/* Caisse : carte cliquable + détail espèces */
.stat.clickable { cursor: pointer; transition: transform .08s, box-shadow .12s; }
.stat.clickable:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(43,182,115,.18); }
.stat .stat-hint { display: block; font-size: 11px; font-weight: 600; color: #2bb673; margin-top: 4px; }
.cash-breakdown-wrap { max-height: 52vh; overflow: auto; border: 1px solid var(--border,#e3e6ee); border-radius: 10px; }
table.cash-breakdown { width: 100%; border-collapse: collapse; }
table.cash-breakdown th, table.cash-breakdown td { padding: 7px 10px; border-bottom: 1px solid var(--border,#eef0f4); font-size: 13px; }
table.cash-breakdown th { position: sticky; top: 0; background: #f7f8fc; text-align: left; }
table.cash-breakdown td.num, table.cash-breakdown th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.cash-breakdown td.pos { color: #1a7f43; font-weight: 600; }
table.cash-breakdown td.neg { color: #c0392b; font-weight: 600; }
.cash-breakdown-total { display: flex; align-items: center; justify-content: space-between; padding: 12px 6px 2px; border-top: 2px solid var(--border,#e3e6ee); margin-top: 8px; font-weight: 800; }
.cash-breakdown-total strong { color: #1a7f43; font-size: 19px; }

/* ===== Chat en direct — console staff (deux panneaux) ===== */
.lca { display: grid; grid-template-columns: 320px 1fr; gap: 14px; height: calc(100vh - 230px); min-height: 460px; margin-top: 14px; }
.lca-list { border: 1px solid var(--border, #e3e6ee); border-radius: 14px; background: var(--panel, #fff); overflow-y: auto; padding: 8px; }
.lca-list-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); padding: 8px 8px 6px; }
.lca-count { background: var(--accent, #5b50e0); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.lca-row { display: block; width: 100%; text-align: left; border: none; background: transparent; cursor: pointer; padding: 10px 11px; border-radius: 11px; margin-bottom: 2px; }
.lca-row:hover { background: rgba(120,120,120,.07); }
.lca-row.active { background: var(--accent-soft, #ecebfd); }
.lca-row.unread strong { font-weight: 800; }
.lca-row-top { display: flex; align-items: center; gap: 8px; }
.lca-row-top strong { font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lca-row-sub { font-size: 12px; color: var(--muted, #6b7280); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lca-unread { background: #e0533d; color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.lca-dot { width: 9px; height: 9px; border-radius: 50%; background: #c7ccd6; flex: 0 0 auto; }
.lca-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.lca-closed { margin-top: 8px; }
.lca-closed > summary { cursor: pointer; font-size: 12px; color: var(--muted, #6b7280); padding: 6px 8px; }
.lca-main { border: 1px solid var(--border, #e3e6ee); border-radius: 14px; background: var(--panel, #fff); display: flex; flex-direction: column; overflow: hidden; }
.lca-empty { margin: auto; text-align: center; color: var(--muted, #6b7280); }
.lca-empty > div { font-size: 40px; }
.lca-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border, #e3e6ee); flex-wrap: wrap; }
.lca-head-id strong { font-size: 16px; }
.lca-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.lca-transfer { padding: 7px 9px; border: 1px solid var(--border, #e3e6ee); border-radius: 8px; font-size: 13px; background: var(--panel, #fff); color: inherit; }
.lca-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: rgba(120,120,120,.03); }
.lca-msg { display: flex; flex-direction: column; max-width: 72%; }
.lca-msg.staff { align-self: flex-end; align-items: flex-end; }
.lca-msg.client { align-self: flex-start; align-items: flex-start; }
.lca-who { font-size: 11px; color: var(--muted, #6b7280); margin: 0 6px 2px; font-weight: 600; }
.lca-bubble { padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.lca-msg.staff .lca-bubble { background: linear-gradient(135deg, #5b50e0, #6d28d9); color: #fff; border-bottom-right-radius: 5px; }
.lca-msg.client .lca-bubble { background: var(--panel, #fff); border: 1px solid var(--border, #e3e6ee); border-bottom-left-radius: 5px; }
.lca-sys { align-self: center; font-size: 11.5px; color: var(--muted, #6b7280); background: rgba(120,120,120,.1); border-radius: 999px; padding: 4px 13px; text-align: center; max-width: 90%; }
.lca-input { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--border, #e3e6ee); }
.lca-input textarea { flex: 1; resize: none; border: 1px solid var(--border, #e3e6ee); border-radius: 11px; padding: 10px 12px; font: inherit; font-size: 14px; max-height: 120px; background: var(--panel, #fff); color: inherit; }
.lca-input textarea:focus { outline: none; border-color: var(--accent, #5b50e0); }
@media (max-width: 860px) { .lca { grid-template-columns: 1fr; height: auto; } .lca-list { max-height: 260px; } .lca-main { min-height: 420px; } }

/* ===== Messagerie : onglets Clients / Équipe (chat unifié) ===== */
.chat-tabs { display: flex; gap: 5px; padding: 7px 9px; border-bottom: 1px solid var(--border, #e3e6ee); flex: 0 0 auto; }
.chat-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border: none; background: rgba(120,120,120,.07); color: var(--muted, #6b7280); border-radius: 10px; padding: 8px 6px; font-size: 13px; font-weight: 700; cursor: pointer; transition: .12s; }
.chat-tab:hover { background: rgba(120,120,120,.13); }
.chat-tab.on { background: var(--accent-soft, #ecebfd); color: #3a32a8; }
.chat-tab-b { background: #e0533d; color: #fff; border-radius: 999px; min-width: 17px; height: 17px; padding: 0 5px; font-size: 10.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.chat-clients { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* ===== Chat clients — contenu (liste + conversation) intégré au panneau ===== */
.lcb-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px; }
.lcb-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: none; background: transparent; cursor: pointer; padding: 10px 11px; border-radius: 11px; }
.lcb-row:hover { background: rgba(120,120,120,.08); }
.lcb-row.unread .lcb-row-name { font-weight: 800; }
.lcb-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lcb-row-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcb-row-main small { font-size: 11.5px; color: var(--muted, #6b7280); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcb-dot { width: 9px; height: 9px; border-radius: 50%; background: #c7ccd6; flex: 0 0 auto; }
.lcb-dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.lcb-unread { background: #e0533d; color: #fff; border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.lcb-conv-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border, #e3e6ee); flex: 0 0 auto; }
.lcb-backbtn { border: none; background: rgba(120,120,120,.08); border-radius: 8px; padding: 5px 9px; font-size: 12.5px; cursor: pointer; color: var(--accent, #5b50e0); font-weight: 600; }
.lcb-backbtn:hover { background: rgba(120,120,120,.16); }
.lcb-conv-name { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lcb-actions { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--border, #e3e6ee); flex: 0 0 auto; scrollbar-width: none; }
.lcb-actions::-webkit-scrollbar { display: none; }
.lcb-actions > * { flex: 0 0 auto; }
.lcb-mine { font-size: 12px; font-weight: 700; color: #0a8f43; }
.lcb-transfer { padding: 5px 7px; border: 1px solid var(--border, #e3e6ee); border-radius: 8px; font-size: 12px; background: var(--panel, #fff); color: inherit; }
.lcb-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 7px; background: rgba(120,120,120,.03); }
.lcb-input { flex: 0 0 auto; display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--border, #e3e6ee); }
.lcb-input textarea { flex: 1; resize: none; border: 1px solid var(--border, #e3e6ee); border-radius: 11px; padding: 9px 11px; font: inherit; font-size: 13.5px; max-height: 100px; background: var(--panel, #fff); color: inherit; }
.lcb-input textarea:focus { outline: none; border-color: var(--accent, #5b50e0); }
.lcb-send { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; border: none; background: var(--accent, #5b50e0); color: #fff; font-size: 17px; cursor: pointer; }
.lcb-send:hover { filter: brightness(1.08); }

/* ===== Bordereau d'achat à un particulier (rachat sur dossier client) ===== */
.btn.amber { background: #f59e0b; color: #1f2430; border-color: #f59e0b; }
.btn.amber:hover { filter: brightness(1.06); }
.bb-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.bb-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 11px; border: 1px solid var(--border, #e3e6ee); border-radius: 11px; background: var(--panel, #fff); }
.bb-main { min-width: 0; }
.bb-amt { text-align: right; white-space: nowrap; }
.bb-act { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.bb-reg-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 6px 0 8px; }
@media (max-width: 640px) { .bb-row { grid-template-columns: 1fr; } .bb-amt, .bb-act { text-align: left; justify-content: flex-start; } }

/* Suivi colis : ETA (retard en rouge, à venir en vert) */
.eta-late { color: #c62828; font-weight: 700; }
.eta-ok { color: #0a8f43; font-weight: 600; }
/* Contraste : sujet des mails NON LUS (était blanc sur fond clair → illisible) */
.mail-table tr.unread td strong { color: #0e7490; }
/* Contraste : champs de la modale « changement de statut » (texte clair sur fond foncé) */
.status-confirm-modal .field input,
.status-confirm-modal .field textarea,
.status-confirm-modal .field select { background: #0e1828; color: #eef3fb; border-color: #2b3d57; }
.status-confirm-modal .field input::placeholder,
.status-confirm-modal .field textarea::placeholder { color: #9fb0c6; }
/* Ligne de résumé (totaux) en bas des listes Devis/Factures */
.doc-totals-row td { background: rgba(120,120,120,.07); border-top: 2px solid var(--border, #e3e6ee); font-size: 13px; }
/* TVA en jaune/or bien voyant, bénéfice (marge HT) en vert — TEXTE coloré uniquement, sans fond de case */
.docs-list-table .doc-tva { color: #b8860b; font-weight: 700; }
.docs-list-table .margin-ok { color: #0a8f43; font-weight: 700; }
.docs-list-table .margin-loss { color: #c62828; font-weight: 700; }

/* ===== Avis Google (page admin greviews) ===== */
.grev-card { margin-bottom: 14px; }
.grev-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.grev-card-meta { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.grev-stars { color: #f5b50a; letter-spacing: 1px; font-size: 14px; }
.grev-comment { margin: 8px 0; padding: 10px 12px; background: rgba(127,127,127,.07); border-radius: 8px; line-height: 1.45; }
.grev-published { margin-top: 10px; padding: 10px 12px; border-left: 3px solid #22c55e; background: rgba(34,197,94,.08); border-radius: 6px; }
.grev-published p { margin: 4px 0 0; }
.grev-err { margin-top: 8px; color: #dc2626; font-size: 13px; }
.grev-loc-select { min-width: 240px; }
.grev-check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }

/* ===== Agent Vocal — console Twilio / OpenAI Realtime ===== */
.va-page { --va-ink:#eaf3f4; --va-muted:#92a8ad; --va-line:rgba(177,218,219,.16); --va-mint:#65e6c4; --va-cyan:#5ed6e8; --va-coral:#ff8b7b; display:grid; gap:16px; }
.va-hero { position:relative; min-height:220px; padding:30px 34px; border:1px solid var(--va-line); border-radius:24px; overflow:hidden; display:flex; align-items:center; justify-content:space-between; gap:30px; color:var(--va-ink); background:
  radial-gradient(circle at 82% 20%,rgba(94,214,232,.18),transparent 30%),
  radial-gradient(circle at 10% 110%,rgba(101,230,196,.18),transparent 36%),
  linear-gradient(135deg,#111d2a 0%,#0d1723 58%,#151829 100%); box-shadow:0 22px 55px rgba(4,13,20,.24); }
.va-hero::before { content:""; position:absolute; inset:-80px -40px auto auto; width:260px; height:260px; border:1px solid rgba(101,230,196,.16); border-radius:50%; box-shadow:0 0 0 32px rgba(94,214,232,.025),0 0 0 70px rgba(94,214,232,.02); pointer-events:none; }
.va-hero::after { content:""; position:absolute; left:0; right:0; bottom:0; height:3px; background:linear-gradient(90deg,var(--va-mint),var(--va-cyan),transparent 82%); opacity:.35; }
.va-hero.live::after { opacity:1; box-shadow:0 0 18px rgba(101,230,196,.55); }
.va-hero-copy { position:relative; z-index:1; max-width:760px; }
.va-hero .eyebrow { color:var(--va-mint); }
.va-hero h2 { color:#f7fcfc; font-size:clamp(30px,4vw,52px); line-height:1; letter-spacing:-.045em; margin:9px 0 14px; }
.va-hero p { color:#b6c7ca; max-width:680px; line-height:1.6; margin:0; font-size:15px; }
.va-health { display:flex; gap:8px; flex-wrap:wrap; margin-top:20px; }
.va-status { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--va-line); background:rgba(255,255,255,.055); color:#cbd8da; border-radius:999px; padding:7px 11px; font-size:11px; font-weight:750; letter-spacing:.02em; }
.va-status i { width:7px; height:7px; border-radius:50%; background:#6e7e85; box-shadow:0 0 0 3px rgba(110,126,133,.13); }
.va-status.ok i { background:var(--va-mint); box-shadow:0 0 0 3px rgba(101,230,196,.14),0 0 12px rgba(101,230,196,.4); }
.va-status.off { color:#9aa9ad; }
.va-power { position:relative; z-index:1; flex:0 0 176px; min-height:150px; border:1px solid rgba(255,255,255,.1); border-radius:20px; background:rgba(5,13,23,.35); backdrop-filter:blur(10px); display:grid; place-items:center; align-content:center; gap:10px; }
.va-power > span { font-size:10px; letter-spacing:.2em; font-weight:850; color:#96a9ad; }
.va-power small { color:#8ea0a5; font-size:11px; }
.va-switch { appearance:none; width:82px; height:42px; border:1px solid rgba(255,255,255,.14); background:#26323e; border-radius:999px; padding:4px; cursor:pointer; transition:.25s ease; box-shadow:inset 0 2px 7px rgba(0,0,0,.25); }
.va-switch i { display:block; width:32px; height:32px; border-radius:50%; background:#c7d0d2; transition:.25s ease; box-shadow:0 4px 10px rgba(0,0,0,.3); }
.va-switch.on { background:linear-gradient(90deg,#21a987,var(--va-mint)); border-color:rgba(101,230,196,.6); }
.va-switch.on i { transform:translateX(39px); background:white; box-shadow:0 0 18px rgba(255,255,255,.45); }
.va-tabs { display:flex; gap:5px; padding:5px; width:max-content; max-width:100%; overflow:auto; border:1px solid var(--va-line); border-radius:14px; background:rgba(9,18,29,.72); scrollbar-width:none; }
.va-tabs::-webkit-scrollbar { display:none; }
.va-tabs button { border:0; background:transparent; color:#93a8ad; border-radius:10px; padding:10px 16px; white-space:nowrap; font:inherit; font-size:12px; font-weight:750; cursor:pointer; }
.va-tabs button:hover { color:#e6f2f3; background:rgba(255,255,255,.05); }
.va-tabs button.active { color:#09231f; background:linear-gradient(135deg,var(--va-mint),#9ff1db); box-shadow:0 7px 18px rgba(52,202,164,.22); }
.va-stat-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; }
.va-stat-grid article { min-height:105px; padding:18px 20px; border:1px solid var(--va-line); border-radius:16px; background:linear-gradient(145deg,rgba(20,33,47,.92),rgba(12,23,35,.94)); display:flex; flex-direction:column; justify-content:space-between; }
.va-stat-grid span { color:#8fa3a8; font-size:11px; font-weight:720; }
.va-stat-grid strong { color:#eef8f8; font-size:27px; letter-spacing:-.04em; }
.va-stat-grid strong small { color:#789197; font-size:10px; letter-spacing:0; }
.va-grid-main { display:grid; grid-template-columns:minmax(0,1fr) 330px; gap:14px; align-items:start; }
.va-page .panel { border-color:var(--va-line) !important; }
.va-settings .panel-head { align-items:flex-start !important; }
.va-settings .field small { color:#7f969c; font-size:11px; }
.va-checks { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:8px 0 12px; }
.va-checks label { min-height:60px; padding:12px; border:1px solid var(--va-line); border-radius:12px; color:#b8c8cc; font-size:12px; line-height:1.4; display:flex; align-items:flex-start; gap:8px; background:rgba(255,255,255,.025); }
.va-checks input { accent-color:#43d5ae; margin-top:2px; }
.va-checks label.locked { align-items:center; }
.va-checks label.locked i { flex:0 0 34px; width:34px; height:34px; display:grid; place-items:center; border:1px solid rgba(101,230,196,.25); border-radius:10px; color:var(--va-mint); background:rgba(101,230,196,.07); font-style:normal; font-size:9px; font-weight:900; letter-spacing:.08em; }
.va-checks label.locked span { display:flex; min-width:0; flex-direction:column; gap:3px; }
.va-checks label.locked strong { color:#dcebed; font-size:11px; }
.va-checks label.locked small { color:#718a90; font-size:9px; }
.va-retention { max-width:680px; }
.va-unit { display:flex; align-items:center; gap:8px; }
.va-unit input { min-width:0; }
.va-unit span { color:#8fa3a8; font-size:12px; }
.va-side { display:grid; gap:12px; }
.va-rule-card,.va-safe-card { position:relative; overflow:hidden; }
.va-rule-card h3 { font-size:17px !important; margin-top:7px !important; }
.va-rule-card p,.va-safe-card li { color:#93a7ac; font-size:12px; line-height:1.55; }
.va-rule-icon { display:grid; place-items:center; width:38px; height:38px; border:1px solid rgba(101,230,196,.28); border-radius:12px; color:var(--va-mint); background:rgba(101,230,196,.08); font-size:19px; font-weight:800; }
.va-safe-card { background:linear-gradient(145deg,rgba(25,48,47,.8),rgba(13,28,34,.88)) !important; }
.va-safe-card > strong { color:#dff8f1; }
.va-safe-card ul { padding-left:18px; margin:12px 0 0; }
.va-section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin:8px 2px 4px; }
.va-section-head h3 { color:#edf6f7; font-size:24px; letter-spacing:-.03em; margin:5px 0; }
.va-section-head p { color:#8ea3a8; margin:0; max-width:700px; font-size:13px; }
.va-knowledge-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.va-doc { min-height:260px; padding:20px; border:1px solid var(--va-line); border-radius:18px; background:linear-gradient(145deg,rgba(19,32,46,.96),rgba(11,22,34,.96)); display:flex; flex-direction:column; transition:.18s ease; }
.va-doc:hover { transform:translateY(-2px); border-color:rgba(101,230,196,.3); box-shadow:0 14px 30px rgba(4,12,18,.18); }
.va-doc.disabled { opacity:.52; filter:saturate(.55); }
.va-doc-top { display:flex; justify-content:space-between; gap:8px; color:#6fdcbe; font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.va-doc-top b { color:#72898f; }
.va-doc h3 { color:#edf7f7; font-size:17px; margin:16px 0 9px; }
.va-doc p { color:#94a8ad; font-size:12px; line-height:1.58; margin:0; flex:1; }
.va-tags { display:flex; gap:5px; flex-wrap:wrap; margin:15px 0 12px; }
.va-tags span { color:#88a7aa; border:1px solid var(--va-line); border-radius:999px; padding:4px 7px; font-size:9px; }
.va-doc-actions { display:flex; gap:6px; flex-wrap:wrap; padding-top:11px; border-top:1px solid var(--va-line); }
.va-slots { display:grid; gap:7px; }
.va-slot { display:grid; grid-template-columns:105px minmax(0,1fr) auto auto; gap:12px; align-items:center; padding:12px; border:1px solid var(--va-line); border-radius:13px; background:rgba(255,255,255,.025); }
.va-slot time { color:#ecf6f6; font-weight:750; font-size:12px; display:flex; flex-direction:column; }
.va-slot time small { color:#789197; font-size:10px; margin-top:3px; }
.va-slot > div { min-width:0; display:flex; flex-direction:column; }
.va-slot > div strong { color:#d9e8ea; font-size:12px; }
.va-slot > div span { color:#7f969b; font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.va-slot em { border-radius:999px; padding:5px 8px; font-size:9px; font-style:normal; font-weight:800; color:#79e5c6; background:rgba(101,230,196,.08); white-space:nowrap; }
.va-slot.limited em { color:#ffd386; background:rgba(255,185,82,.09); }
.va-slot.unavailable em { color:#ff9e91; background:rgba(255,139,123,.09); }
.va-slot-form { position:sticky; top:120px; }
.va-call-panel { padding:6px !important; overflow:hidden !important; }
.va-call-list { display:grid; }
.va-call-row { width:100%; border:0; border-bottom:1px solid var(--va-line); background:transparent; color:inherit; display:grid; grid-template-columns:38px minmax(180px,1fr) minmax(130px,.55fr) minmax(150px,.55fr) 76px 22px; gap:10px; align-items:center; padding:14px 13px; text-align:left; cursor:pointer; }
.va-call-row:last-child { border-bottom:0; }
.va-call-row:hover { background:rgba(101,230,196,.045); }
.va-call-state { width:30px; height:30px; border-radius:10px; display:grid; place-items:center; color:#90a5aa; background:rgba(255,255,255,.045); }
.va-call-state.in-progress { color:var(--va-mint); background:rgba(101,230,196,.1); animation:vaPulse 1.5s infinite; }
@keyframes vaPulse { 50% { box-shadow:0 0 0 7px rgba(101,230,196,0); } 0%,100% { box-shadow:0 0 0 0 rgba(101,230,196,.22); } }
.va-call-main,.va-call-result { min-width:0; display:flex; flex-direction:column; }
.va-call-main strong,.va-call-result strong { color:#dcebed; font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.va-call-main small,.va-call-result small { color:#789197; font-size:10px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; }
.va-call-audit { min-width:0; display:flex; flex-direction:column; align-items:flex-start; }
.va-call-audit strong { border-radius:999px; padding:4px 7px; color:#a9b9bc; background:rgba(255,255,255,.05); font-size:9px; font-weight:850; }
.va-call-audit strong.good { color:#78e6c6; background:rgba(101,230,196,.09); }
.va-call-audit strong.medium { color:#ffd58a; background:rgba(255,193,92,.09); }
.va-call-audit strong.bad { color:#ff9c90; background:rgba(255,139,123,.09); }
.va-call-audit small { max-width:100%; margin-top:4px; color:#70898f; font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.va-call-time { color:#8da3a8; font-size:11px; text-align:right; }
.va-call-arrow { color:var(--va-mint); font-size:24px; }
.va-integration-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.va-connect-card { display:grid; grid-template-columns:48px 1fr; gap:13px; align-items:center; }
.va-connect-logo { width:48px; height:48px; border-radius:15px; display:grid; place-items:center; color:#fff; background:linear-gradient(135deg,#e94359,#a51b32); font-size:17px; font-weight:900; }
.va-connect-card.openai .va-connect-logo { background:linear-gradient(135deg,#1ab68f,#146e77); font-size:12px; }
.va-connect-card h3 { font-size:18px !important; margin-bottom:7px !important; }
.va-connect-card ul { grid-column:1/-1; list-style:none; padding:12px 0 0; margin:6px 0 0; border-top:1px solid var(--va-line); color:#88a0a5; font-size:11px; line-height:1.8; }
.va-webhook-row { display:grid; grid-template-columns:210px minmax(0,1fr) auto; gap:10px; align-items:center; padding:10px 0; border-bottom:1px solid var(--va-line); }
.va-webhook-row > span { color:#8ba1a6; font-size:11px; }
.va-webhook-row code { color:#cce6e3; font-size:11px; overflow:auto; padding:8px 10px; border-radius:8px; background:rgba(0,0,0,.18); }
.va-note { margin-top:14px; padding:13px 15px; border:1px solid rgba(101,230,196,.2); border-radius:12px; background:rgba(101,230,196,.055); }
.va-note strong { color:#9beed8; font-size:12px; }
.va-note p { color:#88a2a5; font-size:11px; margin:4px 0 0; }
.va-config-note pre { overflow:auto; border:1px solid var(--va-line); border-radius:12px; background:rgba(0,0,0,.2); color:#9ee8d6; padding:15px; font-size:11px; line-height:1.7; }
.va-config-note p { color:#81989e; font-size:11px; }
.va-call-detail-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:15px 0; }
.va-call-detail-grid > div { padding:11px; border:1px solid var(--va-line); border-radius:11px; display:flex; flex-direction:column; }
.va-call-detail-grid span { color:#7d949a; font-size:9px; text-transform:uppercase; letter-spacing:.07em; }
.va-call-detail-grid strong { color:#dcebee; font-size:11px; margin-top:5px; }
.va-transcript { margin-top:12px; border:1px solid var(--va-line); border-radius:12px; padding:12px; }
.va-transcript summary { color:#abd8d3; font-size:12px; cursor:pointer; }
.va-transcript pre { max-height:340px; overflow:auto; white-space:pre-wrap; color:#a9babc; font:11px/1.6 ui-monospace,monospace; }
.va-audio-card { margin:12px 0; padding:14px; border:1px solid rgba(101,230,196,.2); border-radius:14px; background:linear-gradient(135deg,rgba(101,230,196,.07),rgba(94,214,232,.035)); display:grid; grid-template-columns:minmax(180px,1fr) minmax(250px,1.5fr) auto; gap:14px; align-items:center; }
.va-audio-card > div { display:flex; flex-direction:column; gap:4px; }
.va-audio-card > div strong { color:#dcebed; font-size:11px; }
.va-audio-card audio { width:100%; height:38px; }
.va-consent-note,.va-analysis-wait { margin:12px 0; padding:12px 14px; border:1px solid var(--va-line); border-radius:12px; color:#859ca1; background:rgba(255,255,255,.025); font-size:11px; }
.va-consent-note.pending { color:#ffd38b; border-color:rgba(255,196,98,.2); background:rgba(255,196,98,.05); }
.va-quality-card { margin:12px 0; padding:16px; border:1px solid var(--va-line); border-radius:16px; background:linear-gradient(145deg,rgba(18,34,45,.97),rgba(10,23,34,.97)); display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:16px; align-items:center; }
.va-quality-card > div:nth-child(2) h3 { margin:4px 0; color:#e2eeee; font-size:15px; }
.va-quality-card > div:nth-child(2) p { margin:0; color:#879ea3; font-size:11px; line-height:1.5; }
.va-quality-card > b { border-radius:999px; padding:6px 9px; color:#ffbb78; background:rgba(255,164,78,.09); font-size:9px; }
.va-quality-card > b.ok { color:#78e6c6; background:rgba(101,230,196,.08); }
.va-score { width:72px; height:72px; border:1px solid currentColor; border-radius:50%; display:flex; align-items:center; justify-content:center; gap:2px; color:#ff9b90; background:rgba(255,139,123,.04); }
.va-score.medium { color:#ffd17c; background:rgba(255,193,92,.04); }
.va-score.good { color:#72e2c2; background:rgba(101,230,196,.04); }
.va-score strong { font-size:23px; letter-spacing:-.06em; }
.va-score span { font-size:7px; line-height:1.15; text-transform:uppercase; }
.va-question-review { margin:12px 0; padding:14px; border:1px solid var(--va-line); border-radius:14px; background:rgba(8,18,28,.4); }
.va-question-review article { display:grid; grid-template-columns:9px minmax(0,1fr) auto; gap:10px; align-items:start; padding:11px 0; border-top:1px solid var(--va-line); }
.va-question-review article i { width:8px; height:8px; margin-top:4px; border-radius:50%; background:#ff8b7b; }
.va-question-review article.answered i { background:var(--va-mint); }
.va-question-review article strong { color:#d8e7e9; font-size:11px; }
.va-question-review article p { margin:4px 0; color:#8ca1a6; font-size:10px; }
.va-question-review article small { color:#667e84; font-size:9px; }
.va-question-review article em { border-radius:999px; padding:4px 7px; color:#ff9b90; background:rgba(255,139,123,.08); font-size:8px; font-style:normal; white-space:nowrap; }
.va-question-review article.answered em { color:#76dec1; background:rgba(101,230,196,.08); }
.va-insight-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:12px 0; }
.va-insight { padding:13px; border:1px solid var(--va-line); border-radius:12px; background:rgba(255,255,255,.02); }
.va-insight > strong { color:#cfe0e2; font-size:11px; }
.va-insight ul { margin:8px 0 0; padding-left:17px; color:#869da2; font-size:10px; line-height:1.55; }
.va-insight.danger { border-color:rgba(255,139,123,.18); background:rgba(255,139,123,.035); }
.va-insight.warning { border-color:rgba(255,196,98,.17); background:rgba(255,196,98,.03); }
.va-call-tools { margin-top:12px; }
.va-events { margin-top:14px; color:#81989e; font-size:10px; }
.va-events > summary { cursor:pointer; color:#9db1b5; }
.va-event-list { display:grid; gap:5px; margin-top:14px; }
.va-event-list > div { display:grid; grid-template-columns:135px 150px minmax(0,1fr); gap:8px; font-size:10px; color:#788f95; }
.va-event-list strong { color:#a8bec2; }
.va-test-result { border-left:3px solid #ff8b7b; background:rgba(255,139,123,.07); border-radius:8px; padding:12px; margin:10px 0; }
.va-test-result.ok { border-left-color:var(--va-mint); background:rgba(101,230,196,.07); }
.va-test-result p { margin:4px 0 0; color:#8fa5aa; }

@media (max-width:1100px) {
  .va-stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .va-grid-main { grid-template-columns:1fr; }
  .va-side { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .va-slot-form { position:static; }
  .va-knowledge-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .va-hero { min-height:0; padding:24px 20px; flex-direction:column; align-items:stretch; }
  .va-hero h2 { font-size:34px; }
  .va-power { min-height:105px; flex-basis:auto; grid-template-columns:1fr auto; padding:16px; }
  .va-power small { grid-column:1/-1; }
  .va-tabs { width:100%; }
  .va-stat-grid,.va-knowledge-grid,.va-integration-grid,.va-side,.va-checks { grid-template-columns:1fr; }
  .va-section-head { align-items:stretch; flex-direction:column; }
  .va-call-row { grid-template-columns:34px minmax(0,1fr) 18px; }
  .va-call-result { grid-column:2; }
  .va-call-audit { grid-column:2; }
  .va-call-time { display:none; }
  .va-call-arrow { grid-column:3; grid-row:1/3; }
  .va-slot { grid-template-columns:90px minmax(0,1fr); }
  .va-slot em,.va-slot .btn { justify-self:start; }
  .va-webhook-row { grid-template-columns:1fr auto; }
  .va-webhook-row code { grid-column:1/-1; grid-row:2; }
  .va-call-detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .va-audio-card,.va-quality-card { grid-template-columns:1fr; }
  .va-insight-grid { grid-template-columns:1fr; }
  .va-event-list > div { grid-template-columns:1fr; padding-bottom:7px; border-bottom:1px solid var(--va-line); }
}

/* ===== Agent vocal — assistant de première connexion ===== */
.va-callkom-monitor{display:grid;gap:18px;margin-bottom:22px;border:1px solid rgba(124,58,237,.16);background:linear-gradient(135deg,rgba(124,58,237,.055),rgba(34,211,238,.035)),#fff}.va-callkom-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.va-callkom-stats span{display:flex;align-items:baseline;gap:7px;padding:13px 14px;border:1px solid #e6e9f2;border-radius:13px;background:#fafbff;color:#687087}.va-callkom-stats strong{font-size:1.35rem;color:#182239}.va-callkom-config{display:grid;grid-template-columns:minmax(260px,1fr) auto auto;align-items:end;gap:12px}.va-callkom-config .field{margin:0}.va-callkom-recent{display:grid;border-top:1px solid #e6e9f2}.va-callkom-recent article{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:12px 2px;border-bottom:1px solid #edf0f6}.va-callkom-recent article div{display:grid;gap:2px}.va-callkom-recent article small{color:#7b8498;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.va-callkom-recent article em{font-style:normal;font-weight:700;color:#4f5b72}.va-callkom-recent article time{color:#8790a3;font-size:.82rem}@media(max-width:800px){.va-callkom-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.va-callkom-config{grid-template-columns:1fr}.va-callkom-recent article{grid-template-columns:auto minmax(0,1fr)}.va-callkom-recent article em,.va-callkom-recent article time{grid-column:2}}
.va-callkom-recent>button{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;width:100%;padding:12px 2px;border:0;border-bottom:1px solid #edf0f6;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.va-callkom-recent>button:hover{background:rgba(124,58,237,.035)}.va-callkom-recent>button div{display:grid;gap:2px;min-width:0}.va-callkom-recent>button small{color:#7b8498;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.va-callkom-recent>button em{font-style:normal;font-weight:700;color:#4f5b72}.va-callkom-recent>button time{color:#8790a3;font-size:.82rem}.va-callkom-dialog{display:grid;gap:18px;min-width:min(760px,80vw)}.va-callkom-dialog>section{display:grid;gap:7px;padding:16px;border:1px solid #e4e7ef;border-radius:14px;background:#f8f9fc}.va-callkom-dialog>section p{margin:0;line-height:1.55}.va-callkom-transcript{display:grid;gap:9px;max-height:55vh;overflow:auto;padding:4px}.va-callkom-transcript article{display:grid;gap:4px;width:min(82%,680px);padding:11px 13px;border-radius:13px;background:#f0f2f6}.va-callkom-transcript article.client{justify-self:end;background:#e9e5ff}.va-callkom-transcript article.agent{justify-self:start;background:#e7f7f1}.va-callkom-transcript article small{font-weight:800;color:#6d7484}.va-callkom-transcript article p{margin:0;white-space:pre-wrap;line-height:1.5}@media(max-width:800px){.va-callkom-recent>button{grid-template-columns:auto minmax(0,1fr)}.va-callkom-recent>button em,.va-callkom-recent>button time{grid-column:2}.va-callkom-dialog{min-width:0}.va-callkom-transcript article{width:92%}}
.va-setup-heading { align-items:center; }
.va-setup-done,.va-setup-pending { flex:0 0 auto; display:inline-flex; align-items:center; gap:7px; padding:9px 12px; border-radius:999px; font-size:10px; font-weight:850; letter-spacing:.03em; }
.va-setup-done { color:#8ce8cd; border:1px solid rgba(101,230,196,.25); background:rgba(101,230,196,.08); }
.va-setup-pending { color:#ffd08b; border:1px solid rgba(255,190,95,.22); background:rgba(255,190,95,.07); }
.va-setup-shell { overflow:hidden; border:1px solid var(--va-line); border-radius:24px; background:linear-gradient(145deg,rgba(17,31,44,.98),rgba(8,18,29,.99)); box-shadow:0 24px 60px rgba(3,10,17,.22); }
.va-setup-progress { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:0; padding:8px; border-bottom:1px solid var(--va-line); background:rgba(4,12,20,.32); }
.va-setup-step { position:relative; min-width:0; border:0; border-radius:13px; padding:12px 8px; color:#758c92; background:transparent; font:inherit; cursor:pointer; display:grid; grid-template-columns:30px minmax(0,1fr); grid-template-rows:auto auto; column-gap:9px; text-align:left; transition:.18s ease; }
.va-setup-step::after { content:""; position:absolute; left:47px; right:-9px; top:27px; height:1px; background:var(--va-line); pointer-events:none; }
.va-setup-step:last-child::after { display:none; }
.va-setup-step:hover { color:#d4e4e5; background:rgba(255,255,255,.035); }
.va-setup-step > span { position:relative; z-index:1; grid-row:1/3; width:30px; height:30px; display:grid; place-items:center; border:1px solid rgba(177,218,219,.17); border-radius:10px; color:#83999e; background:#122330; font-size:10px; font-weight:900; }
.va-setup-step strong { align-self:end; overflow:hidden; color:inherit; font-size:11px; white-space:nowrap; text-overflow:ellipsis; }
.va-setup-step small { overflow:hidden; margin-top:2px; color:#627b81; font-size:8px; white-space:nowrap; text-overflow:ellipsis; }
.va-setup-step.active { color:#e7f5f3; background:linear-gradient(135deg,rgba(101,230,196,.13),rgba(94,214,232,.055)); }
.va-setup-step.active > span { color:#08231e; border-color:transparent; background:linear-gradient(135deg,var(--va-mint),#9df0d9); box-shadow:0 0 18px rgba(101,230,196,.18); }
.va-setup-step.done > span { color:#7ce1c4; border-color:rgba(101,230,196,.25); background:rgba(101,230,196,.08); }
.va-setup-step.done::after { background:linear-gradient(90deg,rgba(101,230,196,.46),rgba(94,214,232,.22)); }
.va-setup-stage { min-height:610px; }
.va-setup-panel { display:none; padding:clamp(24px,4vw,52px); animation:vaSetupIn .3s ease both; }
.va-setup-panel.active { display:block; }
@keyframes vaSetupIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.va-setup-intro { max-width:760px; margin-bottom:28px; }
.va-setup-intro .eyebrow { color:var(--va-mint); }
.va-setup-intro h2 { margin:7px 0 10px; color:#f1f8f8; font-size:clamp(27px,4vw,44px); line-height:1.04; letter-spacing:-.045em; }
.va-setup-intro p { max-width:700px; margin:0; color:#91a6ab; font-size:13px; line-height:1.65; }
.va-provider-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.va-provider-card { min-height:188px; padding:18px; border:1px solid var(--va-line); border-radius:18px; display:grid; grid-template-columns:42px minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:13px; background:rgba(255,255,255,.025); }
.va-provider-card.openai { background:linear-gradient(145deg,rgba(39,111,98,.13),rgba(255,255,255,.018)); }
.va-provider-card.twilio { background:linear-gradient(145deg,rgba(168,54,73,.10),rgba(255,255,255,.018)); }
.va-provider-card.vault { background:linear-gradient(145deg,rgba(55,117,143,.12),rgba(255,255,255,.018)); }
.va-provider-icon { flex:0 0 42px; width:42px; height:42px; border:1px solid rgba(101,230,196,.24); border-radius:13px; display:grid; place-items:center; color:#95ebd4; background:rgba(101,230,196,.08); font-size:11px; font-weight:950; letter-spacing:-.02em; }
.va-provider-card.twilio .va-provider-icon,.provider-twilio .va-provider-icon { color:#ff9ead; border-color:rgba(255,124,146,.23); background:rgba(255,91,118,.08); font-size:18px; }
.va-provider-card.vault .va-provider-icon { color:#8fdceb; border-color:rgba(94,214,232,.22); background:rgba(94,214,232,.07); font-size:18px; }
.va-provider-card > div:nth-child(2) { min-width:0; }
.va-provider-card strong { color:#e3eff0; font-size:13px; }
.va-provider-card p { margin:7px 0 0; color:#81979c; font-size:10px; line-height:1.55; }
.va-provider-card > .va-status { grid-column:1/-1; width:max-content; }
.va-setup-tip { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:14px; padding:15px 17px; border:1px solid rgba(101,230,196,.18); border-radius:14px; background:rgba(101,230,196,.045); }
.va-setup-tip strong { color:#ccece5; font-size:11px; }
.va-setup-tip span { color:#789297; font-size:10px; text-align:right; }
.va-setup-card { padding:22px; border:1px solid var(--va-line); border-radius:20px; background:linear-gradient(145deg,rgba(255,255,255,.034),rgba(255,255,255,.012)); }
.va-setup-card.provider-openai { border-color:rgba(101,230,196,.18); }
.va-setup-card.provider-twilio { border-color:rgba(255,139,123,.16); }
.va-setup-card.provider-mcp { border-color:rgba(75,198,229,.22); }
.va-mcp-logs { margin-top:16px; border-top:1px solid var(--va-line); color:#8ca2a6; }
.va-mcp-logs summary { padding:14px 0 8px; cursor:pointer; color:#c5d4d5; font-size:11px; font-weight:750; }
.va-mcp-logs p { display:flex; justify-content:space-between; gap:15px; margin:0; padding:9px 0; border-top:1px solid rgba(255,255,255,.045); font-size:10px; }
.va-mcp-logs p strong { color:#d9e6e7; text-transform:uppercase; letter-spacing:.05em; }
.va-mcp-logs p span { text-align:right; }
.va-card-title { display:flex; align-items:center; gap:12px; padding-bottom:18px; margin-bottom:20px; border-bottom:1px solid var(--va-line); }
.va-card-title > div:nth-child(2) { min-width:0; display:flex; flex:1; flex-direction:column; }
.va-card-title strong { color:#e7f2f2; font-size:14px; }
.va-card-title small { margin-top:3px; color:#768f95; font-size:10px; }
.va-setup-card .form-grid { gap:15px; }
.va-setup-card .field label { color:#b9cacc; font-size:11px; font-weight:750; }
.va-setup-card .field > small { display:block; margin-top:6px; color:#718a90; font-size:9px; line-height:1.45; }
.va-secret-wrap { display:flex; align-items:stretch; }
.va-secret-wrap input { min-width:0; border-radius:10px 0 0 10px !important; }
.va-secret-wrap button { flex:0 0 auto; min-width:68px; border:1px solid var(--va-line); border-left:0; border-radius:0 10px 10px 0; color:#9ed9d2; background:rgba(101,230,196,.06); font:inherit; font-size:9px; font-weight:850; cursor:pointer; }
.va-secret-wrap button:hover { background:rgba(101,230,196,.11); }
.va-country-fixed { min-height:41px; border:1px solid var(--va-line); border-radius:10px; padding:0 12px; display:flex; align-items:center; gap:9px; background:rgba(5,14,23,.28); }
.va-country-fixed strong { color:#d5e5e6; font-size:11px; }
.va-country-fixed small { margin-left:auto; color:#789197; font-size:9px; }
.va-test-line { display:flex; align-items:center; gap:12px; padding-top:18px; margin-top:20px; border-top:1px solid var(--va-line); }
.va-inline-result { min-width:0; display:flex; align-items:center; gap:8px; color:#ff9b90; font-size:10px; }
.va-inline-result i { flex:0 0 auto; width:7px; height:7px; border-radius:50%; background:currentColor; box-shadow:0 0 0 3px rgba(255,139,123,.08); }
.va-inline-result.ok { color:#7ce0c2; }
.va-inline-result.ok i { box-shadow:0 0 0 3px rgba(101,230,196,.09); }
.va-inline-result.idle { color:#748b91; }
.va-inline-result span { overflow:hidden; text-overflow:ellipsis; }
.va-setup-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:24px; }
.va-setup-actions.end { justify-content:flex-end; }
.va-setup-actions .btn span,.va-final-button span { margin-left:7px; }
.va-choice { min-height:64px; padding:13px 14px; border:1px solid var(--va-line); border-radius:13px; display:flex; align-items:flex-start; gap:10px; background:rgba(255,255,255,.022); cursor:pointer; }
.va-choice input { flex:0 0 auto; margin-top:3px; accent-color:#58ddba; }
.va-choice span { display:flex; flex-direction:column; gap:4px; }
.va-choice strong { color:#d2e3e4; font-size:11px; }
.va-choice small { color:#718a90; font-size:9px; line-height:1.45; }
.va-technical-details { margin-top:20px; border-top:1px solid var(--va-line); padding-top:16px; }
.va-technical-details summary { width:max-content; color:#8bbdb8; font-size:10px; cursor:pointer; }
.va-technical-details[open] summary { margin-bottom:12px; }
.va-setup-success { margin:-10px 0 20px; padding:13px 15px; border:1px solid rgba(101,230,196,.22); border-radius:13px; color:#8ce8cd; background:rgba(101,230,196,.07); font-size:11px; font-weight:750; }
.va-review-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.va-review-grid article { min-height:118px; padding:16px; border:1px solid var(--va-line); border-radius:16px; display:grid; grid-template-columns:29px minmax(0,1fr); grid-template-rows:1fr auto; gap:10px; background:rgba(255,255,255,.022); }
.va-review-grid article > span { color:#607b81; font-size:9px; font-weight:900; }
.va-review-grid article > div { min-width:0; display:flex; flex-direction:column; }
.va-review-grid article strong { color:#dce9ea; font-size:12px; }
.va-review-grid article small { margin-top:5px; color:#718a90; font-size:9px; line-height:1.4; }
.va-review-grid .va-status { grid-column:1/-1; width:max-content; }
.va-final-card { margin-top:12px; padding:15px; border:1px solid rgba(101,230,196,.19); border-radius:17px; display:flex; align-items:center; justify-content:space-between; gap:15px; background:linear-gradient(135deg,rgba(101,230,196,.065),rgba(94,214,232,.025)); }
.va-final-card .va-choice { flex:1; border:0; padding:4px; background:transparent; }
.va-final-button { flex:0 0 auto; min-height:46px; }
.va-test-call-card { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,.85fr); gap:25px; align-items:center; margin-top:14px; padding:20px; border:1px solid var(--va-line); border-radius:17px; background:rgba(5,14,23,.28); }
.va-test-call-card .eyebrow { color:var(--va-cyan); }
.va-test-call-card h3 { margin:5px 0 7px; color:#e2eeee; font-size:17px; }
.va-test-call-card p { margin:0; color:#7c949a; font-size:10px; line-height:1.5; }
.va-test-call-controls { display:grid; gap:8px; }
.va-test-call-controls label { display:flex; align-items:flex-start; gap:7px; color:#84999e; font-size:9px; line-height:1.4; }
.va-test-call-controls label input { margin-top:1px; accent-color:#58ddba; }
.va-test-call-controls > small { color:#ffbd7f; font-size:9px; }

@media (max-width:1050px) {
  .va-setup-progress { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .va-setup-step:nth-child(3)::after,.va-setup-step:nth-child(6)::after { display:none; }
  .va-provider-grid,.va-review-grid { grid-template-columns:1fr; }
  .va-provider-card { min-height:130px; }
}
@media (max-width:700px) {
  .va-setup-heading { align-items:stretch; }
  .va-setup-done,.va-setup-pending { width:max-content; }
  .va-setup-progress { grid-template-columns:repeat(6,62px); overflow-x:auto; scrollbar-width:none; }
  .va-setup-progress::-webkit-scrollbar { display:none; }
  .va-setup-step { grid-template-columns:1fr; grid-template-rows:30px auto; justify-items:center; padding:9px 4px; text-align:center; }
  .va-setup-step::after { left:46px; right:-16px; top:24px; }
  .va-setup-step > span { grid-row:1; }
  .va-setup-step strong { align-self:start; max-width:58px; font-size:9px; }
  .va-setup-step small { display:none; }
  .va-setup-stage { min-height:0; }
  .va-setup-panel { padding:25px 17px; }
  .va-setup-intro { margin-bottom:20px; }
  .va-setup-intro h2 { font-size:30px; }
  .va-provider-grid { grid-template-columns:1fr; }
  .va-provider-card { min-height:0; }
  .va-setup-tip,.va-card-title,.va-test-line,.va-final-card { align-items:stretch; flex-direction:column; }
  .va-setup-tip span { text-align:left; }
  .va-card-title .btn,.va-test-line .btn,.va-final-button { width:100%; }
  .va-test-line { display:flex; }
  .va-setup-actions { flex-wrap:wrap; }
  .va-setup-actions .btn { flex:1; }
  .va-setup-card { padding:16px; }
  .va-test-call-card { grid-template-columns:1fr; gap:16px; }
  .va-mcp-logs p { display:block; }
  .va-mcp-logs p span { display:block; margin-top:3px; text-align:left; }
  .va-technical-details .va-webhook-row { grid-template-columns:1fr; }
  .va-technical-details .va-webhook-row code { grid-column:1; }
}
/* ===== Présence locale =================================================== */
.lp-hero{
  position:relative;overflow:hidden;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr);
  gap:34px;align-items:center;padding:38px;border:1px solid #dbe3ec;border-radius:24px;
  background:
    radial-gradient(circle at 8% 12%,rgba(42,119,255,.12),transparent 34%),
    linear-gradient(135deg,#fafdff 0%,#f3f7fb 58%,#edf3fa 100%);
  box-shadow:0 24px 70px rgba(26,46,79,.08)
}
.lp-hero:after{content:"";position:absolute;right:42%;top:-45%;width:1px;height:190%;background:linear-gradient(transparent,#c7d4e4,transparent);transform:rotate(16deg)}
.lp-hero>div{position:relative;z-index:1}
.lp-hero h2{margin:8px 0 16px;font-size:clamp(31px,3.1vw,50px);line-height:1.03;letter-spacing:-.045em;color:#15243b}
.lp-hero>div>p{max-width:680px;margin:0;color:#5b6b80;font-size:16px;line-height:1.75}
.lp-nap-card{padding:25px;border-radius:18px;background:rgba(255,255,255,.9);border:1px solid #d4dfeb;box-shadow:0 18px 45px rgba(22,45,78,.11);backdrop-filter:blur(15px)}
.lp-nap-label{font-size:10px;font-weight:900;letter-spacing:.18em;color:#2a77ff}
.lp-nap-card h3{margin:8px 0 15px;font-size:25px;color:#17263e}
.lp-nap-card dl{display:grid;gap:0;margin:0 0 18px}
.lp-nap-card dl div{display:grid;grid-template-columns:90px 1fr;gap:15px;padding:10px 0;border-top:1px solid #e7edf4}
.lp-nap-card dt{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#7b899c}
.lp-nap-card dd{margin:0;color:#263750;font-weight:700;line-height:1.4}
.lp-summary{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin:22px 0 34px;border:1px solid #dce4ed;border-radius:17px;background:#fff;box-shadow:0 12px 32px rgba(32,53,80,.05)}
.lp-summary>div{padding:19px 22px;border-right:1px solid #e5ebf2}
.lp-summary>div:last-child{border-right:0}
.lp-summary strong{display:block;font-size:28px;line-height:1;color:#1c2c44}
.lp-summary span{display:block;margin-top:7px;color:#6d7b8e;font-size:12px;line-height:1.35}
.lp-summary .danger strong{color:#c24651}
.lp-section{margin-top:34px}
.lp-connectors{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.lp-connector{display:flex;flex-direction:column;min-height:260px;padding:23px;border:1px solid #dbe4ee;border-radius:18px;background:linear-gradient(150deg,#fff,#f6f9fc);box-shadow:0 12px 32px rgba(25,46,77,.055)}
.lp-connector-head{display:flex;gap:13px;align-items:center}
.lp-provider-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:13px;background:#15243b;color:#fff;font-size:18px;font-weight:900}
.lp-connector h3{margin:0 0 3px;color:#1a2a42;font-size:17px}
.lp-connector-state{font-size:11px;font-weight:800}
.lp-connector-state.warn{color:#b7781a}.lp-connector-state.verify{color:#8a5bcb}.lp-connector-state.pending{color:#6f7d90}.lp-connector-state.ok{color:#16855d}
.lp-connector>p{flex:1;margin:17px 0 13px;color:#617085;line-height:1.58}
.lp-proof{margin-bottom:15px;color:#16855d;font-size:12px;font-weight:800}.lp-proof.muted{color:#7d8999}
.lp-card-actions{display:flex;gap:9px;flex-wrap:wrap}
.lp-registry{padding:26px;border:1px solid #dbe4ed;border-radius:22px;background:#f8fafc}
.lp-tools{display:flex;justify-content:space-between;gap:18px;align-items:center;margin:20px 0;padding-top:18px;border-top:1px solid #e0e7ef}
.lp-filters{display:flex;gap:7px;flex-wrap:wrap}
.lp-filters button{padding:9px 12px;border:1px solid #d7e0ea;border-radius:999px;background:#fff;color:#627187;font:inherit;font-size:12px;font-weight:750;cursor:pointer}
.lp-filters button.active{border-color:#2a77ff;background:#eaf2ff;color:#1e62d5}
.lp-search{display:flex;align-items:center;gap:8px;min-width:285px;padding:0 13px;border:1px solid #d7e0ea;border-radius:12px;background:#fff}
.lp-search span{color:#718098;font-size:19px}.lp-search input{width:100%;padding:11px 0;border:0!important;outline:0;background:transparent!important;box-shadow:none!important}
.lp-directory-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.lp-directory{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:15px;padding:17px;border:1px solid #dce4ed;border-radius:14px;background:#fff;overflow:hidden}
.lp-directory:before{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:#aab5c2}
.lp-directory.correct:before{background:#1aa374}.lp-directory.wrong:before{background:#dc5660}.lp-directory.verify:before{background:#8c61c8}.lp-directory.pending:before{background:#cf8b29}
.lp-dir-main{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.lp-dir-title h3{margin:0 0 3px;color:#1a2941;font-size:15px}.lp-source{color:#8994a4;font-size:10px;text-transform:uppercase;letter-spacing:.07em}
.lp-status{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:#718098}
.lp-status i{width:7px;height:7px;border-radius:50%;background:#aab5c2}.lp-status.correct{color:#16845d}.lp-status.correct i{background:#1aa374}.lp-status.wrong{color:#b73d49}.lp-status.wrong i{background:#dc5660}.lp-status.verify{color:#7950b3}.lp-status.verify i{background:#8c61c8}.lp-status.pending{color:#ad6e16}.lp-status.pending i{background:#cf8b29}
.lp-dir-data{grid-column:1;display:flex;flex-direction:column;gap:3px;min-width:0}
.lp-dir-data>span{color:#7c899b;font-size:11px}.lp-dir-data strong{overflow:hidden;color:#40516a;font-size:12px;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.lp-dir-data small{color:#9aa4b1;font-size:10px}
.lp-dir-actions{grid-column:2;grid-row:1/3;display:flex;flex-direction:column;justify-content:center;gap:6px}
.lp-empty{grid-column:1/-1}
.lp-form .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.lp-form label{display:flex;flex-direction:column;gap:7px;color:#526178;font-size:12px;font-weight:750}
.lp-form .span-2{grid-column:1/-1}
.lp-form input,.lp-form select,.lp-form textarea{width:100%;padding:11px 12px;border:1px solid #d5dfeb;border-radius:10px;background:#fff;color:#1d2d45;font:inherit}
.lp-form .form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px;padding-top:16px;border-top:1px solid #e2e8f0}
@media(max-width:1050px){
  .lp-hero{grid-template-columns:1fr}.lp-hero:after{display:none}.lp-summary{grid-template-columns:repeat(3,1fr)}.lp-summary>div:nth-child(3){border-right:0}.lp-connectors{grid-template-columns:1fr}.lp-directory-list{grid-template-columns:1fr}
}
@media(max-width:700px){
  .lp-hero{padding:22px;border-radius:18px}.lp-nap-card{padding:18px}.lp-summary{grid-template-columns:repeat(2,1fr)}.lp-summary>div{border-bottom:1px solid #e5ebf2}.lp-summary>div:nth-child(2n){border-right:0}.lp-registry{padding:16px}.lp-tools{align-items:stretch;flex-direction:column}.lp-search{min-width:0;width:100%}.lp-directory{grid-template-columns:1fr}.lp-dir-actions{grid-column:1;grid-row:auto;flex-direction:row;justify-content:flex-start}.lp-form .form-grid{grid-template-columns:1fr}.lp-form .span-2{grid-column:1}
}

/* ===== Navigation admin intelligente ===================================== */
#adminTopNav button[data-nav][hidden],
#adminTopNav .nav-section[hidden],
#adminTopNav .nav-recents[hidden] { display:none !important; }

.nav-smart-tools {
  display:grid; gap:8px; width:100%;
  padding:4px 0 10px;
}
.nav-smart-title { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.nav-smart-title > strong {
  color:#808797; font-size:10px; font-weight:850; letter-spacing:.12em; text-transform:uppercase;
}
.nav-smart-title > button {
  display:inline-flex; align-items:center; gap:3px; width:auto; min-height:0; padding:0; border:0; background:transparent; cursor:pointer;
}
.nav-smart-title > button span {
  display:grid; place-items:center; min-width:19px; height:18px; padding:0 4px;
  border:1px solid #d9dce3; border-bottom-color:#bec2cc; border-radius:5px;
  background:#fff; color:#7a8190; font-size:8px; font-weight:800; box-shadow:0 1px 0 rgba(15,23,42,.05);
}
.nav-finder {
  display:grid; grid-template-columns:20px minmax(0,1fr) 24px; align-items:center; gap:5px;
  width:100%; min-height:40px; padding:0 8px 0 11px;
  border:1px solid #dfe2e8; border-radius:11px; background:#fff;
  box-shadow:0 5px 18px rgba(29,35,48,.045); transition:border-color .16s ease,box-shadow .16s ease;
}
.nav-finder:focus-within { border-color:#8174ee; box-shadow:0 0 0 3px rgba(105,87,238,.10),0 7px 20px rgba(29,35,48,.06); }
.nav-finder > span { color:#8c92a0; font-size:17px; line-height:1; }
.nav-finder input {
  min-width:0; width:100%; padding:8px 0 !important; border:0 !important; outline:0 !important;
  background:transparent !important; color:#242938 !important; font:inherit; font-size:12px !important; box-shadow:none !important;
}
.nav-finder input::placeholder { color:#9aa0ad; }
.nav-finder > button {
  display:grid; place-items:center; width:24px; height:24px; min-height:0; padding:0;
  border:0; border-radius:7px; background:#f1f1ed; color:#747b89; cursor:pointer; font-size:16px;
}
.nav-search-status { min-height:12px; color:#8074dd; font-size:9px; font-weight:750; }
.nav-recents { width:100%; margin:5px 0 3px; padding:9px; border:1px solid #e2e3e7; border-radius:12px; background:#f8f8f4; }
.nav-recents-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.nav-recents-head > span { color:#858b98; font-size:9px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.nav-recents-head > button { width:22px; height:22px; min-height:0; padding:0; border:0; background:transparent; color:#a0a5af; cursor:pointer; }
.nav-recents-items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
.nav-recents-items button[data-nav] {
  min-width:0 !important; min-height:30px !important; padding:6px 8px !important; border:1px solid transparent !important;
  border-radius:8px !important; background:#fff !important; color:#596070 !important; font-size:10px !important;
}
.nav-recents-items button[data-nav] span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-recents-items button[data-nav]:hover { border-color:#d9d6fb !important; color:#4138a2 !important; }
.nav-recents-items button[data-nav].active { background:#e9e6ff !important; color:#322b91 !important; }

@media (min-width:1181px) {
  body:has(.admin-top-shell) #adminTopNav .nav-smart-tools {
    position:sticky; top:-16px; z-index:5; margin:-16px 0 2px; padding:16px 0 10px;
    background:linear-gradient(#fbfbf8 82%,rgba(251,251,248,.92));
  }
  body:has(.admin-top-shell) #adminTopNav .nav-smart-title > button,
  body:has(.admin-top-shell) #adminTopNav .nav-finder > button,
  body:has(.admin-top-shell) #adminTopNav .nav-recents-head > button {
    width:auto !important; min-height:0 !important; padding:0 !important; border:0 !important; background:transparent !important;
  }
  body:has(.admin-top-shell) #adminTopNav .nav-finder > button { width:24px !important; height:24px !important; background:#f1f1ed !important; justify-content:center !important; }
  body:has(.admin-top-shell) #adminTopNav .nav-section { margin-top:4px !important; padding-top:4px !important; }
  body:has(.admin-top-shell) #adminTopNav .nav-section-toggle { padding:6px 11px !important; }
  body:has(.admin-top-shell) #adminTopNav .nav-section button[data-nav] { min-height:35px !important; padding:7px 11px !important; font-size:12px !important; }
  /* Une recherche doit ouvrir visuellement les groupes, même s'ils étaient repliés. */
  body:has(.admin-top-shell) #adminTopNav.nav-searching .nav-section-items,
  body:has(.admin-top-shell) #adminTopNav.nav-searching .nav-section.collapsed .nav-section-items { display:block !important; }
  body:has(.admin-top-shell) #adminTopNav.nav-searching .nav-section-toggle { display:none !important; }
  body:has(.admin-top-shell) #adminTopNav .nav-recents-items button[data-nav] { min-height:30px !important; padding:6px 8px !important; font-size:10px !important; }
}

@media (max-width:1180px) {
  #adminTopNav .nav-smart-tools { grid-column:1/-1; position:sticky; top:0; z-index:4; padding:10px; border-radius:12px; background:#fbfbf8; box-shadow:0 8px 24px rgba(20,24,35,.08); }
  #adminTopNav .nav-smart-title > button { width:auto; }
  #adminTopNav .nav-recents { grid-column:1/-1; }
  #adminTopNav .nav-recents-items { grid-template-columns:repeat(4,minmax(0,1fr)); }
  #adminTopNav .nav-section { display:block !important; grid-column:1/-1; width:100%; padding-top:5px; border-top:1px solid #e1e4e9; }
  #adminTopNav .nav-section-toggle { display:flex !important; align-items:center; justify-content:space-between; width:100%; min-height:38px; padding:7px 10px; border:0; background:transparent; color:#777f8e; font-size:10px; font-weight:850; letter-spacing:.09em; text-transform:uppercase; box-shadow:none; }
  #adminTopNav .nav-section-items { display:grid !important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding-top:4px; }
  #adminTopNav .nav-section.collapsed .nav-section-items { display:none !important; }
  #adminTopNav .nav-caret { transition:transform .15s ease; }
  #adminTopNav .nav-section.collapsed .nav-caret { transform:rotate(-90deg); }
  #adminTopNav.nav-searching .nav-section-items,
  #adminTopNav.nav-searching .nav-section.collapsed .nav-section-items { display:grid !important; }
  #adminTopNav.nav-searching .nav-section-toggle { display:none !important; }
}
@media (max-width:620px) {
  #adminTopNav .nav-recents-items { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

/* Calendrier prioritaire : acces direct sous la recherche admin. */
#adminTopNav > button[data-nav="planning"] {
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-height:46px;
  margin:0 0 8px;
  padding:10px 13px;
  border:1px solid #d8c2ae;
  border-radius:12px;
  background:linear-gradient(135deg,#fff8f1,#f3e6da);
  color:#603d29;
  font-weight:850;
  box-shadow:0 8px 20px rgba(94,58,35,.08);
}
#adminTopNav > button[data-nav="planning"]::before {
  content:"";
  width:26px;
  height:26px;
  flex:0 0 26px;
  border-radius:8px;
  background-color:#a8663f;
  background-image:linear-gradient(#fff,#fff),linear-gradient(#fff,#fff),linear-gradient(#fff,#fff),linear-gradient(#fff,#fff);
  background-size:14px 2px,14px 2px,2px 14px,2px 14px;
  background-position:center 9px,center 15px,9px center,15px center;
  background-repeat:no-repeat;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.28);
}
#adminTopNav > button[data-nav="planning"]:hover {
  border-color:#b98663;
  background:linear-gradient(135deg,#fffaf6,#ecd8c8);
  color:#3e281b;
  transform:translateY(-1px);
}
#adminTopNav > button[data-nav="planning"].active {
  border-color:#a8663f;
  background:linear-gradient(135deg,#2a211c,#191716);
  color:#fff8f1;
  box-shadow:0 10px 25px rgba(53,35,25,.18);
}

/* Grille de planification heure par heure. */
.planning-calendar-shell {
  width:100%;
  max-height:min(760px,calc(100vh - 315px));
  overflow:auto;
  border:1px solid #d7dee7;
  border-radius:14px;
  background:#fff;
  box-shadow:0 12px 34px rgba(22,38,59,.08);
  scrollbar-gutter:stable;
}
.planning-calendar-grid {
  display:grid;
  grid-template-columns:72px repeat(5,minmax(175px,1fr));
  grid-template-rows:62px var(--calendar-height);
  min-width:950px;
  background:#fff;
}
.planning-claude-button {
  border-color:#5c45c8 !important;
  background:linear-gradient(135deg,#282044,#5b3fd2) !important;
  color:#fff !important;
  box-shadow:0 10px 26px rgba(80,57,180,.22);
}
.planning-claude-button:hover { filter:brightness(1.08); }
.planning-claude-button:disabled { cursor:wait;opacity:.72; }
.planning-ai-result {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:20px;
  align-items:center;
  margin:0 0 14px;
  padding:18px 20px;
  border:1px solid #cabef4;
  border-radius:15px;
  background:linear-gradient(135deg,#fbfaff,#f1edff);
  box-shadow:0 10px 28px rgba(71,48,160,.09);
}
.planning-ai-result strong { display:block;margin:4px 0;color:#261c52;font-size:15px; }
.planning-ai-result p { margin:0;color:#625c73;font-size:12px; }
.planning-ai-days { display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end; }
.planning-ai-days > span { min-width:120px;padding:9px 11px;border:1px solid #d9d1f5;border-radius:10px;background:#fff;color:#38324a;font-size:11px; }
.planning-ai-days b,.planning-ai-days small { display:block; }
.planning-ai-days b { margin-bottom:3px;color:#5a3ac4; }
.planning-ai-days small { margin-top:2px;color:#777185; }
.planning-calendar-corner,
.planning-calendar-date {
  position:sticky;
  top:0;
  z-index:8;
  border-right:1px solid #dfe5ec;
  border-bottom:1px solid #cfd8e3;
  background:rgba(250,249,246,.98);
  backdrop-filter:blur(12px);
}
.planning-calendar-corner {
  left:0;
  z-index:10;
  display:grid;
  place-items:center;
  color:#7b8492;
  font-size:10px;
  font-weight:900;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.planning-calendar-date {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto auto;
  align-content:center;
  gap:1px 8px;
  padding:9px 11px;
}
.planning-calendar-date span {
  overflow:hidden;
  color:#646d7c;
  font-size:10px;
  font-weight:850;
  letter-spacing:.07em;
  text-overflow:ellipsis;
  text-transform:uppercase;
  white-space:nowrap;
}
.planning-calendar-date strong { color:#172033;font-size:13px; }
.planning-calendar-date em {
  grid-column:2;
  grid-row:1;
  min-width:21px;
  height:21px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:#ececf2;
  color:#586071;
  font-size:10px;
  font-style:normal;
  font-weight:900;
}
.planning-calendar-date button {
  grid-column:2;
  grid-row:2;
  width:21px;
  height:21px;
  min-height:0;
  padding:0;
  border:1px solid #d1a98c;
  border-radius:7px;
  background:#fff7f0;
  color:#895333;
  cursor:pointer;
  font-size:16px;
  line-height:1;
}
.planning-calendar-date.today { background:linear-gradient(135deg,#fff5ec,#f5e5d8); }
.planning-calendar-date.today strong { color:#8f5431; }
.planning-calendar-times {
  position:sticky;
  left:0;
  z-index:7;
  height:var(--calendar-height);
  border-right:1px solid #cfd8e3;
  background:#fbfbf8;
}
.planning-calendar-times span {
  position:absolute;
  inset-inline:0;
  display:block;
  padding:4px 10px 0 0;
  border-top:1px solid #d9e0e8;
  color:#657084;
  font-size:10px;
  font-weight:800;
  text-align:right;
}
.planning-calendar-times span.half { border-top:1px dashed #edf0f4; }
.planning-calendar-day {
  position:relative;
  height:var(--calendar-height);
  min-width:0;
  overflow:hidden;
  border-right:1px solid #e2e7ed;
  background:repeating-linear-gradient(to bottom,#fff 0,#fff 37px,#e8edf2 37px,#e8edf2 38px);
}
.planning-calendar-day.today { background:repeating-linear-gradient(to bottom,#fffcf8 0,#fffcf8 37px,#eadfd5 37px,#eadfd5 38px); }
.planning-calendar-slot {
  position:absolute;
  z-index:1;
  left:0;
  right:0;
  width:100%;
  min-height:0;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  cursor:crosshair;
}
.planning-calendar-slot:hover:not(:disabled) { background:rgba(168,102,63,.08);box-shadow:inset 0 0 0 1px rgba(168,102,63,.18); }
.planning-calendar-slot.closed {
  cursor:not-allowed;
  background:repeating-linear-gradient(135deg,rgba(112,124,140,.055),rgba(112,124,140,.055) 7px,rgba(112,124,140,.1) 7px,rgba(112,124,140,.1) 8px);
}
.planning-calendar-event {
  position:absolute;
  z-index:3;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  min-height:30px;
  padding:6px 7px;
  overflow:hidden;
  border:1px solid #aec7ec;
  border-left:4px solid #2f6fd6;
  border-radius:8px;
  background:linear-gradient(135deg,#f8fbff,#e7f0ff);
  color:#192940;
  cursor:pointer;
  text-align:left;
  box-shadow:0 4px 12px rgba(33,65,105,.12);
}
.planning-calendar-event:hover { z-index:5;filter:brightness(.98);box-shadow:0 8px 18px rgba(33,65,105,.18); }
.planning-calendar-event > strong { font-size:10px;font-weight:950; }
.planning-calendar-event > span {
  width:100%;
  overflow:hidden;
  font-size:11px;
  font-weight:850;
  line-height:1.15;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.planning-calendar-event > small {
  width:100%;
  overflow:hidden;
  color:#54647a;
  font-size:9px;
  line-height:1.15;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.planning-calendar-event.status-in_progress { border-color:#c5b5ef;border-left-color:#7c3aed;background:linear-gradient(135deg,#fbfaff,#eee9ff); }
.planning-calendar-event.status-done { border-color:#b8dfcc;border-left-color:#16805a;background:linear-gradient(135deg,#fbfffd,#e6f8ef); }
.planning-calendar-event.status-not_done { border-color:#e1c1bc;border-left-color:#b85145;background:linear-gradient(135deg,#fffaf9,#f7eae7); }
.planning-calendar-event.status-cancelled { border-color:#d9dde3;border-left-color:#929aaa;background:#f2f3f5;opacity:.65; }
.planning-calendar-event.priority-high,
.planning-calendar-event.priority-urgent { border-left-color:#d04457; }
.planning-calendar-now {
  position:absolute;
  z-index:6;
  left:0;
  right:0;
  height:2px;
  pointer-events:none;
  background:#e35243;
  box-shadow:0 0 0 1px rgba(227,82,67,.08);
}
.planning-calendar-now::before { content:"";position:absolute;left:-4px;top:-3px;width:8px;height:8px;border-radius:50%;background:#e35243; }
.planning-calendar-now span {
  position:absolute;
  top:-9px;
  right:5px;
  padding:1px 5px;
  border-radius:5px;
  background:#e35243;
  color:#fff;
  font-size:8px;
  font-weight:900;
}
.planning-list-fallback { margin-top:12px;border-top:1px solid #e0e5eb;padding-top:10px; }
.planning-list-fallback > summary { cursor:pointer;color:#6e4a35;font-size:12px;font-weight:850; }
.planning-list-fallback[open] > summary { margin-bottom:12px; }
.planning-inactive-history { margin-top:12px;padding:10px 12px;border:1px solid #e1d9d3;border-radius:12px;background:#fbf9f7; }
.planning-inactive-history > summary { cursor:pointer;color:#6f625a;font-size:12px;font-weight:850; }
.planning-inactive-list { display:grid;gap:8px;margin-top:10px; }
.planning-inactive-list article { display:flex;justify-content:space-between;gap:16px;padding:10px;border:1px solid #e5dfda;border-radius:10px;background:#fff; }
.planning-inactive-list article > div { display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap; }
.planning-inactive-list article > div:first-child { min-width:0;flex-direction:column;gap:2px; }
.planning-inactive-list span,.planning-inactive-list small { color:#707783;font-size:11px; }
.planning-inactive-list small { white-space:pre-line; }
.planning-current-status { min-height:46px;display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid #dce2e8;border-radius:10px;background:#fafbfc; }
.planning-current-status small { color:#697386;line-height:1.3; }
.planning-execution { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;align-items:center;padding:16px;border:1px solid #d7d0c8;border-radius:14px;background:linear-gradient(135deg,#fffdf9,#f8f4ef); }
.planning-execution strong,.planning-execution p { display:block;margin:3px 0 0; }
.planning-execution p { max-width:680px;color:#687181;font-size:12px;line-height:1.45; }
.planning-execution-actions,.planning-item-actions { display:flex;align-items:center;gap:7px;flex-wrap:wrap; }
.planning-status-chip.status-not_done { border-color:#e8c2bc;background:#fff1ef;color:#a33e35; }

@media (max-width:820px) {
  .planning-calendar-shell { max-height:68vh; }
  .planning-calendar-grid { grid-template-columns:64px repeat(5,170px);min-width:914px; }
  .planning-calendar-date { padding-inline:8px; }
  .planning-ai-result { grid-template-columns:1fr; }
  .planning-ai-days { justify-content:flex-start; }
  .planning-execution { grid-template-columns:1fr; }
}

/* ========================================================================== */
/* Suivi MCP CallKom                                                          */
/* ========================================================================== */
.mcp-page { --mcp-ink:#15201d; --mcp-muted:#697470; --mcp-line:#dce3df; --mcp-green:#167c59; --mcp-amber:#b97517; --mcp-red:#b4493f; display:grid; gap:18px; color:var(--mcp-ink); }
.mcp-hero { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:28px; align-items:end; padding:30px; overflow:hidden; border:1px solid #cfdbd5; border-radius:24px; background:radial-gradient(circle at 86% 5%,rgba(79,165,126,.22),transparent 35%),linear-gradient(135deg,#13231d 0%,#1e3229 58%,#223e32 100%); color:#f7faf8; box-shadow:0 20px 55px rgba(18,40,31,.16); }
.mcp-hero h2 { margin:5px 0 10px; color:#fff; font-size:clamp(28px,4vw,50px); letter-spacing:-.04em; }
.mcp-hero p { max-width:760px; margin:0; color:#becdc6; line-height:1.65; }
.mcp-hero .eyebrow { color:#8fd4b3; }
.mcp-health { display:flex; flex-wrap:wrap; gap:8px; margin-top:20px; }
.mcp-live,.mcp-retention { display:inline-flex; align-items:center; gap:7px; padding:8px 11px; border:1px solid rgba(255,255,255,.14); border-radius:999px; background:rgba(255,255,255,.06); color:#dbe8e2; font-size:11px; font-weight:750; }
.mcp-live i,.mcp-pulse-label i { width:8px; height:8px; border-radius:50%; background:#88938e; }
.mcp-live.online i,.mcp-pulse-label i { background:#42dd98; box-shadow:0 0 0 5px rgba(66,221,152,.12); animation:mcpPulse 1.8s ease-out infinite; }
.mcp-live.offline i { background:#e16a5d; }
@keyframes mcpPulse { 0%,45%{box-shadow:0 0 0 0 rgba(66,221,152,.30)} 100%{box-shadow:0 0 0 8px rgba(66,221,152,0)} }
.mcp-hero-side { display:grid; min-width:210px; gap:6px; padding:18px; border:1px solid rgba(255,255,255,.14); border-radius:16px; background:rgba(5,14,10,.24); }
.mcp-hero-side span { color:#94aaa0; font-size:10px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.mcp-hero-side strong { font-size:16px; }
.mcp-hero-side .btn { margin-top:8px; border-color:rgba(255,255,255,.22); background:rgba(255,255,255,.08); color:#fff; }
.mcp-stats { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; }
.mcp-stats article { display:grid; gap:5px; min-height:118px; padding:18px; border:1px solid var(--mcp-line); border-radius:16px; background:#fff; box-shadow:0 8px 25px rgba(30,46,39,.05); }
.mcp-stats article span,.mcp-stats article small { color:var(--mcp-muted); font-size:11px; }
.mcp-stats article strong { align-self:end; font-size:28px; letter-spacing:-.04em; }
.mcp-stats article.good { border-top:3px solid var(--mcp-green); }.mcp-stats article.warn { border-top:3px solid var(--mcp-amber); }.mcp-stats article.bad { border-top:3px solid var(--mcp-red); }
.mcp-live-board { padding:22px; border:1px solid #273a32; border-radius:20px; background:#17211d; color:#f1f7f4; box-shadow:0 12px 35px rgba(23,33,29,.12); }
.mcp-section-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:16px; }
.mcp-section-head h3 { margin:2px 0 0; font-size:22px; }.mcp-section-head p { margin:4px 0 0; color:var(--mcp-muted); }
.mcp-live-board .eyebrow { color:#77cda5; }.mcp-live-board h3 { color:#fff; }
.mcp-pulse-label { display:flex; align-items:center; gap:9px; color:#9eb6ab; font-size:11px; font-weight:800; }
.mcp-live-list { display:grid; gap:8px; }
.mcp-live-request,.mcp-live-idle { display:flex; align-items:center; gap:12px; padding:14px 15px; border:1px solid rgba(255,255,255,.10); border-radius:13px; background:rgba(255,255,255,.045); }
.mcp-live-request small,.mcp-live-idle small { display:block; margin-top:2px; color:#8ea198; }.mcp-spinner { width:17px; height:17px; border:2px solid rgba(255,255,255,.18); border-top-color:#5ae0a2; border-radius:50%; animation:mcpSpin .8s linear infinite; }
@keyframes mcpSpin { to{transform:rotate(360deg)} }.mcp-live-idle>i { width:10px; height:10px; border-radius:50%; background:#38d98e; box-shadow:0 0 18px rgba(56,217,142,.7); }
.mcp-live-feed { display:grid; gap:1px; margin-top:14px; border:1px solid rgba(255,255,255,.07); border-radius:12px; overflow:hidden; }
.mcp-live-feed>div { display:grid; grid-template-columns:145px 170px minmax(160px,1fr) minmax(180px,1fr); align-items:center; gap:12px; padding:10px 13px; background:rgba(255,255,255,.035); font-size:11px; }.mcp-live-feed>div>span:first-child { color:#83968d; }.mcp-live-feed>p { margin:0; padding:14px; color:#82968c; }
.mcp-authorized { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr); gap:28px; align-items:center; padding:24px !important; }.mcp-authorized h3 { margin:3px 0 8px; }.mcp-authorized p { margin:0; color:var(--mcp-muted); line-height:1.65; }.mcp-authorized code { padding:2px 5px; border-radius:5px; background:#edf2ef; color:#285542; }
.mcp-privacy-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }.mcp-privacy-grid span { display:grid; gap:3px; padding:12px; border:1px solid var(--mcp-line); border-radius:12px; color:var(--mcp-muted); font-size:10px; }.mcp-privacy-grid strong { color:var(--mcp-ink); font-size:11px; }
.mcp-history { padding:24px !important; overflow:visible !important; }
.mcp-filters { display:grid; grid-template-columns:150px 190px 210px minmax(210px,1fr) auto auto; gap:10px; align-items:end; margin-bottom:18px; padding:14px; border:1px solid var(--mcp-line); border-radius:14px; background:#f7f9f7; }.mcp-filters label { display:grid; gap:5px; }.mcp-filters label>span { color:#727d78; font-size:9px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }.mcp-filters select,.mcp-filters input { width:100%; min-height:40px; padding:8px 10px; border:1px solid #d8dfdb; border-radius:9px; background:#fff; color:var(--mcp-ink); }
.mcp-log-list { display:grid; gap:8px; }.mcp-log { display:grid; grid-template-columns:150px minmax(160px,1fr) minmax(200px,1.2fr) 175px 140px 18px; gap:14px; align-items:center; padding:15px; border:1px solid var(--mcp-line); border-radius:14px; background:#fff; cursor:pointer; transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease; }.mcp-log:hover,.mcp-log:focus { transform:translateY(-1px); border-color:#9bc5b1; box-shadow:0 9px 28px rgba(27,61,46,.08); outline:none; }.mcp-log-time,.mcp-log-action,.mcp-log-client,.mcp-log-source,.mcp-log>div { display:grid; gap:4px; min-width:0; }.mcp-log small { color:#818a86; font-size:10px; }.mcp-log-action span,.mcp-log-time strong { font-weight:800; }.mcp-log-error { overflow:hidden; max-width:190px; text-overflow:ellipsis; white-space:nowrap; color:#ae4b43 !important; }.mcp-log-open { color:#78a38f; font-size:23px; }
.mcp-status { display:inline-flex; align-items:center; gap:6px; width:max-content; padding:6px 8px; border-radius:999px; background:#edf1ef; color:#60716a; font-size:9px; font-weight:850; letter-spacing:.025em; }.mcp-status i { width:6px; height:6px; border-radius:50%; background:currentColor; }.mcp-status.success { background:#e7f7ef; color:#13734f; }.mcp-status.warning { background:#fff4dc; color:#966314; }.mcp-status.danger { background:#ffe9e6; color:#a63e35; }
.mcp-client-link { width:max-content; max-width:100%; padding:0; border:0; background:none; color:#186c50; font:inherit; font-weight:800; text-align:left; cursor:pointer; text-decoration:underline; text-decoration-color:#b7d6c8; text-underline-offset:3px; }.mcp-client-link.static { text-decoration:none; }.mcp-client-none,.mcp-client-pending { color:#79837f; font-size:11px; }.mcp-client-pending { color:#9a681b; }.mcp-more { display:block; margin:16px auto 0; }.mcp-empty { display:grid; gap:4px; place-items:center; padding:40px; border:1px dashed var(--mcp-line); border-radius:14px; color:var(--mcp-muted); }
.mcp-detail { display:grid; gap:18px; min-width:min(760px,80vw); }.mcp-detail-result { display:flex; align-items:center; gap:12px; padding:13px; border-radius:12px; background:#f4f7f5; }.mcp-detail-result>span:last-child { margin-left:auto; color:#707b76; }.mcp-detail dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1px; overflow:hidden; border:1px solid var(--mcp-line); border-radius:14px; background:var(--mcp-line); }.mcp-detail dl>div { display:grid; gap:4px; padding:13px; background:#fff; }.mcp-detail dl>div.wide { grid-column:1/-1; }.mcp-detail dt { color:#7c8682; font-size:9px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }.mcp-detail dd { min-width:0; margin:0; overflow-wrap:anywhere; }.danger-text { color:#a7443c; }
@media (max-width:1450px) { .mcp-stats { grid-template-columns:repeat(3,1fr); }.mcp-log { grid-template-columns:130px 1fr 1.15fr 155px 110px 14px; gap:10px; }.mcp-filters { grid-template-columns:repeat(3,1fr); }.mcp-filters .search { grid-column:1/3; } }
@media (max-width:900px) { .mcp-hero { grid-template-columns:1fr; padding:22px; }.mcp-hero-side { min-width:0; }.mcp-stats { grid-template-columns:repeat(2,1fr); }.mcp-authorized { grid-template-columns:1fr; }.mcp-live-feed>div { grid-template-columns:1fr 1fr; }.mcp-log { grid-template-columns:1fr 1fr; }.mcp-log-open { display:none; }.mcp-filters { grid-template-columns:1fr 1fr; }.mcp-filters .search { grid-column:1/-1; } }
@media (max-width:580px) { .mcp-page { gap:12px; }.mcp-hero,.mcp-live-board,.mcp-history { border-radius:15px; padding:16px !important; }.mcp-stats { grid-template-columns:1fr 1fr; gap:7px; }.mcp-stats article { min-height:95px; padding:13px; }.mcp-stats article strong { font-size:23px; }.mcp-section-head { display:grid; }.mcp-live-feed>div,.mcp-log { grid-template-columns:1fr; }.mcp-filters { grid-template-columns:1fr; }.mcp-filters .search { grid-column:auto; }.mcp-authorized { padding:16px !important; }.mcp-privacy-grid,.mcp-detail dl { grid-template-columns:1fr; }.mcp-detail { min-width:0; }.mcp-log { gap:8px; }.mcp-log>div { padding-bottom:7px; border-bottom:1px solid #edf0ee; }.mcp-log>div:last-of-type { border-bottom:0; }.mcp-live-request { align-items:flex-start; } }

/* Relances téléphoniques identifiées par le MCP CallKom */
.callkom-followup-badge{display:inline-flex;align-items:center;width:max-content;margin:0 7px 7px 0;padding:6px 9px;border:1px solid #e99e49;border-radius:999px;background:#fff2dc;color:#8b4d09;font-size:10px;font-weight:850;letter-spacing:.02em;box-shadow:0 5px 16px rgba(198,111,23,.14)}
.production-table tr.row-callkom-followup>td{background:#fff9ed}.production-table tr.row-callkom-followup>td:first-child{box-shadow:inset 4px 0 #e68a2e}
.kanban-card.has-callkom-followup{border-color:#e49a43!important;box-shadow:0 0 0 2px rgba(228,154,67,.12),0 12px 32px rgba(125,75,18,.10)!important}
.callkom-ack-btn{border-color:#ca711d!important;background:#9a5514!important;color:#fff!important}
.callkom-followup-panel{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 18px;padding:18px 20px;border:1px solid #dda05d;border-radius:16px;background:linear-gradient(135deg,#fff5e3,#fffaf2);box-shadow:0 10px 30px rgba(143,81,15,.08)}
.callkom-followup-panel h3{margin:3px 0 5px}.callkom-followup-panel p{margin:0;color:#6f5a45}.callkom-followup-panel .eyebrow{color:#a45b16}
@media(max-width:700px){.callkom-followup-panel{align-items:stretch;flex-direction:column}.callkom-followup-panel .btn{width:100%}}

/* ========================================================================== */
/* Atelier Admin 2026 — couche operationnelle commune                         */
/* Une seule grammaire visuelle pour tous les modules, sans modifier le metier */
/* ========================================================================== */
body:has(.admin-top-shell) {
  --admin-navy:#162136;
  --admin-navy-2:#253550;
  --admin-canvas:#f4f5f1;
  --admin-surface:#ffffff;
  --admin-soft:#f8f8f5;
  --admin-line:#e2e5df;
  --admin-line-strong:#cfd5dc;
  --admin-indigo:#5747d7;
  --admin-indigo-soft:#eeecff;
  --admin-copper:#b86b3e;
  --admin-copper-soft:#fff2e8;
  --admin-success:#0d8659;
  --admin-success-soft:#e9f8f1;
  --admin-warning:#a7640d;
  --admin-warning-soft:#fff5df;
  --admin-danger:#b8404d;
  --admin-danger-soft:#fff0f1;
  --admin-muted:#687386;
  --admin-shadow:0 12px 34px rgba(25,34,51,.065);
  color:var(--admin-navy);
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

body:has(.admin-top-shell) * { box-sizing:border-box; }
body:has(.admin-top-shell) button,
body:has(.admin-top-shell) input,
body:has(.admin-top-shell) select,
body:has(.admin-top-shell) textarea { font:inherit; }

body:has(.admin-top-shell) .admin-top-shell .content {
  width:100%;
  max-width:1920px;
  margin:0 auto;
  padding:24px clamp(16px,2vw,34px) 42px;
  background:var(--admin-canvas);
}
body:has(.admin-top-shell) .admin-top-shell .content[data-view] > * { animation:adminEnter .18s ease-out; }
@keyframes adminEnter { from{opacity:.25;transform:translateY(3px)} to{opacity:1;transform:none} }

body:has(.admin-top-shell) .admin-header {
  min-height:72px;
  padding:11px clamp(14px,2vw,28px);
  background:rgba(255,255,255,.96)!important;
  backdrop-filter:blur(16px);
}
body:has(.admin-top-shell) .admin-brand {
  border-left:4px solid var(--admin-copper)!important;
  padding-left:12px!important;
}
body:has(.admin-top-shell) .admin-brand strong { color:var(--admin-navy)!important;font-size:16px;letter-spacing:-.015em; }
body:has(.admin-top-shell) .admin-brand span { color:var(--admin-indigo)!important;font-size:10px;font-weight:850;letter-spacing:.045em;text-transform:uppercase; }
body:has(.admin-top-shell) .admin-userbar { gap:8px!important; }

/* Creation rapide toujours au meme endroit */
.admin-create-menu { position:relative;flex:0 0 auto; }
.admin-create-menu > summary { list-style:none;min-width:92px;cursor:pointer; }
.admin-create-menu > summary::-webkit-details-marker { display:none; }
.admin-create-menu[open] > summary { box-shadow:0 0 0 4px rgba(87,71,215,.14)!important; }
.admin-create-popover {
  position:absolute;
  z-index:120;
  top:calc(100% + 10px);
  right:0;
  display:grid;
  width:300px;
  padding:8px;
  border:1px solid var(--admin-line);
  border-radius:15px;
  background:#fff;
  box-shadow:0 22px 60px rgba(22,33,54,.18);
}
.admin-create-popover button {
  display:grid;
  gap:3px;
  width:100%;
  padding:11px 12px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--admin-navy);
  text-align:left;
  cursor:pointer;
}
.admin-create-popover button:hover,.admin-create-popover button:focus-visible { background:var(--admin-indigo-soft);outline:0; }
.admin-create-popover strong { font-size:13px; }
.admin-create-popover span { color:var(--admin-muted);font-size:11px; }

/* Navigation : lisible, compacte, memorisable */
@media (min-width:1181px) {
  body:has(.admin-top-shell) #adminTopNav.top-nav {
    width:264px!important;
    padding:14px 13px 26px!important;
    border-right-color:var(--admin-line)!important;
    background:#fcfcfa!important;
  }
  body:has(.admin-top-shell) .main { padding-left:264px!important; }
  body:has(.admin-top-shell) #adminTopNav.top-nav button[data-nav] {
    min-height:42px!important;
    margin:1px 0!important;
    padding:0 12px!important;
    border:1px solid transparent!important;
    border-radius:10px!important;
    background:transparent!important;
    color:#344158!important;
    font-size:13px!important;
    font-weight:690!important;
    text-align:left!important;
  }
  body:has(.admin-top-shell) #adminTopNav.top-nav button[data-nav]:hover { background:#f1f2ee!important;color:var(--admin-navy)!important; }
  body:has(.admin-top-shell) #adminTopNav.top-nav button[data-nav].active {
    border-color:#dcd8ff!important;
    background:var(--admin-indigo-soft)!important;
    color:#3529a5!important;
    box-shadow:inset 3px 0 var(--admin-indigo)!important;
  }
  body:has(.admin-top-shell) #adminTopNav .nav-section {
    margin-top:10px!important;
    padding-top:8px!important;
    border-top:1px solid var(--admin-line)!important;
  }
  body:has(.admin-top-shell) #adminTopNav .nav-section-toggle {
    min-height:34px!important;
    padding:0 8px!important;
    color:#778091!important;
    font-size:10px!important;
    font-weight:900!important;
    letter-spacing:.09em!important;
    text-transform:uppercase!important;
  }
  body:has(.admin-top-shell) .nav-smart-tools {
    position:sticky;
    z-index:5;
    top:-14px;
    margin:-14px -13px 10px!important;
    padding:15px 13px 11px!important;
    border-bottom:1px solid var(--admin-line);
    background:rgba(252,252,250,.97);
    backdrop-filter:blur(12px);
  }
}
.nav-smart-title { color:#7b8493; }
.nav-finder {
  min-height:44px!important;
  border:1px solid var(--admin-line-strong)!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:0 4px 14px rgba(22,33,54,.04);
}
.nav-finder:focus-within { border-color:var(--admin-indigo)!important;box-shadow:0 0 0 3px rgba(87,71,215,.12); }
.nav-recents { border-color:var(--admin-line)!important;background:#f6f6f2!important; }

/* Panneaux et titres */
body:has(.admin-top-shell) .panel,
body:has(.admin-top-shell) .detail-main,
body:has(.admin-top-shell) .detail-side {
  border-color:var(--admin-line)!important;
  border-radius:18px!important;
  background:var(--admin-surface)!important;
  box-shadow:var(--admin-shadow)!important;
}
body:has(.admin-top-shell) .panel { padding:22px!important; }
body:has(.admin-top-shell) .panel-head {
  align-items:flex-start!important;
  gap:18px!important;
  margin-bottom:18px!important;
  padding-bottom:15px;
  border-bottom:1px solid var(--admin-line);
}
body:has(.admin-top-shell) .panel-head h2,
body:has(.admin-top-shell) .panel-head h3,
body:has(.admin-top-shell) .modal-head h2 {
  margin-top:3px;
  color:var(--admin-navy)!important;
  font-weight:820;
  letter-spacing:-.025em!important;
}
body:has(.admin-top-shell) .eyebrow,
body:has(.admin-top-shell) .panel-eyebrow {
  color:var(--admin-copper)!important;
  font-size:10px!important;
  font-weight:900!important;
  letter-spacing:.1em!important;
}

/* Boutons : une hierarchie stable sur tout le SaaS */
body:has(.admin-top-shell) .btn {
  min-height:40px;
  padding:0 13px;
  border:1px solid var(--admin-line-strong)!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#2f3d54!important;
  font-size:12px;
  font-weight:760!important;
  line-height:1.2;
  box-shadow:0 2px 5px rgba(22,33,54,.025);
  transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease,background .12s ease;
}
body:has(.admin-top-shell) .btn:hover:not(:disabled) { transform:translateY(-1px);border-color:#aeb7c4!important;box-shadow:0 7px 16px rgba(22,33,54,.08); }
body:has(.admin-top-shell) .btn:active:not(:disabled) { transform:translateY(0); }
body:has(.admin-top-shell) .btn.small { min-height:32px;padding:0 10px;font-size:11px; }
body:has(.admin-top-shell) .btn.primary {
  border-color:var(--admin-indigo)!important;
  background:linear-gradient(135deg,#6658e3,var(--admin-indigo))!important;
  color:#fff!important;
  box-shadow:0 8px 18px rgba(87,71,215,.18)!important;
}
body:has(.admin-top-shell) .btn.blue { border-color:#d8d3ff!important;background:var(--admin-indigo-soft)!important;color:#4133b6!important;box-shadow:none!important; }
body:has(.admin-top-shell) .btn.green { border-color:#b9e5d1!important;background:var(--admin-success-soft)!important;color:#076e48!important;box-shadow:none!important; }
body:has(.admin-top-shell) .btn.warn { border-color:#efd19c!important;background:var(--admin-warning-soft)!important;color:#8a5009!important;box-shadow:none!important; }
body:has(.admin-top-shell) .btn.red,
body:has(.admin-top-shell) .danger-action { border-color:#efc3c8!important;background:var(--admin-danger-soft)!important;color:#a62e3d!important;box-shadow:none!important; }
body:has(.admin-top-shell) .btn.ghost { background:transparent!important;box-shadow:none!important; }
body:has(.admin-top-shell) .btn:disabled { opacity:.45;cursor:not-allowed;transform:none!important;box-shadow:none!important; }
body:has(.admin-top-shell) :is(button,a,input,select,textarea,summary):focus-visible { outline:3px solid rgba(87,71,215,.26)!important;outline-offset:2px; }

/* Formulaires : libelles, aide et zones de saisie coherents */
body:has(.admin-top-shell) .field { gap:7px;margin-bottom:13px; }
body:has(.admin-top-shell) .field label,
body:has(.admin-top-shell) .check { color:#3f4b60!important;font-size:11px!important;font-weight:820!important; }
body:has(.admin-top-shell) :is(.field input,.field textarea,.field select,.search,.inline-form input,.mini-select) {
  min-height:42px;
  border:1px solid var(--admin-line-strong)!important;
  border-radius:10px!important;
  background:#fff!important;
  color:var(--admin-navy)!important;
  box-shadow:inset 0 1px 0 rgba(22,33,54,.02)!important;
}
body:has(.admin-top-shell) .field textarea { min-height:105px;line-height:1.55; }
body:has(.admin-top-shell) :is(input,textarea)::placeholder { color:#9aa3b0; }
body:has(.admin-top-shell) .form-grid { gap:2px 14px; }
body:has(.admin-top-shell) .check { min-height:38px;padding:8px 10px;border-radius:9px;background:var(--admin-soft); }

/* Tableaux : priorite a la lecture et actions secondaires rangees */
body:has(.admin-top-shell) :is(.production-table-wrap,.client-table-wrap,#documentTable,.table-scroll) {
  border:1px solid var(--admin-line);
  border-radius:14px;
  background:#fff;
  overflow:auto;
}
body:has(.admin-top-shell) table { margin:0;background:#fff; }
body:has(.admin-top-shell) thead th {
  position:sticky;
  z-index:3;
  top:0;
  padding:12px 11px!important;
  border-bottom:1px solid var(--admin-line-strong)!important;
  background:#f7f7f4!important;
  color:#697486!important;
  font-size:9px!important;
  font-weight:900!important;
  letter-spacing:.075em!important;
  text-transform:uppercase!important;
}
body:has(.admin-top-shell) tbody td { padding:13px 11px!important;border-bottom:1px solid #eceee9!important;color:#26344a;line-height:1.45; }
body:has(.admin-top-shell) tbody tr:last-child td { border-bottom:0!important; }
body:has(.admin-top-shell) tbody tr:hover td { background:#fafaf7!important; }
body:has(.admin-top-shell) td.right { min-width:168px; }
body:has(.admin-top-shell) td.right > .btn,
body:has(.admin-top-shell) td.right > a.btn { margin:2px!important; }
body:has(.admin-top-shell) .production-table .mini-select { min-height:36px;font-size:11px; }
body:has(.admin-top-shell) .production-table td:first-child strong,
body:has(.admin-top-shell) .docs-list-table td:first-child strong { color:#253353;font-weight:900; }

.ta-wrap,.doc-action-stack { display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px; }
.row-action-menu { flex:1 1 100%;min-width:0;text-align:right; }
.row-action-menu > summary { display:inline-flex!important;list-style:none;cursor:pointer; }
.row-action-menu > summary::-webkit-details-marker { display:none; }
.row-action-menu[open] > summary { border-color:#c6c0fb!important;background:var(--admin-indigo-soft)!important;color:#4235ad!important; }
.row-action-panel {
  display:grid;
  grid-template-columns:1fr;
  gap:5px;
  margin-top:6px;
  padding:7px;
  border:1px solid var(--admin-line);
  border-radius:10px;
  background:var(--admin-soft);
}
.row-action-panel .btn { width:100%;margin:0!important;justify-content:center; }
.row-action-panel a.btn { display:flex;align-items:center;text-decoration:none; }

/* Files d'attente devis : toutes les decisions restent accessibles sans noyer l'ecran */
.quote-validity-panel {
  grid-template-columns:minmax(230px,.7fr) minmax(420px,1.3fr)!important;
  gap:20px!important;
  margin-bottom:16px!important;
  border-radius:15px!important;
}
.quote-validity-list { max-height:360px;overflow:auto;padding-right:4px;scrollbar-gutter:stable; }
.quote-validity-list article { min-height:72px;border-radius:11px!important;background:#fff!important; }
.quote-validity-list article > div { display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end; }

/* Espace clients : le formulaire ne mange plus la liste, mais reste immediat */
body:has(.admin-top-shell) .clients-workspace { grid-template-columns:minmax(0,1fr) minmax(300px,360px)!important;gap:18px!important; }
body:has(.admin-top-shell) .clients-workspace .side-panel { position:sticky;top:94px;align-self:start;max-height:calc(100vh - 116px);overflow:auto; }
.client-pagination { padding:11px 4px!important; }
.client-pagination-actions { flex-wrap:wrap; }

/* Chargement, vide et erreur : le systeme explique toujours quoi faire */
body:has(.admin-top-shell) .panel.loading {
  min-height:210px;
  border-style:dashed!important;
  background:linear-gradient(100deg,#f7f7f3 30%,#fff 48%,#f7f7f3 66%)!important;
  background-size:220% 100%!important;
  color:var(--admin-muted);
  font-weight:800;
  animation:adminLoading 1.25s linear infinite!important;
}
@keyframes adminLoading { to{background-position:-220% 0} }
body:has(.admin-top-shell) .panel.error { justify-items:center;gap:8px;border-color:#efc3c8!important;background:var(--admin-danger-soft)!important;color:#902e39; }
body:has(.admin-top-shell) .empty { padding:30px;border:1px dashed var(--admin-line-strong);border-radius:12px;background:var(--admin-soft);color:var(--admin-muted);text-align:center; }

/* Modales : entete fixe et lecture confortable */
body:has(.admin-top-shell) .modal-backdrop { padding:22px;background:rgba(15,24,40,.58)!important;backdrop-filter:blur(4px)!important; }
body:has(.admin-top-shell) .modal { border:1px solid var(--admin-line)!important;border-radius:20px!important;padding:20px!important;box-shadow:0 28px 90px rgba(15,24,40,.28)!important; }
body:has(.admin-top-shell) .modal-head { position:sticky;z-index:12;top:-20px;margin:-20px -20px 18px!important;padding:18px 20px 15px!important;border-bottom:1px solid var(--admin-line)!important;background:rgba(255,255,255,.97);backdrop-filter:blur(12px); }

/* Barre mobile : les cinq gestes quotidiens a portee de pouce */
.admin-mobile-dock { display:none; }
@media (max-width:1180px) {
  body:has(.admin-top-shell) .admin-top-shell .content { padding:15px 14px 90px; }
  body:has(.admin-top-shell) .admin-header { min-height:62px;padding:8px 12px; }
  .admin-create-menu { display:none; }
  .admin-mobile-dock {
    position:fixed;
    z-index:200;
    right:10px;
    bottom:max(10px,env(safe-area-inset-bottom));
    left:10px;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:4px;
    padding:6px;
    border:1px solid rgba(255,255,255,.6);
    border-radius:17px;
    background:rgba(22,33,54,.95);
    box-shadow:0 18px 45px rgba(15,24,40,.28);
    backdrop-filter:blur(18px);
  }
  .admin-mobile-dock button { min-width:0;min-height:48px;padding:5px 3px;border:0;border-radius:11px;background:transparent;color:#dce3ee;font-size:9px;font-weight:800;cursor:pointer; }
  .admin-mobile-dock button.primary { background:linear-gradient(135deg,#725fee,#5747d7);color:#fff;box-shadow:0 6px 15px rgba(87,71,215,.38); }
  .work-agent-mobile-shortcut { bottom:82px!important; }
  body:has(.admin-top-shell) .clients-workspace { grid-template-columns:1fr!important; }
  body:has(.admin-top-shell) .clients-workspace .side-panel { position:static;max-height:none; }
}

@media (max-width:760px) {
  body:has(.admin-top-shell) .admin-top-shell .content { padding:10px 9px 88px; }
  body:has(.admin-top-shell) .panel { margin-bottom:10px!important;padding:15px!important;border-radius:14px!important; }
  body:has(.admin-top-shell) .panel-head { align-items:stretch!important;flex-direction:column!important;gap:10px!important;padding-bottom:12px; }
  body:has(.admin-top-shell) .panel-head .toolbar { display:grid;grid-template-columns:1fr 1fr;width:100%;gap:7px!important; }
  body:has(.admin-top-shell) .panel-head .toolbar > :is(.btn,.search,a,select) { width:100%;min-width:0; }
  body:has(.admin-top-shell) .panel-head .toolbar .primary { grid-column:1/-1; }
  body:has(.admin-top-shell) .actions-row { align-items:stretch;flex-direction:column; }
  body:has(.admin-top-shell) .actions-row > :is(.search,input,select,.segmented) { width:100%; }
  body:has(.admin-top-shell) .modal-backdrop { padding:0!important;align-items:stretch; }
  body:has(.admin-top-shell) .modal { width:100%;height:100dvh;max-height:100dvh;border:0!important;border-radius:0!important;padding:14px!important; }
  body:has(.admin-top-shell) .modal-head { top:-14px;margin:-14px -14px 14px!important;padding:14px!important; }
  .quote-validity-panel { grid-template-columns:1fr!important;padding:15px!important; }
  .quote-validity-list { max-height:330px; }
  .quote-validity-list article { grid-template-columns:1fr!important; }
  body:has(.admin-top-shell) .client-table-wrap table,
  body:has(.admin-top-shell) .docs-list-table,
  body:has(.admin-top-shell) .production-table { min-width:920px!important; }
  .admin-mobile-dock { right:6px;bottom:max(6px,env(safe-area-inset-bottom));left:6px;border-radius:15px; }
}

@media (prefers-reduced-motion:reduce) {
  body:has(.admin-top-shell) *,body:has(.admin-top-shell) *::before,body:has(.admin-top-shell) *::after { scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important; }
}
