/* CNEE Backoffice — tokens mirrored from Next.js `src/app/globals.css` (main site) */

:root {
  /* —— Public site / design system (keep in sync with globals.css) —— */
  --background: #ffffff;
  --foreground: #0f172a;

  --cnee-blue-50: #eff6ff;
  --cnee-blue-100: #dbeafe;
  --cnee-blue-200: #bfdbfe;
  --cnee-blue-300: #93c5fd;
  --cnee-blue-400: #60a5fa;
  --cnee-blue-500: #1b5e96;
  --cnee-blue-600: #1a4b7a;
  --cnee-blue-700: #143d64;
  --cnee-blue-800: #0f2e4d;
  --cnee-blue-900: #0a1f36;

  --cnee-orange-50: #fff7ed;
  --cnee-orange-100: #ffedd5;
  --cnee-orange-200: #fed7aa;
  --cnee-orange-300: #fdba74;
  --cnee-orange-400: #fb923c;
  --cnee-orange-500: #ff8c00;
  --cnee-orange-600: #ea580c;
  --cnee-orange-700: #c2410c;

  --cnee-gray-50: #f8fafc;
  --cnee-gray-100: #f1f5f9;
  --cnee-gray-200: #e2e8f0;
  --cnee-gray-300: #cbd5e1;
  --cnee-gray-400: #94a3b8;
  --cnee-gray-500: #64748b;
  --cnee-gray-600: #475569;
  --cnee-gray-700: #334155;
  --cnee-gray-800: #1e293b;
  --cnee-gray-900: #0f172a;

  --cnee-gold-300: #fde047;
  --cnee-gold-400: #facc15;
  --cnee-gold-500: #fcd116;

  --brand-blue: var(--cnee-blue-500);
  --brand-blue-dark: var(--cnee-blue-600);
  --brand-orange: var(--cnee-orange-500);
  --brand-orange-dark: var(--cnee-orange-600);

  /* —— Backoffice semantic (map to site tokens) —— */
  --bo-page: var(--cnee-gray-50);
  --bo-surface: #ffffff;
  --bo-ink: var(--foreground);
  --bo-muted: var(--cnee-gray-600);
  --bo-border: var(--cnee-gray-200);
  --bo-hero: var(--cnee-blue-800);
  --bo-hero-text: #ffffff;
  --bo-accent: var(--cnee-gold-400);
  --bo-accent-strong: var(--cnee-gold-500);
  --bo-blue: var(--cnee-blue-500);
  --bo-blue-soft: var(--cnee-blue-700);
  --bo-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --bo-radius: 14px;
  --bo-radius-lg: 16px;
  --bo-sidebar-width: 260px;

  /* Legacy names used across older templates & rules */
  --blue-dark: var(--bo-ink);
  --blue: var(--bo-blue);
  --blue-soft: var(--bo-blue-soft);
  --aqua: #20a0c0;
  --yellow: var(--bo-accent-strong);
  --orange: var(--cnee-orange-500);
  --cream: var(--bo-page);
  --gray-100: var(--cnee-gray-100);
  --gray-200: var(--bo-border);
  --gray-600: var(--bo-muted);
  --text: var(--bo-ink);
  font-size: 16px;
}

.bo-gradient-topbar {
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-orange));
}

body.bo-body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bo-page);
  color: var(--bo-ink);
  -webkit-font-smoothing: antialiased;
}

/* --- Auth / standalone pages --- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.bo-display {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.02em;
}

/* --- App shell --- */

.dashboard-shell {
  width: 100%;
  min-height: 100vh;
  background: var(--bo-page);
}

.dashboard-layout {
  display: grid;
  grid-template-columns: var(--bo-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
  max-width: none;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bo-page);
  border-right: 2px solid var(--bo-border);
  padding: calc(1.35rem + 4px) 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-sizing: border-box;
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-orange));
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.15rem 0.25rem 0.5rem;
}

.bo-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--cnee-blue-500), var(--cnee-blue-700));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.65rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(27, 94, 150, 0.25);
}

.bo-cnee-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.bo-cnee-logo--sidebar {
  width: 48px;
  height: 48px;
}

.bo-cnee-logo--avatar {
  width: 36px;
  height: 36px;
}

.bo-panel-scroll {
  max-height: min(340px, 52vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.35rem;
  margin-top: 0.25rem;
  scrollbar-gutter: stable;
}

.bo-panel-scroll::-webkit-scrollbar {
  width: 6px;
}

.bo-panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(27, 94, 150, 0.28);
  border-radius: 999px;
}

.bo-panel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.panel.slim .bo-panel-scroll {
  max-height: min(380px, 58vh);
}

.sidebar-brand .brand-text {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bo-ink);
}

.sidebar-brand small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--bo-muted);
  line-height: 1.35;
  max-width: 14rem;
}

.sidebar-brand .logo-mark {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.nav-item {
  padding: 0.62rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--bo-ink);
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bo-surface);
  border-color: var(--bo-border);
}

.nav-item.active {
  background: var(--bo-surface);
  border-color: var(--bo-border);
  box-shadow: var(--bo-shadow);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin: 0.35rem 0 0.5rem;
  padding: 0.35rem 0 0.35rem 0.5rem;
  border-left: 2px solid var(--bo-border);
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--bo-muted);
  padding: 0.15rem 0.75rem 0.35rem;
  line-height: 1.3;
}

.nav-item--sub {
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.48rem 0.75rem 0.48rem 0.85rem;
  color: var(--bo-muted);
  margin: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  line-height: 1.35;
}

.nav-item--sub:hover,
.nav-item--sub.active {
  color: var(--bo-ink);
  background: var(--bo-surface);
  border-color: var(--bo-border);
}

.nav-item--sub.active {
  box-shadow: var(--bo-shadow);
}

.nav-item--nested {
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem 0.4rem 0.75rem;
  color: var(--bo-muted);
  margin: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  line-height: 1.35;
}

.nav-item--nested:hover,
.nav-item--nested.active {
  color: var(--bo-ink);
  background: var(--bo-surface);
  border-color: var(--bo-border);
}

.nav-item--nested.active {
  box-shadow: var(--bo-shadow);
}

.logout-form {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bo-border);
}

.logout-form .btn-secondary {
  width: 100%;
}

.main-panel {
  padding: 1.25rem clamp(1.25rem, 3vw, 2.75rem) 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100vh;
  box-sizing: border-box;
  background: var(--bo-page);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 1.25rem;
  margin: 0;
  border-bottom: 2px solid var(--bo-border);
  color: var(--bo-ink);
}

.top-bar h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bo-ink);
}

.top-bar p,
.text-muted {
  margin: 0.2rem 0 0 0;
  color: var(--bo-muted);
  font-size: 0.88rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.bo-topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.2rem 0.2rem 0.75rem;
  border: 1px solid var(--bo-border);
  border-radius: 999px;
  background: var(--bo-surface);
  min-width: min(280px, 42vw);
}

.bo-topbar-search__input {
  border: none;
  background: transparent;
  color: var(--bo-ink);
  font: inherit;
  font-size: 0.88rem;
  width: 100%;
  min-width: 0;
  outline: none;
}

.bo-topbar-search__input::placeholder {
  color: var(--bo-muted);
}

