/* ============================================================
   Jenna's World — CRM · Design System v8 « Daylight »
   REFONTE COMPLÈTE (27/08/2026) — direction « Motoko 2026 »

   Principes :
   - CLAIR PAR DÉFAUT — papier #f5f5f5, cartes blanches, encre #111.
     Le thème sombre chaleureux reste disponible ([data-theme="dark"]).
   - Élévation par FOND, pas par ombre : les ombres sont quasi nulles.
   - Un seul accent : l'encre (noir neutre). Aucune couleur criarde,
     aucun glow, aucun dégradé décoratif, aucun emoji comme icône.
   - Grille 8px, rayons 10/14/18px, Inter, chiffres tabulaires,
     marges généreuses.
   ============================================================ */

/* ============================================================
   1. TOKENS — clair par défaut
   ============================================================ */
:root,
[data-theme="light"] {
  /* Surfaces : papier → carte → creux */
  --bg: #f5f4f2;
  --panel: #ffffff;
  --surface: #faf9f7;
  --surface-2: #f1efec;
  --elevated: #ffffff;

  /* Encre : 4 niveaux */
  --text: #14120f;
  --text1: #14120f;
  --text2: #6e6862;
  --text3: #9a938b;

  /* Hairlines — presque invisibles, juste de quoi poser la carte */
  --border: rgba(20, 18, 15, 0.08);
  --border-strong: rgba(20, 18, 15, 0.15);
  --row-border: rgba(20, 18, 15, 0.06);
  --line-tint: rgba(20, 18, 15, 0.065);

  /* Accent unique — l'encre */
  /* Accent UNIQUE : bleu Telegram. Il ne sert qu'aux actions, aux liens
     et aux repères actifs — tout le reste reste gris chaud. */
  --accent: #229ed9;
  --accent-hover: #157cb0;
  --accent-active: #126b99;
  --accent-bright: #229ed9;
  --accent-solid: #229ed9;
  --accent-solid-hover: #1c8dc4;
  --accent-grad: #229ed9;
  --accent-grad-hover: #1c8dc4;
  --on-accent: #ffffff;
  --accent-soft: rgba(34, 158, 217, 0.1);
  --accent-wash: rgba(34, 158, 217, 0.055);
  --accent-ring: rgba(34, 158, 217, 0.4);
  --accent-line: rgba(34, 158, 217, 0.3);
  --accent-border-soft: rgba(34, 158, 217, 0.24);
  --accent-border-hover: rgba(34, 158, 217, 0.42);
  --accent-glow: transparent;
  --halo: transparent;
  --btn-primary-glow: none;
  --logo-shadow: none;

  /* Sémantique — sourde, toujours doublée d'un libellé */
  --ok: #17795e;   --ok-soft: rgba(23, 121, 94, 0.09);
  --warn: #8a5a12; --warn-soft: rgba(138, 90, 18, 0.09);
  --warn-border: rgba(138, 90, 18, 0.2);
  --err: #b3261e;  --err-soft: rgba(179, 38, 30, 0.08);

  /* Remplissages génériques */
  --hover-fill: rgba(20, 18, 15, 0.045);
  --tint: rgba(20, 18, 15, 0.02);
  --tint-2: rgba(20, 18, 15, 0.035);
  --chip-bg: rgba(20, 18, 15, 0.045);
  --chip-hover: rgba(20, 18, 15, 0.08);
  --btn-ghost-hover: rgba(20, 18, 15, 0.045);
  --file-btn-bg: rgba(20, 18, 15, 0.045);
  --file-btn-hover: rgba(20, 18, 15, 0.08);
  --file-btn-border: rgba(20, 18, 15, 0.14);
  --track-bg: rgba(20, 18, 15, 0.07);
  --step-bg: rgba(20, 18, 15, 0.025);
  --step-hover: rgba(20, 18, 15, 0.05);
  --code-bg: rgba(20, 18, 15, 0.05);
  --code-text: #423c35;
  --overlay: rgba(24, 24, 24, 0.34);

  /* Chat — bulles blanches / grises, aucune couleur */
  --bubble-in: #f1efec;
  --bubble-out: #ffffff;
  --bubble-out-border: rgba(20, 18, 15, 0.1);

  /* Surfaces translucides */
  --topbar-bg: rgba(245, 244, 242, 0.85);
  --sidebar-bg: #f5f4f2;
  --pop-bg: rgba(255, 255, 255, 0.98);
  --toast-bg: #f2f1ef;
  --toast-text: #121215;

  /* Ombres — quasi inexistantes : l'élévation vient du fond */
  --shadow-sm: 0 1px 2px rgba(20, 18, 15, 0.03);
  --shadow-md: 0 1px 2px rgba(20, 18, 15, 0.04), 0 4px 12px rgba(20, 18, 15, 0.04);
  --shadow-lg: 0 2px 6px rgba(20, 18, 15, 0.05), 0 12px 32px rgba(20, 18, 15, 0.07);
  --shadow-float: 0 4px 12px rgba(20, 18, 15, 0.07), 0 20px 48px rgba(20, 18, 15, 0.1);

  /* Chart — nuances d'encre uniquement */
  --seg-dm: #229ed9;
  --seg-subs: #7fc7e6;
  --seg-channel: #d6d2cc;
  --scroll-thumb: rgba(20, 18, 15, 0.14);
  --scroll-thumb-hover: rgba(20, 18, 15, 0.26);

  /* Géométrie */
  --r-xs: 10px;
  --r-sm: 12px;
  --r: 16px;
  --r-lg: 18px;
  --sidebar-w: 256px;
  --topbar-h: 72px;
  --gutter: 32px;
  --ease: 0.16s cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: light;
}

/* ---------- Thème SOMBRE chaleureux (optionnel) ---------- */
[data-theme="dark"] {
  --bg: #121215;
  --panel: #1a1a1e;
  --surface: #212126;
  --surface-2: #2a2a30;
  --elevated: #32323a;

  --text: #f3f1ee;
  --text1: #f3f1ee;
  --text2: #a5a09a;
  --text3: #78736d;

  --border: rgba(255, 252, 246, 0.075);
  --border-strong: rgba(255, 252, 246, 0.15);
  --row-border: rgba(255, 252, 246, 0.055);
  --line-tint: rgba(255, 252, 246, 0.06);

  --accent: #229ed9;
  --accent-hover: #6ec3ea;
  --accent-active: #8ed2ef;
  --accent-bright: #229ed9;
  --accent-solid: #229ed9;
  --accent-solid-hover: #35abe0;
  --accent-grad: #229ed9;
  --accent-grad-hover: #35abe0;
  --on-accent: #ffffff;
  --accent-soft: rgba(34, 158, 217, 0.16);
  --accent-wash: rgba(34, 158, 217, 0.08);
  --accent-ring: rgba(34, 158, 217, 0.45);
  --accent-line: rgba(34, 158, 217, 0.34);
  --accent-border-soft: rgba(34, 158, 217, 0.26);
  --accent-border-hover: rgba(34, 158, 217, 0.44);
  --accent-glow: transparent;
  --halo: transparent;
  --btn-primary-glow: none;
  --logo-shadow: none;

  --ok: #6ec99a;   --ok-soft: rgba(110, 201, 154, 0.13);
  --warn: #e0b45f; --warn-soft: rgba(224, 180, 95, 0.12);
  --warn-border: rgba(224, 180, 95, 0.28);
  --err: #e88b7f;  --err-soft: rgba(232, 139, 127, 0.13);

  --hover-fill: rgba(255, 252, 246, 0.055);
  --tint: rgba(255, 252, 246, 0.025);
  --tint-2: rgba(255, 252, 246, 0.045);
  --chip-bg: rgba(255, 252, 246, 0.055);
  --chip-hover: rgba(255, 252, 246, 0.1);
  --btn-ghost-hover: rgba(255, 252, 246, 0.07);
  --file-btn-bg: rgba(255, 252, 246, 0.06);
  --file-btn-hover: rgba(255, 252, 246, 0.11);
  --file-btn-border: rgba(255, 252, 246, 0.16);
  --track-bg: rgba(255, 252, 246, 0.08);
  --step-bg: rgba(255, 252, 246, 0.035);
  --step-hover: rgba(255, 252, 246, 0.07);
  --code-bg: rgba(255, 252, 246, 0.06);
  --code-text: #c8c8d0;
  --overlay: rgba(8, 8, 10, 0.7);

  --bubble-in: #26262c;
  --bubble-out: #163243;
  --bubble-out-border: rgba(34, 158, 217, 0.3);

  --topbar-bg: rgba(18, 18, 21, 0.82);
  --sidebar-bg: #121215;
  --pop-bg: rgba(50, 50, 58, 0.97);
  --toast-bg: #14120f;
  --toast-text: #ffffff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 10px 34px rgba(0, 0, 0, 0.44);
  --shadow-float: 0 18px 52px rgba(0, 0, 0, 0.52);

  --seg-dm: #229ed9;
  --seg-subs: #4a7f96;
  --seg-channel: #3a3a42;
  --scroll-thumb: rgba(255, 252, 246, 0.13);
  --scroll-thumb-hover: rgba(255, 252, 246, 0.24);

  color-scheme: dark;
}


