/* ══════════════════════════════════════════════════════════════════════════
   WHILERESUME — BACKOFFICE

   Un outil de travail, pas une vitrine. Trente-trois entrées de menu, des
   tableaux denses, de la modération. La lisibilité prime sur l'effet.

   ── PARTI PRIS ────────────────────────────────────────────────────────────

   La couleur ne décore jamais. Elle porte un état :

       vert    → actif, validé, en ligne
       ambre   → en attente, annulé mais encore valide
       rouge   → bloqué, remboursé, supprimé
       bleu    → Stripe / web
       violet  → RevenueCat / mobile
       gris    → neutre, expiré, sans objet

   Le même vocabulaire vaut pour un badge dans un tableau et pour l'entrée
   active du menu. On lit l'état d'une ligne sans lire le texte.

   ── STRUCTURE ─────────────────────────────────────────────────────────────

   .bo            grille : barre latérale + contenu
   .bo-side       navigation, ardoise sombre
   .bo__main      colonne de travail, surface claire
   .bo-top        barre supérieure collante
   .bo-page       zone de contenu

   Écrit à la main, sans framework. Les classes suivent la convention
   bloc__élément--variante.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Ardoise : la barre latérale ── */
  --bo-slate-950: #0b1220;
  --bo-slate-900: #111a2b;
  --bo-slate-800: #1a2438;
  --bo-slate-700: #263349;
  --bo-slate-500: #64748b;
  --bo-slate-400: #94a3b8;
  --bo-slate-300: #cbd5e1;

  /* ── Surface : la zone de travail ── */
  --bo-bg:        #f6f7f9;
  --bo-surface:   #ffffff;
  --bo-line:      #e3e7ed;
  --bo-line-soft: #eef1f5;

  /* ── Texte ── */
  --bo-ink:       #16202e;
  --bo-ink-soft:  #4a5769;
  --bo-ink-mute:  #7b8798;

  /* ── Accent : vert profond ── */
  --bo-accent:      #0f766e;
  --bo-accent-dark: #0c5f58;
  --bo-accent-soft: #d5f0ec;
  --bo-accent-ink:  #0b4f49;

  /* ── États ── */
  --bo-ok:       #15803d;
  --bo-ok-soft:  #dcfce7;
  --bo-ok-ink:   #14532d;

  --bo-warn:      #b45309;
  --bo-warn-soft: #fef3c7;
  --bo-warn-ink:  #78350f;

  --bo-danger:      #b91c1c;
  --bo-danger-soft: #fee2e2;
  --bo-danger-ink:  #7f1d1d;

  --bo-blue:      #1d4ed8;
  --bo-blue-soft: #dbeafe;
  --bo-blue-ink:  #1e3a8a;

  --bo-violet:      #6d28d9;
  --bo-violet-soft: #ede9fe;
  --bo-violet-ink:  #4c1d95;

  /* ── Mesures ── */
  --bo-side-w: 264px;
  --bo-top-h:  60px;
  --bo-r:      10px;
  --bo-r-sm:   7px;

  --bo-shadow:    0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --bo-shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);

  --bo-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bo-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
}

/* ══════════════════════════════════════════════════════════════════════════
   BASE
   ══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

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

body.bo-body {
  margin: 0;
  font-family: var(--bo-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--bo-ink);
  background: var(--bo-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--bo-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 21px; }
h2 { font-size: 16px; }
p  { margin: 0; }

svg { flex: none; }

/* Le focus reste visible partout : on navigue ce backoffice au clavier. */
:focus-visible {
  outline: 2px solid var(--bo-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ══════════════════════════════════════════════════════════════════════════
   ARMATURE
   ══════════════════════════════════════════════════════════════════════════ */

.bo {
  display: grid;
  grid-template-columns: var(--bo-side-w) minmax(0, 1fr);
  min-height: 100vh;
}

.bo__main {
  min-width: 0;           /* sans ça, un tableau large déborde la grille */
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════════════════
   BARRE LATÉRALE
   ══════════════════════════════════════════════════════════════════════════ */

.bo-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bo-slate-950);
  border-right: 1px solid var(--bo-slate-800);
}

.bo-side__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--bo-top-h);
  flex: none;
  border-bottom: 1px solid var(--bo-slate-800);
}