.bo-topbar-search .icon-btn {
  border: none;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.icon-btn--bell {
  position: relative;
}

.bo-notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stat-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card--link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bo-search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bo-search-results__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--bo-border);
  border-radius: 12px;
  background: var(--bo-surface);
}

.bo-search-results__category {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bo-muted);
}

.bo-search-results__link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  color: inherit;
  text-decoration: none;
}

.bo-search-results__link:hover strong {
  color: var(--cnee-blue-700);
}

.bo-search-results__link span {
  color: var(--bo-muted);
  font-size: 0.88rem;
}

.promo-card .btn-secondary {
  margin-top: 0.65rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bo-border);
  background: var(--bo-surface);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: var(--bo-ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--bo-muted);
  background: var(--gray-100);
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-secondary .icon,
.btn-primary .icon {
  margin-right: 0.45rem;
}

.btn-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  width: 34px;
  height: 34px;
}

.btn-icon-only .icon {
  margin-right: 0;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: 999px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  box-shadow: var(--bo-shadow);
}

.user-pill strong {
  font-size: 0.88rem;
  color: var(--bo-ink);
}

.user-pill small {
  display: block;
  font-size: 0.72rem;
  color: var(--bo-muted);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bo-accent);
  color: var(--bo-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
}

.avatar img,
.avatar .bo-cnee-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Welcome hero (dashboard home) */

.bo-welcome {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.75rem clamp(1.25rem, 4vw, 2.5rem);
  border-radius: var(--bo-radius-lg);
  background: linear-gradient(135deg, var(--cnee-blue-600) 0%, var(--cnee-blue-800) 55%, var(--cnee-blue-900) 100%);
  color: #ffffff;
  box-shadow: var(--bo-shadow);
  position: relative;
  overflow: hidden;
}

.bo-welcome-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.65;
}

.bo-welcome-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-style: italic;
  font-weight: 600;
  line-height: 1.05;
}

.bo-welcome-sub {
  margin: 0.65rem 0 0;
  max-width: 32rem;
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.72;
}

.bo-welcome-accent {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  margin: auto 0;
  border-radius: 50%;
  border: 6px solid transparent;
  border-top-color: var(--bo-accent);
  border-right-color: var(--bo-accent);
  opacity: 0.95;
  transform: rotate(-12deg);
}

@media (max-width: 640px) {
  .bo-welcome-accent {
    display: none;
  }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bo-surface);
  border: 2px solid var(--bo-border);
  border-radius: var(--bo-radius);
  padding: 1.1rem 1.2rem;
  color: var(--bo-ink);
  box-shadow: var(--bo-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(21, 20, 15, 0.08);
}

.stat-card.highlighted {
  background: linear-gradient(145deg, var(--cnee-blue-600), var(--cnee-blue-800));
  color: #ffffff;
  border-color: transparent;
}

.stat-card.highlighted .stat-label {
  color: var(--bo-hero-text);
  opacity: 0.75;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--bo-muted);
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--bo-ink);
  line-height: 1.15;
  margin: 0 0 0.2rem;
  letter-spacing: -0.03em;
}

.stat-card.highlighted .stat-value {
  color: var(--bo-accent);
}

.stat-card.highlighted small {
  color: rgba(250, 248, 244, 0.68);
}

.stat-value span {
  font-size: 0.95rem;
  margin-left: 0.15rem;
  font-weight: 600;
  opacity: 0.85;
}

.grid-columns {
  display: grid;
  grid-template-columns: 1.5fr 0.72fr;
  gap: 1.25rem;
}

.grid-columns.bottom {
  grid-template-columns: 1fr 0.82fr;
}

@media (max-width: 960px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 2px solid var(--bo-border);
  }

  .grid-columns,
  .grid-columns.bottom {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--bo-surface);
  border: 2px solid var(--bo-border);
  border-radius: var(--bo-radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--bo-shadow);
}

.form-stacked .form-group {
  margin-bottom: 1.2rem;
}

.form-stacked label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--bo-ink);
}

.form-stacked input[type="text"],
.form-stacked input[type="datetime-local"],
.form-stacked textarea,
.form-stacked select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--bo-border);
  font-size: 1rem;
  box-sizing: border-box;
  background: var(--bo-surface);
  color: var(--bo-ink);
}

.news-form .form-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.news-form .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.news-form .form-column h2,
.news-form .form-column h3 {
  margin-top: 0;
  color: var(--bo-ink);
}

.form-grid.meta-grid {
  margin-top: 0.5rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--bo-radius);
  border: 1px solid var(--bo-border);
  background: var(--cnee-blue-50);
}

.news-form .meta-grid {
  background: var(--gray-100);
  padding: 1.2rem;
  border-radius: var(--bo-radius);
  border: 1px solid var(--bo-border);
}

.field-error {
  color: #b42318;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.panel-header h2 {
  margin: 0;
  color: var(--bo-ink);
  font-size: 1.05rem;
  font-weight: 700;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.72rem 0.5rem;
  border-bottom: 1px solid var(--bo-border);
  color: var(--bo-ink);
}

.data-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bo-muted);
  font-weight: 700;
  background: var(--gray-100);
  padding: 0.85rem 0.6rem;
}

.data-table td {
  font-size: 0.9rem;
}

.data-table tbody tr:hover {
  background: rgba(232, 226, 213, 0.35);
}

.status-pill {
  display: inline-block;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--bo-ink);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--bo-border);
}

.actions-cell button {
  margin-right: 0.4rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
}

.json-inline {
  display: inline-block;
  background: var(--gray-100);
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--bo-ink);
  border: 1px solid var(--bo-border);
}

.promo-card {
  background: var(--gray-100);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  padding: 1rem;
  margin-bottom: 0.85rem;
}

.promo-card button {
  border: none;
  background: var(--bo-hero);
  color: var(--bo-hero-text);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

.news-list,
.access-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-list li {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--bo-border);
  padding-bottom: 0.85rem;
}

.news-date {
  font-weight: 700;
  color: var(--bo-blue);
}

.access-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--bo-border);
  padding-bottom: 0.65rem;
}

.dashboard-footer {
  margin-top: auto;
  padding: 0.85rem 1.1rem;
  border-radius: var(--bo-radius);
  border: 2px solid var(--bo-border);
  background: var(--bo-surface);
  color: var(--bo-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.logo-mark {
  width: 96px;
  height: 96px;
  margin-bottom: 1rem;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-tagline {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.login-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.login-form input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: none;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.82rem 1.35rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, var(--cnee-blue-400), var(--cnee-blue-600));
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(27, 94, 150, 0.3);
  transition: filter 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.login-form .btn-primary {
  width: 100%;
}

.btn-secondary {
  padding: 0.72rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--bo-border);
  background: var(--bo-surface);
  color: var(--bo-ink);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--gray-100);
  border-color: var(--bo-muted);
}

/* Shared form control (login + password reset via forms.py) */

.bo-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bo-ink);
}

.bo-input {
  margin-top: 0.35rem;
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid var(--bo-border);
  background: var(--bo-surface);
  padding: 0.8rem 1rem;
  font-size: 15px;
  color: var(--bo-ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bo-input::placeholder {
  color: var(--bo-muted);
  opacity: 0.75;
}

.bo-input:focus {
  border-color: var(--cnee-blue-500);
  box-shadow: 0 0 0 3px rgba(27, 94, 150, 0.22);
}

.bo-input--code,
textarea.bo-input--code {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  font-size: 0.84rem;
  line-height: 1.45;
}

select.bo-input {
  min-height: 2.75rem;
  cursor: pointer;
}

.bo-form-group {
  margin-bottom: 1.05rem;
}

.bo-form-group .bo-input {
  margin-top: 0.35rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-report {
  background: #ef4444;
  color: white;
}

.badge-intervention {
  background: #f59e0b;
  color: white;
}

.badge-information {
  background: #3b82f6;
  color: white;
}

/* Status Pills — workflow semantics */
.status-nouveau {
  background: #10b981;
  color: white;
  border: none;
}

.status-en_cours {
  background: #3b82f6;
  color: white;
  border: none;
}

.status-traite {
  background: #6b7280;
  color: white;
  border: none;
}

.status-ferme {
  background: #374151;
  color: white;
  border: none;
}

.status-rejete {
  background: #ef4444;
  color: white;
  border: none;
}

.status-open {
  background: #10b981;
  color: white;
  border: none;
}

.status-in_progress {
  background: #3b82f6;
  color: white;
  border: none;
}

.status-waiting {
  background: #f59e0b;
  color: white;
  border: none;
}

.status-closed {
  background: #6b7280;
  color: white;
  border: none;
}

.status-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: none;
  font-size: 0.78rem;
  font-weight: 600;
  background: white;
  color: var(--bo-ink);
  cursor: pointer;
  min-width: 120px;
  box-shadow: none;
  outline: none;
  background-image: none !important;
  text-align: left;
}

.status-select:hover {
  opacity: 0.92;
}

.status-select:focus {
  outline: none;
  opacity: 1;
}

.status-select.status-select-nouveau {
  background: #10b981;
  color: white;
  border: none;
}

.status-select.status-select-en_cours {
  background: #3b82f6;
  color: white;
  border: none;
}

.status-select.status-select-traite {
  background: #6b7280;
  color: white;
  border: none;
}

.status-select.status-select-ferme {
  background: #374151;
  color: white;
  border: none;
}

.status-select.status-select-rejete {
  background: #ef4444;
  color: white;
  border: none;
}

.status-select option {
  padding: 0.5rem;
  font-weight: 600;
  background: white;
  color: var(--bo-ink);
}

.status-update-form {
  margin: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-item label {
  font-size: 0.82rem;
  color: var(--bo-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-item strong {
  color: var(--bo-ink);
  font-size: 1rem;
  font-weight: 600;
}

.filter-form {
  margin-bottom: 1rem;
}

.filter-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 150px;
  flex: 1;
}

.filter-group:last-child {
  flex: 0 0 auto;
  min-width: auto;
  flex-direction: row;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group:last-child button,
.filter-group:last-child a {
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-group label {
  font-size: 0.88rem;
  color: var(--bo-ink);
  font-weight: 700;
}

.form-data-display {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  padding: 1rem;
  background: var(--gray-100);
  border-radius: 10px;
  border-left: 3px solid var(--bo-blue);
}

.form-field label {
  display: block;
  font-weight: 600;
  color: var(--bo-ink);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.form-value {
  color: var(--bo-ink);
  font-size: 0.95rem;
  line-height: 1.6;
}

.form-value pre {
  background: var(--gray-100);
  padding: 0.75rem;
  border-radius: 8px;
  overflow-x: auto;
  color: var(--bo-ink);
  font-size: 0.85rem;
  margin: 0;
  border: 1px solid var(--bo-border);
}

.notes-display {
  background: var(--gray-100);
  padding: 1rem;
  border-radius: 10px;
  color: var(--bo-ink);
  line-height: 1.6;
  white-space: pre-wrap;
  border-left: 3px solid var(--bo-accent-strong);
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.table-icon-btn {
  border: none;
  background: var(--gray-100);
  color: var(--bo-ink);
  border-radius: 10px;
  padding: 0.38rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  border: 1px solid var(--bo-border);
}

.table-icon-btn:hover {
  background: var(--bo-hero);
  color: var(--bo-hero-text);
  border-color: var(--bo-hero);
}

.table-icon-btn .icon {
  width: 16px;
  height: 16px;
  margin-right: 0;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s ease;
}

.btn-sm.btn-primary {
  background: var(--bo-hero);
  color: var(--bo-hero-text);
  box-shadow: none;
}

.btn-sm.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-sm.btn-secondary {
  background: var(--bo-surface);
  color: var(--bo-ink);
  border: 1px solid var(--bo-border);
}

.btn-sm.btn-secondary:hover {
  background: var(--gray-100);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bo-border);
}

.page-info {
  color: var(--bo-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--bo-ink);
  background: var(--bo-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--cnee-blue-500);
  box-shadow: 0 0 0 3px rgba(27, 94, 150, 0.2);
}

.form-control::placeholder {
  color: var(--bo-muted);
  opacity: 0.65;
}

/* --- Flash messages (Django messages framework) --- */

.bo-messages-region {
  pointer-events: none;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
}

.bo-toast {
  pointer-events: auto;
  display: flex;
  width: 100%;
  max-width: 32rem;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--bo-border);
  padding: 0.85rem 1rem;
  background: var(--bo-surface);
  color: var(--bo-ink);
  box-shadow: var(--bo-shadow);
}

.bo-toast-dot {
  margin-top: 0.35rem;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--bo-accent-strong);
}

.bo-toast--success {
  border-color: rgba(16, 185, 129, 0.45);
}

.bo-toast--success .bo-toast-dot {
  background: #10b981;
}

.bo-toast--error {
  border-color: rgba(220, 38, 38, 0.4);
}

.bo-toast--error .bo-toast-dot {
  background: #ef4444;
}

.bo-toast--warning {
  border-color: rgba(245, 158, 11, 0.45);
}

.bo-toast--warning .bo-toast-dot {
  background: #f59e0b;
}

.bo-toast p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}
.bo-toast-close {
  flex-shrink: 0;
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--bo-muted);
  padding: 0 0.15rem;
  opacity: 0.7;
}
.bo-toast-close:hover { opacity: 1; }

/* --- Standalone auth (login) — split layout aligned with site hero --- */

.bo-auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bo-surface);
}

.bo-auth-page > .bo-auth-topbar {
  flex-shrink: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-orange));
}

.bo-auth-page-split {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 1fr);
  min-height: 0;
}

@media (max-width: 900px) {
  .bo-auth-page-split {
    grid-template-columns: 1fr;
  }
}

.bo-auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem);
  background: linear-gradient(135deg, var(--cnee-blue-600) 0%, var(--cnee-blue-800) 50%, var(--cnee-blue-900) 100%);
  color: #ffffff;
  overflow: hidden;
}

.bo-auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="g" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.06)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23g)"/></svg>');
  opacity: 0.9;
  pointer-events: none;
}

.bo-auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 26rem;
}

.bo-auth-brand .bo-gradient-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.bo-auth-brand-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  padding: 10px;
  margin-bottom: 1.5rem;
}

.bo-auth-brand h1 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.bo-auth-brand .bo-auth-brand-tag {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cnee-gold-400);
}

.bo-auth-brand p {
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.65;
  opacity: 0.88;
}

.bo-auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--cnee-gray-50);
  border-left: 1px solid var(--bo-border);
}

@media (max-width: 900px) {
  .bo-auth-panel {
    border-left: none;
    border-top: 1px solid var(--bo-border);
  }
}

.bo-auth-card {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: var(--bo-surface);
  border-radius: var(--bo-radius-lg);
  border: 1px solid var(--bo-border);
  box-shadow: var(--bo-shadow);
  padding: 2rem 2rem 1.5rem;
}

.bo-auth-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bo-ink);
}

.bo-auth-card > .text-muted {
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.bo-auth-card-foot {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--bo-border);
  font-size: 0.75rem;
  color: var(--bo-muted);
  line-height: 1.45;
}

.bo-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bo-page);
}

.bo-login-shell {
  width: 100%;
  max-width: 440px;
}

.bo-login-card {
  overflow: hidden;
  border-radius: 16px;
  border: 2px solid var(--bo-border);
  background: var(--bo-surface);
  box-shadow: var(--bo-shadow);
}

.bo-login-hero {
  padding: 2rem 2rem 1.75rem;
  background: linear-gradient(135deg, var(--cnee-blue-600), var(--cnee-blue-900));
  color: #ffffff;
  text-align: center;
}

.bo-login-hero .bo-login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 1rem;
  display: block;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  padding: 6px;
}

.bo-login-hero h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bo-login-hero .bo-login-tag {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cnee-gold-400);
  letter-spacing: 0.02em;
}

.bo-login-hero p {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  opacity: 0.85;
}

.bo-login-body {
  padding: 1.75rem 2rem 0.5rem;
}

.bo-login-actions {
  padding: 0 2rem 1.5rem;
}

.bo-login-foot {
  border-top: 1px solid var(--bo-border);
  padding: 1rem 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--bo-muted);
  line-height: 1.5;
}

.bo-alert-error {
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(180, 35, 24, 0.35);
  background: rgba(254, 242, 242, 0.95);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #7f1d1d;
}

.bo-auth-link {
  color: var(--cnee-blue-600);
  font-weight: 600;
  text-decoration: none;
}

.bo-auth-link:hover {
  text-decoration: underline;
  color: var(--cnee-blue-700);
}

/* Simple grids used in map overview & misc */
.grid {
  display: grid;
  gap: 1rem;
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.text-success {
  color: #047857;
}

.text-warning {
  color: #b45309;
}

.text-info {
  color: var(--bo-blue);
}

/* --- Form layout & CMS visual editor --- */

.form-errors {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: rgba(254, 242, 242, 0.95);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #991b1b;
  font-size: 0.9rem;
}

.form-errors p {
  margin: 0.25rem 0 0;
}

.form-errors p:first-child {
  margin-top: 0;
}

.form-grid {
  display: grid;
  gap: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-column h2,
.form-column h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cnee-blue-800);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--cnee-blue-100);
}

.form-group label {
  font-weight: 600;
  color: var(--bo-ink);
}

.form-group small {
  display: block;
  margin-top: 0.35rem;
  color: var(--bo-muted);
  font-size: 0.82rem;
}

/* Homepage CMS — section tiles */
.bo-cms-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.bo-lang-switch {
  display: inline-flex;
  border-radius: 10px;
  border: 1px solid var(--bo-border);
  overflow: hidden;
  background: var(--bo-surface);
}

.bo-lang-switch a {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--bo-muted);
  border-right: 1px solid var(--bo-border);
  min-height: unset;
  min-width: unset;
}

.bo-lang-switch a:last-child {
  border-right: none;
}

.bo-lang-switch a:hover {
  background: var(--gray-100);
  color: var(--bo-ink);
}

.bo-lang-switch a.bo-lang-switch--active {
  background: var(--cnee-blue-500);
  color: #ffffff;
}

.bo-cms-tiles {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.bo-cms-tile {
  display: flex;
  flex-direction: column;
  border-radius: var(--bo-radius);
  border: 1px solid var(--bo-border);
  background: var(--bo-surface);
  box-shadow: var(--bo-shadow);
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.bo-cms-tile:hover {
  box-shadow: 0 12px 32px rgba(27, 94, 150, 0.12);
  transform: translateY(-2px);
}

.bo-cms-tile-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.1rem 1.15rem 0.85rem;
  border-bottom: 1px solid var(--bo-border);
  background: linear-gradient(180deg, var(--cnee-gray-50), var(--bo-surface));
}

.bo-cms-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.bo-cms-tile-icon--blue {
  background: var(--cnee-blue-100);
}

.bo-cms-tile-icon--orange {
  background: var(--cnee-orange-100);
}

.bo-cms-tile-icon--gold {
  background: rgba(252, 209, 22, 0.2);
}

.bo-cms-tile-icon--neutral {
  background: var(--cnee-gray-200);
}

.bo-cms-tile-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bo-muted);
}

.bo-cms-tile h2 {
  margin: 0.15rem 0 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--bo-ink);
}

.bo-cms-tile-body {
  padding: 0.85rem 1.15rem 1.15rem;
  flex: 1;
}

.bo-cms-tile-body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--bo-muted);
}

.bo-cms-tile-actions {
  padding: 0 1.15rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.bo-cms-tile-actions .btn-secondary {
  font-size: 0.88rem;
}

/* CMS section editor — two columns */
.bo-cms-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 1.5rem;
  align-items: start;
}

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

.bo-cms-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bo-fieldset {
  margin: 0;
  padding: 0;
  border: none;
}

.bo-fieldset-legend {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cnee-blue-600);
  margin-bottom: 0.85rem;
}

.bo-stack-card {
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  padding: 1.15rem 1.2rem;
  background: var(--bo-surface);
}

.bo-stack-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bo-ink);
}

.bo-cms-aside {
  position: sticky;
  top: 1rem;
}

.bo-preview-panel {
  border-radius: var(--bo-radius);
  border: 1px solid var(--bo-border);
  background: var(--cnee-blue-50);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--bo-shadow);
}

.bo-preview-panel h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cnee-blue-700);
}

.bo-preview-panel p,
.bo-preview-panel li {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--cnee-gray-700);
}

.bo-preview-panel ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.bo-preview-mock {
  margin-top: 0.85rem;
  border-radius: 12px;
  background: var(--bo-surface);
  border: 1px dashed var(--cnee-blue-200);
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--bo-muted);
}

#bo-partners-preview {
  margin-top: 0.65rem;
  max-height: 220px;
  overflow: auto;
  font-size: 0.8rem;
}

#bo-partners-preview .bo-partner-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--bo-border);
}

/* Flash editor — visual severity & language strips */
.bo-flash-layout .form-grid {
  margin-top: 0.5rem;
}

.bo-lang-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
}

.bo-lang-banner--fr {
  color: var(--cnee-blue-700);
}

.bo-lang-banner--en {
  color: var(--cnee-orange-600);
}

.bo-lang-banner .bo-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.bo-flash-meta-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.bo-severity-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.bo-severity-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bo-muted);
}

.bo-severity-swatch span:first-child {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

/* ===== INTUITIVE CMS EDITORS (Sprint — visual map, partner rows, link rows) ===== */

/* Breadcrumb */
.bo-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--bo-muted);
  margin-bottom: 0.1rem;
}
.bo-breadcrumb a { color: var(--cnee-blue-500); text-decoration: none; }
.bo-breadcrumb a:hover { text-decoration: underline; }
.bo-breadcrumb-sep { color: var(--bo-muted); }

/* Status badges (draft / live) */
.bo-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.bo-status-badge--live {
  background: #e6f9ed;
  color: #1a7a3a;
  border: 1px solid #b6e8c8;
}
.bo-status-badge--draft {
  background: #fff3e0;
  color: #b95a00;
  border: 1px solid #ffd9a0;
}

/* Compact 2-col grid inside fieldsets */
.form-grid--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 700px) {
  .form-grid--2 { grid-template-columns: 1fr; }
}

/* Inline form label (used inside dynamic rows) */
.bo-row-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bo-muted);
  margin-bottom: 0.3rem;
}

/* ---- Map pin list ---- */
/* ---- Rich pin card editor ---- */
.bo-pin-card {
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  background: var(--bo-surface);
  margin-bottom: 0.55rem;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}
.bo-pin-card--open {
  border-color: var(--cnee-blue-300, #93c5fd);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}
.bo-pin-card-hdr {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  background: var(--bo-bg);
  border-bottom: 1px solid transparent;
}
.bo-pin-card--open .bo-pin-card-hdr {
  border-bottom-color: var(--bo-border);
}
.bo-pin-card-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.bo-pin-card-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  min-width: 0;
  text-align: left;
  flex: 1;
}
.bo-pin-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bo-ink);
  line-height: 1.3;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 28ch;
}
.bo-pin-card-coord {
  font-size: 0.73rem;
  color: var(--bo-muted);
}
.bo-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--bo-border);
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--bo-muted);
  line-height: 1;
  padding: 0;
}
.bo-btn-icon:hover { background: var(--cnee-blue-50); color: var(--cnee-blue-600); border-color: var(--cnee-blue-200); }
.bo-btn-icon--danger:hover { background: #fff1f1; color: #c0392b; border-color: #e57373; }

.bo-pin-card-body {
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.bo-pin-card-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.bo-pin-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--bo-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bo-pin-card-body textarea.bo-input {
  resize: vertical;
  min-height: 54px;
  font-size: 0.85rem;
}

/* Legacy .bo-pin-* kept for backwards compat — no longer rendered */
.bo-pin-list-header { display: none; }
.bo-pin-item { display: none; }
.bo-pin-color { display: none; }
.bo-pin-locate,
.bo-pin-del {
  background: none; border: 1px solid var(--bo-border); border-radius: 4px;
  cursor: pointer; padding: 0.25rem 0.45rem; font-size: 0.82rem; color: var(--bo-muted); line-height: 1;
}

/* ---- Partner card rows ---- */
.bo-partner-editor-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  background: var(--bo-surface);
  margin-bottom: 0.6rem;
  transition: box-shadow 0.15s;
}
.bo-partner-editor-row:hover { box-shadow: 0 2px 10px rgba(27,94,150,0.08); }
.bo-partner-handle {
  color: var(--bo-muted);
  cursor: grab;
  padding-top: 0.6rem;
  user-select: none;
  font-size: 1rem;
}
.bo-partner-info { flex: 1; min-width: 0; }
.bo-partner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
  padding-top: 0.25rem;
}

/* Common row action buttons */
.bo-row-up, .bo-row-down, .bo-row-del {
  background: none;
  border: 1px solid var(--bo-border);
  border-radius: 4px;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  font-size: 0.82rem;
  color: var(--bo-muted);
  line-height: 1;
}
.bo-row-up:hover, .bo-row-down:hover {
  background: var(--cnee-blue-50);
  color: var(--cnee-blue-600);
  border-color: var(--cnee-blue-200);
}
.bo-row-del:hover { background: #ffe4e4; color: #c0392b; border-color: #e57373; }

/* ---- Footer link row editors ---- */
.bo-link-editor-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bo-muted);
  margin: 1rem 0 0.4rem;
}
.bo-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.bo-link-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--bo-border);
  border-radius: 6px;
  background: var(--bo-surface);
}
@media (max-width: 700px) {
  .bo-link-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .bo-link-row .bo-lnk-href { grid-column: 1 / -1; }
  .bo-link-row .bo-row-del { grid-row: 1; grid-column: 2; justify-self: end; }
}

/* Save/Publish action bar */
.bo-form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 1rem 1.2rem;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-shadow);
  position: sticky;
  bottom: 1rem;
  z-index: 10;
}

/* ---- Mission tabs (homepage CMS) — editor UI ---- */
.bo-fieldset--mission-banner {
  margin-bottom: 2.25rem;
}
.bo-mission-banner-card {
  border: 1px solid var(--bo-border);
  border-radius: 12px;
  padding: 1.25rem 1.4rem 1.4rem;
  background: linear-gradient(145deg, #ffffff 0%, #f0f7fc 100%);
  box-shadow: 0 2px 14px rgba(27, 94, 150, 0.07);
}
.bo-mission-banner-help {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--bo-text, #1e293b);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  border-left: 4px solid var(--cnee-blue-500, #2e6fad);
}
.bo-mission-banner-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bo-fieldset--mission-tabs {
  margin-top: 0.25rem;
}
.bo-fieldset--mission-tabs .bo-stack-card.bo-mission-editor-shell {
  border: 1px solid var(--bo-border);
  border-radius: 14px;
  padding: 1.5rem 1.5rem 1.65rem;
  background: linear-gradient(165deg, #fbfdff 0%, #f1f5f9 100%);
  box-shadow: 0 2px 16px rgba(27, 94, 150, 0.07);
}

.bo-mission-guide-block {
  margin-bottom: 2rem;
  padding: 1.15rem 1.35rem 1.35rem;
  background: #fff;
  border: 1px solid var(--bo-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.bo-mission-section-heading {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--cnee-blue-800, #1e3a5f);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--cnee-blue-100, #dbeafe);
}
.bo-mission-editor-lead p {
  margin: 0 0 0.65rem;
  font-size: 0.91rem;
  line-height: 1.58;
  color: var(--bo-text, #1e293b);
}
.bo-mission-editor-note {
  margin-bottom: 0 !important;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--bo-muted);
}
.bo-mission-hintlist {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--bo-muted);
}
.bo-mission-hintlist kbd {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  font-size: 0.72rem;
  font-family: inherit;
  border: 1px solid var(--bo-border);
  border-radius: 4px;
  background: #f8fafc;
}

.bo-mission-list-anchor {
  margin: 0 0 1.35rem;
  padding-top: 1.35rem;
  border-top: 1px dashed var(--bo-border);
}
.bo-mission-list-anchor .bo-mission-section-heading {
  border-bottom: none;
  padding-bottom: 0.25rem;
}
.bo-mission-list-intro {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--bo-muted);
  max-width: 52rem;
}

.bo-mission-pillar-rows {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.bo-mission-pillar-editor-row {
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--bo-border);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.07);
}
.bo-mission-pillar-editor-row--builtin {
  border-top: 3px solid var(--cnee-blue-600, #1b5e96);
  border-left: 1px solid var(--bo-border);
}
.bo-mission-pillar-editor-row--custom {
  border-top: 3px solid #d4a017;
  border-left: 1px solid var(--bo-border);
}

/* Zone A — mission / identity */
.bo-mission-card-mission-block {
  padding: 1rem 1.35rem 1.15rem;
  background: linear-gradient(180deg, #f0f6fb 0%, #e8f0f8 100%);
  border-bottom: 2px solid var(--bo-border);
}
.bo-mission-card-block-label {
  margin: 0 0 0.65rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--cnee-blue-800, #1e3a5f);
  opacity: 0.92;
}
.bo-mission-card-content-block {
  background: #fafbfc;
}
.bo-mission-card-content-block > .bo-mission-card-block-label {
  margin: 0;
  padding: 1rem 1.35rem 0.5rem;
  color: #475569;
  background: #fafbfc;
  border-bottom: 1px solid var(--bo-border);
}

.bo-mission-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0;
  background: transparent;
  border-bottom: none;
}
.bo-mission-card-header__id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}
.bo-mission-card-header__id .bo-mission-field-label {
  width: 100%;
  margin-top: 0.35rem;
}
.bo-mission-card-header__id .bo-input.bo-mission-pillar-id {
  width: 100%;
  max-width: 22rem;
}
.bo-mission-kind-badge {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--cnee-blue-200, #bfdbfe);
  color: var(--cnee-blue-800, #1e3a5f);
}
.bo-mission-kind-badge--custom {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.bo-mission-slug {
  font-size: 0.78rem;
  padding: 0.18rem 0.5rem;
  background: #fff;
  border: 1px solid var(--bo-border);
  border-radius: 6px;
  color: var(--bo-muted);
}
.bo-mission-card-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  justify-content: flex-end;
}
.bo-mission-icon-btn {
  min-width: 2.25rem;
  height: 2.1rem;
  padding: 0 0.45rem;
  border: 1px solid var(--bo-border);
  border-radius: 6px;
  background: #fff;
  color: var(--bo-muted);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.bo-mission-icon-btn:hover {
  background: var(--cnee-blue-50, #eff6ff);
  color: var(--cnee-blue-700, #1b5e96);
  border-color: var(--cnee-blue-200, #bfdbfe);
}
.bo-mission-reorder-spacer {
  display: inline-block;
  width: 4.8rem;
}
.bo-mission-remove-btn {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.38rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--bo-border);
  background: #fff;
  color: var(--bo-muted);
  cursor: pointer;
}
.bo-mission-remove-btn:hover {
  background: #fff5f5;
  border-color: #f5c6c6;
  color: #c0392b;
}

/* Zone B — content panels */
.bo-mission-card-body {
  padding: 1.35rem 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background: #fafbfc;
}
.bo-mission-content-panel {
  margin: 0;
  padding: 1.05rem 1.15rem 1.2rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.bo-mission-content-panel--last {
  margin-bottom: 0;
}
.bo-mission-content-panel__title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #1e293b;
  letter-spacing: 0.02em;
}
.bo-mission-content-panel__hint {
  margin: 0 0 1rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--bo-muted);
}
.bo-mission-content-panel__hint kbd {
  display: inline-block;
  padding: 0.06rem 0.3rem;
  font-size: 0.7rem;
  font-family: inherit;
  border: 1px solid var(--bo-border);
  border-radius: 3px;
  background: #f8fafc;
}
.bo-mission-panel-grid {
  gap: 0.85rem 1rem !important;
}
@media (min-width: 768px) {
  .bo-mission-panel-grid {
    gap: 1rem 1.25rem !important;
  }
}
.bo-mission-field .bo-mission-field-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--bo-muted);
  margin-bottom: 0.35rem;
}
.bo-mission-field .bo-input,
.bo-mission-field textarea.bo-input {
  width: 100%;
}
.bo-mission-field textarea {
  min-height: 5.5rem;
  line-height: 1.45;
  resize: vertical;
}
.bo-mission-req {
  font-weight: 600;
  color: #b91c1c;
}
.bo-mission-add-wrap {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--bo-border);
}
.bo-mission-add-custom {
  padding: 0.52rem 1.15rem;
  font-weight: 600;
}
.bo-mission-json-hidden {
  display: none;
}
.bo-mission-pillar-image-preview {
  margin-top: 0.5rem;
}
.bo-mission-pillar-image-preview__img {
  display: block;
  max-width: 180px;
  max-height: 140px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--bo-border);
  object-fit: cover;
}

.bo-news-feed-curation-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.bo-news-feed-curation-section {
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  padding: 0.95rem 1rem 1rem;
  background: #fff;
}
.bo-news-feed-curation-section__head {
  margin-bottom: 0.75rem;
}
.bo-news-feed-curation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.bo-news-feed-curation-block,
.bo-news-feed-curation-pool {
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: #fff;
}
.bo-news-feed-curation-block__title {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cnee-blue-800, #1e3a5f);
}
.bo-news-feed-curation-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--bo-muted);
}
.bo-news-feed-curation-add {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}
.bo-news-feed-curation-select {
  flex: 1 1 auto;
  min-width: 0;
}
.bo-news-feed-curation-add-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.bo-news-feed-curation-checks {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 220px;
  overflow-y: auto;
}
.bo-news-feed-curation-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.4;
}
.bo-news-feed-curation-selected {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.bo-news-feed-curation-selected__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  background: #fafbfc;
  font-size: 0.82rem;
}
.bo-news-feed-curation-selected__label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
}
.bo-news-feed-curation-selected__actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}
.bo-news-feed-curation-remove {
  font-size: 1rem;
  line-height: 1;
}
.bo-news-feed-curation-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--bo-muted);
}

/* ── Partners card grid ──────────────────────────────────────────────── */
.bo-partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.9rem;
}
.bo-partner-card {
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  background: var(--bo-surface);
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.bo-partner-card:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
  border-color: var(--cnee-blue-300);
}
.bo-partner-card-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  background: var(--bo-bg);
  border-bottom: 1px solid var(--bo-border);
}
.bo-partner-card-logo-wrap {
  width: 88px;
  height: 56px;
  flex-shrink: 0;
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bo-partner-logo-preview-box {
  margin-top: 0.5rem;
  width: 176px;
  height: 112px;
  border: 1px solid var(--bo-border);
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bo-partner-logo-preview-box__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 8px;
}
.bo-partner-logo-preview-box__empty {
  font-size: 0.75rem;
  color: var(--bo-muted);
}
.bo-cms-logo-preview {
  display: inline-block;
}
.bo-cms-logo-preview--dark {
  background: #0f2e4d;
  padding: 12px;
  border-radius: 8px;
}
.bo-cms-logo-preview__label {
  font-size: 0.75rem;
  color: var(--bo-muted);
  margin: 0 0 0.35rem;
}
.bo-cms-logo-preview__img {
  object-fit: contain;
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}
.bo-cms-logo-preview__img--nav {
  width: 48px;
  height: 48px;
}
.bo-cms-logo-preview__img--footer {
  width: 128px;
  height: 128px;
  background: transparent;
  border: none;
}
.bo-cms-portrait-preview {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.bo-cms-portrait-preview__img {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--bo-border);
}
.bo-partner-card-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}
.bo-partner-no-logo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--bo-muted);
  background: var(--bo-bg);
}
.bo-partner-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.bo-partner-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--bo-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bo-partner-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.bo-partner-type-badge--partner {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}
.bo-partner-type-badge--tutelle {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}
.bo-partner-card-btns {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex-shrink: 0;
}
.bo-partner-card-btns button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--bo-border);
  border-radius: 5px;
  background: var(--bo-surface);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--bo-muted);
  transition: background 0.12s, color 0.12s;
}
.bo-partner-card-btns button:hover { background: var(--bo-bg); color: var(--bo-text); }
.bo-partner-card-del {
  color: #dc2626 !important;
  border-color: #fecaca !important;
}
.bo-partner-card-del:hover { background: #fee2e2 !important; }
.bo-partner-card-fields {
  padding: 0.85rem;
}

/* —— Site menu (sidebar dropdowns) —— */
.site-menu {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0.35rem 0 0.5rem;
}

.site-menu__section {
  display: block;
  margin: 0;
  border-radius: 10px;
}

.site-menu__toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 0.62rem 0.8rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--bo-ink);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.3;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.site-menu__toggle::-webkit-details-marker {
  display: none;
}

.site-menu__chevron {
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--bo-muted);
  border-bottom: 2px solid var(--bo-muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  margin-top: -0.1rem;
}

.site-menu__section[open] > .site-menu__toggle .site-menu__chevron {
  transform: rotate(45deg);
  margin-top: 0.05rem;
}

.site-menu__section-label {
  flex: 1 1 auto;
  min-width: 0;
}

.site-menu__toggle:hover {
  background: var(--bo-surface);
  border-color: var(--bo-border);
}

.site-menu__section[open] > .site-menu__toggle {
  background: var(--bo-surface);
  border-color: var(--bo-border);
  box-shadow: var(--bo-shadow);
}

.site-menu__panel {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.35rem 0 0.55rem;
  padding: 0.45rem;
  border-radius: 12px;
  background: #f4f7fb;
  border: 1px solid var(--bo-border);
}

.site-menu__group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0.1rem 0;
  padding: 0.4rem 0.35rem 0.45rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(27, 94, 150, 0.12);
}

.site-menu__group-label {
  margin: 0;
  padding: 0.15rem 0.55rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: #1b5e96;
}

.site-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.site-menu__item {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 0.58rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #ffffff;
  color: #334155 !important;
  text-decoration: none !important;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.35;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.site-menu__group .site-menu__item {
  background: #f8fafc;
}

.site-menu__item:hover {
  color: var(--bo-ink) !important;
  background: #eef5fb !important;
  border-color: #c5d8ea;
  text-decoration: none !important;
}

.site-menu__item--active,
.site-menu__item.site-menu__item--active {
  color: var(--bo-ink) !important;
  background: #e8f1fa !important;
  border-color: #9bbfda;
  box-shadow: var(--bo-shadow);
  font-weight: 600;
  text-decoration: none !important;
}

.site-menu__group--active {
  border-color: #9bbfda;
}

/* —— Map CMS hub —— */
.cms-map-province-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.cms-map-province-card {
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  background: var(--bo-surface);
  box-shadow: var(--bo-shadow);
  display: flex;
  flex-direction: column;
}

.cms-map-province-card__hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.65rem;
  border-bottom: 1px solid var(--bo-border);
}

.cms-map-province-card__hdr h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--cnee-blue-700);
}

.cms-map-marker-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1rem;
  flex: 1;
}

.cms-map-marker-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--cnee-gray-100);
  font-size: 0.88rem;
}

.cms-map-marker-list__item:last-child {
  border-bottom: none;
}

.cms-map-marker-list__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cms-map-province-card__empty {
  padding: 1rem;
  margin: 0;
  font-size: 0.88rem;
}

.cms-map-province-card__ft {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--bo-border);
}

.cms-map-bandeau-panel .panel-header {
  align-items: center;
}

/* —— Institutional CMS form panels —— */
.bo-info-banner--cms {
  background: var(--cnee-blue-50);
  border: 1px solid var(--cnee-blue-200);
  border-radius: var(--bo-radius);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--cnee-blue-800);
}

.bo-lang-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--bo-muted);
  margin: 0.5rem 0 0.35rem;
}

.bo-field-divider {
  margin: 1rem 0;
  border: none;
  border-top: 1px solid var(--bo-border);
}

.bo-cms-panel {
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  margin-bottom: 0.65rem;
  background: var(--bo-surface);
}

.bo-cms-panel__summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--cnee-blue-700);
  padding: 0.7rem 1rem;
}

.bo-cms-panel__summary::-webkit-details-marker {
  display: none;
}

.bo-cms-panel__summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.4rem;
  font-size: 0.75rem;
  color: var(--bo-muted);
}

.bo-cms-panel[open] > .bo-cms-panel__summary::before {
  transform: rotate(90deg);
}

.bo-cms-panel__body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--bo-border);
}

/* Segmented CMS editor layout */
.bo-cms-section-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.bo-cms-nested-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bo-cms-panel--section {
  margin-bottom: 0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 45, 82, 0.06);
}

.bo-cms-panel--section > .bo-cms-panel__summary {
  padding: 0.85rem 1.1rem;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
  border-radius: 10px 10px 0 0;
}

.bo-cms-panel--section[open] > .bo-cms-panel__summary {
  border-bottom: 1px solid var(--bo-border);
}

.bo-cms-panel--nested {
  margin-bottom: 0;
  background: #fafbfd;
}

.bo-cms-panel__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  margin-right: 0.55rem;
  border-radius: 999px;
  background: var(--cnee-blue-700);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}

.bo-cms-panel__title {
  vertical-align: middle;
}

.bo-cms-panel__help {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: #eef5fb;
  color: var(--cnee-blue-800);
  font-size: 0.82rem;
  line-height: 1.5;
}

.bo-lang-block {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  background: #fff;
}

.bo-lang-block + .bo-lang-block {
  margin-top: 0.75rem;
}

.form-grid--2 > .bo-lang-block {
  margin-top: 0;
}

.form-grid--2 > .bo-lang-block + .bo-lang-block {
  margin-top: 0;
}

/* ── Compact backoffice scale (entire dashboard) ── */
.dashboard-shell--compact,
.dashboard-shell {
  font-size: 0.875rem;
}

.dashboard-shell--compact .main-panel,
.dashboard-shell .main-panel {
  gap: 1rem;
  padding-bottom: 1.75rem;
}

.dashboard-shell--compact .top-bar,
.dashboard-shell .top-bar {
  padding: 0.65rem 0 0.85rem;
}

.dashboard-shell--compact .top-bar h1,
.dashboard-shell .top-bar h1 {
  font-size: 0.98rem;
}

.dashboard-shell--compact .top-bar p,
.dashboard-shell .top-bar p {
  font-size: 0.8rem;
}

.dashboard-shell--compact .bo-input,
.dashboard-shell .bo-input {
  font-size: 0.84rem;
  padding: 0.52rem 0.72rem;
  border-radius: 8px;
}

.dashboard-shell--compact select.bo-input,
.dashboard-shell select.bo-input {
  min-height: 2.35rem;
}

.dashboard-shell--compact .bo-label,
.dashboard-shell .bo-label {
  font-size: 0.78rem;
}

.dashboard-shell--compact .bo-form-group,
.dashboard-shell .bo-form-group {
  margin-bottom: 0.75rem;
}

.dashboard-shell--compact .btn-primary,
.dashboard-shell .btn-primary {
  padding: 0.52rem 0.95rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

.dashboard-shell--compact .btn-secondary,
.dashboard-shell .btn-secondary {
  padding: 0.48rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

.dashboard-shell--compact .btn-sm,
.dashboard-shell .btn-sm {
  padding: 0.32rem 0.65rem;
  font-size: 0.76rem;
  border-radius: 6px;
}

.dashboard-shell--compact .bo-cms-tiles,
.dashboard-shell .bo-cms-tiles {
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.dashboard-shell--compact .bo-cms-tile-head,
.dashboard-shell .bo-cms-tile-head {
  padding: 0.75rem 0.85rem 0.65rem;
}

.dashboard-shell--compact .bo-cms-tile-icon,
.dashboard-shell .bo-cms-tile-icon {
  width: 38px;
  height: 38px;
  font-size: 1rem;
  border-radius: 8px;
}

.dashboard-shell--compact .bo-cms-tile h2,
.dashboard-shell .bo-cms-tile h2 {
  font-size: 0.88rem;
}

.dashboard-shell--compact .bo-cms-tile-body,
.dashboard-shell .bo-cms-tile-body {
  padding: 0.65rem 0.85rem 0.85rem;
  font-size: 0.78rem;
}

.dashboard-shell--compact .bo-stack-card,
.dashboard-shell .bo-stack-card {
  padding: 0.85rem 0.95rem;
}

.dashboard-shell--compact .bo-cms-panel__summary,
.dashboard-shell .bo-cms-panel__summary {
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
}

.dashboard-shell--compact .bo-cms-panel__body,
.dashboard-shell .bo-cms-panel__body {
  padding: 0.75rem 0.85rem 0.9rem;
}

.dashboard-shell--compact .bo-cms-panel__step,
.dashboard-shell .bo-cms-panel__step {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.72rem;
}

.dashboard-shell--compact .bo-cms-panel__help,
.dashboard-shell .bo-cms-panel__help {
  font-size: 0.76rem;
  margin-bottom: 0.65rem;
}

.dashboard-shell--compact .bo-lang-label,
.dashboard-shell .bo-lang-label {
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}

.dashboard-shell--compact .bo-lang-block,
.dashboard-shell .bo-lang-block {
  padding: 0.65rem 0.75rem;
}

/* Legacy fieldsets → panel look inside CMS editors */
.bo-cms-section-stack .bo-fieldset--panel {
  border: 1px solid var(--cnee-blue-200);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bo-surface);
}

.bo-cms-section-stack .bo-fieldset--panel > .bo-fieldset-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.55rem 0.75rem;
  background: var(--cnee-blue-50);
  border-bottom: 1px solid var(--cnee-blue-200);
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  color: var(--cnee-blue-800);
}

.bo-cms-section-stack .bo-fieldset--panel > .bo-stack-card {
  border: none;
  border-radius: 0;
  padding: 0.75rem 0.85rem;
}

.bo-cms-section-stack .bo-fieldset--panel + .bo-fieldset--panel {
  margin-top: 0;
}

.bo-cms-legend {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.76rem;
  color: var(--bo-muted);
}

/* Documents module */
.bo-doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.bo-doc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--bo-border);
  border-radius: 8px;
}

.bo-doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.bo-doc-table th,
.bo-doc-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--bo-border);
  text-align: left;
  vertical-align: top;
}

.bo-doc-table th {
  background: var(--cnee-blue-50);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cnee-blue-800);
}

.bo-doc-link {
  font-size: 0.76rem;
  color: var(--cnee-blue-600);
}

.bo-doc-thumb {
  margin-top: 0.35rem;
  max-height: 40px;
  max-width: 64px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--bo-border);
}

.bo-doc-preview {
  max-height: 120px;
  max-width: 200px;
  border-radius: 8px;
  border: 1px solid var(--bo-border);
  margin-bottom: 0.5rem;
}

.bo-file-current {
  font-size: 0.76rem;
  color: var(--bo-muted);
  margin: 0 0 0.5rem;
  word-break: break-all;
}

.bo-doc-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.bo-doc-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
}

.bo-doc-category-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  background: var(--bo-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bo-doc-category-card:hover {
  border-color: var(--cnee-blue-400);
  box-shadow: 0 4px 12px rgba(27, 94, 150, 0.1);
}

.bo-doc-category-card__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bo-ink);
}

.bo-doc-category-card__count {
  font-size: 0.72rem;
  color: var(--bo-muted);
}

.bo-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.bo-filter-pill {
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--bo-border);
  font-size: 0.76rem;
  text-decoration: none;
  color: var(--bo-ink);
  background: var(--bo-surface);
}

.bo-filter-pill--active {
  background: var(--cnee-blue-500);
  border-color: var(--cnee-blue-500);
  color: #fff;
}

.bo-yes {
  color: #16a34a;
  font-size: 0.78rem;
  font-weight: 600;
}

.bo-btn-danger {
  color: #b91c1c !important;
  border-color: #fecaca !important;
}

.bo-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--bo-border);
}

/* ── Global module alignment (lists, forms, news editor) ── */
.dashboard-shell .main-panel > section.panel.wide {
  border: 1px solid var(--cnee-blue-200);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  box-shadow: none;
  background: var(--bo-surface);
}

.dashboard-shell .main-panel .bo-filter-bar {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--cnee-blue-50);
  border: 1px solid var(--cnee-blue-200);
  border-radius: 8px;
  gap: 0.5rem;
}

.dashboard-shell .main-panel .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  overflow: hidden;
}

.dashboard-shell .main-panel .data-table th,
.dashboard-shell .main-panel .data-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--bo-border);
  text-align: left;
  vertical-align: top;
}

.dashboard-shell .main-panel .data-table th {
  background: var(--cnee-blue-50);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cnee-blue-800);
}

.bo-cms-section-stack,
.bo-cms-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bo-module-stack .bo-info-banner {
  margin-bottom: 0;
}

.bo-news-step {
  border: 1px solid var(--cnee-blue-200);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bo-surface);
}

.bo-news-step__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: var(--cnee-blue-50);
  border-bottom: 1px solid var(--cnee-blue-200);
}

.bo-news-step__num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--cnee-blue-500);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bo-news-step__title {
  font-size: 0.84rem;
  font-weight: 700;
  margin: 0;
  color: var(--cnee-blue-800);
}

.bo-news-step__hint {
  font-size: 0.76rem;
  color: var(--bo-muted);
  margin: 0.15rem 0 0;
}

.bo-news-step__body {
  padding: 0.75rem 0.85rem;
}

.bo-news-guide {
  border: 1px solid var(--cnee-blue-200);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: var(--cnee-blue-50);
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}
