/* ==========================================================================
   OFIM Admin — design system (chantier new-admin)
   Source de vérité visuelle : .vibe/new-admin/design.md
   Direction : « océan Indien professionnel » — marine profond, lagon, corail.
   Signature : le ruban horizon (dégradé marine → lagon → corail).
   ========================================================================== */

/* ----------------------------------------------------------- Fonts */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/hanken-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ----------------------------------------------------------- Tokens */
:root {
  color-scheme: light;

  --bo-bg: #F5F6FA;
  --bo-surface: #FFFFFF;
  --bo-surface-2: #F0F2F7;
  --bo-border: #E4E7EF;
  --bo-border-strong: #C9CFDD;
  --bo-text: #131B2E;
  --bo-text-2: #5A6478;
  --bo-text-3: #8B93A7;

  --bo-marine: #101C4D;
  --bo-marine-2: #1A2A6B;
  --bo-primary: #2E4FD8;
  --bo-primary-hover: #2542BC;
  --bo-primary-soft: #E9EDFC;
  --bo-lagon: #17C3CE;
  --bo-corail: #FF6B4A;

  --bo-success: #189A66; --bo-success-soft: #E4F6EE;
  --bo-warning: #DC8A10; --bo-warning-soft: #FBF1DF;
  --bo-danger:  #D93036; --bo-danger-soft:  #FCE9EA;
  --bo-info:    #2E90FA; --bo-info-soft:    #E7F1FE;

  --bo-ruban: linear-gradient(90deg, #101C4D 0%, #2E4FD8 35%, #17C3CE 70%, #FF6B4A 100%);

  --bo-r-sm: 8px;
  --bo-r-md: 12px;
  --bo-r-lg: 16px;

  --bo-shadow-1: 0 1px 2px rgb(16 24 64 / .06);
  --bo-shadow-2: 0 8px 24px -6px rgb(16 24 64 / .16);

  --bo-sidebar-l: 260px;
  --bo-sidebar-mini-l: 68px;
  --bo-topbar-h: 58px;

  --bo-vite: 160ms ease-out;
  --bo-normal: 240ms ease-out;
}

[data-theme="dark"] {
  color-scheme: dark;

  --bo-bg: #0D1220;
  --bo-surface: #151B2C;
  --bo-surface-2: #1C2337;
  --bo-border: #262E45;
  --bo-border-strong: #39415C;
  --bo-text: #E8EBF4;
  --bo-text-2: #A7AFC4;
  --bo-text-3: #6E7690;

  --bo-marine: #0B1440;
  --bo-marine-2: #17225C;
  --bo-primary: #6B85F2;
  --bo-primary-hover: #8299F5;
  --bo-primary-soft: #1D2749;
  --bo-lagon: #22D3DE;
  --bo-corail: #FF7D5E;

  --bo-success: #34C08B; --bo-success-soft: #14301F;
  --bo-warning: #F2A93B; --bo-warning-soft: #33260F;
  --bo-danger:  #F0565C; --bo-danger-soft:  #391418;
  --bo-info:    #55A7FB; --bo-info-soft:    #12253D;

  --bo-shadow-1: 0 1px 2px rgb(0 0 0 / .35);
  --bo-shadow-2: 0 10px 28px -6px rgb(0 0 0 / .55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;

    --bo-bg: #0D1220;
    --bo-surface: #151B2C;
    --bo-surface-2: #1C2337;
    --bo-border: #262E45;
    --bo-border-strong: #39415C;
    --bo-text: #E8EBF4;
    --bo-text-2: #A7AFC4;
    --bo-text-3: #6E7690;

    --bo-marine: #0B1440;
    --bo-marine-2: #17225C;
    --bo-primary: #6B85F2;
    --bo-primary-hover: #8299F5;
    --bo-primary-soft: #1D2749;
    --bo-lagon: #22D3DE;
    --bo-corail: #FF7D5E;

    --bo-success: #34C08B; --bo-success-soft: #14301F;
    --bo-warning: #F2A93B; --bo-warning-soft: #33260F;
    --bo-danger:  #F0565C; --bo-danger-soft:  #391418;
    --bo-info:    #55A7FB; --bo-info-soft:    #12253D;

    --bo-shadow-1: 0 1px 2px rgb(0 0 0 / .35);
    --bo-shadow-2: 0 10px 28px -6px rgb(0 0 0 / .55);
  }
}

/* ----------------------------------------------------------- Reset & base */
*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body.bo-body {
  margin: 0;
  min-height: 100%;
  background: var(--bo-bg);
  color: var(--bo-text);
  font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms ease, color 200ms ease;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; }
h1 { font-size: 24px; letter-spacing: -0.01em; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0 0 8px; }
a { color: var(--bo-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--bo-text-2); }
strong { font-weight: 650; }

:focus-visible {
  outline: 2px solid var(--bo-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

::placeholder { color: var(--bo-text-3); }

.bo-skip {
  position: absolute; left: -9999px; top: 8px; z-index: 300;
  background: var(--bo-surface); color: var(--bo-text);
  padding: 8px 16px; border-radius: var(--bo-r-sm); box-shadow: var(--bo-shadow-2);
}
.bo-skip:focus { left: 8px; }

.bo-ico {
  width: 20px; height: 20px; flex: none;
  stroke-width: 2;
  vertical-align: -0.28em;
}

/* ----------------------------------------------------------- Layout app */
.bo-app { display: flex; min-height: 100vh; }

.bo-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bo-main {
  flex: 1;
  padding: 24px 32px 48px;
  max-width: 1440px;
  width: 100%;
}
@media (max-width: 768px) { .bo-main { padding: 16px 16px 40px; } }

/* ----------------------------------------------------------- Sidebar */
.bo-sidebar {
  width: var(--bo-sidebar-l);
  flex: none;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bo-marine-2) 0%, var(--bo-marine) 18%);
  color: rgb(255 255 255 / .72);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / .25) transparent;
  transition: width var(--bo-normal), transform var(--bo-normal);
  z-index: 60;
}