/* ============================================================
   2. BASE
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--scroll-thumb) transparent;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--accent-soft); color: var(--text); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: content-box; }

a { color: var(--accent); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.022em;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: 26px; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 6px;
}

img { max-width: 100%; }

/* Focus visible unifié */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Utilitaires ---------- */
.hidden { display: none !important; }
.muted { color: var(--text2); }
.small { font-size: 12.5px; }
.error-text { color: var(--err); font-size: 13px; margin: 8px 0 0; }
.ok-text { color: var(--ok); font-size: 13px; }

/* ============================================================
   3. SHELL — sidebar + main + topbar
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar façon Notion ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  z-index: 60;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  height: var(--topbar-h);
  flex: none;
}
.brand-logo {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-solid);
  color: var(--on-accent);
}
.brand-logo svg { width: 18px; height: 18px; }
.brand-name {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav {
  flex: 1;
  padding: 4px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--text3);
  padding: 0 8px;
  margin: 18px 0 6px;
}
.nav-group:first-child { margin-top: 6px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.012em;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.nav-link:hover { background: var(--hover-fill); color: var(--text); }
/* Actif = carte blanche posée sur le papier (référence), pas une pastille colorée. */
.nav-link.active {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-ico {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--text3);
  transition: color var(--ease);
}
.nav-ico svg { width: 17px; height: 17px; display: block; }
.nav-link:hover .nav-ico { color: var(--text2); }
.nav-link.active .nav-ico { color: var(--accent); }

/* Groupe « Advanced » repliable */
.nav-advanced { margin-top: 18px; }
.nav-advanced summary {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r);
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background var(--ease), color var(--ease);
}
.nav-advanced summary::-webkit-details-marker { display: none; }
.nav-advanced summary:hover { background: var(--hover-fill); color: var(--text); }
.nav-advanced summary::after {
  content: "";
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.55;
  transition: transform var(--ease);
}
.nav-advanced[open] summary::after { transform: rotate(45deg); }
.nav-advanced .nav-link { margin-top: 2px; }

.sidebar-footer {
  padding: 12px 12px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  position: sticky;
  bottom: 0;
  background: var(--sidebar-bg);
}
.sidebar-footer .btn { justify-content: flex-start; }

/* ---------- Main ---------- */
.main {
  grid-column: 2;
  min-width: 0;
  padding: calc(var(--topbar-h) + 8px) var(--gutter) 88px;
}

.page { max-width: 1240px; }
/* `backwards` et non `both` : avec `both`, l'image finale de `pageIn`
   (transform) restait appliquée pour toujours, ce qui faisait de la section
   un BLOC CONTENEUR pour les `position: fixed` qu'elle contient. Les
   modales AI Offers (#offer-modal, #offer-fan-modal) se retrouvaient donc
   enfermées dans la hauteur de la page : carte coupée, voile partiel et
   bouton « Save offer » hors écran. `backwards` garde l'animation d'entrée
   et rend `transform: none` une fois terminée. */
.page.fade-in { animation: pageIn 0.26s cubic-bezier(0.22, 0.61, 0.36, 1) backwards; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.fade-in .stat-card { animation: cardIn 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.fade-in .stat-card:nth-child(2) { animation-delay: 0.03s; }
.fade-in .stat-card:nth-child(3) { animation-delay: 0.06s; }
.fade-in .stat-card:nth-child(4) { animation-delay: 0.09s; }
.fade-in .stat-card:nth-child(n+5) { animation-delay: 0.12s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Page header ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin: 0 0 20px;
}
.page h2 {
  flex: 1 1 260px;
  min-width: 0;
  font-size: 20px;
  font-weight: 640;
  letter-spacing: -0.024em;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
/* Le titre principal vit dans le header fixe : les en-têtes de section
   internes restent discrets, et la période y est masquée (pilotée en haut). */
.page-head-slim h2 { font-size: 17px; font-weight: 620; }
.page-head .period-select { display: none; }
/* Les actions du header restent sur UNE ligne (jamais d'empilement). */
.page-head > .btn-group,
.page-head > .btn { flex: 0 0 auto; flex-wrap: nowrap; }
.page-sub {
  display: block;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text2);
  letter-spacing: -0.006em;
}
.btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Topbar = header de page (titre + période + ⌘K + cloche) ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--gutter);
  background: var(--bg);
  z-index: 50;
}
.topbar-title {
  flex: none;
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--text);
  white-space: nowrap;
}

/* Sélecteur de période — pilules, l'active en carte blanche */
.topbar-period {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}
.period-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  height: 36px;
  padding: 0 16px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.period-btn:hover { color: var(--text); background: var(--hover-fill); }
.period-btn-active {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
}
.period-btn-active:hover { background: var(--panel); }

/* Actions à droite */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

/* Recherche ⌘K — champ blanc arrondi, purement déclencheur */
.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: clamp(180px, 26vw, 300px);
  height: 40px;
  padding: 0 8px 0 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text3);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 450;
  cursor: pointer;
  transition: border-color var(--ease), color var(--ease);
}
.topbar-search:hover { border-color: var(--border-strong); color: var(--text2); }
.topbar-search svg { width: 16px; height: 16px; flex: none; }
.topbar-search-label {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-kbd {
  flex: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 550;
  color: var(--text3);
  background: var(--surface-2);
  border-radius: 7px;
  padding: 3px 7px;
  line-height: 1;
}

.month-rev {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.bell, .theme-toggle, .sidebar-toggle {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text2);
  cursor: pointer;
  position: relative;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.bell:hover, .theme-toggle:hover, .sidebar-toggle:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.bell svg { width: 17px; height: 17px; }
.bell-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--accent-solid);
  color: var(--on-accent);
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  border: 2px solid var(--bg);
}

.sidebar-toggle { display: none; position: fixed; top: 16px; left: 16px; z-index: 70; }
.sidebar-overlay { display: none; }

