/* ===========================================================================
   STUDIO — la variante « outil interne » (back-office, tableau de bord d'equipe).

   A charger APRES studio.css, sur une racine `<div class="st bo">`. Memes
   jetons, memes couleurs, meme police ; ce qui change, c'est la forme :
   - un menu a gauche (icone + nom), la page active remplie de la couleur d'accent ;
   - de grandes cartes blanches SANS trait, coins de 28 px, posees sur le gris ;
   - tout ce qui se clique est une pastille : boutons noirs, onglets de 44 px ;
   - les tableaux sont des bandes arrondies separees par 8 px.

   Les classes propres a cette variante commencent par « b- ». Les composants
   « s- » (etiquettes, champs, notes, chiffres…) restent utilisables dedans.
   =========================================================================== */

.st.bo { --radius: 28px; --zoom: 1; zoom: var(--zoom); flex-direction: row; min-height: calc(100vh / var(--zoom)); }
/* Pour voir plus de lignes a l'ecran sur un outil dense : --zoom: 0.9. */

/* --- le menu --- */
.st .b-side { position: sticky; top: 0; z-index: 30; flex: none; width: 236px; height: calc(100vh / var(--zoom)); padding: 20px 12px 20px 20px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; scrollbar-width: none; }
.st .b-brand { flex: none; display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 0 6px; color: var(--ink); }
.st .b-brand:hover { color: var(--ink); }
.st .b-brand img, .st .b-brand .logo { width: 42px; height: 42px; border-radius: 13px; object-fit: cover; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 600; }
.st .b-brand span { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.st .b-nav { display: flex; flex-direction: column; gap: 4px; }
.st .b-nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 14px; color: var(--ink); font-size: 14.5px; white-space: nowrap; }
.st .b-nav a svg { flex: none; }
.st .b-nav a:hover { background: var(--s1); color: var(--accent-soft); }
.st .b-nav a[aria-current='page'] { background: var(--accent); color: #fff; font-weight: 500; }
.st .b-nav a.sep { margin-top: 14px; }
.st .b-nav a i { flex: none; min-width: 22px; height: 22px; padding: 0 6px; margin-left: auto; border-radius: 11px; background: var(--ink); color: var(--bg); font: 600 11px/22px var(--f-sans); font-style: normal; text-align: center; }
.st .b-nav a[aria-current='page'] i { background: #fff; color: var(--accent-soft); }

/* --- la barre du haut : des pastilles blanches alignees a droite --- */
.st .b-wrap { flex: 1 1 0; min-width: 0; padding: 0 28px 0 4px; display: flex; flex-direction: column; }
.st .b-top { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding: 20px 0 0; }
.st .b-round { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--s1); color: var(--ink); }
.st .b-round:hover { color: var(--accent-soft); }
.st .b-who { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 4px; border-radius: 22px; background: var(--s1); color: var(--ink); }
.st .b-who:hover { color: var(--ink); }
.st .b-who .s-av { width: 36px; height: 36px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; }
.st .b-who b { display: block; font-size: 14px; font-weight: 600; line-height: 1.15; }
.st .b-who small { display: block; font-size: 11.5px; color: var(--mut); }
.st .b-gauge { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--s1); color: var(--ink); font-size: 13px; }
.st .b-gauge .track { width: 64px; height: 6px; border-radius: 3px; background: var(--s3); overflow: hidden; }
.st .b-gauge .track i { display: block; height: 100%; border-radius: 3px; background: var(--ink); }

/* --- la page --- */
.st .b-main { flex: 1; width: 100%; max-width: 2200px; padding: 18px 0 44px; display: flex; flex-direction: column; gap: 16px; }
.st .b-eyebrow { font-size: 13px; color: var(--mut); }
.st .b-main > header h1, .st .b-title { font-size: clamp(30px, 3.4vw, 40px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; }
.st .b-main > header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 6px; }
.st .b-main h2, .st .b-h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.st .b-banner { padding: 12px 18px; border-radius: 18px; background: var(--tint-warn); color: var(--warn); font-size: 14px; }

