/* ════════════════════════════════════════════════════════════════
   ProjexaPM Backoffice — Admin Console
   Design system: matches main app palette (light bg + navy sidebar)
   ════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bo-sidebar-w: 248px;
  --bo-topbar-h: 58px;
  --bo-radius: 10px;
  --bo-radius-lg: 12px;

  /* ── Main app surfaces (light) ── */
  --bo-bg: #eef2f9;
  --bo-bg-deep: #e3e9f3;
  --bo-surface: #ffffff;
  --bo-surface-2: #f6f8fc;
  --bo-surface-3: #e9eef7;

  /* ── Borders ── */
  --bo-border: #d6dee9;
  --bo-border-2: #b3bdcc;

  /* ── Text ── */
  --bo-text: #0a0f1d;
  --bo-text-2: #1f2a44;
  --bo-text-3: #4a5876;
  --bo-text-faint: #7a8499;

  /* ── Primary (blue, same as main app) ── */
  --bo-accent: #1e40af;
  --bo-accent-h: #1e3a8a;
  --bo-accent-soft: #dde7ff;
  --bo-accent-border: rgba(30,64,175,0.25);

  /* ── Cyan accent (secondary) ── */
  --bo-cyan: #0891b2;
  --bo-cyan-h: #0e7490;
  --bo-cyan-soft: #cffafe;

  /* ── Sidebar (dark navy — same as main app) ── */
  --bo-sidebar-bg: #050b1c;
  --bo-sidebar-bg-2: #0c1730;
  --bo-sidebar-text: #cbd2dd;
  --bo-sidebar-text-muted: #6c7791;
  --bo-sidebar-active: #1a2848;
  --bo-sidebar-divider: #1a253f;

  /* ── Topbar (white like main app cards) ── */
  --bo-topbar: #ffffff;

  /* ── Status ── */
  --bo-success: #047857;
  --bo-success-strong: #065f46;
  --bo-success-soft: #c5f3df;
  --bo-warning: #d97706;
  --bo-warning-strong: #b45309;
  --bo-warning-soft: #fde9c4;
  --bo-danger: #b91c1c;
  --bo-danger-strong: #991b1b;
  --bo-danger-soft: #fbd5d5;
  --bo-info: #0369a1;
  --bo-info-soft: #c6e6fb;
  --bo-purple: #6d28d9;
  --bo-purple-soft: #ddd0fc;
  --bo-muted-soft: #e9eef7;

  /* ── Shadows ── */
  --bo-shadow-xs: 0 1px 2px rgba(8,14,32,0.05);
  --bo-shadow-sm: 0 1px 3px rgba(8,14,32,0.07), 0 1px 2px rgba(8,14,32,0.05);
  --bo-shadow:    0 4px 8px -2px rgba(8,14,32,0.10), 0 2px 4px -2px rgba(8,14,32,0.06);
  --bo-shadow-md: 0 12px 18px -4px rgba(8,14,32,0.13), 0 4px 6px -2px rgba(8,14,32,0.06);
  --bo-ring: 0 0 0 3px rgba(30,64,175,0.18);

  /* ── Fonts ── */
  --bo-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bo-font-mono: 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--bo-font);
  background: var(--bo-bg);
  color: var(--bo-text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}
a { color: var(--bo-accent); text-decoration: none; }
a:hover { color: var(--bo-accent-h); }
button { font-family: var(--bo-font); cursor: pointer; }
input, select, textarea { font-family: var(--bo-font); }

/* ── Shell Layout ── */
#bo-shell {
  display: flex;
  min-height: 100vh;
}
#bo-shell.hidden { display: none; }

/* ════════════════════════════════════
   SIDEBAR — dark navy (same as main app)
   ════════════════════════════════════ */
#bo-sidebar {
  width: var(--bo-sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bo-sidebar-bg) 0%, var(--bo-sidebar-bg-2) 100%);
  color: var(--bo-sidebar-text);
  border-right: none;
  box-shadow: 1px 0 0 rgba(255,255,255,0.04), 4px 0 24px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.07) transparent;
}
#bo-sidebar::-webkit-scrollbar { width: 3px; }
#bo-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* ── Brand ── */
.bo-brand {
  padding: 0 12px 14px 16px;
  border-bottom: 1px solid var(--bo-sidebar-divider);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 16px;
}
.bo-brand-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.bo-brand-text { flex: 1; min-width: 0; }
.bo-brand-name {
  font-weight: 700; font-size: 13px; color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bo-brand-tag {
  font-size: 10px; font-weight: 600;
  color: #93c5fd;
  text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--bo-sidebar-active);
  border: 1px solid rgba(59,130,246,0.25);
  padding: 1px 7px; border-radius: 10px;
  display: inline-block; margin-top: 2px;
}