/* Le carré d'accent : seule touche de couleur pleine du menu. */
.bo-side__mark {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bo-accent);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -.02em;
}

.bo-side__name {
  color: #fff;
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-side__nav {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 10px 20px;
}

/* Barre de défilement discrète — 33 entrées, elle sert souvent. */
.bo-side__nav::-webkit-scrollbar { width: 8px; }
.bo-side__nav::-webkit-scrollbar-thumb {
  background: var(--bo-slate-700);
  border-radius: 4px;
  border: 2px solid var(--bo-slate-950);
}
.bo-side__nav::-webkit-scrollbar-thumb:hover { background: var(--bo-slate-500); }

.bo-side__label {
  padding: 16px 10px 6px;
  color: var(--bo-slate-500);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.bo-side__nav > .bo-side__label:first-child { padding-top: 4px; }

.bo-side__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 1px;
  border-radius: var(--bo-r-sm);
  color: var(--bo-slate-300);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .13s ease, color .13s ease;
}
.bo-side__link:hover {
  background: var(--bo-slate-800);
  color: #fff;
  text-decoration: none;
}
.bo-side__link svg {
  width: 17px;
  height: 17px;
  opacity: .65;
  transition: opacity .13s ease;
}
.bo-side__link:hover svg { opacity: 1; }

/* L'entrée active : fond teinté + filet d'accent à gauche. Le même vert que
   les badges « actif » — la couleur dit toujours la même chose. */
.bo-side__link.is-active {
  position: relative;
  background: color-mix(in srgb, var(--bo-accent) 20%, var(--bo-slate-900));
  color: #fff;
  font-weight: 600;
}
.bo-side__link.is-active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--bo-accent);
}
.bo-side__link.is-active svg { opacity: 1; }

.bo-side__sub {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 20px;
  background: var(--bo-slate-800);
  color: var(--bo-slate-400);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.bo-side__link.is-active .bo-side__sub {
  background: var(--bo-accent);
  color: #fff;
}

.bo-side__foot {
  flex: none;
  padding: 10px;
  border-top: 1px solid var(--bo-slate-800);
}
.bo-side__foot .bo-side__link { margin: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   BARRE SUPÉRIEURE
   ══════════════════════════════════════════════════════════════════════════ */

.bo-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--bo-top-h);
  padding: 0 20px;
  flex: none;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--bo-line);
}

.bo-top__title {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -.01em;
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-burger {
  display: none;          /* mobile seulement */
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-r-sm);
  background: var(--bo-surface);
  color: var(--bo-ink-soft);
  cursor: pointer;
}
.bo-burger svg { width: 18px; height: 18px; }
.bo-burger:hover { background: var(--bo-bg); }

/* ══════════════════════════════════════════════════════════════════════════
   PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.bo-page {
  flex: 1;
  padding: 22px 20px 56px;
  max-width: 1500px;
  width: 100%;
}

.bo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.bo-head p {
  margin-top: 3px;
  color: var(--bo-ink-mute);
  font-size: 13.5px;
}

.bo-title { font-size: 15.5px; font-weight: 650; }
.bo-sub   { color: var(--bo-ink-mute); font-size: 13px; margin-top: 3px; }
.bo-muted { color: var(--bo-ink-mute); font-weight: 400; }
.bo-xs    { font-size: 12.5px; }

.bo-flex  { display: flex; align-items: center; flex-wrap: wrap; }
.bo-gap-1 { gap: 6px; }
.bo-gap-2 { gap: 12px; }

/* ══════════════════════════════════════════════════════════════════════════
   CARTES
   ══════════════════════════════════════════════════════════════════════════ */

.bo-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-r);
  box-shadow: var(--bo-shadow);
  overflow: hidden;
}

.bo-card__body { padding: 16px; }
.bo-card__body + .bo-card__body { border-top: 1px solid var(--bo-line-soft); }

/* ══════════════════════════════════════════════════════════════════════════
   COMPTEURS

   Chiffres alignés en tabulaire : on compare deux lignes d'un coup d'œil.
   ══════════════════════════════════════════════════════════════════════════ */