/* --- cartes : blanches, sans trait --- */
.st .b-card { background: var(--s1); border-radius: var(--radius); padding: 24px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.st .b-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.st .b-cols.main-side { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }

/* Les chiffres cles : une rangee de tuiles. */
.st .b-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.st .b-tiles > div { flex: 1 1 132px; min-width: 132px; padding: 12px 16px; border-radius: 18px; background: var(--s1); }
.st .b-card .b-tiles > div { background: var(--s2); }
.st .b-tiles span { display: block; font-size: 12.5px; color: var(--mut); }
.st .b-tiles b { display: block; margin-top: 2px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.st .b-tiles .ok b { color: var(--ok); }
.st .b-tiles .warn b { color: var(--warn); }
.st .b-tiles .bad b { color: var(--bad); }

/* --- boutons : des pastilles. Noir pour agir, gris pour le reste, rose pour detruire. --- */
.st .b-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 999px; background: var(--btn-ink); color: var(--btn-ink-text); font: 600 14px/1 var(--f-sans); white-space: nowrap; cursor: pointer; }
.st .b-btn:hover { opacity: 0.86; color: var(--btn-ink-text); }
.st .b-btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.st .b-btn.accent { background: var(--accent); color: #fff; }
.st .b-btn.ghost { background: var(--s1); color: var(--ink); font-weight: 500; }
.st .b-card .b-btn.ghost, .st td .b-btn.ghost { background: var(--s2); }
.st .b-btn.ghost:hover { color: var(--ink); opacity: 0.8; }
.st .b-btn.danger { background: color-mix(in srgb, var(--bad) 12%, var(--s1)); color: var(--bad); }

/* --- recherche, tri, onglets --- */
.st .b-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st .b-filters :is(input, select) { height: 44px; padding: 0 18px; border-radius: 22px; background: var(--s1); font-size: 14.5px; outline: none; }
.st .b-card .b-filters :is(input, select) { background: var(--s2); }
.st .b-filters :is(input, select):focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.st .b-search { position: relative; flex: 1 1 220px; max-width: 420px; }
.st .b-search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.st .b-search input { width: 100%; padding-left: 42px; }
.st .b-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.st .b-pills :is(a, button) { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 22px; background: var(--s1); color: var(--ink); font-size: 14px; font-weight: 500; white-space: nowrap; }
.st .b-card .b-pills :is(a, button) { background: var(--s2); }
.st .b-pills :is(a, button):hover { color: var(--accent-soft); }
.st .b-pills :is(a, button)[aria-current='true'], .st .b-pills button[aria-pressed='true'] { background: var(--accent); color: #fff; font-weight: 600; }
.st .b-pills i { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--bad); color: #fff; font: 600 12px var(--f-sans); font-style: normal; }
.st .b-pills [aria-current='true'] i, .st .b-pills [aria-pressed='true'] i { background: #fff; color: var(--accent-soft); }

/* --- tableaux : chaque ligne est une bande arrondie --- */
.st .b-table-wrap { overflow-x: auto; }
.st .b-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 14px; }
.st .b-table th { padding: 0 14px 2px; text-align: left; font-size: 12px; font-weight: 500; color: var(--mut); white-space: nowrap; }
.st .b-table td { background: var(--s1); padding: 12px 14px; vertical-align: middle; }
.st .b-card .b-table td { background: var(--s2); }
.st .b-table td:first-child { border-radius: 18px 0 0 18px; }
.st .b-table td:last-child { border-radius: 0 18px 18px 0; }
.st .b-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 7%, var(--s1)); }
.st .b-table .num { text-align: right; white-space: nowrap; }
.st .b-table td b { font-weight: 600; }
.st .b-table td small { display: block; font-size: 12.5px; color: var(--mut); }
.st .b-thumb { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: var(--s3); flex: none; }
.st .b-bar { height: 6px; min-width: 80px; border-radius: 3px; background: var(--s3); overflow: hidden; }
.st .b-bar i { display: block; height: 100%; border-radius: 3px; background: var(--ink); }

/* --- etiquettes d'etat --- */
.st .b-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; background: var(--s3); color: var(--ink); font-size: 12px; font-weight: 600; white-space: nowrap; }
.st .b-chip.ok { background: color-mix(in srgb, var(--ok) 13%, var(--s1)); color: var(--ok); }
.st .b-chip.warn { background: color-mix(in srgb, var(--warn) 16%, var(--s1)); color: var(--warn); }
.st .b-chip.bad { background: color-mix(in srgb, var(--bad) 12%, var(--s1)); color: var(--bad); }
.st .b-chip.accent { background: color-mix(in srgb, var(--accent) 13%, var(--s1)); color: var(--accent-ink); }