/* ---------- Palette de recherche ⌘K ---------- */
.search-palette {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 14vh 20px 20px;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.search-palette-card {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.search-palette-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid var(--border);
}
.search-palette-field svg { width: 17px; height: 17px; color: var(--text3); flex: none; }
.search-palette-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 450;
  outline: none;
  padding: 0;
}
.search-results { max-height: 340px; overflow-y: auto; padding: 8px; }
.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--ease);
}
.search-item:hover, .search-item-active { background: var(--surface-2); }
.search-item-ico {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text2);
}
.search-item:hover .search-item-ico,
.search-item-active .search-item-ico { background: var(--panel); color: var(--text); }
.search-item-ico svg { width: 16px; height: 16px; }
.search-item-text { display: flex; flex-direction: column; min-width: 0; }
.search-item-text b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.search-item-text span {
  font-size: 12px;
  color: var(--text3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-empty { padding: 26px 14px; text-align: center; color: var(--text3); font-size: 13px; }

/* ---------- Panneau notifications ---------- */
.bell-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 6px);
  right: 24px;
  width: 340px;
  max-height: 460px;
  overflow-y: auto;
  background: var(--pop-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  z-index: 80;
  padding: 6px;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text3);
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--ease);
}
.notif-item:hover { background: var(--hover-fill); }
.notif-item.unread { color: var(--text); background: var(--accent-wash); }
.notif-ico {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  color: var(--text2);
}
.notif-ico svg { width: 15px; height: 15px; }
.notif-body { min-width: 0; }
.notif-msg { display: block; line-height: 1.45; }
.notif-item .t { display: block; font-size: 11.5px; color: var(--text3); margin-top: 3px; }
.notif-empty { padding: 22px 12px; text-align: center; color: var(--text3); font-size: 13px; }

/* ============================================================
   4. SURFACES — panels, banners, grilles
   ============================================================ */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.panel h3 {
  font-size: 15.5px;
  font-weight: 640;
  letter-spacing: -0.018em;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.banner {
  position: relative;
  background: var(--accent-wash);
  border: 1px solid var(--accent-border-soft);
  border-radius: var(--r);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: var(--text2);
  line-height: 1.6;
}
.banner b { color: var(--text); font-weight: 600; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.two-col > .panel { margin-bottom: 20px; }
/* Une seule colonne réellement visible → pas de moitié d'écran vide. */
.two-col:has(> .panel.hidden) { grid-template-columns: minmax(0, 780px); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

/* « More details » repliable du dashboard */
.dash-more { margin-top: 4px; }
.dash-more summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  list-style: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text2);
  user-select: none;
  transition: background var(--ease), color var(--ease);
}
.dash-more summary::-webkit-details-marker { display: none; }
.dash-more summary:hover { background: var(--surface); color: var(--text); }
.dash-more summary::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  opacity: 0.6;
  transition: transform var(--ease);
}
.dash-more[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.dash-more-count { font-weight: 450; color: var(--text3); }
.dash-more[open] > .panel { margin-top: 16px; }

/* ============================================================
   5. HERO + ONBOARDING (dashboard)
   ============================================================ */
/* Salutation : du texte posé sur le papier, aucune carte — l'air fait
   le travail. C'est le seul endroit où l'app parle à la première
   personne : date du jour, bonjour, puis une nouvelle du jour. */
.dash-hero {
  margin: 4px 0 30px;
  animation: heroIn 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}
.dash-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
}
.dash-eyebrow:empty { display: none; }
.dash-hero h2 {
  font-size: 22px;
  font-weight: 660;
  letter-spacing: -0.028em;
  margin: 0 0 6px;
}
.dash-hero .dash-note {
  margin: 0;
  max-width: 64ch;
  font-size: 14px;
  font-weight: 450;
  color: var(--text2);
  line-height: 1.65;
  animation: heroIn 0.5s 0.06s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.onboarding-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.onboarding-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.onboarding-title { font-size: 14px; font-weight: 620; }
.onboarding-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.onboarding-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
}
.onboarding-step a { font-weight: 600; }
.onboarding-num {
  flex: none;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Boutique encore vide : le parcours en trois étapes ----------
   Rien n'a été vendu : c'est le moment de dire quoi faire, pas d'aligner
   des zéros. Le parcours prend la place que prendraient les chiffres. */
.dash-empty {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 28px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: heroIn 0.5s 0.04s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.dash-empty-intro { margin-bottom: 20px; }
.dash-empty-title {
  font-size: 16px;
  font-weight: 640;
  letter-spacing: -0.022em;
}
.dash-empty-desc {
  margin: 6px 0 0;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--text2);
  line-height: 1.6;
}
.journey {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}
.journey-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 18px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.journey-num {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.journey-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.journey-title { font-size: 13.5px; font-weight: 620; letter-spacing: -0.012em; }
.journey-desc { font-size: 12.5px; font-weight: 450; color: var(--text3); line-height: 1.55; }
.dash-empty-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Cartes KPI encore endormies ----------
   Regroupées hors de la grille principale : un libellé, ce qui les
   remplira, et un tiret. Aucun « 0 » ne crie sur la page. */
.quiet-block { margin: -6px 0 24px; }
.quiet-head {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
}
.quiet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
  gap: 10px;
}
.quiet-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color var(--ease), background var(--ease);
}
.quiet-card:hover { border-color: var(--border-strong); background: var(--panel); }
.quiet-ico {
  flex: none;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: var(--text3);
}
.quiet-ico svg { width: 17px; height: 17px; display: block; }
.quiet-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.quiet-label {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text2);
  letter-spacing: -0.012em;
}
.quiet-hint {
  font-size: 12px;
  font-weight: 450;
  color: var(--text3);
  line-height: 1.45;
}
.quiet-dash {
  flex: none;
  font-size: 17px;
  font-weight: 500;
  color: var(--text3);
  opacity: 0.55;
}

/* ============================================================
   6. KPI CARDS + CHARTS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease);
}
/* Micro-interaction : la carte se « réveille » — la bordure se précise,
   l'icône reprend de l'encre. Aucun mouvement brusque, aucune ombre. */
.stat-card:hover { border-color: var(--border-strong); }
.stat-card:hover .stat-icon { color: var(--text); }
.stat-card .stat-value { transition: letter-spacing var(--ease); }
/* Ligne du haut : libellé à gauche, icône fine à droite (référence). */
.stat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.stat-icon {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--text3);
}
.stat-icon svg { width: 18px; height: 18px; display: block; }
.stat-label {
  font-size: 14px;
  font-weight: 550;
  color: var(--text2);
  letter-spacing: -0.012em;
  min-width: 0;
}
.stat-value {
  font-size: 30px;
  font-weight: 620;
  letter-spacing: -0.038em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-trend {
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 450;
  color: var(--text3);
}
.stat-trend.up, .stat-trend.down {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}
.stat-trend.up { color: var(--ok); background: var(--ok-soft); }
.stat-trend.down { color: var(--err); background: var(--err-soft); }

/* ---------- Feed d'activité récente (dashboard) ---------- */
.activity-panel { padding: 24px 24px 8px; }
.activity-head { margin-bottom: 6px; }
.activity-head h3 { margin: 0 0 2px; }
.activity-head p { margin: 0 0 12px; }
.activity-feed { display: flex; flex-direction: column; }
.activity-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--row-border);
}
.activity-row:last-child { border-bottom: 0; }
.activity-row { transition: background var(--ease); border-radius: var(--r-sm); }
.activity-row:hover { background: var(--surface); }
.activity-row:hover .activity-ico { background: var(--panel); color: var(--text); }
.activity-ico { transition: background var(--ease), color var(--ease); }
/* Entrée en cascade : le feed se remplit, il n'apparaît pas d'un bloc. */
.fade-in .activity-row { animation: rowIn 0.34s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.fade-in .activity-row:nth-child(2) { animation-delay: 0.04s; }
.fade-in .activity-row:nth-child(3) { animation-delay: 0.08s; }
.fade-in .activity-row:nth-child(4) { animation-delay: 0.12s; }
.fade-in .activity-row:nth-child(n+5) { animation-delay: 0.16s; }
@keyframes rowIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.activity-ico {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text2);
}
.activity-ico svg { width: 17px; height: 17px; }
.activity-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.activity-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.012em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-meta { font-size: 12.5px; color: var(--text3); }
.activity-empty { padding: 2px 0 26px; color: var(--text3); font-size: 13px; }