.bo-sidebar__brand {
  display: flex; flex-direction: column; gap: 0;
  padding: 20px 20px 14px;
  text-decoration: none;
}
.bo-sidebar__brand:hover { text-decoration: none; }
.bo-sidebar__logo {
  font-size: 26px; font-weight: 800; letter-spacing: 0.16em;
  color: #fff;
}
.bo-sidebar__sub {
  font-size: 11px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bo-lagon);
}

.bo-sidebar__search {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 14px 12px;
  padding: 0 10px;
  background: rgb(255 255 255 / .08);
  border: 1px solid rgb(255 255 255 / .10);
  border-radius: var(--bo-r-sm);
  transition: border-color var(--bo-vite), background var(--bo-vite);
}
.bo-sidebar__search:focus-within {
  background: rgb(255 255 255 / .12);
  border-color: var(--bo-lagon);
}
.bo-sidebar__search .bo-ico { color: rgb(255 255 255 / .5); width: 16px; height: 16px; }
.bo-sidebar__search-btn {
  display: inline-flex; align-items: center;
  background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer;
}
.bo-sidebar__search-btn:hover .bo-ico { color: var(--bo-lagon); }
.bo-sidebar__search-input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0;
  color: #fff; font: inherit; font-size: 13px;
  padding: 8px 0;
}
.bo-sidebar__search-input::placeholder { color: rgb(255 255 255 / .45); }

.bo-nav { flex: 1; padding: 4px 14px 16px; }

.bo-nav__section {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em;
  color: rgb(255 255 255 / .38);
  padding: 16px 10px 6px;
}

.bo-nav__item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0; background: none; cursor: pointer;
  border-radius: var(--bo-r-sm);
  color: rgb(255 255 255 / .72);
  font: inherit; font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  transition: background var(--bo-vite), color var(--bo-vite);
}
.bo-nav__item:hover { background: rgb(255 255 255 / .07); color: #fff; text-decoration: none; }
.bo-nav__item .bo-ico { width: 18px; height: 18px; opacity: .8; }
.bo-nav__item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.bo-nav__item .bo-badge { flex: none; }

.bo-nav__item.is-active {
  background: rgb(255 255 255 / .09);
  color: #fff;
  font-weight: 650;
}
.bo-nav__item.is-active::before {
  content: '';
  position: absolute; left: -14px; top: 15%;
  height: 70%; width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--bo-lagon);
}

.bo-nav__group summary { list-style: none; }
.bo-nav__group summary::-webkit-details-marker { display: none; }
.bo-nav__chev { width: 14px !important; height: 14px !important; transition: transform var(--bo-vite); }
.bo-nav__group[open] > summary .bo-nav__chev { transform: rotate(180deg); }
.bo-nav__item--sub { padding-left: 38px; font-size: 13px; }

.bo-sidebar__collapse {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 14px 14px;
  padding: 8px 10px;
  background: none; border: 1px solid rgb(255 255 255 / .12);
  border-radius: var(--bo-r-sm);
  color: rgb(255 255 255 / .6);
  font: inherit; font-size: 12.5px;
  cursor: pointer;
  transition: color var(--bo-vite), border-color var(--bo-vite);
}
.bo-sidebar__collapse:hover { color: #fff; border-color: rgb(255 255 255 / .3); }
.bo-sidebar__collapse .bo-ico { width: 16px; height: 16px; transition: transform var(--bo-normal); }

/* Sidebar repliée (desktop) */
@media (min-width: 993px) {
  .bo-sidebar-mini .bo-sidebar { width: var(--bo-sidebar-mini-l); }
  .bo-sidebar-mini .bo-sidebar__sub,
  .bo-sidebar-mini .bo-sidebar__search,
  .bo-sidebar-mini .bo-nav__section,
  .bo-sidebar-mini .bo-nav__item span,
  .bo-sidebar-mini .bo-nav__item .bo-badge,
  .bo-sidebar-mini .bo-nav__chev,
  .bo-sidebar-mini .bo-sidebar__collapse span { display: none; }
  .bo-sidebar-mini .bo-sidebar__logo { font-size: 15px; letter-spacing: 0.06em; }
  .bo-sidebar-mini .bo-sidebar__brand { padding: 18px 8px 10px; align-items: center; }
  .bo-sidebar-mini .bo-nav { padding: 4px 8px 12px; }
  .bo-sidebar-mini .bo-nav__item { justify-content: center; padding: 10px 8px; }
  .bo-sidebar-mini .bo-nav__item.is-active::before { left: -8px; }
  .bo-sidebar-mini .bo-sidebar__collapse { justify-content: center; }
  .bo-sidebar-mini .bo-sidebar__collapse .bo-ico { transform: rotate(180deg); }
}

/* Sidebar mobile off-canvas */
@media (max-width: 992px) {
  .bo-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--bo-shadow-2);
  }
  .bo-sidebar.is-open { transform: translateX(0); }
  .bo-overlay {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 55;
    background: rgb(9 14 30 / .55);
    backdrop-filter: blur(2px);
  }
  .bo-sidebar__collapse { display: none; }
}
@media (min-width: 993px) {
  .bo-topbar__burger { display: none !important; }
  .bo-overlay { display: none !important; }
}

/* ----------------------------------------------------------- Topbar */
.bo-topbar {
  display: flex; align-items: center; gap: 10px;
  height: var(--bo-topbar-h);
  padding: 0 20px;
  background: var(--bo-surface);
  border-bottom: 1px solid var(--bo-border);
  position: sticky; top: 0; z-index: 50;
}
.bo-topbar__spacer { flex: 1; }

.bo-ruban {
  height: 2px;
  background: var(--bo-ruban);
  position: sticky; top: var(--bo-topbar-h); z-index: 50;
}