/* --- champs de l'outil : coins de 14 px --- */
.st.bo .s-input, .st.bo textarea.s-input, .st.bo select.s-input { border-radius: 14px; border-color: var(--s3); font-size: 14.5px; }

/* --- telephone : le menu de gauche laisse la place a la barre du bas (.s-tabbar) --- */
@media (max-width: 900px) {
  .st.bo { flex-direction: column; }
  .st .b-side { display: none; }
  .st .b-wrap { padding: 0 16px; }
  .st .b-top { padding-top: 12px; }
  .st .b-cols.main-side { grid-template-columns: minmax(0, 1fr); }
  .st .b-card { padding: 18px; border-radius: 22px; }
  .st .b-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .st .b-pills > * { flex: none; }
  .st.bo .s-tabbar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: flex; padding: 0 8px env(safe-area-inset-bottom); background: rgba(var(--bar-rgb), 0.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .st.bo .s-tabbar a { flex: 1 1 0; min-width: 0; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--faint); font-size: 11.5px; font-weight: 500; }
  .st.bo .s-tabbar a[aria-current='page'] { color: var(--ink); }
  .st.bo.st-app { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ===========================================================================
   Complements venus des premiers essais.
   =========================================================================== */

/* Le bouton qui encaisse ou valide un paiement : vert, comme partout. */
.st .b-btn.ok { background: var(--ok-fill); color: #fff; }

/* Des bandes cliquables dans une carte (resultats d'une recherche, fiches recentes) :
   avatar ou vignette, deux lignes de texte, une information a droite. */
.st .b-rows { display: flex; flex-direction: column; gap: 8px; }
.st .b-rows > * { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--s2); color: var(--ink); min-width: 0; }
.st .b-rows > a:hover { background: color-mix(in srgb, var(--accent) 8%, var(--s2)); color: var(--ink); }
.st .b-rows .txt { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.st .b-rows .txt b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st .b-rows .txt small { font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st .b-rows .side { flex: none; text-align: right; font-size: 13px; }
.st .b-rows .side small { display: block; font-size: 11.5px; color: var(--mut); }
/* Une personne dans une ligne de tableau ou une bande : ses initiales dans un rond. */
.st .b-table .s-av, .st .b-rows .s-av { width: 40px; height: 40px; font-size: 13px; font-weight: 600; }

/* La colonne laterale de 380 px laisse trop peu de place a un tableau avant 1180 px. */
@media (max-width: 1180px) {
  .st .b-cols.main-side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  /* La marque reste visible : seule, en haut a gauche, sur la meme ligne que les pastilles. */
  .st.bo { position: relative; }
  .st .b-side { display: flex; position: absolute; top: 12px; left: 16px; width: auto; height: 44px; padding: 0; overflow: visible; }
  .st .b-side .b-nav { display: none; }
  .st .b-brand { margin: 0; padding: 0; height: 44px; }
  .st .b-brand span { display: none; }
  .st .b-gauge { display: none; }
  .st .b-top { min-height: 56px; }
  /* Les actions de la tete de page passent sous le titre, sur toute la largeur. */
  .st .b-main > header > .s-row { width: 100%; }
  .st .b-main > header .b-btn { flex: 1 1 auto; }
  /* Un tableau .stack devient une pile de fiches : plus d'en-tetes, la premiere cellule en titre. */
  .st .b-table.stack thead { display: none; }
  .st .b-table.stack, .st .b-table.stack tbody { display: block; }
  .st .b-table.stack tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; padding: 14px; border-radius: 18px; background: var(--s1); }
  .st .b-card .b-table.stack tr { background: var(--s2); }
  .st .b-table.stack td, .st .b-card .b-table.stack td { background: none; padding: 0; border-radius: 0; }
  .st .b-table.stack td:first-child { flex: 1 1 100%; }
  .st .b-table.stack td.num { margin-left: auto; }
  .st .b-table.stack td:last-child:has(.b-btn) { flex: 1 1 100%; display: flex; gap: 8px; }
  .st .b-table.stack td:last-child .b-btn { flex: 1 1 0; }
}