/* ---------- Bar chart (HTML/CSS pur) ---------- */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 190px;
  padding: 12px 4px 30px;
  position: relative;
}
.chart-lg { height: 230px; }
.chart .empty-state { margin: auto; padding: 0; border: 0; background: none; }
.chart .empty-state .empty-ico { width: 44px; height: 44px; margin-bottom: 6px; }
.chart .empty-state .empty-title { font-size: 13.5px; }
.chart .empty-state .empty-desc { font-size: 12.5px; }

/* ---------- Aperçu de graphique (aucune donnée) ----------
   Plutôt qu'un cadre vide : la silhouette pâle des barres à venir, et
   une légende posée au centre. Les barres ne portent aucun chiffre —
   elles ne décrivent rien, elles montrent seulement la forme. */
.chart-is-ghost { display: block; height: 210px; padding: 12px 4px 24px; }
/* Les barres occupent la moitié basse et s'effacent en montant ; la légende
   a la moitié haute pour elle seule — aucun texte ne passe sur une barre. */
.chart-ghost {
  position: absolute;
  inset: 48% 4px 24px;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.3) 100%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.3) 100%);
}
.chart-ghost-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
  height: 100%;
}
.ghost-bar {
  flex: 1;
  border-radius: 7px 7px 3px 3px;
  background: var(--line-tint);
}
.chart-ghost-note {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 48%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  padding: 0 24px;
}
.chart-ghost-title {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text2);
}
.chart-ghost-desc {
  font-size: 12.5px;
  font-weight: 450;
  color: var(--text3);
  max-width: 46ch;
  line-height: 1.55;
}

/* ---------- Aperçu du feed d'activité (aucune donnée) ---------- */
.activity-ghost {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 0 4px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
}
.activity-ghost-row { display: flex; align-items: center; gap: 12px; }
.ghost-dot {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 99px;
  background: var(--line-tint);
}
.ghost-line {
  height: 9px;
  border-radius: 99px;
  background: var(--line-tint);
  flex: 1;
  max-width: 240px;
}
.ghost-line-short { max-width: 96px; opacity: 0.6; }

.bar {
  position: relative;
  flex: 1;
  min-width: 8px;
  border-radius: 6px 6px 3px 3px;
  background: var(--accent-solid);
  opacity: 0.9;
  transition: opacity var(--ease), filter var(--ease);
  align-self: flex-end;
}
.bar:hover { opacity: 1; }
.bar .tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
  z-index: 5;
}
.bar:hover .tip { opacity: 1; }
.bar .day {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text3);
  white-space: nowrap;
}
.bar-stacked {
  display: flex;
  flex-direction: column-reverse;
  background: none;
  opacity: 1;
  overflow: hidden;
}
.bar-stacked .stack { width: 100%; }
.seg-dm { background: var(--seg-dm); }
.seg-subs { background: var(--seg-subs); }
.seg-channel { background: var(--seg-channel); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--row-border);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
}
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ---------- Barres horizontales ---------- */
.hbar-row {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--row-border);
}
.hbar-row:last-child { border-bottom: 0; }
.hbar-label { font-size: 13px; color: var(--text2); }
.hbar-track {
  height: 8px;
  background: var(--track-bg);
  border-radius: 99px;
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent-grad);
  transition: width 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.hbar-value {
  font-size: 13px;
  font-weight: 620;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 76px;
  text-align: right;
}

/* ============================================================
   7. BOUTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), border-color var(--ease),
              color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn:hover { background: var(--surface); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Primaire = pilule d'encre pleine (bouton « Sign in » de la référence). */
.btn-primary {
  background: var(--accent-solid);
  border-color: transparent;
  color: var(--on-accent);
  font-weight: 600;
  box-shadow: none;
}
.btn-primary:hover { background: var(--accent-solid-hover); border-color: transparent; }
.btn-primary:disabled { box-shadow: none; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text2);
}
.btn-ghost:hover { background: var(--btn-ghost-hover); color: var(--text); }

.btn-danger {
  background: transparent;
  border-color: var(--err-soft);
  color: var(--err);
}
.btn-danger:hover { background: var(--err-soft); border-color: var(--err); }

.btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; border-radius: 99px; }
.btn-block { width: 100%; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============================================================
   8. BADGES + TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.002em;
  background: var(--chip-bg);
  color: var(--text2);
  white-space: nowrap;
  vertical-align: middle;
}
.badge-active, .badge.purple { background: var(--accent-soft); color: var(--accent); }
.badge.green, .badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge.red { background: var(--err-soft); color: var(--err); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.gray { background: var(--chip-bg); color: var(--text3); }
.badge-draft { background: var(--warn-soft); color: var(--warn); }
.badge-inuse { background: var(--ok-soft); color: var(--ok); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  margin: 0 4px 4px 0;
  border-radius: 99px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 11.5px;
}

/* ============================================================
   9. TABLES
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 0 12px 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--row-border);
  color: var(--text2);
  vertical-align: middle;
}
.table td b { color: var(--text); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--ease); }
.table tbody tr:hover { background: var(--tint); }
tr[onclick] { cursor: pointer; }

/* ============================================================
   10. FORMULAIRES
   ============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.form-grid label,
.form-grid > .full {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text2);
  min-width: 0;
}
.form-grid label.full,
.form-grid .full { grid-column: 1 / -1; }

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}
textarea {
  height: auto;
  min-height: 76px;
  padding: 10px 12px;
  line-height: 1.55;
  resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--text3); font-weight: 450; }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--panel);
}
input:disabled, select:disabled, textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--tint);
}

select,
.period-select,
.test-fan-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  cursor: pointer;
}
.period-select, .test-fan-select { height: 36px; max-width: 200px; font-size: 13px; }

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  accent-color: var(--accent-solid);
  cursor: pointer;
}
.form-grid label:has(> input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text2);
  font-size: 13px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.field-hint { font-size: 12px; color: var(--text3); font-weight: 450; }

input[type="file"] {
  font-size: 12.5px;
  color: var(--text2);
  height: auto;
  padding: 8px;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border-radius: var(--r-xs);
  border: 1px solid var(--file-btn-border);
  background: var(--file-btn-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background var(--ease);
}
input[type="file"]::file-selector-button:hover { background: var(--file-btn-hover); }

/* ============================================================
   11. ÉTATS VIDES
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 44px 24px;
  color: var(--text2);
}
/* Un état vide doit être accueillant : icône fine dans un halo doux,
   une phrase humaine, et toujours une porte de sortie (le CTA). */
.empty-state .empty-ico {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text3);
  margin-bottom: 10px;
  transition: color var(--ease), background var(--ease);
}
.empty-state .empty-ico svg { width: 22px; height: 22px; }
.empty-state:hover .empty-ico { color: var(--text2); background: var(--surface); }
.empty-state .empty-title {
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.018em;
  color: var(--text);
}
.empty-state .empty-desc {
  font-size: 13.5px;
  color: var(--text2);
  max-width: 46ch;
  line-height: 1.6;
}
.empty-state .empty-cta { margin-top: 16px; }
.chart-empty { padding: 20px; }
td > .empty-state { padding: 32px 16px; }