.bo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.bo-stat {
  padding: 14px 16px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-r);
  box-shadow: var(--bo-shadow);
}

.bo-stat__num,
.bo-stat__value {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  color: var(--bo-ink);
}

.bo-stat__label {
  margin-top: 3px;
  color: var(--bo-ink-mute);
  font-size: 12.5px;
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════════════
   TABLEAUX

   Le cœur de l'outil. En-tête collant : on garde ses repères en défilant une
   longue liste.
   ══════════════════════════════════════════════════════════════════════════ */

.bo-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.bo-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 14px;
  background: var(--bo-bg);
  border-bottom: 1px solid var(--bo-line);
  color: var(--bo-ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .055em;
  text-align: left;
  white-space: nowrap;
}

.bo-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--bo-line-soft);
  vertical-align: middle;
}

.bo-table tbody tr:last-child td { border-bottom: 0; }
.bo-table tbody tr { transition: background .1s ease; }
.bo-table tbody tr:hover { background: var(--bo-bg); }

/* Les nombres s'alignent : comparer une colonne de montants doit être
   immédiat. */
.bo-table td strong { font-variant-numeric: tabular-nums; font-weight: 650; }

/* La deuxième ligne d'une cellule — e-mail sous un nom, agence sous un
   client. Présente sans concurrencer. */
.bo-table__sub {
  margin-top: 1px;
  color: var(--bo-ink-mute);
  font-size: 12px;
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════════════════════════════
   BADGES

   La couleur porte l'état, jamais l'ornement.
   ══════════════════════════════════════════════════════════════════════════ */

.bo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bo-line-soft);
  color: var(--bo-ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.bo-badge--success { background: var(--bo-ok-soft);     color: var(--bo-ok-ink); }
.bo-badge--warning { background: var(--bo-warn-soft);   color: var(--bo-warn-ink); }
.bo-badge--danger  { background: var(--bo-danger-soft); color: var(--bo-danger-ink); }
.bo-badge--blue    { background: var(--bo-blue-soft);   color: var(--bo-blue-ink); }
.bo-badge--violet  { background: var(--bo-violet-soft); color: var(--bo-violet-ink); }
.bo-badge--muted   { background: var(--bo-line-soft);   color: var(--bo-ink-mute); }

/* ══════════════════════════════════════════════════════════════════════════
   BOUTONS
   ══════════════════════════════════════════════════════════════════════════ */

.bo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--bo-r-sm);
  background: var(--bo-accent);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s ease, border-color .13s ease;
}
.bo-btn:hover { background: var(--bo-accent-dark); text-decoration: none; }
.bo-btn svg { width: 15px; height: 15px; }