.bo-topbar__palette {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--bo-surface-2);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r-sm);
  color: var(--bo-text-3);
  font: inherit; font-size: 13px;
  cursor: pointer;
  min-width: 200px;
  transition: border-color var(--bo-vite), color var(--bo-vite);
}
.bo-topbar__palette:hover { border-color: var(--bo-border-strong); color: var(--bo-text-2); }
.bo-topbar__palette .bo-ico { width: 15px; height: 15px; }
.bo-topbar__palette span { flex: 1; text-align: left; }
.bo-topbar__palette kbd,
.bo-palette kbd {
  font-family: inherit; font-size: 10.5px; font-weight: 600;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--bo-text-2);
}
@media (max-width: 768px) {
  .bo-topbar { padding: 0 10px; gap: 4px; }
  .bo-topbar__palette { min-width: 0; }
  .bo-topbar__palette span, .bo-topbar__palette kbd { display: none; }
  /* Agence : icône seule (le nom déborde en mobile → scroll horizontal de page) */
  .bo-topbar__agence { max-width: 44px; padding: 7px 8px; }
  .bo-topbar__agence span { display: none; }
}

.bo-topbar__agence {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--bo-r-sm);
  color: var(--bo-text);
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  max-width: 260px;
  transition: background var(--bo-vite);
}
.bo-topbar__agence:hover { background: var(--bo-surface-2); }
.bo-topbar__agence--fixe { cursor: default; }
.bo-topbar__agence--fixe:hover { background: none; }
.bo-topbar__agence .bo-ico { width: 17px; height: 17px; color: var(--bo-primary); }
.bo-topbar__agence span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bo-topbar__pastille {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bo-corail);
  color: #fff;
  font-size: 10.5px; font-weight: 700; line-height: 17px;
  text-align: center;
}

.bo-topbar__profil {
  border: 0; background: none; padding: 0; cursor: pointer;
  border-radius: 999px;
}
.bo-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 999px;
  background: var(--bo-primary-soft);
  color: var(--bo-primary);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.02em;
  transition: box-shadow var(--bo-vite);
}
.bo-topbar__profil:hover .bo-avatar { box-shadow: 0 0 0 3px var(--bo-primary-soft); }

/* Thème : n'afficher que l'icône opposée */
.bo-theme-moon { display: none; }
[data-theme="dark"] .bo-theme-moon { display: inline-block; }
[data-theme="dark"] .bo-theme-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .bo-theme-moon { display: inline-block; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .bo-theme-sun { display: none; }
}

/* ----------------------------------------------------------- Dropdown menus */
.bo-menu-wrap { position: relative; }
.bo-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 230px;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r-md);
  box-shadow: var(--bo-shadow-2);
  padding: 6px;
  z-index: 120;
  animation: bo-pop var(--bo-vite);
}
.bo-menu--droite { left: auto; right: 0; }
.bo-menu__titre {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bo-text-3);
  padding: 8px 10px 4px;
}
.bo-menu__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0; background: none; cursor: pointer;
  border-radius: var(--bo-r-sm);
  color: var(--bo-text);
  font: inherit; font-size: 13.5px;
  text-decoration: none;
  text-align: left;
  transition: background var(--bo-vite);
}
.bo-menu__item:hover { background: var(--bo-surface-2); text-decoration: none; }
.bo-menu__item .bo-ico { width: 16px; height: 16px; color: var(--bo-text-2); }
.bo-menu__item.is-active { font-weight: 650; color: var(--bo-primary); }
.bo-menu__item.is-active .bo-ico { color: var(--bo-primary); }
.bo-menu__item--danger { color: var(--bo-danger); }
.bo-menu__item--danger .bo-ico { color: var(--bo-danger); }
.bo-menu__item--danger:hover { background: var(--bo-danger-soft); }
.bo-menu__sep { height: 1px; margin: 6px 4px; background: var(--bo-border); }
.bo-menu__vide { padding: 10px; color: var(--bo-text-3); font-size: 13px; }

@keyframes bo-pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- Boutons */
.bo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px;
  border-radius: var(--bo-r-sm);
  border: 1px solid transparent;
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--bo-vite), border-color var(--bo-vite),
    color var(--bo-vite), box-shadow var(--bo-vite), transform var(--bo-vite);
  user-select: none;
}
.bo-btn:hover { text-decoration: none; }
.bo-btn:active { transform: translateY(1px); }
.bo-btn .bo-ico { width: 16px; height: 16px; }
.bo-btn[disabled], .bo-btn[aria-disabled="true"] {
  opacity: .5; pointer-events: none;
}

.bo-btn--primary {
  background: var(--bo-primary); color: #fff;
  box-shadow: var(--bo-shadow-1);
}
.bo-btn--primary:hover { background: var(--bo-primary-hover); }

.bo-btn--ghost {
  background: transparent;
  border-color: var(--bo-border-strong);
  color: var(--bo-text);
}
.bo-btn--ghost:hover { background: var(--bo-surface-2); }

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

.bo-btn--danger { background: var(--bo-danger); color: #fff; }
.bo-btn--danger:hover { filter: brightness(1.08); }
.bo-btn--danger-soft { background: var(--bo-danger-soft); color: var(--bo-danger); }
.bo-btn--danger-soft:hover { background: var(--bo-danger); color: #fff; }

.bo-btn--sm { padding: 5px 10px; font-size: 12.5px; }
.bo-btn--sm .bo-ico { width: 14px; height: 14px; }
.bo-btn--bloc { width: 100%; }
.bo-btn--icon { padding: 8px; position: relative; }
.bo-btn--icon.bo-btn--sm { padding: 5px; }

.bo-btn.is-charge { pointer-events: none; opacity: .7; }
.bo-btn.is-charge .bo-ico { animation: bo-spin 0.9s linear infinite; }
@keyframes bo-spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------- Badges */
.bo-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  line-height: 1.5;
  font-feature-settings: 'tnum';
}
.bo-badge--corail  { background: var(--bo-corail); color: #fff; }
.bo-badge--success { background: var(--bo-success-soft); color: var(--bo-success); }
.bo-badge--warning { background: var(--bo-warning-soft); color: var(--bo-warning); }
.bo-badge--danger  { background: var(--bo-danger-soft); color: var(--bo-danger); }
.bo-badge--info    { background: var(--bo-info-soft); color: var(--bo-info); }
.bo-badge--neutral { background: var(--bo-surface-2); color: var(--bo-text-2); }

/* ----------------------------------------------------------- Cartes */
.bo-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r-md);
  box-shadow: var(--bo-shadow-1);
  margin-bottom: 20px;
}
.bo-card__header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--bo-border);
}
.bo-card__header h2 { font-size: 15.5px; font-weight: 650; }
.bo-card__actions { display: flex; align-items: center; gap: 8px; }
.bo-card__body { padding: 20px; }
.bo-card__body > :last-child { margin-bottom: 0; }
.bo-card__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--bo-border);
  display: flex; align-items: center; gap: 8px;
}

/* ----------------------------------------------------------- Page header */
.bo-page-header { margin-bottom: 20px; }
.bo-crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  color: var(--bo-text-3);
  margin-bottom: 6px;
}
.bo-crumbs a { color: var(--bo-text-3); }
.bo-crumbs a:hover { color: var(--bo-primary); text-decoration: none; }
.bo-crumbs__sep { opacity: .6; }
.bo-page-header__ligne {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.bo-page-header__sous { color: var(--bo-text-2); margin: 4px 0 0; font-size: 13.5px; }
.bo-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ----------------------------------------------------------- Grilles & stats */
.bo-grille { display: grid; gap: 16px; margin-bottom: 20px; }
.bo-grille--stats { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.bo-grille--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.bo-stat {
  position: relative;
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 20px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r-md);
  box-shadow: var(--bo-shadow-1);
  color: var(--bo-text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color var(--bo-vite), transform var(--bo-vite), box-shadow var(--bo-vite);
}
a.bo-stat:hover {
  text-decoration: none;
  border-color: var(--bo-primary);
  transform: translateY(-2px);
  box-shadow: var(--bo-shadow-2);
}
.bo-stat__ico {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bo-primary-soft);
  color: var(--bo-primary);
}
.bo-stat__ico .bo-ico { width: 18px; height: 18px; }
.bo-stat__valeur {
  font-size: 32px; font-weight: 700; letter-spacing: -0.02em;
  font-feature-settings: 'tnum';
}
.bo-stat__libelle { color: var(--bo-text-2); font-size: 13px; padding-right: 40px; }
.bo-stat__delta { color: var(--bo-text-3); font-size: 12px; }

.bo-raccourcis { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------- Alertes inline */
.bo-alerte {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--bo-r-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
}
.bo-alerte .bo-ico { width: 17px; height: 17px; margin-top: 1px; }
.bo-alerte--danger  { background: var(--bo-danger-soft); color: var(--bo-danger); }
.bo-alerte--success { background: var(--bo-success-soft); color: var(--bo-success); }
.bo-alerte--warning { background: var(--bo-warning-soft); color: var(--bo-warning); }
.bo-alerte--info    { background: var(--bo-info-soft); color: var(--bo-info); }

/* ----------------------------------------------------------- Champs */
.bo-field { margin-bottom: 16px; min-width: 0; }
.bo-field__label {
  display: block;
  font-size: 13px; font-weight: 600;
  margin-bottom: 6px;
  color: var(--bo-text);
}
.bo-field__req { color: var(--bo-corail); }
.bo-field__help { font-size: 12.5px; color: var(--bo-text-3); margin: 5px 0 0; }
.bo-field__error { font-size: 12.5px; color: var(--bo-danger); margin: 5px 0 0; font-weight: 600; }

.bo-input, .bo-textarea, .bo-select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border-strong);
  border-radius: var(--bo-r-sm);
  color: var(--bo-text);
  font: inherit; font-size: 14px;
  transition: border-color var(--bo-vite), box-shadow var(--bo-vite);
}
.bo-input:hover, .bo-textarea:hover, .bo-select:hover { border-color: var(--bo-text-3); }
.bo-input:focus, .bo-textarea:focus, .bo-select:focus {
  outline: none;
  border-color: var(--bo-primary);
  box-shadow: 0 0 0 3px var(--bo-primary-soft);
}
.bo-field--erreur .bo-input, .bo-field--erreur .bo-textarea, .bo-field--erreur .bo-select {
  border-color: var(--bo-danger);
}
.bo-field--erreur .bo-input:focus { box-shadow: 0 0 0 3px var(--bo-danger-soft); }
.bo-input--sm { padding: 6px 10px; font-size: 13px; }
.bo-textarea { resize: vertical; min-height: 80px; }
.bo-select { appearance: auto; }

.bo-input-groupe { display: flex; align-items: stretch; }
.bo-input-groupe .bo-input { border-radius: var(--bo-r-sm) 0 0 var(--bo-r-sm); }
.bo-input-groupe__unite {
  display: inline-flex; align-items: center;
  padding: 0 12px;
  background: var(--bo-surface-2);
  border: 1px solid var(--bo-border-strong);
  border-left: 0;
  border-radius: 0 var(--bo-r-sm) var(--bo-r-sm) 0;
  color: var(--bo-text-2);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
}

/* Switch */
.bo-switch {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer;
  padding: 6px 0;
}
.bo-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.bo-switch__piste {
  flex: none;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: var(--bo-border-strong);
  position: relative;
  transition: background var(--bo-vite);
  margin-top: 1px;
}
.bo-switch__piste::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / .3);
  transition: transform var(--bo-vite);
}
.bo-switch input:checked + .bo-switch__piste { background: var(--bo-success); }
.bo-switch input:checked + .bo-switch__piste::after { transform: translateX(16px); }
.bo-switch input:focus-visible + .bo-switch__piste { outline: 2px solid var(--bo-primary); outline-offset: 2px; }
.bo-switch__texte { font-size: 13.5px; }
.bo-switch__texte small { display: block; color: var(--bo-text-3); font-size: 12.5px; }

.bo-form-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }

/* ----------------------------------------------------------- Tables */
.bo-table-card { padding: 0; overflow: hidden; }
.bo-table-card__outils {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bo-border);
  flex-wrap: wrap;
}
.bo-table-card__recherche {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 200px; max-width: 340px;
}
.bo-table-card__recherche .bo-ico { color: var(--bo-text-3); width: 16px; height: 16px; }
.bo-table-card__outils-droite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.bo-table-scroll { overflow-x: auto; }
.bo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.bo-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bo-surface-2);
  color: var(--bo-text-2);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  position: sticky; top: 0;
}
.bo-table td {
  padding: 11px 14px;
  border-top: 1px solid var(--bo-border);
  vertical-align: middle;
  font-feature-settings: 'tnum';
}
.bo-table tbody tr { transition: background var(--bo-vite); }
.bo-table tbody tr:hover { background: var(--bo-surface-2); }
.bo-table__droite { text-align: right !important; }
.bo-table__actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 4px;
  opacity: .55;
  transition: opacity var(--bo-vite);
}
.bo-table tbody tr:hover .bo-table__actions { opacity: 1; }

.bo-table__tri {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; color: inherit;
  text-transform: inherit; letter-spacing: inherit; font-weight: inherit;
}
.bo-table__tri-ico { width: 13px !important; height: 13px !important; opacity: .6; }
th[data-sort-actif] .bo-table__tri { color: var(--bo-primary); }
th[data-sort-actif="desc"] .bo-table__tri-ico { transform: scaleY(-1); }

.bo-table__ligne-lien { cursor: pointer; }

.bo-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--bo-border);
  flex-wrap: wrap;
}
.bo-pagination__total { color: var(--bo-text-2); font-size: 13px; }
.bo-pagination__pages { display: flex; align-items: center; gap: 4px; }
.bo-pagination__points { color: var(--bo-text-3); padding: 0 4px; }
.bo-pagination a[aria-disabled="true"] { opacity: .4; pointer-events: none; }

/* ----------------------------------------------------------- Tabs */
.bo-tabs {
  display: flex; gap: 2px;
  flex-wrap: wrap; /* fenêtre étroite : passage à la ligne — jamais d'onglet hors champ (la scrollbar est masquée) */
  border-bottom: 2px solid var(--bo-border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none; /* flèches/barre parasites Windows */
}
.bo-tabs::-webkit-scrollbar { display: none; }
.bo-tabs__onglet {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--bo-text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color var(--bo-vite), border-color var(--bo-vite);
}
.bo-tabs__onglet:hover { color: var(--bo-text); }
.bo-tabs__onglet.is-active { color: var(--bo-primary); border-bottom-color: var(--bo-primary); }
.bo-tabs__etat { width: 7px; height: 7px; border-radius: 999px; }
.bo-tabs__etat--ok { background: var(--bo-success); }
.bo-tabs__etat--warn { background: var(--bo-warning); }
.bo-tab-panneau[hidden] { display: none; }

/* ----------------------------------------------------------- Toasts */
.bo-toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 250;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(400px, calc(100vw - 40px));
}
.bo-toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 14px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-left: 4px solid var(--bo-info);
  border-radius: var(--bo-r-sm);
  box-shadow: var(--bo-shadow-2);
  font-size: 13.5px;
  animation: bo-toast-in var(--bo-normal);
}
.bo-toast--success { border-left-color: var(--bo-success); }
.bo-toast--success .bo-toast__ico { color: var(--bo-success); }
.bo-toast--danger { border-left-color: var(--bo-danger); }
.bo-toast--danger .bo-toast__ico { color: var(--bo-danger); }
.bo-toast--warning { border-left-color: var(--bo-warning); }
.bo-toast--warning .bo-toast__ico { color: var(--bo-warning); }
.bo-toast--info .bo-toast__ico { color: var(--bo-info); }
.bo-toast__ico { flex: none; margin-top: 1px; }
.bo-toast__ico .bo-ico { width: 17px; height: 17px; }
.bo-toast__texte { flex: 1; }
.bo-toast__fermer {
  flex: none;
  border: 0; background: none; padding: 2px; cursor: pointer;
  color: var(--bo-text-3);
  border-radius: 4px;
}
.bo-toast__fermer:hover { color: var(--bo-text); }
.bo-toast__fermer .bo-ico { width: 14px; height: 14px; }
.bo-toast.is-sortie { animation: bo-toast-out var(--bo-vite) forwards; }
@keyframes bo-toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes bo-toast-out {
  to { opacity: 0; transform: translateX(24px); }
}

/* ----------------------------------------------------------- Dialog */
.bo-dialog {
  border: 0;
  border-radius: var(--bo-r-lg);
  background: var(--bo-surface);
  color: var(--bo-text);
  box-shadow: var(--bo-shadow-2);
  padding: 0;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
}
.bo-dialog--large { width: min(720px, calc(100vw - 32px)); }
.bo-dialog::backdrop {
  background: rgb(9 14 30 / .55);
  backdrop-filter: blur(2px);
}
.bo-dialog[open] { animation: bo-dialog-in var(--bo-normal); }
@keyframes bo-dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.bo-dialog__header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 18px 22px 0;
}
.bo-dialog__header h2 { font-size: 17px; }
.bo-dialog__body { padding: 12px 22px 20px; color: var(--bo-text-2); font-size: 14px; }
.bo-dialog__body > :last-child { margin-bottom: 0; }
.bo-dialog__footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 0 22px 20px;
}
.bo-dialog--danger .bo-dialog__header h2 { color: var(--bo-danger); }

/* Compat <dialog> non supporté (Safari < 15.4 — ex. Safari 13.1 / macOS 10.13) :
   l'élément est inconnu du navigateur, donc rien ne masque un dialog fermé ni
   ne centre un dialog ouvert. bo.compatDialog (admin.js) greffe showModal/close
   et pose .bo-dialog--compat + le voile. Sans effet sur navigateur moderne
   (dialog fermé déjà masqué par le UA, .bo-dialog--compat jamais posée). */
dialog:not([open]) { display: none; }
.bo-dialog-voile { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 400; background: rgb(9 14 30 / .55); }
dialog.bo-dialog--compat[open] {
  display: block;
  position: fixed; top: 10vh; left: 0; right: 0;
  margin: 0 auto;
  max-height: 80vh;
  overflow: auto;
  z-index: 401;
}

/* ----------------------------------------------------------- Empty & skeleton */
.bo-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
  padding: 40px 20px;
  color: var(--bo-text-2);
}
.bo-empty__ico {
  width: 44px !important; height: 44px !important;
  color: var(--bo-text-3);
  stroke-width: 1.4 !important;
  margin-bottom: 4px;
}
.bo-empty h1, .bo-empty h3 { color: var(--bo-text); }
.bo-empty .bo-btn { margin-top: 10px; }
.bo-empty--page { padding: 90px 20px; }

.bo-skeleton {
  border-radius: var(--bo-r-sm);
  background: linear-gradient(90deg, var(--bo-surface-2) 25%, var(--bo-border) 50%, var(--bo-surface-2) 75%);
  background-size: 200% 100%;
  animation: bo-skeleton 1.4s infinite;
  min-height: 16px;
}
@keyframes bo-skeleton {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ----------------------------------------------------------- Progress */
.bo-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--bo-surface-2);
  overflow: hidden;
}
.bo-progress__barre {
  height: 100%;
  border-radius: 999px;
  background: var(--bo-ruban);
  transition: width var(--bo-normal);
}

/* ----------------------------------------------------------- Dropzone & médias */
.bo-dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 36px 20px;
  border: 2px dashed var(--bo-border-strong);
  border-radius: var(--bo-r-md);
  color: var(--bo-text-2);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--bo-vite), background var(--bo-vite);
}
.bo-dropzone:hover, .bo-dropzone.is-survol {
  border-color: var(--bo-lagon);
  background: color-mix(in srgb, var(--bo-lagon) 6%, transparent);
}
.bo-dropzone .bo-ico { width: 30px; height: 30px; color: var(--bo-text-3); }

.bo-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.bo-media {
  position: relative;
  border-radius: var(--bo-r-sm);
  overflow: hidden;
  border: 1px solid var(--bo-border);
  background: var(--bo-surface-2);
  aspect-ratio: 4 / 3;
}
.bo-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bo-media__actions {
  /* Longhands (pas `inset`) : Safari 13.1 (macOS 10.13, parc agences) ignore
     inset → barre clippée sous la vignette (overflow hidden) = médias ni
     supprimables ni réordonnables (OFIM-9999). */
  position: absolute; right: 0; bottom: 0; left: 0;
  display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap;
  padding: 6px;
  background: linear-gradient(transparent, rgb(9 14 30 / .65));
  opacity: 0;
  transition: opacity var(--bo-vite);
}
.bo-media:hover .bo-media__actions,
.bo-media:focus-within .bo-media__actions { opacity: 1; }
.bo-media__poignee { cursor: grab; }
.bo-media.sortable-ghost { opacity: .4; }

/* ----------------------------------------------------------- Palette (Ctrl+K) */
.bo-palette {
  border: 0;
  border-radius: var(--bo-r-lg);
  background: var(--bo-surface);
  color: var(--bo-text);
  box-shadow: var(--bo-shadow-2);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  margin-top: 10vh;
}
.bo-palette::backdrop { background: rgb(9 14 30 / .5); backdrop-filter: blur(2px); }
.bo-palette__champ {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--bo-border);
}
.bo-palette__champ .bo-ico { color: var(--bo-text-3); }
.bo-palette__champ input {
  flex: 1;
  border: 0; background: none; outline: 0;
  font: inherit; font-size: 15px;
  color: var(--bo-text);
}
.bo-palette__resultats { max-height: 46vh; overflow-y: auto; padding: 8px; }
.bo-palette__groupe {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bo-text-3);
  padding: 10px 10px 4px;
}
.bo-palette__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0; background: none; cursor: pointer;
  border-radius: var(--bo-r-sm);
  color: var(--bo-text);
  font: inherit; font-size: 14px;
  text-align: left;
  text-decoration: none;
}
.bo-palette__item .bo-ico { width: 16px; height: 16px; color: var(--bo-text-2); }
.bo-palette__item.is-actif, .bo-palette__item:hover {
  background: var(--bo-primary-soft);
  color: var(--bo-primary);
  text-decoration: none;
}
.bo-palette__vide { padding: 24px; text-align: center; color: var(--bo-text-3); }

/* ----------------------------------------------------------- Login */
.bo-body--login {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--bo-lagon) 14%, transparent), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, color-mix(in srgb, var(--bo-corail) 10%, transparent), transparent 55%),
    var(--bo-marine);
}
.bo-login { width: 100%; display: flex; justify-content: center; padding: 24px; }
.bo-login__ruban {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--bo-ruban);
}
.bo-login__carte {
  width: min(400px, 100%);
  background: var(--bo-surface);
  border-radius: var(--bo-r-lg);
  box-shadow: var(--bo-shadow-2);
  padding: 36px 34px 26px;
  animation: bo-dialog-in 360ms ease-out;
}
.bo-login__marque { display: flex; flex-direction: column; margin-bottom: 22px; }
.bo-login__logo {
  font-size: 30px; font-weight: 800; letter-spacing: 0.16em;
  color: var(--bo-marine);
}
[data-theme="dark"] .bo-login__logo { color: #fff; }
.bo-login__sous {
  font-size: 11px; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bo-lagon);
}
.bo-login__titre { font-size: 17px; font-weight: 650; margin-bottom: 18px; color: var(--bo-text-2); }
.bo-login__form .bo-btn { margin-top: 6px; }
.bo-login__aide {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--bo-text-3);
  text-align: center;
}

/* --------------------------------------------- Compléments demandés (Lot 1) */
.bo-card__footer--droite { justify-content: flex-end; }

.bo-infos { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.bo-infos__ligne { display: flex; gap: 12px; font-size: 13.5px; }
.bo-infos__ligne dt { flex: none; width: 160px; color: var(--bo-text-3); }
.bo-infos__ligne dd { margin: 0; color: var(--bo-text); }

.bo-avatar--lg { width: 52px; height: 52px; font-size: 18px; }

.bo-switch:has(input:disabled) { opacity: .55; cursor: default; }
.bo-switch:has(input:disabled) .bo-switch__piste { cursor: default; }

.bo-note { font-size: 12.5px; color: var(--bo-text-3); margin: 10px 0 0; }
.bo-texte-aide { font-size: 12.5px; color: var(--bo-text-3); }

.bo-badge--sm { padding: 1px 6px; font-size: 10.5px; }

a.bo-tabs__onglet:hover { text-decoration: none; }

.bo-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bo-dialog__section {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bo-text-2);
  margin: 16px 0 8px;
}
.bo-dialog__body .bo-dialog__section:first-child { margin-top: 0; }

input[type="file"].bo-input::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--bo-r-sm);
  background: var(--bo-primary-soft);
  color: var(--bo-primary);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
}
input[type="file"].bo-input::file-selector-button:hover {
  background: var(--bo-primary);
  color: #fff;
}

.bo-table__vignette {
  width: 56px;
  flex: none; /* flex item dans .bo-flex : sans ça la vignette est comprimée par le texte */
  aspect-ratio: 4 / 3;
  border-radius: var(--bo-r-sm);
  overflow: hidden;
  background: var(--bo-surface-2);
  display: block;
}
.bo-table__vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bo-graphe { position: relative; height: 320px; }

.bo-grille--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.bo-mail-apercu {
  width: 100%;
  height: 60vh;
  border: 0;
  border-radius: var(--bo-r-sm);
  background: #fff;
}

/* --------------------------------------------- Compléments demandés (Lot 2) */
.bo-btn--success { background: var(--bo-success); color: #fff; }
.bo-btn--success:hover { filter: brightness(1.08); }

.bo-search-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.bo-search-filtres { position: sticky; top: calc(var(--bo-topbar-h) + 18px); }
@media (max-width: 1100px) {
  .bo-search-layout { grid-template-columns: 1fr; }
  .bo-search-filtres { position: static; }
}

.bo-of-hero__prix { font-size: 24px; font-weight: 700; font-feature-settings: 'tnum'; }
.bo-of-hero__type { font-size: 16px; font-weight: 600; }
.bo-of-paires th {
  width: 320px;
  color: var(--bo-text-2);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13.5px;
  background: none;
  position: static;
}

.bo-carte { height: 380px; border-radius: var(--bo-r-md); overflow: hidden; }

button.bo-media {
  border: 1px solid var(--bo-border);
  padding: 0;
  background: var(--bo-surface-2);
  cursor: zoom-in;
  display: block;
  width: 100%;
}
.bo-of-video video, .bo-media--video video { width: 100%; border-radius: var(--bo-r-sm); display: block; }
.bo-dialog__body img { max-width: 100%; height: auto; }
.bo-media__legende { font-size: 12px; color: var(--bo-text-3); margin-top: 4px; }

.bo-input[disabled], .bo-textarea[disabled], .bo-select[disabled] {
  background: var(--bo-surface-2);
  color: var(--bo-text-2);
  cursor: not-allowed;
  opacity: 1;
}

/* --------------------------------------------- Compléments demandés (Lot 3) */
.bo-editeur { display: flex; gap: 20px; align-items: flex-start; }
.bo-editeur > :first-child { flex: 1; min-width: 0; }
.bo-editeur__aside {
  flex: none;
  width: 340px;
  position: sticky;
  top: calc(var(--bo-topbar-h) + 18px);
}
@media (max-width: 1200px) {
  .bo-editeur { flex-direction: column; }
  .bo-editeur__aside { width: 100%; position: static; }
}
.bo-editeur__aside .bo-btn--bloc { margin-bottom: 8px; }

.bo-radio-groupe { display: flex; gap: 16px; flex-wrap: wrap; padding: 4px 0; }
.bo-radio-groupe label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13.5px; }

.bo-form-section {
  font-size: 13px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bo-text-2);
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--bo-border);
}
.bo-form-section:first-child { margin-top: 0; }

.bo-alerte ul { margin: 6px 0 0; padding-left: 18px; }
.bo-alerte li { margin: 2px 0; }

.bo-upload-ligne {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  font-size: 13px;
}
.bo-upload-ligne__nom {
  flex: none; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bo-upload-ligne .bo-progress { flex: 1; }
.bo-upload-ligne__pct { flex: none; width: 42px; text-align: right; font-feature-settings: 'tnum'; color: var(--bo-text-2); }

.bo-autosave { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--bo-text-3); }
.bo-autosave::before {
  content: '';
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--bo-success);
}
.bo-autosave.is-dirty { color: var(--bo-text-2); }
.bo-autosave.is-dirty::before { background: var(--bo-corail); }

.bo-blog-media-vignette { border-radius: var(--bo-r-sm); overflow: hidden; background: var(--bo-surface-2); }
.bo-blog-media-vignette img, .bo-blog-media-vignette video { width: 100%; display: block; }
.bo-blog-media-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }

/* Thème Quill 2 raccordé aux tokens (light + dark) */
.bo-quill .ql-toolbar.ql-snow {
  border: 1px solid var(--bo-border-strong);
  border-radius: var(--bo-r-sm) var(--bo-r-sm) 0 0;
  background: var(--bo-surface-2);
  font-family: inherit;
}
.bo-quill .ql-container.ql-snow {
  border: 1px solid var(--bo-border-strong);
  border-top: 0;
  border-radius: 0 0 var(--bo-r-sm) var(--bo-r-sm);
  background: var(--bo-surface);
  color: var(--bo-text);
  font-family: inherit;
  font-size: 14px;
  min-height: 300px;
}
.bo-quill .ql-editor { min-height: 300px; }
.bo-quill .ql-editor.ql-blank::before { color: var(--bo-text-3); font-style: normal; }
.bo-quill .ql-snow .ql-stroke { stroke: var(--bo-text-2); }
.bo-quill .ql-snow .ql-fill { fill: var(--bo-text-2); }
.bo-quill .ql-snow .ql-picker { color: var(--bo-text-2); }
.bo-quill .ql-snow .ql-picker-options {
  background: var(--bo-surface);
  border-color: var(--bo-border) !important;
  border-radius: var(--bo-r-sm);
  box-shadow: var(--bo-shadow-2);
}
.bo-quill .ql-snow.ql-toolbar button:hover .ql-stroke,
.bo-quill .ql-snow.ql-toolbar button.ql-active .ql-stroke,
.bo-quill .ql-snow .ql-picker-label:hover .ql-stroke { stroke: var(--bo-primary); }
.bo-quill .ql-snow.ql-toolbar button:hover .ql-fill,
.bo-quill .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--bo-primary); }
.bo-quill .ql-snow .ql-picker-label:hover,
.bo-quill .ql-snow .ql-picker-item:hover,
.bo-quill .ql-snow .ql-picker-label.ql-active { color: var(--bo-primary); }
.bo-quill .ql-snow .ql-tooltip {
  background: var(--bo-surface);
  border-color: var(--bo-border);
  box-shadow: var(--bo-shadow-2);
  color: var(--bo-text);
  border-radius: var(--bo-r-sm);
}
.bo-quill .ql-snow .ql-tooltip input[type=text] {
  background: var(--bo-surface);
  border-color: var(--bo-border-strong);
  color: var(--bo-text);
}

/* --------------------------------------------- Compléments demandés (Lot 4) */
[data-us-section] { margin-top: 24px; }
[data-us-societe] { margin-left: 16px; }

/* ----------------------------------------------------------- Combo (select riche) */
.bo-combo { position: relative; }
.bo-combo__natif {
  position: absolute !important;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0; padding: 0; border: 0;
}
.bo-combo__controle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 6px 12px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border-strong);
  border-radius: var(--bo-r-sm);
  color: var(--bo-text);
  font: inherit; font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--bo-vite), box-shadow var(--bo-vite);
}
.bo-combo__controle:hover { border-color: var(--bo-text-3); }
.bo-combo__controle:focus-visible {
  outline: none;
  border-color: var(--bo-primary);
  box-shadow: 0 0 0 3px var(--bo-primary-soft);
}
.bo-combo__placeholder { color: var(--bo-text-3); }
.bo-combo__chev { width: 15px !important; height: 15px !important; color: var(--bo-text-3); flex: none; }
.bo-combo__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.bo-combo__tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  background: var(--bo-primary-soft);
  color: var(--bo-primary);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
}
.bo-combo__tag .bo-ico { width: 12px; height: 12px; }
.bo-combo__tag:hover { background: var(--bo-danger-soft); color: var(--bo-danger); }
.bo-combo__panneau {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  z-index: 130;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r-md);
  box-shadow: var(--bo-shadow-2);
  animation: bo-pop var(--bo-vite);
}
.bo-combo__recherche {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bo-border);
}
.bo-combo__recherche .bo-ico { width: 15px; height: 15px; color: var(--bo-text-3); }
.bo-combo__recherche input {
  flex: 1; border: 0; background: none; outline: 0;
  font: inherit; font-size: 13.5px;
  color: var(--bo-text);
}
.bo-combo__options { max-height: 260px; overflow-y: auto; padding: 6px; }
.bo-combo__option {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0; background: none; cursor: pointer;
  border-radius: var(--bo-r-sm);
  color: var(--bo-text);
  font: inherit; font-size: 13.5px;
  text-align: left;
}
.bo-combo__option:hover, .bo-combo__option.is-actif { background: var(--bo-surface-2); }
.bo-combo__option.is-coche { color: var(--bo-primary); font-weight: 600; }
.bo-combo__coche { width: 16px; flex: none; display: inline-flex; }
.bo-combo__coche .bo-ico { width: 14px; height: 14px; }
.bo-combo__vide { padding: 14px; text-align: center; color: var(--bo-text-3); font-size: 13px; }

/* ----------------------------------------------------------- Utilitaires */
.bo-mono {
  font-family: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
  font-size: 12.5px;
  font-feature-settings: 'tnum';
}
.bo-texte-2 { color: var(--bo-text-2); }
.bo-texte-3 { color: var(--bo-text-3); }
.bo-nowrap { white-space: nowrap; }
.bo-droite { text-align: right; }
.bo-flex { display: flex; align-items: center; gap: 8px; }
.bo-flex-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bo-spacer { flex: 1; }
.bo-mb-0 { margin-bottom: 0 !important; }
.bo-sep-v { width: 1px; height: 22px; background: var(--bo-border); }

/* Grille quotas Leboncoin (page=annoncesLeboncoin) */
.bo-lbc-ligne-total { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.bo-lbc-ligne-total .bo-field__label { min-width: 110px; margin: 0; }
.bo-lbc-total-input { max-width: 110px; }
.bo-lbc-cellule { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; flex-wrap: wrap; }
.bo-lbc-quota-input { max-width: 84px; }
.bo-input[aria-invalid="true"] { border-color: var(--bo-danger); }

/* Vue en transition (pjax) ET soumission de formulaire en cours (admin.js) */
.bo-main.is-chargement { opacity: .55; pointer-events: none; transition: opacity 120ms ease; }

/* Bandeau « envoi en cours » : la sidebar et la topbar restent cliquables (seul
   .bo-main est grisé), et le bandeau lui-même n'intercepte aucun clic. */
.bo-envoi {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 260; pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-r-sm);
  box-shadow: var(--bo-shadow-2);
  font-size: 13.5px;
}
.bo-envoi__rond {
  flex: none; width: 15px; height: 15px;
  border: 2px solid var(--bo-border);
  border-top-color: var(--bo-primary);
  border-radius: 50%;
  animation: bo-envoi-tourne 700ms linear infinite;
}
@keyframes bo-envoi-tourne { to { transform: rotate(360deg); } }

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