/* ============================================================
   12. GALERIE
   ============================================================ */
.gal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.gal-toolbar #gal-search { flex: 1; min-width: 180px; max-width: 320px; height: 36px; }
.gal-toolbar #gal-sort { width: auto; min-width: 150px; height: 36px; margin-left: auto; }

/* ---------- Curseur de taille des vignettes ----------
   Un seul réglage, discret, à droite du tri : il pilote --gal-size,
   la variable que lit la grille. Les deux thèmes suivent tout seuls. */
.gal-size-ctl {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 12px 0 13px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--panel);
}
.gal-size-ctl label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text2);
  white-space: nowrap;
  cursor: default;
}
.gal-size-ctl input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 96px;
  height: 16px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: ew-resize;
}
.gal-size-ctl input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 99px;
  background: var(--track-bg);
}
.gal-size-ctl input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 99px;
  background: var(--track-bg);
}
.gal-size-ctl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--accent-solid);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent-border-soft);
  transition: transform var(--ease);
}
.gal-size-ctl input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-solid);
  border: 2px solid var(--panel);
  box-shadow: 0 0 0 1px var(--accent-border-soft);
}
.gal-size-ctl input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }
.gal-size-ctl input[type="range"]:focus-visible { outline: none; }
.gal-size-ctl input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent-ring); }
.gal-size-ctl input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--accent-ring); }

/* Filtres segmentés */
.gal-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.gal-seg-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 0 14px;
  height: 36px;
  border-radius: 99px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.gal-seg-btn:hover { color: var(--text); background: var(--hover-fill); }
.gal-seg-btn.gal-seg-active {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
}

/* Grille média — le contenu est le héros.
   --gal-size = largeur mini d'une vignette, pilotée par #gal-size
   (valeur par défaut = la taille historique, 272px). L'écart suit la
   taille : à petites vignettes, une gouttière de 20px ferait des trous. */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--gal-size, 272px), 1fr));
  gap: clamp(10px, calc(var(--gal-size, 272px) * 0.072), 20px);
}
.gal-grid > .empty-state { grid-column: 1 / -1; }

.gal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.gal-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.gal-card-off { opacity: 0.55; }
.gal-card-off:hover { opacity: 0.8; }

/* Ratio portrait 3:4 : c'est le format des photos de créatrice — un 4:3
   coupait systématiquement les visages. */
.gal-media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  overflow: hidden;
}
.gal-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.gal-thumb-ph {
  display: grid;
  place-items: center;
  color: var(--text3);
  background: var(--surface-2);
}
.gal-thumb-ph svg { width: 34px; height: 34px; }
.gal-card:hover .gal-thumb { transform: scale(1.025); }

/* ---------- Vignette VIDÉO : la vraie première image du fichier ----------
   Le <video> muet sert d'affiche. `pointer-events: none` est essentiel :
   le clic doit atteindre la carte (ouvrir l'édition), pas le lecteur. */
.gal-thumb-video {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  background: var(--surface-2);
}
.gal-thumb-video > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  background: var(--surface-2);
}
/* Pastille « vidéo » — repère discret, pas une icône décorative. */
.gal-vid-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(18, 18, 22, 0.55);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  transition: background var(--ease);
}
.gal-vid-play svg { width: 22px; height: 22px; }
.gal-card:hover .gal-vid-play { background: var(--accent-solid); }
/* Durée « m:ss » — remplie par app.js sur `loadedmetadata`. */
.gal-vid-dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.gal-card-lib { cursor: pointer; }
/* Le nom de fichier vit SOUS la photo, sur la carte blanche :
   plus lisible qu'un voile noir, et fidèle à la référence. */
