/**
 * Bien-Maintenir — Dashboard layout & design system
 * Complète bf-theme.css (charte bien-fonde)
 */
:root {
  --sidebar-rail: 64px;
  --sidebar-expanded: 240px;
  --sidebar-current: var(--sidebar-expanded);
  --surface: var(--bf-white);
  --surface-muted: var(--bf-light-gray);
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.06);
  --shadow-md: 0 4px 16px rgba(17, 17, 17, 0.08);
  --content-max: 1280px;
  --space-xs: 0.4rem;
  --space-sm: 0.8rem;
  --space-md: 1.2rem;
  --space-lg: 1.6rem;
  --space-xl: 2rem;
  --space-2xl: 2.4rem;
  --bf-danger: #c62828;
  --bf-warn-bg: #fff8e6;
  --bf-warn-text: #8a4b00;
}

@media (prefers-reduced-motion: reduce) {
  .bm-sidebar,
  .bm-main,
  .bm-nav-item,
  .bm-site-card,
  .bm-sidebar-collapse {
    transition: none !important;
  }
}

/* ——— Shell ——— */
.bm-app.bm-shell {
  display: flex;
  min-height: 100vh;
  --sidebar-current: var(--sidebar-expanded);
}

.bm-shell:has(.bm-sidebar.is-rail) {
  --sidebar-current: var(--sidebar-rail);
}

.bm-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 200;
  width: var(--sidebar-current);
  min-width: var(--sidebar-current);
  height: 100vh;
  background: var(--bf-black-2);
  color: var(--bf-white);
  display: flex;
  flex-direction: column;
  transform: none !important;
  transition: width 0.25s var(--bf-ease-menu), min-width 0.25s var(--bf-ease-menu);
  border-right: 1px solid #000;
  overflow: hidden;
}

.bm-sidebar.is-rail {
  --sidebar-current: var(--sidebar-rail);
}

.bm-sidebar.is-expanded {
  --sidebar-current: var(--sidebar-expanded);
}

.bm-sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: var(--sidebar-expanded);
  min-width: var(--sidebar-expanded);
}

.bm-sidebar.is-rail .bm-sidebar__inner {
  width: var(--sidebar-expanded);
}

.bm-sidebar__brand {
  padding: 1.5rem 1.2rem 1.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  flex-shrink: 0;
}

.bm-shell .bm-sidebar__brand::after {
  top: 1.4rem;
  height: 40px;
}

.bm-sidebar__brand-link {
  gap: 0.9rem;
}

.bm-sidebar__brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.bm-shell .bm-sidebar__brand strong {
  font-size: 1.45rem;
  line-height: 1.15;
}

.bm-shell .bm-sidebar__brand small {
  font-size: 0.95rem;
  margin-top: 0;
  letter-spacing: 0.14em;
}

.bm-sidebar__brand-link span {
  opacity: 1;
  transition: opacity 0.2s;
}

.bm-sidebar.is-rail .bm-sidebar__brand-link span {
  opacity: 0;
  width: 0;
  overflow: hidden;
  display: inline-block;
}

.bm-sidebar__site {
  padding: 1rem 1.2rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--bf-yellow);
  flex-shrink: 0;
}

.bm-sidebar__site-label {
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

.bm-sidebar__site-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.bm-sidebar__site-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.bm-sidebar__site-project {
  font-family: var(--bf-font-ui);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.62);
  word-break: break-word;
}

.bm-sidebar__site-env {
  font-family: var(--bf-font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bf-white);
}