/* ── Sidebar Navigation ── */
#bo-nav { flex: 1; padding: 10px 8px 4px; }

.bo-nav-section { margin-bottom: 2px; }
.bo-nav-section-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--bo-sidebar-text-muted);
  cursor: default;
  border-radius: 6px;
  user-select: none;
  margin-top: 8px;
}
.bo-nav-section:first-child .bo-nav-section-label { margin-top: 0; }

.bo-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px;
  color: var(--bo-sidebar-text);
  font-size: 12.5px; font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}
.bo-nav-item:hover {
  background: var(--bo-sidebar-active);
  color: #ffffff;
}
.bo-nav-item:hover .bo-nav-icon,
.bo-nav-item:hover i { color: #93c5fd; }
.bo-nav-item.active {
  background: linear-gradient(90deg, rgba(59,130,246,.20), rgba(59,130,246,.07));
  color: #ffffff;
  box-shadow: inset 2px 0 0 #1e40af;
}
.bo-nav-item.active .bo-nav-icon,
.bo-nav-item.active i { color: #93c5fd; }
.bo-nav-icon,
.bo-nav-item i {
  width: 15px; text-align: center;
  color: var(--bo-sidebar-text-muted);
  font-size: 12px; flex-shrink: 0;
}
.bo-nav-badge {
  margin-left: auto;
  background: var(--bo-sidebar-active);
  color: #93c5fd;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
}
.bo-nav-badge.danger {
  background: rgba(185,28,28,0.18);
  color: #fca5a5;
}

/* ── Sidebar Footer ── */
.bo-sidebar-footer {
  border-top: 1px solid var(--bo-sidebar-divider);
  padding: 8px 8px 10px;
  flex-shrink: 0;
}
.bo-sidebar-user {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s;
}
.bo-sidebar-user:hover { background: var(--bo-sidebar-active); }
.bo-sidebar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff;
  flex-shrink: 0;
}
.bo-sidebar-user-info { flex: 1; min-width: 0; }
.bo-sidebar-user-name {
  font-size: 12.5px; font-weight: 600; color: var(--bo-sidebar-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bo-sidebar-user-role {
  font-size: 10px; color: #93c5fd;
  font-weight: 600;
}
.bo-back-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  color: var(--bo-sidebar-text-muted); font-size: 12.5px; font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 4px;
}
.bo-back-btn:hover { background: var(--bo-sidebar-active); color: var(--bo-sidebar-text); }
.bo-back-btn .bo-nav-icon { color: var(--bo-sidebar-text-muted); }

/* ════════════════════════════════════
   MAIN CONTENT — light bg (same as main app)
   ════════════════════════════════════ */
#bo-main {
  flex: 1;
  margin-left: var(--bo-sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  background: var(--bo-bg);
}

/* ── Topbar ── */
#bo-topbar {
  height: var(--bo-topbar-h);
  background: var(--bo-topbar);
  border-bottom: 1px solid var(--bo-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--bo-shadow-xs);
}
.bo-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--bo-text-3);
}
.bo-breadcrumb-sep { opacity: 0.5; }
.bo-breadcrumb-current { color: var(--bo-text); font-weight: 500; }
.bo-topbar-right {
  display: flex; align-items: center; gap: 12px;
}
.bo-topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ── View content area ── */
#bo-view {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}

/* ── Page header ── */
.bo-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.bo-page-title {
  font-size: 22px; font-weight: 700; color: var(--bo-text);
  letter-spacing: -0.02em;
}
.bo-page-sub { font-size: 13px; color: var(--bo-text-3); margin-top: 4px; }
.bo-page-header-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/* ── Cards ── */
.bo-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--bo-shadow-xs);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.bo-card:hover { box-shadow: var(--bo-shadow-sm); }
.bo-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.bo-card-title {
  font-size: 14px; font-weight: 700; color: var(--bo-text);
  letter-spacing: -0.01em;
}
.bo-card-sub {
  font-size: 12px; color: var(--bo-text-3); margin-top: 2px;
}

/* ── Stat Cards ── */
.bo-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.bo-stat-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--bo-shadow-xs);
}
.bo-stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--bo-accent);
}
.bo-stat-card.success::before { background: linear-gradient(180deg, var(--bo-success), var(--bo-success-strong)); }
.bo-stat-card.warning::before { background: linear-gradient(180deg, var(--bo-warning), var(--bo-warning-strong)); }
.bo-stat-card.danger::before  { background: linear-gradient(180deg, var(--bo-danger),  var(--bo-danger-strong)); }
.bo-stat-card.accent::before  { background: linear-gradient(180deg, var(--bo-cyan),    var(--bo-cyan-h)); }
.bo-stat-card.purple::before  { background: linear-gradient(180deg, var(--bo-purple),  #5b21b6); }
.bo-stat-card:hover { box-shadow: var(--bo-shadow-sm); }
.bo-stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.bo-stat-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.bo-stat-icon.indigo { background: var(--bo-accent-soft); color: var(--bo-accent); }
.bo-stat-icon.green  { background: var(--bo-success-soft); color: var(--bo-success); }
.bo-stat-icon.amber  { background: var(--bo-warning-soft); color: var(--bo-warning); }
.bo-stat-icon.red    { background: var(--bo-danger-soft);  color: var(--bo-danger); }
.bo-stat-icon.cyan   { background: var(--bo-cyan-soft);   color: var(--bo-cyan); }
.bo-stat-icon.purple { background: var(--bo-purple-soft); color: var(--bo-purple); }
.bo-stat-icon.muted  { background: var(--bo-surface-3);  color: var(--bo-text-3); }
.bo-stat-trend {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px;
}
.bo-stat-trend.up { background: var(--bo-success-soft); color: var(--bo-success-strong); }
.bo-stat-trend.neutral { background: var(--bo-muted-soft); color: var(--bo-text-3); }
.bo-stat-label {
  font-size: 11px; color: var(--bo-text-3);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.bo-stat-value {
  font-size: 24px; font-weight: 700; color: var(--bo-text);
  letter-spacing: -0.02em; margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.bo-stat-sub { font-size: 11px; color: var(--bo-text-3); margin-top: 2px; }

/* ── Tables ── */
.bo-table-wrap {
  overflow-x: auto;
  border-radius: var(--bo-radius);
  border: 1px solid var(--bo-border);
}
table.bo-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
table.bo-table thead th {
  background: var(--bo-surface-2);
  padding: 9px 14px;
  text-align: left;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--bo-text-3);
  border-bottom: 1px solid var(--bo-border);
  white-space: nowrap;
}
table.bo-table tbody tr {
  border-bottom: 1px solid var(--bo-border);
  transition: background 0.1s;
}
table.bo-table tbody tr:last-child { border-bottom: none; }
table.bo-table tbody tr:hover { background: var(--bo-surface-2); }
table.bo-table td {
  padding: 10px 14px;
  color: var(--bo-text);
  vertical-align: middle;
}
table.bo-table td.muted { color: var(--bo-text-3); }
table.bo-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.bo-table td.actions { text-align: right; white-space: nowrap; }

/* ── Badges ── */
.bo-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 100px;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  line-height: 1.5;
  border: 1px solid transparent;
  white-space: nowrap;
}
.bo-badge.success { background: var(--bo-success-soft); color: var(--bo-success-strong); border-color: rgba(4,120,87,0.18); }
.bo-badge.warning { background: var(--bo-warning-soft); color: var(--bo-warning-strong); border-color: rgba(217,119,6,0.18); }
.bo-badge.danger  { background: var(--bo-danger-soft);  color: var(--bo-danger-strong);  border-color: rgba(185,28,28,0.18); }
.bo-badge.info    { background: var(--bo-info-soft);    color: var(--bo-info);           border-color: rgba(3,105,161,0.18); }
.bo-badge.muted   { background: var(--bo-surface-3);    color: var(--bo-text-3);         border-color: var(--bo-border); }
.bo-badge.accent  { background: var(--bo-accent-soft);  color: var(--bo-accent);         border-color: var(--bo-accent-border); }
.bo-badge.purple  { background: var(--bo-purple-soft);  color: var(--bo-purple);         border-color: rgba(109,40,217,0.18); }
.bo-badge.cyan    { background: var(--bo-cyan-soft);    color: var(--bo-cyan-h);         border-color: rgba(8,145,178,0.18); }
.bo-badge i { font-size: 9px; }

/* ── Buttons ── */
.bo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 8px;
  font-size: 13px; font-weight: 600; border: 1px solid transparent;
  cursor: pointer; transition: background 0.15s, transform 0.05s, box-shadow 0.15s, border-color 0.15s;
  white-space: nowrap; letter-spacing: -0.005em;
  font-family: var(--bo-font);
  box-shadow: var(--bo-shadow-xs);
}
.bo-btn:active { transform: translateY(1px); }
.bo-btn:focus-visible { outline: none; box-shadow: var(--bo-ring); }
.bo-btn-primary {
  background: var(--bo-accent); color: #fff;
}
.bo-btn-primary:hover { background: var(--bo-accent-h); }
.bo-btn-secondary {
  background: var(--bo-surface); color: var(--bo-text);
  border-color: var(--bo-border-2);
}
.bo-btn-secondary:hover { background: var(--bo-surface-2); border-color: var(--bo-accent); color: var(--bo-accent); }
.bo-btn-danger {
  background: var(--bo-danger); color: #fff;
}
.bo-btn-danger:hover { background: var(--bo-danger-strong); }
.bo-btn-success {
  background: var(--bo-success); color: #fff;
}
.bo-btn-success:hover { background: var(--bo-success-strong); }
.bo-btn-warning {
  background: var(--bo-warning); color: #fff;
}
.bo-btn-warning:hover { background: var(--bo-warning-strong); }
.bo-btn-ghost {
  background: transparent; color: var(--bo-text-3);
  box-shadow: none; border-color: transparent;
}
.bo-btn-ghost:hover { background: var(--bo-surface-3); color: var(--bo-text); }
.bo-btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.bo-btn-lg { padding: 11px 20px; font-size: 14px; border-radius: 9px; }
.bo-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.bo-icon-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: none;
  background: transparent; color: var(--bo-text-3);
  cursor: pointer; transition: all 0.12s;
}
.bo-icon-btn:hover { background: var(--bo-surface-3); color: var(--bo-text); }
.bo-icon-btn.danger:hover { background: var(--bo-danger-soft); color: var(--bo-danger); }

/* ── Forms ── */
.bo-field { margin-bottom: 16px; }
.bo-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--bo-text-3); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.bo-input, .bo-select, .bo-textarea {
  width: 100%;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  color: var(--bo-text);
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--bo-font);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.bo-input:focus, .bo-select:focus, .bo-textarea:focus {
  border-color: var(--bo-accent);
  box-shadow: var(--bo-ring);
}
.bo-input::placeholder { color: var(--bo-text-faint); }
.bo-select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5876' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
.bo-textarea { min-height: 80px; resize: vertical; }
.bo-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bo-form-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* ── Search / Filter bar ── */
.bo-filter-bar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px;
}
.bo-search {
  flex: 1; min-width: 200px; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  padding: 7px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--bo-shadow-xs);
}
.bo-search:focus-within { border-color: var(--bo-accent); box-shadow: var(--bo-ring); }
.bo-search i { color: var(--bo-text-faint); flex-shrink: 0; font-size: 12px; }
.bo-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--bo-text); font-size: 13px; font-family: var(--bo-font);
}
.bo-search input::placeholder { color: var(--bo-text-faint); }

/* ── Modal ── */
.bo-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(8,14,32,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.bo-modal-overlay.hidden { display: none; }
.bo-modal {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-lg);
  width: 100%; max-width: 540px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--bo-shadow-md);
}
.bo-modal-lg { max-width: 760px; }
.bo-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.bo-modal-title { font-size: 17px; font-weight: 700; color: var(--bo-text); }
.bo-modal-body { padding: 20px 24px; }
.bo-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--bo-border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--bo-surface-2);
  border-radius: 0 0 var(--bo-radius-lg) var(--bo-radius-lg);
}

/* ── Toast ── */
#bo-toast-root {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 2000; display: flex; flex-direction: column-reverse; gap: 8px;
  pointer-events: none;
}
.bo-toast {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-left: 3px solid var(--bo-accent);
  border-radius: var(--bo-radius);
  padding: 12px 16px;
  font-size: 13px; color: var(--bo-text);
  box-shadow: var(--bo-shadow-md);
  display: flex; align-items: center; gap: 10px;
  max-width: 340px;
  pointer-events: all;
  animation: bo-toast-in 0.25s ease;
}
.bo-toast.success { border-left-color: var(--bo-success); }
.bo-toast.error   { border-left-color: var(--bo-danger);  }
.bo-toast.warning { border-left-color: var(--bo-warning); }
@keyframes bo-toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Auth gate ── */
#bo-auth-gate {
  position: fixed; inset: 0;
  background: var(--bo-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
#bo-auth-gate.hidden { display: none; }
.bo-auth-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-lg);
  padding: 40px;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: var(--bo-shadow-md);
}
.bo-auth-icon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 24px; color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}
.bo-auth-title { font-size: 20px; font-weight: 700; color: var(--bo-text); margin-bottom: 8px; }
.bo-auth-sub { font-size: 13px; color: var(--bo-text-3); margin-bottom: 24px; }

/* ── Empty state ── */
.bo-empty {
  text-align: center; padding: 60px 20px;
  color: var(--bo-text-3);
}
.bo-empty-icon { font-size: 40px; margin-bottom: 16px; opacity: 0.35; color: var(--bo-accent); }
.bo-empty-title { font-size: 16px; font-weight: 600; color: var(--bo-text); margin-bottom: 8px; }
.bo-empty-sub { font-size: 13px; max-width: 320px; margin: 0 auto; color: var(--bo-text-3); }

/* ── Loading ── */
.bo-loading {
  text-align: center; padding: 60px 20px;
  color: var(--bo-text-3); font-size: 13px;
}
.bo-spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--bo-border);
  border-top-color: var(--bo-accent);
  border-radius: 50%;
  animation: bo-spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes bo-spin { to { transform: rotate(360deg); } }

/* ── Alert ── */
.bo-alert {
  padding: 12px 16px;
  border-radius: var(--bo-radius);
  font-size: 13px; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: flex-start;
}
.bo-alert.danger  { background: var(--bo-danger-soft);  color: var(--bo-danger-strong);  border: 1px solid rgba(185,28,28,0.2); }
.bo-alert.warning { background: var(--bo-warning-soft); color: var(--bo-warning-strong); border: 1px solid rgba(217,119,6,0.2); }
.bo-alert.success { background: var(--bo-success-soft); color: var(--bo-success-strong); border: 1px solid rgba(4,120,87,0.2); }
.bo-alert.info    { background: var(--bo-info-soft);    color: var(--bo-info);           border: 1px solid rgba(3,105,161,0.2); }

/* ── Info grid / key-value pairs ── */
.bo-info-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.bo-info-grid.three { grid-template-columns: repeat(3, 1fr); }
.bo-info-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bo-text-3); margin-bottom: 4px; }
.bo-info-value { font-size: 14px; color: var(--bo-text); font-weight: 500; }
.bo-info-value.mono { font-family: var(--bo-font-mono); font-size: 12px; }
.bo-info-value.large { font-size: 22px; font-weight: 700; }

/* ── Tabs ── */
.bo-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--bo-border);
  margin-bottom: 20px;
}
.bo-tab {
  padding: 10px 18px;
  font-size: 13px; font-weight: 500;
  color: var(--bo-text-3);
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.15s; margin-bottom: -1px;
}
.bo-tab:hover { color: var(--bo-text); }
.bo-tab.active { color: var(--bo-accent); border-bottom-color: var(--bo-accent); font-weight: 600; }

/* ── Coming soon stub ── */
.bo-stub {
  padding: 40px 0;
}
.bo-stub-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 32px;
}
.bo-stub-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: var(--bo-accent-soft);
  color: var(--bo-accent);
}
.bo-stub-info h2 { font-size: 22px; font-weight: 700; color: var(--bo-text); margin-bottom: 6px; }
.bo-stub-info p  { color: var(--bo-text-3); font-size: 14px; max-width: 560px; }
.bo-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.bo-feature-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-lg);
  padding: 18px;
  box-shadow: var(--bo-shadow-xs);
  transition: box-shadow 0.15s;
}
.bo-feature-card:hover { box-shadow: var(--bo-shadow-sm); }
.bo-feature-card-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; margin-bottom: 10px;
  background: var(--bo-accent-soft);
  color: var(--bo-accent);
}
.bo-feature-card h4 { font-size: 13px; font-weight: 600; color: var(--bo-text); margin-bottom: 5px; }
.bo-feature-card p  { font-size: 12px; color: var(--bo-text-3); line-height: 1.5; }

/* ── Progress bar ── */
.bo-progress { height: 6px; background: var(--bo-surface-3); border-radius: 3px; overflow: hidden; }
.bo-progress-bar { height: 100%; border-radius: 3px; transition: width 0.5s; background: var(--bo-accent); }
.bo-progress-bar.green  { background: var(--bo-success); }
.bo-progress-bar.red    { background: var(--bo-danger); }
.bo-progress-bar.amber  { background: var(--bo-warning); }
.bo-progress-bar.cyan   { background: var(--bo-cyan); }

/* ── Two-col layout helper ── */
.bo-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px;
}
.bo-two-col.main-aside { grid-template-columns: 2fr 1fr; }

/* ── Health metric cards ── */
.bo-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.bo-health-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  padding: 14px;
  box-shadow: var(--bo-shadow-xs);
}
.bo-health-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--bo-text-3); margin-bottom: 8px; }
.bo-health-value { font-size: 20px; font-weight: 700; color: var(--bo-text); }
.bo-health-sub   { font-size: 11px; color: var(--bo-text-3); margin-top: 2px; }
.bo-health-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.bo-health-dot { width: 7px; height: 7px; border-radius: 50%; }
.bo-health-dot.green { background: var(--bo-success); box-shadow: 0 0 6px rgba(4,120,87,0.5); }
.bo-health-dot.amber { background: var(--bo-warning); }
.bo-health-dot.red   { background: var(--bo-danger);  }

/* ── KPI grid (dashboard) ── */
.bo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 16px;
}

/* ── Divider ── */
.bo-divider { border: none; border-top: 1px solid var(--bo-border); margin: 20px 0; }

/* ── View animation ── */
.bo-view { animation: bo-fadein 0.2s ease; }
@keyframes bo-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ── Semáforos ── */
.bo-semaforo { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; flex-shrink: 0; }
.bo-semaforo.green  { background: var(--bo-success); box-shadow: 0 0 0 2px var(--bo-success-soft); }
.bo-semaforo.yellow { background: var(--bo-warning); box-shadow: 0 0 0 2px var(--bo-warning-soft); }
.bo-semaforo.red    { background: var(--bo-danger);  box-shadow: 0 0 0 2px var(--bo-danger-soft);  }
.bo-semaforo.gray   { background: #cbd5e1; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  #bo-sidebar { transform: translateX(-100%); transition: transform 0.25s; }
  #bo-sidebar.open { transform: none; }
  #bo-main { margin-left: 0; }
  .bo-two-col, .bo-two-col.main-aside { grid-template-columns: 1fr; }
  .bo-form-row.three { grid-template-columns: 1fr 1fr; }
  #bo-topbar { padding: 0 16px; }
  #bo-view { padding: 16px; }
}
@media (max-width: 640px) {
  .bo-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bo-form-row { grid-template-columns: 1fr; }
  .bo-form-row.three { grid-template-columns: 1fr; }
  .bo-page-header { flex-direction: column; }
}

/* ── Scrollbar ── */
* { scrollbar-width: thin; scrollbar-color: var(--bo-border) transparent; }
*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-thumb { background: var(--bo-border-2); border-radius: 3px; }

/* ── Utilities ── */
.hidden { display: none !important; }
.text-success { color: var(--bo-success); }
.text-danger  { color: var(--bo-danger); }
.text-warning { color: var(--bo-warning); }
.text-muted   { color: var(--bo-text-3); }
.text-dim     { color: var(--bo-text-faint); }
.text-mono    { font-family: var(--bo-font-mono); font-size: 12px; }
.truncate     { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex         { display: flex; }
.items-center { align-items: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.mt-4         { margin-top: 16px; }
.mb-4         { margin-bottom: 16px; }
.fw-600       { font-weight: 600; }