.gal-lib-caption {
  padding: 13px 15px 14px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.gal-lib-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.012em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gal-lib-desc {
  font-size: 12px;
  color: var(--text3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Actions au survol — pas de reflow, révélation d'opacité */
.gal-actions-hover {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--ease), transform var(--ease);
  z-index: 3;
}
.gal-card-lib:hover .gal-actions-hover,
.gal-card-lib:focus-within .gal-actions-hover { opacity: 1; transform: none; }
.gal-actions-hover .btn {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: var(--r-xs);
  background: rgba(20, 20, 24, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.gal-actions-hover .btn:hover { background: rgba(38, 38, 44, 0.94); border-color: rgba(255, 255, 255, 0.3); }
.gal-actions-hover .btn-danger { color: #ff8f85; }
.gal-actions-hover .btn-danger:hover { background: rgba(180, 40, 32, 0.85); color: #fff; }

/* ---------- Vue resserrée (curseur vers la gauche) ----------
   Sous ~200px de large, la carte garde la photo comme héros : le pied
   maigrit, la description passe à la trappe (le nom du fichier reste,
   tronqué), et les repères posés sur l'image rétrécissent avec elle. */
.gal-grid.gal-dense .gal-lib-caption { padding: 8px 10px 9px; }
.gal-grid.gal-dense .gal-lib-name { font-size: 12px; }
.gal-grid.gal-dense .gal-lib-desc { display: none; }
.gal-grid.gal-dense .gal-actions-hover { top: 6px; right: 6px; gap: 4px; }
.gal-grid.gal-dense .gal-actions-hover .btn { height: 24px; padding: 0 7px; font-size: 11px; }
.gal-grid.gal-dense .gal-vid-play { width: 32px; height: 32px; }
.gal-grid.gal-dense .gal-vid-play svg { width: 16px; height: 16px; }
.gal-grid.gal-dense .gal-vid-dur { right: 5px; bottom: 5px; padding: 1px 5px; font-size: 10px; }
.gal-grid.gal-dense .gal-thumb-ph svg { width: 24px; height: 24px; }

.gal-type {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.gal-zoom {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  opacity: 0;
  transition: opacity var(--ease);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 99px;
  padding: 4px 8px;
  font-size: 12px;
  color: #fff;
}
.gal-card:hover .gal-zoom { opacity: 1; }
.gal-media-link { display: block; height: 100%; }

/* Corps de carte (variante vendable) */
.gal-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.gal-status-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gal-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.gal-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text3); }
.gal-price { color: var(--accent); font-weight: 650; }
.gal-badge-free { background: var(--ok-soft); color: var(--ok); padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; }
.gal-sales, .gal-extra, .gal-date { font-size: 12px; color: var(--text3); }
.gal-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.gal-card-lib .gal-body { display: none; }

.gal-loadmore-wrap { grid-column: 1 / -1; display: flex; justify-content: center; padding: 12px 0 4px; }

/* Sets */
.gal-view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.gal-view-title { font-size: 17px; font-weight: 620; margin-bottom: 4px; }
.gal-view-head code { font-size: 12px; }

.bundle-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.bundle-card:hover { border-color: var(--border-strong); background: var(--surface); transform: translateY(-1px); }
.bundle-card.off { opacity: 0.6; }
.bundle-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bundle-title { font-size: 14.5px; font-weight: 620; }
.bundle-price { color: var(--accent); font-weight: 650; font-size: 14px; }
.bundle-desc { font-size: 13px; color: var(--text2); margin: 0; }
.bundle-items { font-size: 12.5px; color: var(--text3); }
.bundle-meta { font-size: 12px; color: var(--text3); }
.bundle-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.gal-bundle-active-row { flex-direction: row !important; align-items: center; gap: 8px !important; }

/* ============================================================
   13. MODALE GALERIE (import + carte d'édition)
   ============================================================ */
body.gal-modal-open { overflow: hidden; }

.gal-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}
.gal-modal::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.gal-modal-form {
  position: relative;
  width: 100%;
  max-width: 940px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px 28px 22px;
  box-shadow: var(--shadow-float);
  animation: modalIn 0.22s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  margin: auto;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}
#item-form-wrap.gal-import-mode .gal-modal-form { max-width: 560px; }

.gal-modal-head { margin-bottom: 20px; }
/* En mode édition, ce titre est le NOM DU FICHIER : il peut être long,
   il s'ellipse plutôt que de casser la mise en page de la modale. */
.gal-modal-head h3 {
  font-size: 18px;
  font-weight: 640;
  letter-spacing: -0.022em;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gal-form-sub { font-size: 13px; margin: 0; }

/* Croix de fermeture (import / édition). C'est la SEULE sortie « annuler »
   avec le bouton Cancel : un clic sur le voile ne ferme plus la fenêtre,
   pour ne jamais perdre une saisie en cours. Même dessin que .of-modal-x. */
#item-form-wrap .gal-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
#item-form-wrap .gal-modal-head-text { min-width: 0; }
.gal-modal-x {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--text2);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}
.gal-modal-x:hover { background: var(--hover-fill); color: var(--text); }
.gal-modal-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.gal-modal-grid { display: grid; gap: 20px; }
.gal-modal-media { display: flex; flex-direction: column; gap: 10px; }
.gal-modal-fields { display: flex; flex-direction: column; gap: 12px; }

/* Bascule import / édition */
#item-form-wrap.gal-import-mode .gal-edit-card { display: none; }
#item-form-wrap.gal-edit-mode .gal-modal-media { display: none; }

/* row-reverse → l'action primaire (Save/Import) se retrouve à DROITE ;
   `flex-start` pousse donc le groupe vers le bord droit de la modale. */
#item-form-wrap .gal-form-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  flex-direction: row-reverse;
  justify-content: flex-start;
}

/* ---------- Carte d'édition : photo à gauche, infos à droite ---------- */
.gal-edit-card {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.gal-edit-media { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* Ligne méta sous le titre : type + numéro. Le nom du fichier est
   remonté en en-tête de la carte (demande propriétaire). */
.gal-filename {
  font-size: 12px;
  font-weight: 550;
  color: var(--text3);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Cadre média de la carte d'édition — TOUS les ratios.
   Le cadre a une hauteur souple ; l'image se contente d'y tenir
   (`contain` + auto) : jamais recadrée, jamais déformée, toujours
   centrée. Le fond est un gris papier doux, pas du noir : un
   paysage dans un cadre portrait ne produit plus de barres noires. */
.gal-edit-photo {
  position: relative;
  min-height: 300px;
  height: 46vh;
  max-height: 520px;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  /* FLEX et non grid : sur une grille à ligne `auto`, la hauteur en %
     de l'enfant dépend de la ligne, qui dépend de l'enfant — le
     navigateur abandonne et l'image débordait (donc se faisait rogner).
     En flex, le cadre a une hauteur définie et `max-height:100%` tient. */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
/* width/height 100% + `contain` : la SEULE combinaison qui tient pour
   tous les ratios. Avec `width:auto`, `max-height:100%` ne contraignait
   pas la hauteur et un portrait débordait (donc se faisait rogner par
   l'overflow du cadre). Ici l'image tient toujours, jamais rognée,
   jamais déformée, centrée sur un gris papier. */
/* L'image tient dans le cadre quel que soit son ratio — portrait,
   paysage ou carré : jamais rognée, jamais déformée, toujours centrée. */
.gal-edit-photo img,
.gal-edit-photo video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  display: block;
  border-radius: var(--r-xs);
  background: none;
}
/* Le LECTEUR de la carte d'édition : contrôles natifs du navigateur, fond
   noir (une vidéo n'est pas une photo sur papier), largeur confortable dès
   l'ouverture — sans quoi il apparaît en 300x150 avant les métadonnées. */
.gal-edit-photo video {
  width: 100%;
  height: 100%;
  background: #000;
}
.gal-edit-ph { color: var(--text3); font-size: 13px; padding: 24px; text-align: center; }

.gal-edit-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.gal-edit-arrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.gal-edit-arrow:hover:not(:disabled) {
  background: var(--accent-soft);
  border-color: var(--accent-border-soft);
  color: var(--accent);
}
.gal-edit-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.gal-edit-count {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: center;
}

.gal-edit-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gal-edit-heading {
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.018em;
  word-break: break-word;
  margin: 0;
}
.gal-edit-heading:empty { display: none; }
.gal-edit-info .gal-text-details { display: flex; flex-direction: column; gap: 16px; }
.gal-edit-info .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }

/* Bloc « ✨ Auto » */
.gal-ai-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--r-sm);
  background: var(--accent-wash);
  border: 1px solid var(--accent-border-soft);
}
.gal-ai-label { color: var(--accent); font-weight: 600; font-size: 12.5px; }
.gal-ai-line { display: flex; gap: 8px; }
.gal-ai-line input[type="text"] { flex: 1; min-width: 0; height: 36px; background: var(--panel); }
#ai-gen { flex: none; height: 36px; }

.gal-price-hint { font-size: 12px; color: var(--text3); }
.gal-active-row { flex-direction: row !important; align-items: center; gap: 10px !important; }

/* Interrupteur */
.gal-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.gal-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.gal-switch-slider {
  position: absolute;
  inset: 0;
  background: var(--track-bg);
  border-radius: 99px;
  cursor: pointer;
  transition: background var(--ease);
}
.gal-switch-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 99px;
  background: #fff;
  transition: transform var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.gal-switch input:checked + .gal-switch-slider { background: var(--accent-solid); }
.gal-switch input:checked + .gal-switch-slider::before { transform: translateX(16px); }

/* ---------- Dropzone ---------- */
.gal-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px 20px;
  border-radius: var(--r);
  border: 1.5px dashed var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--ease), background var(--ease);
  overflow: hidden;
}
.gal-dropzone:hover { border-color: var(--accent); background: var(--accent-wash); }
.gal-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  padding: 0;
}
.gal-dropzone-drag { border-color: var(--accent); background: var(--accent-soft); }
.gal-dropzone-locked { opacity: 0.55; cursor: not-allowed; border-style: solid; }
.gal-dropzone-locked input { pointer-events: none; }
.gal-dropzone-square { aspect-ratio: 4 / 3; padding: 20px; }
.gal-dropzone-square .gal-dz-icon { width: 46px; height: 46px; }
.gal-dropzone-square .gal-dz-title { font-size: 14px; }

.gal-dz-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}
.gal-dz-icon svg { width: 20px; height: 20px; }
.gal-dz-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.gal-dz-sub { font-size: 12px; color: var(--text3); text-align: center; margin: 0; }
.gal-dz-sub b { color: var(--text2); }
.gal-dz-file {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 550;
  word-break: break-all;
}
.gal-dz-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.gal-dz-files { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; }
.gal-dz-label { font-size: 12px; font-weight: 600; color: var(--text3); }
.gal-dz-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--r-xs);
  background: var(--surface);
  border: 1px solid var(--border);
}
.gal-dz-file-item img,
.gal-dz-vid {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 14px;
}
.gal-dz-file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gal-dz-file-name {
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gal-dz-file-size { font-size: 11px; color: var(--text3); }
.gal-dz-x, .gal-dz-clear {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background var(--ease), color var(--ease);
}
.gal-dz-x:hover, .gal-dz-clear:hover { background: var(--err-soft); color: var(--err); }
.gal-dz-clear { align-self: flex-start; font-size: 12px; }

.gal-kind-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gal-kind-label { font-size: 12.5px; font-weight: 550; color: var(--text2); }
.gal-kind-hint { font-size: 12px; color: var(--text3); }

#gal-sale-fields { display: flex; flex-direction: column; gap: 10px; }
#gal-sale-fields .gal-free-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
#gal-sale-fields .gal-kind-row { gap: 10px; }
#gal-sale-fields label { font-size: 12.5px; color: var(--text2); }

/* Bloc avancé */
.gal-advanced { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.gal-advanced summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text3);
  user-select: none;
}
.gal-advanced summary::-webkit-details-marker { display: none; }
.gal-advanced summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--ease);
}
.gal-advanced[open] summary::before { transform: rotate(45deg); }
.gal-advanced[open] summary { color: var(--text2); margin-bottom: 10px; }
.gal-advanced p { font-size: 12.5px; color: var(--text3); }
.gal-advanced code { font-size: 11.5px; }