.bm-sidebar__site-card .bm-site-icon--sm {
  width: 24px;
  height: 24px;
  margin-top: 0.1rem;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.bm-sidebar__site-name {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.bm-sidebar.is-rail .bm-sidebar__site-text {
  display: none;
}

.bm-sidebar.is-rail .bm-sidebar__site {
  padding: 0.8rem;
  text-align: center;
  border-left: none;
}

.bm-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.8rem 0.6rem;
}

.bm-sidebar-collapse {
  position: fixed;
  z-index: 210;
  top: 1.45rem;
  left: calc(var(--sidebar-current) - 13px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--bf-gray-stroke);
  border-radius: 50%;
  background: var(--surface);
  color: var(--bf-dark-gray);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    left 0.25s var(--bf-ease-menu),
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}

.bm-sidebar-collapse:hover {
  background: var(--bf-yellow);
  color: var(--bf-black);
  border-color: var(--bf-black);
  box-shadow: var(--shadow-md);
}

.bm-sidebar-collapse[data-tooltip]:hover::after,
.bm-sidebar-collapse[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: fixed;
  left: calc(var(--sidebar-current) + 18px);
  top: 1.45rem;
  transform: translateY(0);
  background: var(--bf-black);
  color: var(--bf-white);
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  font-family: var(--bf-font-ui);
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 300;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

/* Nav items — spécificité > .bm-nav a (bf-theme) pour garder flex inline */
.bm-sidebar__nav .bm-nav-item,
.bm-nav a.bm-nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.2rem;
  padding: 0.85rem 1.2rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-md);
  border-left: none;
  color: var(--bf-gray);
  font-family: var(--bf-font-ui);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  transition: background 0.15s, color 0.15s;
  position: relative;
  white-space: nowrap;
}

.bm-sidebar__nav .bm-nav-item:hover,
.bm-nav a.bm-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--bf-white);
  opacity: 1;
}

.bm-sidebar__nav .bm-nav-item.router-link-active,
.bm-nav a.bm-nav-item.router-link-active {
  background: rgba(255, 240, 0, 0.12);
  color: var(--bf-yellow);
  border-left-color: transparent;
}

.bm-sidebar__nav .bm-nav-item.router-link-active::before,
.bm-nav a.bm-nav-item.router-link-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3rem;
  bottom: 0.3rem;
  width: 3px;
  background: var(--bf-yellow);
  border-radius: 0 2px 2px 0;
}

.bm-sidebar__nav .bm-nav-item__icon,
.bm-nav a.bm-nav-item .bm-nav-item__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.bm-sidebar__nav .bm-nav-item__label,
.bm-nav a.bm-nav-item .bm-nav-item__label {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.bm-sidebar.is-rail .bm-sidebar__nav .bm-nav-item,
.bm-sidebar.is-rail .bm-nav a.bm-nav-item {
  justify-content: center;
  padding: 0.75rem;
}

.bm-sidebar.is-rail .bm-sidebar__nav .bm-nav-item__label,
.bm-sidebar.is-rail .bm-nav a.bm-nav-item .bm-nav-item__label {
  display: none;
}

.bm-sidebar.is-rail .bm-sidebar__nav .bm-nav-item[data-tooltip]:hover::after,
.bm-sidebar.is-rail .bm-nav a.bm-nav-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bf-black);
  color: var(--bf-white);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 1.2rem;
  white-space: nowrap;
  z-index: 300;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.bm-nav__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.8rem 0.4rem;
}

.bm-nav__label {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bf-dark-gray);
  padding: 0.4rem 1rem 0.6rem;
}

.bm-sidebar.is-rail .bm-nav__label,
.bm-sidebar.is-rail .bm-nav__divider {
  display: none;
}

.bm-nav-back.bm-nav-item,
.bm-nav a.bm-nav-back.bm-nav-item {
  margin-bottom: 0.6rem;
  color: var(--bf-gray);
  font-size: 1.25rem;
  opacity: 0.85;
}

/* Main area */
.bm-main {
  flex: 1;
  margin-left: var(--sidebar-current);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s var(--bf-ease-menu);
  background: var(--surface-muted);
  width: calc(100% - var(--sidebar-current));
}

.bm-sidebar.is-collapsed {
  transform: none !important;
}

.bm-topbar {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--bf-gray-stroke);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1.4rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.bm-topbar__burger {
  display: none;
}

.bm-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
  font-family: var(--bf-font-ui);
  font-size: 1.25rem;
}

.bm-breadcrumb__item {
  color: var(--bf-dark-gray);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.bm-breadcrumb__item:hover {
  color: var(--bf-black);
  opacity: 1;
}

.bm-breadcrumb__item.is-current {
  color: var(--bf-black);
  font-weight: 700;
  max-width: none;
}

.bm-breadcrumb__sep {
  color: var(--bf-gray);
  user-select: none;
}

.bm-topbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.bm-topbar__actions .bm-btn {
  gap: 0.55rem;
}

.bm-user-menu {
  position: relative;
  font-family: var(--bf-font-ui);
  font-size: 1.3rem;
  line-height: 1.35;
}

.bm-user-menu__avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--bf-black);
  color: var(--bf-yellow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.bm-user-menu__avatar--lg {
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.05rem;
}

.bm-user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--bf-black);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.bm-user-menu__trigger:hover {
  background: var(--bf-light-gray);
  border-color: var(--bf-gray-stroke);
}

.bm-user-menu__trigger:focus {
  outline: none;
}

.bm-user-menu__trigger:focus-visible {
  outline: 2px solid var(--bf-black);
  outline-offset: 2px;
}

.bm-user-menu__trigger[aria-expanded='true'] {
  background: var(--bf-light-gray);
  border-color: var(--bf-gray-stroke);
  box-shadow: var(--shadow-sm);
}

.bm-user-menu__name {
  font: inherit;
  font-weight: 600;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-user-menu__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bf-dark-gray);
  transition: transform 0.2s var(--bf-ease-out, ease-out), color 0.15s;
}

.bm-user-menu__chevron.is-open {
  transform: rotate(180deg);
  color: var(--bf-black);
}

.bm-user-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(26rem, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--bf-gray-stroke);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 28px rgba(17, 17, 17, 0.12);
  overflow: hidden;
  z-index: 150;
  animation: bm-user-menu-in 0.16s var(--bf-ease-out, ease-out);
}

@keyframes bm-user-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bm-user-menu__head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--bf-gray-stroke);
}

.bm-user-menu__identity {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.bm-user-menu__display-name {
  font: inherit;
  font-weight: 700;
  color: var(--bf-black);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-user-menu__email {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--bf-dark-gray);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-user-menu__body,
.bm-user-menu__foot {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem;
}

.bm-user-menu__foot {
  border-top: 1px solid var(--bf-gray-stroke);
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.bm-user-menu__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--bf-black);
  font: inherit;
  font-weight: 500;
  line-height: inherit;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.bm-user-menu__panel button.bm-user-menu__item {
  appearance: none;
  margin: 0;
}

.bm-user-menu__item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  background: rgba(17, 17, 17, 0.05);
  color: var(--bf-dark-gray);
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.bm-user-menu__item-label {
  flex: 1;
  min-width: 0;
}

.bm-user-menu__item:hover {
  background: rgba(255, 240, 0, 0.14);
  opacity: 1;
}

.bm-user-menu__item:hover .bm-user-menu__item-icon {
  background: rgba(17, 17, 17, 0.08);
  color: var(--bf-black);
}

.bm-user-menu__item--danger {
  color: #b71c1c;
}

.bm-user-menu__item--danger .bm-user-menu__item-icon {
  background: rgba(198, 40, 40, 0.08);
  color: #c62828;
}

.bm-user-menu__item--danger:hover {
  background: #fdecea;
  color: #b71c1c;
  opacity: 1;
}

.bm-user-menu__item--danger:hover .bm-user-menu__item-icon {
  background: rgba(198, 40, 40, 0.14);
  color: #b71c1c;
}

.bm-confirm-modal__title {
  margin: 0 0 1rem;
  font-size: 1.8rem;
}

.bm-confirm-modal__body p {
  margin: 0 0 0.6rem;
  line-height: 1.5;
}

.bm-confirm-modal__body p:last-child {
  margin-bottom: 0;
}

.bm-confirm-modal__actions {
  margin-top: 1.6rem;
  justify-content: flex-end;
}

.bm-table--compact th {
  width: 38%;
  font-weight: 700;
  text-align: left;
  padding: 0.8rem 1rem;
  background: var(--bf-light-gray);
  border-bottom: 1px solid var(--bf-gray-stroke);
}

.bm-table--compact td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--bf-gray-stroke);
}

.bm-content {
  flex: 1;
  padding: 2rem 2rem 3.2rem;
  max-width: none;
  width: 100%;
}

.bm-page {
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
}

/* Page header */
.bm-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.bm-page-header__main {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  min-width: 0;
}

.bm-page-header__icon {
  color: var(--bf-black);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  margin-top: 0.15rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--bf-gray-stroke);
  box-shadow: var(--shadow-sm);
}

.bm-page-header__title {
  margin: 0;
  font-family: var(--bf-font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--bf-black);
  letter-spacing: 0.01em;
}

.bm-page-header__desc {
  margin: 0.4rem 0 0;
  font-size: 1.3rem;
  color: var(--bf-dark-gray);
  font-weight: 400;
  line-height: 1.45;
  max-width: 40rem;
  word-break: break-word;
}

.bm-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  padding-top: 0.25rem;
}

/* Stat grid */
.bm-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.bm-stat-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.5rem 1.8rem;
  background: var(--surface);
  border: 1px solid var(--bf-gray-stroke);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.bm-stat-card__icon {
  color: var(--bf-dark-gray);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bm-stat-card__label {
  font-family: var(--bf-font-ui);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bf-dark-gray);
  margin-bottom: 0.4rem;
}

.bm-stat-card__value {
  font-family: var(--bf-font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.bm-stat-card--success .bm-stat-card__icon { color: #2e7d32; }
.bm-stat-card--warn .bm-stat-card__icon { color: #e65100; }
.bm-stat-card--error .bm-stat-card__icon { color: #c62828; }

/* Quick actions */
.bm-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.bm-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--bf-gray-stroke);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.bm-quick-action:hover {
  border-color: var(--bf-black);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  opacity: 1;
}

.bm-quick-action__label {
  font-family: var(--bf-font-ui);
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
}

/* Empty state */
.bm-empty {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border: 1px dashed var(--bf-gray-stroke);
  border-radius: var(--radius-lg);
}

.bm-empty__icon {
  color: var(--bf-gray);
  margin-bottom: 1rem;
}

.bm-empty__title {
  margin: 0 0 0.6rem;
  font-size: 1.8rem;
}

.bm-empty__desc {
  margin: 0 0 1.6rem;
  color: var(--bf-dark-gray);
}

/* Cards refresh */
.bm-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.bm-site-card {
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s, transform 0.15s;
}

.bm-site-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.bm-env-tile {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--bf-gray-stroke);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.bm-env-tile:hover {
  border-color: var(--bf-black);
  box-shadow: var(--shadow-md);
  opacity: 1;
}

.bm-env-tile__head {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Login split */
.bm-auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.bm-auth-split__brand {
  background: var(--bf-black-2);
  color: var(--bf-white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
}

.bm-auth-split__brand h1 {
  font-size: 3.2rem;
  margin: 1.6rem 0 0.8rem;
}

.bm-auth-split__form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--surface-muted);
}

.bm-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.bm-icon-wrap svg,
.bm-icon {
  display: block;
}

.bm-card h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bm-sidebar__nav .bm-nav-item:focus-visible,
.bm-nav a.bm-nav-item:focus-visible,
.bm-sidebar-collapse:focus-visible,
.bm-btn:focus-visible,
.bm-quick-action:focus-visible,
.bm-user-menu__trigger:focus-visible {
  outline: 2px solid var(--bf-yellow);
  outline-offset: 2px;
}

.bm-topbar .bm-user-menu__trigger:focus-visible {
  outline-color: var(--bf-black);
}

.bm-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bm-intervention-card {
  padding: 1.2rem 1.4rem;
  margin-bottom: 0.8rem;
}

.bm-intervention-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 1.25rem;
}

.bm-intervention-card__summary {
  font-weight: 600;
  margin: 0 0 0.8rem;
}

.bm-intervention-card__actions {
  display: flex;
  justify-content: flex-end;
}

.bm-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

@media (max-width: 767px) {
  .bm-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 0.4rem;
  }

  .bm-tab {
    flex-shrink: 0;
    min-height: 44px;
  }
}

/* Overlay mobile drawer */
@media (max-width: 1023px) {
  .bm-sidebar {
    transform: translateX(-100%) !important;
    width: var(--sidebar-expanded) !important;
    min-width: var(--sidebar-expanded) !important;
  }

  .bm-sidebar-collapse {
    display: none;
  }

  .bm-sidebar.is-mobile-open {
    transform: translateX(0) !important;
  }

  .bm-sidebar.is-mobile-open .bm-nav-item__label,
  .bm-sidebar.is-mobile-open .bm-sidebar__brand-link span,
  .bm-sidebar.is-mobile-open .bm-sidebar__site-text,
  .bm-sidebar.is-mobile-open .bm-nav__label,
  .bm-sidebar.is-mobile-open .bm-nav__divider {
    display: revert !important;
    opacity: 1 !important;
    width: auto !important;
  }

  .bm-sidebar.is-mobile-open .bm-sidebar__nav .bm-nav-item,
  .bm-sidebar.is-mobile-open .bm-nav a.bm-nav-item {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0.85rem 1.2rem;
  }

  .bm-main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  .bm-topbar__burger {
    display: flex;
  }

  .bm-overlay.is-visible {
    display: block;
  }

  .bm-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .bm-breadcrumb__item {
    max-width: 120px;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .bm-sidebar:not(.is-expanded) {
    --sidebar-current: var(--sidebar-rail);
  }

  .bm-stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .bm-content {
    padding: 1.2rem 1rem 2rem;
  }

  .bm-page-header__title {
    font-size: 2rem;
  }

  .bm-stat-grid {
    grid-template-columns: 1fr;
  }

  .bm-page-header__actions {
    width: 100%;
  }

  .bm-page-header__actions .bm-btn {
    width: 100%;
    justify-content: center;
  }

  .bm-auth-split {
    grid-template-columns: 1fr;
  }

  .bm-auth-split__brand {
    padding: 2rem;
    min-height: auto;
  }

  .bm-topbar {
    padding: 0 1rem;
  }

  .bm-user-menu__name {
    display: none;
  }

  .bm-user-menu__trigger {
    padding-right: 0.35rem;
  }
}

@media (min-width: 768px) {
  .bm-intervention-table-cards {
    display: none;
  }
}

@media (max-width: 767px) {
  .bm-intervention-table-desktop {
    display: none;
  }
}

/* ——— Espacement & alignement (polish dashboard) ——— */
.bm-page > .bm-page-header + .bm-banner,
.bm-page > .bm-page-header + .bm-flash {
  margin-top: -0.4rem;
}

.bm-page > .bm-page-header + .bm-card,
.bm-page > .bm-page-header + .bm-section {
  margin-top: 0;
}

.bm-page__footer-actions {
  margin-top: 2.4rem;
}

.bm-card--envs {
  margin-top: 2rem;
}

.bm-card {
  padding: 2.4rem 2.6rem;
  border-radius: var(--radius-lg);
}

.bm-card--danger {
  border: 2px solid var(--bf-danger);
}

.bm-card--warn {
  border: 2px solid var(--bf-yellow);
}

.bm-card--danger::before,
.bm-card--warn::before {
  opacity: 0;
}

.bm-card__head {
  align-items: center;
  margin-bottom: 2rem;
}

.bm-card--accent .bm-card__head {
  padding-top: 0.25rem;
}

.bm-card h2 {
  gap: 0.75rem;
}

.bm-form .bm-field-hint {
  margin: 0;
  line-height: 1.45;
}

.bm-form__actions .bm-btn,
.bm-form-actions .bm-btn {
  margin-top: 0;
}

.bm-form > .bm-btn:not(.bm-form-grid > *) {
  margin-top: var(--space-lg);
}

.bm-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  line-height: 1.5;
}

.bm-banner .bm-icon-wrap {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.bm-env-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem 1.4rem;
  padding: 1.4rem 0.8rem;
}

.bm-env-row .bm-site-icon {
  align-self: center;
  flex-shrink: 0;
}

.bm-env-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.bm-env-row__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.bm-env-row__url {
  font-size: 1.35rem;
  line-height: 1.45;
  word-break: break-all;
}

.bm-env-row__meta {
  font-size: 1.25rem;
  line-height: 1.4;
}

.bm-env-row__aside {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.bm-env-row__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--bf-gray-text, #888);
}

.bm-env-list li + li {
  border-top: 1px solid var(--bf-gray-stroke);
}

.bm-env-list__item {
  display: block;
}

.bm-env-list__item .bm-env-row {
  display: grid;
}

.bm-env-warnings {
  margin: 0 0.8rem 1rem 4.8rem;
  padding: 0.85rem 1rem;
  background: rgba(180, 83, 9, 0.08);
  border: 1px solid rgba(180, 83, 9, 0.22);
  border-radius: 4px;
}

.bm-env-warnings .bm-logs {
  margin: 0;
}

.bm-env-warnings .bm-logs li {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.bm-env-warnings .bm-logs li + li {
  margin-top: 0.35rem;
  border-top: none;
}

.bm-tab {
  gap: 0.55rem;
}

.bm-btn {
  gap: 0.55rem;
  padding: 0 1.6rem;
  border-radius: var(--radius-md);
}

/* ——— Layout utilities ——— */
.bm-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.bm-stack--sm {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.bm-stack--lg {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.bm-form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  max-width: 42rem;
}

.bm-form-stack .bm-field {
  margin-bottom: 0;
}

.bm-form-grid--users .bm-field--ip {
  grid-column: 1 / -1;
}

.bm-table--compact th,
.bm-table--compact td {
  padding: 0.85rem 1.2rem;
}

.bm-table--compact th {
  width: 11rem;
  white-space: nowrap;
}

.bm-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.bm-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.bm-field:last-child {
  margin-bottom: 0;
}

.bm-muted-block {
  margin: 0 0 var(--space-lg);
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--bf-dark-gray);
}

.bm-table-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.bm-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.bm-env-setup {
  margin-top: var(--space-lg);
}

.bm-env-setup__token,
.bm-env-setup__pre {
  display: block;
  margin-bottom: var(--space-md);
}

.bm-env-setup__pre {
  white-space: pre-wrap;
}

.bm-auth-form {
  max-width: 400px;
  margin: 0 auto;
}

.bm-auth-form h1 {
  margin: 0 0 var(--space-xl);
  font-size: 2rem;
}

.bm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
}

.bm-empty__icon {
  color: var(--bf-dark-gray);
  opacity: 0.6;
}

.bm-empty__title {
  margin: 0;
  font-family: var(--bf-font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bf-black);
}

.bm-empty__desc {
  margin: 0;
  font-size: 1.3rem;
  color: var(--bf-dark-gray);
  max-width: 28rem;
}

.bm-empty__actions {
  margin-top: var(--space-sm);
}

.bm-alert-card__title {
  margin: 0 0 var(--space-sm);
  font-size: 1.5rem;
  font-weight: 700;
}

.bm-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-lg);
}

.bm-section--flush-top {
  margin-top: 0;
}

.bm-settings-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bm-settings-form > .bm-card {
  margin-bottom: 0;
}

.bm-settings-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--bf-gray-stroke);
}

.bm-tab-panel {
  margin-top: var(--space-lg);
}

.bm-env-add {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--bf-gray-stroke);
}

.bm-env-add__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.bm-env-add__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.bm-restore-panel {
  margin-top: var(--space-sm);
  background: var(--bf-warn-bg);
}

.bm-op-result {
  margin-top: var(--space-md);
}

.bm-table .bm-table__actions,
.bm-table td.bm-table__actions {
  text-align: right;
}

.bm-pagination__label {
  font-size: 1.2rem;
  margin-right: var(--space-xs);
}

.bm-choice-grid--spaced {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-md);
}

.bm-token-pre {
  margin-top: var(--space-sm);
  white-space: pre-wrap;
}

.bm-archive-hint {
  margin-top: var(--space-xs);
  font-size: 1.1rem;
  color: var(--bf-warn-text);
}

.bm-form--inline .bm-input--grow {
  flex: 1;
  min-width: 12rem;
  max-width: none;
}

.bm-auth-link {
  margin: 0.8rem 0 0;
  font-size: 1.3rem;
}

.bm-auth-link a {
  color: var(--bf-black);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.bm-auth-split__brand .bm-muted {
  color: var(--bf-gray);
  max-width: 32rem;
}

.bm-login-box--narrow {
  max-width: 400px;
  width: 100%;
}

.bm-login__title--setup {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.bm-login__title--login {
  font-size: 2rem;
  margin-bottom: var(--space-lg);
}

.bm-banner--spaced {
  margin-bottom: var(--space-lg);
}

.bm-progress__bar--full {
  width: 100%;
}

button.bm-quick-action {
  cursor: pointer;
  font: inherit;
  text-align: inherit;
  width: 100%;
  appearance: none;
}

.bm-site-card__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--bf-gray-stroke);
}

.bm-site-card__head h3 {
  margin: 0;
  line-height: 1.25;
  font-size: 1.6rem;
}

.bm-table--projects {
  width: 100%;
}

.bm-table--projects .bm-table__row-link {
  cursor: pointer;
}

.bm-table--projects .bm-table__row-link:hover td,
.bm-table--projects .bm-table__row-link:focus-visible td {
  background: var(--surface-muted);
}

.bm-table--projects .bm-table__row-link:focus-visible {
  outline: none;
}

.bm-table__project-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.bm-table__project-name {
  font-weight: 600;
  line-height: 1.3;
}

.bm-table__col-narrow {
  width: 1%;
  white-space: nowrap;
}

.bm-grid--projects {
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

.bm-grid--projects .bm-site-card {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
}

.bm-site-card__envs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.bm-site-card__env {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.65rem 1.2rem;
  padding: 1.2rem 1.4rem;
  background: var(--surface-muted);
  border: 1px solid var(--bf-gray-stroke);
  border-radius: var(--radius-md);
  border-left-width: 3px;
}

.bm-site-card__env--preprod {
  border-left-color: #0a5a8a;
}

.bm-site-card__env--prod {
  border-left-color: #8a0a0a;
}

.bm-site-card__env--staging {
  border-left-color: #666;
}

.bm-site-card__env-head {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.8rem;
}

.bm-site-card__env-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.bm-site-card__env-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.bm-site-card__env-url {
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--bf-dark-gray);
  word-break: break-all;
}

.bm-site-card__env-wp {
  font-size: 1.15rem;
  color: var(--bf-gray-text, #888);
}

.bm-site-card__env-diag {
  align-self: end;
  flex-shrink: 0;
}

.bm-site-card__empty {
  margin: 0;
  font-size: 1.25rem;
}

.bm-empty {
  gap: 1rem;
}

.bm-empty .bm-btn {
  margin-top: 0.5rem;
}

@media (max-width: 767px) {
  .bm-grid--projects {
    grid-template-columns: 1fr;
  }

  .bm-site-card__env {
    grid-template-columns: 1fr;
  }

  .bm-site-card__env-diag {
    justify-self: start;
    margin-top: 0.4rem;
  }

  .bm-env-row {
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.2rem 0.4rem;
  }

  .bm-env-row__aside {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: -0.2rem;
  }

  .bm-page-header__main {
    align-items: flex-start;
  }

  .bm-page-header__icon {
    margin-top: 0.15rem;
  }
}

.bm-inline-datetime-edit__display--editable {
  cursor: pointer;
  border-bottom: 1px dashed var(--bm-muted, #94a3b8);
}

.bm-inline-datetime-edit__input {
  font: inherit;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--bm-border, #cbd5e1);
  border-radius: 4px;
  background: var(--bm-surface, #fff);
}