.bo-btn--primary { background: var(--bo-accent); color: #fff; }
.bo-btn--primary:hover { background: var(--bo-accent-dark); }

.bo-btn--secondary {
  background: var(--bo-surface);
  border-color: var(--bo-line);
  color: var(--bo-ink);
}
.bo-btn--secondary:hover { background: var(--bo-bg); border-color: #d3dae3; }

.bo-btn--danger { background: var(--bo-danger); color: #fff; }
.bo-btn--danger:hover { background: #991b1b; }

.bo-btn--sm { padding: 5px 10px; font-size: 12.5px; }
.bo-btn--sm svg { width: 13px; height: 13px; }

.bo-btn--block { width: 100%; }

.bo-btn:disabled,
.bo-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════════════════════
   FORMULAIRES
   ══════════════════════════════════════════════════════════════════════════ */

.bo-field { display: block; margin-bottom: 14px; }

.bo-label {
  display: block;
  margin-bottom: 5px;
  color: var(--bo-ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.bo-input,
.bo-select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-r-sm);
  background: var(--bo-surface);
  color: var(--bo-ink);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  transition: border-color .13s ease, box-shadow .13s ease;
}

.bo-input::placeholder { color: var(--bo-ink-mute); }

.bo-input:focus,
.bo-select:focus {
  outline: 0;
  border-color: var(--bo-accent);
  box-shadow: 0 0 0 3px var(--bo-accent-soft);
}

.bo-select {
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8798' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 15px;
  cursor: pointer;
}

.bo-select--sm {
  width: auto;
  padding: 5px 28px 5px 9px;
  font-size: 12.5px;
  background-size: 13px;
}

textarea.bo-input { min-height: 100px; resize: vertical; line-height: 1.6; }

.bo-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
}
.bo-checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--bo-accent);
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════════════
   MESSAGES

   Un message dit ce qui s'est passé et ce qu'il reste à faire. Le filet de
   gauche porte l'état — même code couleur que les badges.
   ══════════════════════════════════════════════════════════════════════════ */

.bo-alert {
  padding: 11px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--bo-line);
  border-left: 3px solid var(--bo-ink-mute);
  border-radius: var(--bo-r-sm);
  background: var(--bo-surface);
  color: var(--bo-ink);
  font-size: 13.5px;
}
.bo-alert a { text-decoration: underline; }

.bo-alert--success {
  border-color: color-mix(in srgb, var(--bo-ok) 25%, var(--bo-line));
  border-left-color: var(--bo-ok);
  background: var(--bo-ok-soft);
  color: var(--bo-ok-ink);
}
.bo-alert--info {
  border-color: color-mix(in srgb, var(--bo-accent) 25%, var(--bo-line));
  border-left-color: var(--bo-accent);
  background: var(--bo-accent-soft);
  color: var(--bo-accent-ink);
}
.bo-alert--warning {
  border-color: color-mix(in srgb, var(--bo-warn) 25%, var(--bo-line));
  border-left-color: var(--bo-warn);
  background: var(--bo-warn-soft);
  color: var(--bo-warn-ink);
}
.bo-alert--danger {
  border-color: color-mix(in srgb, var(--bo-danger) 25%, var(--bo-line));
  border-left-color: var(--bo-danger);
  background: var(--bo-danger-soft);
  color: var(--bo-danger-ink);
}

/* ══════════════════════════════════════════════════════════════════════════
   VIDE

   Un écran vide invite à agir, il ne s'excuse pas.
   ══════════════════════════════════════════════════════════════════════════ */

.bo-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--bo-ink-mute);
}
.bo-empty p { font-size: 13.5px; }
.bo-empty .bo-btn { margin-top: 14px; }

/* ══════════════════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════════════════ */

.bo-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 14px;
  border-top: 1px solid var(--bo-line-soft);
}

.bo-pager a,
.bo-pager span {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bo-line);
  border-radius: var(--bo-r-sm);
  background: var(--bo-surface);
  color: var(--bo-ink-soft);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.bo-pager a:hover { background: var(--bo-bg); text-decoration: none; }

.bo-pager .is-active,
.bo-pager [aria-current="page"] {
  background: var(--bo-accent);
  border-color: var(--bo-accent);
  color: #fff;
  font-weight: 650;
}

.bo-pager .is-disabled { opacity: .4; pointer-events: none; }

/* ══════════════════════════════════════════════════════════════════════════
   CODE
   ══════════════════════════════════════════════════════════════════════════ */

.bo-code,
code.bo-xs,
.bo-table code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bo-line-soft);
  color: var(--bo-ink-soft);
  font-family: var(--bo-mono);
  font-size: 12px;
}

/* ══════════════════════════════════════════════════════════════════════════
   MODALES

   La modale est un confort : la vérification sérieuse se fait côté serveur.
   Elle ralentit un geste irréversible, elle ne le sécurise pas.
   ══════════════════════════════════════════════════════════════════════════ */

.bo-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ⚠️  L'ouverture se fait en retirant l'attribut `hidden` — c'est ce que
   posent les templates. Le sélecteur doit donc porter sur [hidden], pas sur
   une classe : sinon la modale s'affiche dès le chargement de la page. */
.bo-modal[hidden] { display: none; }

.bo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, .55);
  backdrop-filter: blur(2px);
}

.bo-modal__box {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--bo-surface);
  border-radius: 12px;
  box-shadow: var(--bo-shadow-lg);
  animation: bo-modal-in .16s ease-out;
}

@keyframes bo-modal-in {
  from { opacity: 0; transform: translateY(6px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

.bo-modal__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 0;
}

.bo-modal__icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bo-danger-soft);
  color: var(--bo-danger);
}
.bo-modal__icon svg { width: 19px; height: 19px; }

.bo-modal__title { font-size: 15.5px; font-weight: 650; padding-top: 6px; }

.bo-modal__body {
  padding: 12px 18px 0;
  overflow-y: auto;
  color: var(--bo-ink-soft);
  font-size: 13.5px;
}

/* Ce que la suppression emporte avec elle. Énumérer évite la mauvaise
   surprise. */
.bo-modal__list {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.7;
}

.bo-modal__hint {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: var(--bo-r-sm);
  background: var(--bo-warn-soft);
  color: var(--bo-warn-ink);
  font-size: 12.5px;
}

.bo-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px;
}

/* Le bouton qui confirme. Rouge : il n'y a pas de retour en arrière. */
.bo-modal__danger {
  background: var(--bo-danger);
  color: #fff;
}
.bo-modal__danger:hover:not(:disabled) { background: #991b1b; }

/* ══════════════════════════════════════════════════════════════════════════
   MENU MOBILE
   ══════════════════════════════════════════════════════════════════════════ */

.bo-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(11, 18, 32, .5);
}
.bo-backdrop.is-active { display: block; }

/* ══════════════════════════════════════════════════════════════════════════
   CONNEXION
   ══════════════════════════════════════════════════════════════════════════ */

.bo-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bo-slate-950);
}

.bo-login__box {
  width: 100%;
  max-width: 372px;
  padding: 30px;
  background: var(--bo-surface);
  border-radius: 12px;
  box-shadow: var(--bo-shadow-lg);
}

.bo-login__head { text-align: center; margin-bottom: 22px; }

.bo-login__mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--bo-accent);
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.02em;
}

.bo-login__title { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.bo-login__sub   { margin-top: 3px; color: var(--bo-ink-mute); font-size: 13px; }
.bo-login__foot  { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--bo-ink-mute); }

/* ══════════════════════════════════════════════════════════════════════════
   CARTE

   pointX = longitude, pointY = latitude. L'inversion est dans les données,
   pas ici — mais elle se voit d'abord sur la carte.
   ══════════════════════════════════════════════════════════════════════════ */

.bo-map-legend { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; }

.bo-map-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--bo-accent);
}

/* ══════════════════════════════════════════════════════════════════════════
   FICHE CANDIDAT
   ══════════════════════════════════════════════════════════════════════════ */

.cv-sec { margin-bottom: 14px; }

.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.cv-grid-3 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.cv-chips,
.cv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.cv-chip {
  padding: 2px 9px;
  border: 1px solid var(--bo-line);
  border-radius: 20px;
  background: var(--bo-bg);
  color: var(--bo-ink-soft);
  font-size: 12.5px;
  font-weight: 500;
}

.cv-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--bo-line-soft);
}
.cv-item:last-child { border-bottom: 0; padding-bottom: 0; }

.cv-item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cv-item__t { font-weight: 600; font-size: 13.5px; }

.cv-rm { color: var(--bo-ink-mute); font-size: 12.5px; }

/* ══════════════════════════════════════════════════════════════════════════
   ADAPTATION

   Sous 1024px la barre latérale sort du flux et coulisse. Le contenu occupe
   toute la largeur : sur un écran étroit, la place va aux données.
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .bo { grid-template-columns: 1fr; }

  .bo-side {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: var(--bo-side-w);
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .bo-side.is-active { transform: none; }

  .bo-burger { display: inline-flex; }
}

@media (max-width: 640px) {
  .bo-page { padding: 16px 14px 44px; }
  .bo-top  { padding: 0 14px; }

  h1 { font-size: 19px; }

  .bo-head { margin-bottom: 16px; }

  .bo-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .bo-stat  { padding: 12px 13px; }
  .bo-stat__num, .bo-stat__value { font-size: 22px; }

  .bo-table thead th { padding: 8px 11px; }
  .bo-table tbody td { padding: 10px 11px; }

  .bo-card__body { padding: 13px; }

  /* Les filtres passent en pile : à côté, ils deviennent illisibles. */
  .bo-card__body.bo-flex { display: block; }
  .bo-card__body.bo-flex .bo-field { margin-bottom: 10px; }
  .bo-card__body.bo-flex .bo-select { width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════════
   PRÉFÉRENCES SYSTÈME
   ══════════════════════════════════════════════════════════════════════════ */

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

@media print {
  .bo-side, .bo-top, .bo-pager, .bo-btn, .bo-backdrop { display: none !important; }
  .bo { grid-template-columns: 1fr; }
  .bo-page { padding: 0; max-width: none; }
  .bo-card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .bo-table thead th { position: static; }
}

/* ══════════════════════════════════════════════════════════════════════
   ÉDITEUR DE TEXTE ENRICHI (bo-editor.js)
   ══════════════════════════════════════════════════════════════════════ */

.bo-ed {
  width: 100%;
  border: 1px solid var(--bo-line, #E5E9F0);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.bo-ed__bar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 6px 8px;
  background: var(--bo-bg, #F7F8FB);
  border-bottom: 1px solid var(--bo-line, #E5E9F0);
}

.bo-ed__btn {
  min-width: 30px; height: 28px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 7px;
  background: none; color: var(--bo-ink, #1E2330);
  font-size: 13px; font-family: inherit; cursor: pointer;
}
.bo-ed__btn:hover { background: #fff; border-color: var(--bo-line, #E5E9F0); }

.bo-ed__toggle {
  margin-left: auto; height: 28px; padding: 0 10px;
  border: 1px solid var(--bo-line, #E5E9F0); border-radius: 7px;
  background: #fff; color: var(--bo-muted, #6B7280);
  font-size: 12px; font-family: inherit; cursor: pointer;
}
.bo-ed__toggle:hover { color: var(--bo-ink, #1E2330); }

/* ⚠️  UNE HAUTEUR MINIMALE, PAS FIXE.

   La zone grandit avec le texte : une description de fiche fait trois
   lignes ou trois paragraphes selon l'entreprise, et une hauteur figée
   obligerait à défiler dans une boîte de 100 px. */
.bo-ed__area {
  min-height: 180px; max-height: 60vh; overflow-y: auto;
  padding: 12px 14px;
  font-size: 14px; line-height: 1.65; color: var(--bo-ink, #1E2330);
  outline: none;
}
.bo-ed__area:focus { box-shadow: inset 0 0 0 2px rgba(107, 71, 166, .12); }

.bo-ed__area h2 { font-size: 17px; margin: 14px 0 6px; }
.bo-ed__area h3 { font-size: 15px; margin: 12px 0 5px; }
.bo-ed__area p { margin: 0 0 10px; }
.bo-ed__area ul, .bo-ed__area ol { margin: 0 0 10px; padding-left: 22px; }
.bo-ed__area a { color: #6B47A6; }

/* Le textarea sous l'éditeur (mode « Code HTML ») : pleine largeur et
   police à chasse fixe, pour relire du balisage sans se tordre les yeux. */
.bo-ed textarea.bo-input {
  width: 100%; border: 0; border-radius: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; min-height: 220px;
}

/* ⚠️  TOUTES LES ZONES DE TEXTE PRENNENT LA LARGEUR DISPONIBLE.

   Sans cette règle, un `<textarea>` garde sa largeur par défaut — environ
   20 caractères — quelle que soit la card qui l'entoure. Les descriptions
   d'entreprise se rédigeaient dans un timbre-poste. */
textarea.bo-input { width: 100%; box-sizing: border-box; }

/* ── Barre d'actions groupées ────────────────────────────────────────── */
.bo-bulkbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 10px 14px;
  border: 1px solid var(--bo-line, #E5E9F0); border-radius: 10px;
  background: var(--bo-bg, #F7F8FB);
  font-size: 13px;
}
.bo-bulkbar__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.bo-bulkbar__all { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.bo-bulkbar__all strong { color: #6B47A6; }

/* Les cases du tableau : assez grandes pour être visées sans effort. */
.bo-table input[type="checkbox"] { width: 15px; height: 15px; accent-color: #6B47A6; cursor: pointer; }

/* ── Sélecteur de langue de CONTENU (barre du haut) ───────────────────────
   Distinct visuellement du sélecteur de langue d'interface, juste à côté :
   deux réglages voisins qui ne font pas la même chose. Le libellé les
   sépare autant que l'écart. */
.bo-clang {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 14px; padding: 3px 6px 3px 8px;
  border: 1px solid var(--bo-line, #E5E9F0); border-radius: 8px;
  background: var(--bo-bg, #F7F8FB);
}
.bo-clang__label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--bo-muted, #6B7280);
  margin-right: 4px;
}
.bo-clang__item {
  padding: 2px 6px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--bo-muted, #6B7280);
  text-decoration: none;
}
.bo-clang__item:hover { background: #fff; color: var(--bo-ink, #1E1B2E); }
.bo-clang__item.is-on { background: #6B47A6; color: #fff; }

@media (max-width: 720px) {
  /* Sur mobile la barre est déjà pleine : on garde les codes, on retire le
     libellé plutôt que tout le sélecteur. */
  .bo-clang__label { display: none; }
}

/* ── Onglets de statut ────────────────────────────────────────────────────
   Le compteur vit DANS l'onglet : il dit à la fois combien il y en a et où
   cliquer. C'est ce qui permet de supprimer le bloc de statistiques, qui
   affichait les mêmes nombres en double juste au-dessus. */
.bo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--bo-line, #E8EAEF);
}
.bo-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  color: var(--bo-muted, #6B7280);
  font-size: 13.5px; font-weight: 600;
  text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}
.bo-tab:hover { color: var(--bo-ink, #1E1B2E); background: var(--bo-bg, #F7F8FA); }

/* L'onglet actif porte un trait sous le texte plutôt qu'un fond plein :
   il marque la position sans peser dans un écran déjà dense. */
.bo-tab.is-on {
  color: #6B47A6;
  border-bottom-color: #6B47A6;
  background: none;
}

.bo-tab__n {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .06);
  font-size: 11.5px; font-weight: 700;
}
.bo-tab.is-on .bo-tab__n { background: rgba(107, 71, 166, .12); color: #6B47A6; }

@media (max-width: 640px) {
  .bo-tab { padding: 8px 12px; font-size: 12.5px; }
}

/* ══════════════════════════════════════════════════════════════════════
   LIEU ET RATTACHEMENT DANS LA LISTE DES OFFRES (bo-lieu)

   Deux colonnes se répondent : ce qui est écrit dans l'offre, et ce à quoi
   elle est rattachée. Chacune tient sur deux lignes — la ville, puis le
   pays en dessous — pour que la comparaison se fasse verticalement, d'un
   coup d'œil, sans élargir le tableau.
   ══════════════════════════════════════════════════════════════════════ */
.bo-lieu {
  font-size: 13px;
  line-height: 1.35;
  color: var(--bo-ink);
}

/* Le pays : plus discret que la ville, parce qu'il se déduit d'elle. */
.bo-lieu__sub {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--bo-ink-mute);
  margin-top: 2px;
}

/* ⚠️  « NON RATTACHÉE » NE DOIT PAS CRIER.

   Sur une base en cours de correction, l'immense majorité des lignes le
   sont. En rouge, le tableau entier virerait à l'alerte et l'on ne verrait
   plus rien. C'est un état de fait, pas une erreur : gris et en italique. */
.bo-lieu__vide {
  color: var(--bo-ink-mute);
  font-style: italic;
  font-size: 12.5px;
}

/* Rattaché à un pays sans ville — « Remote », « France entière ». */
.bo-lieu--zone { color: var(--bo-ink-soft); }

/* ⚠️  UNE RÉFÉRENCE BRUTE SE DISTINGUE PAR LA FONTE, PAS PAR UN BADGE.

   Un badge « réf. » collé à la valeur disait pourquoi la case montre
   « VIL-00004059 » plutôt qu'un nom — mais il doublait la largeur du
   contenu dans une colonne déjà étroite, et sur une base peu rattachée il
   se répétait sur chaque ligne.

   La fonte à chasse fixe suffit : un identifiant ne se lit pas comme un
   nom de ville, on le voit sans qu'on l'annonce. */
.bo-lieu--ref {
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: 11.5px;
  color: var(--bo-ink-soft);
}