/* ---------- Lightbox ---------- */
.gal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.gal-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.gal-lb-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  max-width: 1080px;
  width: 100%;
  max-height: calc(100vh - 80px);
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-float);
  animation: modalIn 0.22s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.gal-lb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(20, 20, 24, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--ease);
}
.gal-lb-close:hover { background: rgba(50, 50, 56, 0.95); }
.gal-lb-media { background: var(--surface-2); display: grid; place-items: center; min-height: 300px; padding: 10px; }
.gal-lb-media img,
.gal-lb-media video { max-width: 100%; max-height: calc(100vh - 80px); width: auto; height: auto; object-fit: contain; display: block; border-radius: var(--r-xs); }
/* Un lecteur vidéo sans largeur intrinsèque connue resterait minuscule le
   temps des métadonnées : on lui donne un plancher confortable. */
.gal-lb-media video { min-width: min(560px, 100%); background: #000; }
.gal-lb-ph { display: grid; place-items: center; color: var(--text3); padding: 40px; }
.gal-lb-ph svg { width: 46px; height: 46px; }
.gal-lb-body { padding: 26px 24px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.gal-lb-body h3 { font-size: 18px; font-weight: 640; letter-spacing: -0.02em; }
.gal-lb-desc { margin: 0; line-height: 1.6; }
.gal-lb-tags { margin: 0; }
.gal-lb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }

/* ============================================================
   14. AI OFFERS
   ============================================================ */
.offer-picker-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.offer-picker-count { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.offer-picker-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.offer-media-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.offer-media-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  background: var(--panel);
  border: 1px solid var(--border);
  transition: border-color var(--ease), background var(--ease);
}
.offer-media-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.offer-media-row input[type="checkbox"] { flex: none; }
.offer-media-row .om-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.offer-media-row .om-label small { color: var(--text3); font-weight: 450; }
.offer-media-row .gal-seg { flex: none; }
.offer-media-row.om-disabled { opacity: 0.5; }
.offer-media-row.om-disabled .gal-seg { pointer-events: none; }
.offer-media-empty { padding: 24px; text-align: center; color: var(--text3); font-size: 13px; }

.offer-pack-note {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--accent-wash);
  border: 1px solid var(--accent-border-soft);
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}
.offer-pack-note b { color: var(--accent); }

.conversion-box {
  font-size: 26px;
  font-weight: 660;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  padding: 4px 0 10px;
}
.conversion-box .small { display: block; font-size: 12.5px; color: var(--text3); font-weight: 450; letter-spacing: normal; }

/* ============================================================
   15. INBOX — un vrai chat
   ============================================================ */
/* Inspiration shadcn « mail » : trois colonnes — la liste, la
   conversation, puis la fiche du fan. La conversation garde toute sa
   largeur, les métadonnées ne l'écrasent plus. */
.inbox-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(240px, 300px);
  gap: 16px;
  height: calc(100vh - var(--topbar-h) - 130px);
  min-height: 520px;
}
.inbox-details {
  padding: 20px;
  overflow-y: auto;
}
.inbox-details h3 { margin-bottom: 14px; }
.inbox-details-empty { line-height: 1.6; }
/* Dans la colonne, la fiche s'empile verticalement (plus en bandeau). */
.inbox-details .fan-context {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 13px;
}
.inbox-details .fan-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--row-border);
}
.inbox-details .fan-chip:last-child { border-bottom: 0; padding-bottom: 0; }
.inbox-details .fan-status {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 0;
}
.inbox-details .fan-recent { flex-basis: auto; white-space: normal; padding-top: 0; border-top: 0; }
.inbox-layout > .panel { margin-bottom: 0; display: flex; flex-direction: column; min-height: 0; }

.inbox-convs { padding: 14px 10px 10px; }
.inbox-convs h3 { padding: 0 8px; margin-bottom: 10px; }
.conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }

.conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--ease);
  border-left: 2px solid transparent;
}
.conv-item:hover { background: var(--hover-fill); }
.conv-item.active { background: var(--accent-soft); border-left-color: var(--accent); }
.conv-item.followup { border-left-color: var(--warn); }
.conv-item.done { opacity: 0.55; }
.conv-item.active.followup { border-left-color: var(--accent); }

.conv-avatar {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}
.conv-main { flex: 1; min-width: 0; }
.conv-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-item.active .conv-name { color: var(--accent); }
.conv-preview {
  font-size: 12.5px;
  color: var(--text3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.conv-meta {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-size: 11px;
  color: var(--text3);
  text-align: right;
  white-space: nowrap;
}

/* ---------- Fil de discussion ---------- */
.inbox-thread { padding: 0; overflow: hidden; }
.thread-head {
  flex: none;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.016em;
  color: var(--text);
}
.fan-context {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text2);
}
.fan-chip { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fan-chip b { color: var(--text); font-weight: 600; }
.fan-status { gap: 6px; margin-left: auto; }
.fan-status .btn.active-status {
  background: var(--accent-soft);
  border-color: var(--accent-border-soft);
  color: var(--accent);
  font-weight: 620;
}
/* Rappel des derniers échanges : UNE ligne — le fil complet est juste
   en dessous, inutile de le répéter sur trois lignes. */
.fan-recent {
  flex-basis: 100%;
  line-height: 1.6;
  padding-top: 8px;
  border-top: 1px solid var(--row-border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.txt-fan { color: var(--text2); }
.txt-jenna { color: var(--accent); }

.thread-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  background: var(--bg);
}
.thread-body > .muted { margin: auto; }

.bubble {
  position: relative;
  width: fit-content;
  max-width: min(68%, 560px);
  padding: 9px 13px 7px;
  border-radius: 16px;
  font-size: 13.5px;
  font-weight: 450;
  line-height: 1.5;
  word-break: break-word;
  animation: bubbleIn 0.2s ease both;
}
.bubble-text { display: block; white-space: pre-wrap; }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.bubble.user {
  align-self: flex-start;
  background: var(--bubble-in);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
  color: var(--text);
}
.bubble.assistant {
  align-self: flex-end;
  background: var(--bubble-out);
  border: 1px solid var(--bubble-out-border);
  border-bottom-right-radius: 5px;
  color: var(--text);
}
.bubble + .bubble { margin-top: 2px; }
.bubble.user + .bubble.assistant,
.bubble.assistant + .bubble.user { margin-top: 8px; }
.bubble-time {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text3);
  letter-spacing: 0.01em;
}
.bubble.assistant .bubble-time { text-align: right; color: var(--accent-bright); opacity: 0.75; }
.bubble.user .bubble-time { text-align: left; }

/* ---------- Zone de saisie ---------- */
.reply-box {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}
.reply-box textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  border-radius: var(--r);
  background: var(--surface);
  resize: none;
}
.reply-box .btn { flex: none; height: 44px; padding: 0 20px; border-radius: var(--r); }
#reply-msg { padding: 0 20px 10px; margin: 0; flex: none; }
#reply-msg:empty { display: none; }

/* ---------- Réponses rapides ---------- */
.qr-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.qr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.qr-chip:hover { background: var(--accent-soft); border-color: var(--accent-border-soft); color: var(--accent); }
.qr-del {
  border: 0;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  border-radius: 4px;
}
.qr-del:hover { color: var(--err); }
.qr-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.qr-form input { flex: 1; min-width: 160px; height: 36px; }
.list-count { font-size: 12.5px; color: var(--text3); }
.list-count b { color: var(--text); font-size: 15px; font-weight: 650; }

/* ---------- Broadcasts ---------- */
.bc-preview { margin-top: 12px; }
.bc-preview-box {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--accent-wash);
  border: 1px solid var(--accent-border-soft);
  font-size: 13px;
  color: var(--text2);
}

/* ============================================================
   16. LOGIN
   ============================================================ */
/* La page d'accueil est la première chose que voit la propriétaire : papier
   chaud, une seule carte posée au centre, beaucoup d'air autour. Fond plat —
   un lavis en dégradé produisait des bandes visibles à ces opacités. */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  background: var(--bg);
  overflow: hidden;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 392px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 44px 40px 40px;
  text-align: center;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.login-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--accent-solid);
  color: var(--on-accent);
}
.login-logo svg { width: 28px; height: 28px; }
.login-card h1 {
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.035em;
  margin: 0 0 8px;
}
.login-sub {
  margin: 0 0 32px;
  font-size: 14px;
  font-weight: 450;
  line-height: 1.55;
  color: var(--text2);
}
.login-card form { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.login-label {
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text3);
}
/* Champ : l'icône vit DANS le champ, le texte respire à sa droite. */
.login-field { position: relative; }
.login-field-ico {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--text3);
  pointer-events: none;
  transition: color var(--ease);
}
.login-field-ico svg { width: 17px; height: 17px; display: block; }
.login-field:focus-within .login-field-ico { color: var(--accent); }
.login-card input {
  width: 100%;
  height: 50px;
  padding-left: 42px;
  text-align: left;
  background: var(--surface);
  border-radius: var(--r);
  font-size: 14.5px;
}
.login-card .btn {
  margin-top: 10px;
  height: 50px;
  font-size: 14.5px;
  border-radius: var(--r);
}
.login-foot {
  margin: 0;
  max-width: 392px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text3);
  animation: modalIn 0.3s 0.08s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.login-card .error-text { margin: 14px 0 0; text-align: center; }
.login-hint {
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  border: 1px solid var(--warn-border);
  color: var(--warn);
  font-size: 12.5px;
  text-align: left;
}

/* ============================================================
   17. TOASTS / OVERLAYS / 404
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 400;
  max-width: min(90vw, 460px);
  padding: 12px 18px;
  border-radius: var(--r);
  background: var(--toast-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.24s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.session-expired-overlay {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.session-expired-card {
  width: 100%;
  max-width: 380px;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 30px 28px;
  text-align: center;
  box-shadow: var(--shadow-float);
}
.session-expired-icon {
  font-size: 22px;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--accent-soft);
}
.session-expired-card h3 { font-size: 17px; margin-bottom: 6px; }
.session-expired-card p { font-size: 13.5px; color: var(--text2); margin-bottom: 20px; }

.notfound-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 90px 24px;
}
.notfound-icon {
  font-size: 24px;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.notfound-state h2 { font-size: 22px; }
.notfound-state p { color: var(--text2); }
.notfound-state .btn { margin-top: 12px; }

/* ---------- Panneau « Voice & Style » mis en avant ---------- */
.panel-vs { position: relative; overflow: hidden; }
.panel-vs::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(340px 160px at 100% 0%, var(--accent-glow), transparent 70%);
  pointer-events: none;
}
.panel-vs h3, .panel-vs p, .panel-vs .btn { position: relative; }

/* ============================================================
   18. RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .gal-lb-card { grid-template-columns: minmax(0, 1fr); max-height: calc(100vh - 60px); overflow-y: auto; }
  .gal-lb-media img { max-height: 46vh; }
}

@media (max-width: 1280px) {
  /* Pas la place pour trois colonnes : la fiche du fan passe en bandeau
     sous l'en-tête du fil, comme avant. */
  .inbox-layout { grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); }
  .inbox-details { grid-column: 1 / -1; max-height: 240px; }
  .inbox-details .fan-context { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
  .inbox-details .fan-chip { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 0; border-bottom: 0; }
}

@media (max-width: 1024px) {
  .gal-edit-card { grid-template-columns: minmax(0, 1fr); }
  .gal-edit-media { max-width: 380px; }
  .inbox-layout { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); }
}

@media (max-width: 860px) {
  :root { --sidebar-w: 260px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ease);
    z-index: 55;
  }
  body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  .sidebar-toggle { display: grid; transition: opacity var(--ease); }
  /* Tiroir ouvert : le hamburger se superposerait au logo de la marque.
     On l'efface — l'overlay et les liens de nav referment le tiroir. */
  body.sidebar-open .sidebar-toggle { opacity: 0; pointer-events: none; }
  .main { grid-column: 1; padding: calc(var(--topbar-h) + 8px) 18px 60px; }
  .topbar { left: 0; padding: 0 18px 0 62px; }
  .page-head { align-items: flex-start; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .gal-edit-info .form-grid { grid-template-columns: minmax(0, 1fr); }
  .inbox-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .inbox-convs { max-height: 320px; }
  .inbox-thread { min-height: 520px; }
  .hbar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hbar-row .hbar-track { grid-column: 1 / -1; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .gal-modal { padding: 20px 14px; }
  .gal-modal-form { padding: 20px 18px 18px; }
  .theme-toggle { right: 16px; bottom: 16px; }
  .month-rev { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 23px; }
  .page h2 { font-size: 21px; }
  .dash-hero { padding: 22px 20px; }
  .dash-hero h2 { font-size: 22px; }
  .gal-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .bubble { max-width: 86%; }
}

/* En-tête interne réduit à sa phrase d'explication (le titre est en haut). */
.page-head h2.page-head-subonly {
  font-size: 0;
  gap: 0;
}
.page-head h2.page-head-subonly .page-sub { font-size: 13.5px; }

/* Vignettes en brouillon : atténuées, mais toujours lisibles. */
.gal-card-off { opacity: 0.78; }
.gal-card-off:hover { opacity: 1; }

/* …SAUF dans la bibliothèque : un média importé y arrive TOUJOURS en
   brouillon (aucun prix, aucune vente tant qu'il n'est pas dans une offre).
   L'atténuer ferait croire à un contenu « éteint » ou déjà classé : la
   galerie est neutre, c'est l'offre qui décide Locked / Free preview. */
.gal-card-lib.gal-card-off,
.gal-card-lib.gal-card-off:hover { opacity: 1; }

/* Inbox — avatars en bleu DOUX : quatre pastilles pleines côte à côte
   pesaient trop lourd dans une colonne calme. */
.conv-avatar {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 620;
}
.conv-item.active .conv-avatar { background: var(--accent-solid); color: var(--on-accent); }

/* Fil vide : une phrase plutôt qu'un grand blanc. */
.thread-body:empty::before {
  content: "Pick someone on the left — the whole conversation shows up here.";
  margin: auto;
  max-width: 32ch;
  text-align: center;
  color: var(--text3);
  font-size: 13.5px;
  line-height: 1.6;
}

/* Le champ de la palette EST déjà le repère visuel : pas de double anneau. */
.search-palette-field input:focus-visible { outline: none; }
.search-palette-field:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }
