/* ==========================================================================
   LEO Admin — Design System
   Light/Dark via Bootstrap 5.3 color modes (data-bs-theme on <html>)
   ========================================================================== */

/* ---- Theme tokens ------------------------------------------------------- */
:root,
[data-bs-theme="light"] {
  --leo-bg: #f6f7f9;
  --leo-surface: #ffffff;
  --leo-surface-2: #f9fafb;
  --leo-surface-3: #f2f4f7;
  --leo-sidebar-bg: #ffffff;
  --leo-border: #e6e8ec;
  --leo-border-strong: #d4d7dd;
  --leo-text: #101828;
  --leo-text-2: #344054;
  --leo-text-muted: #667085;
  --leo-sidebar-text: #344054;
  --leo-sidebar-muted: #98a2b3;
  --leo-header-bg: rgba(255, 255, 255, 0.86);
  --leo-active-bg: #eef2ff;
  --leo-active-text: #4338ca;
  --leo-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --leo-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

  --bs-body-bg: var(--leo-bg);
  --bs-body-color: var(--leo-text);
  --bs-border-color: var(--leo-border);
}

[data-bs-theme="dark"] {
  --leo-bg: #0c111b;
  --leo-surface: #141a26;
  --leo-surface-2: #182030;
  --leo-surface-3: #1d2638;
  --leo-sidebar-bg: #0f1520;
  --leo-border: #232c3d;
  --leo-border-strong: #2f3a50;
  --leo-text: #eef1f6;
  --leo-text-2: #c9d0dc;
  --leo-text-muted: #8a94a7;
  --leo-sidebar-text: #c9d0dc;
  --leo-sidebar-muted: #6b7588;
  --leo-header-bg: rgba(12, 17, 27, 0.86);
  --leo-active-bg: rgba(99, 102, 241, 0.16);
  --leo-active-text: #a5b4fc;
  --leo-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --leo-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);

  --bs-body-bg: var(--leo-bg);
  --bs-body-color: var(--leo-text);
  --bs-border-color: var(--leo-border);
  --bs-secondary-color: var(--leo-text-muted);
}

/* Brand accent + semantic tones (shared across themes) */
:root {
  --leo-brand-1: #4f46e5;
  --leo-brand-2: #6366f1;
  --leo-brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: #4338ca;

  --leo-success: #12b76a;
  --leo-warning: #f79009;
  --leo-danger: #f04438;
  --leo-info: #0ba5ec;
  --leo-radius: 12px;
  --leo-radius-sm: 8px;
}
[data-bs-theme="dark"] {
  --bs-link-color: #a5b4fc;
  --bs-link-color-rgb: 165, 180, 252;
  --bs-link-hover-color: #c7d2fe;
}

* { -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--leo-bg);
  color: var(--leo-text);
  font-size: 0.9rem;
  font-feature-settings: 'cv11', 'ss01';
}
.text-muted { color: var(--leo-text-muted) !important; }
a { text-decoration: none; }

/* ---- Layout scaffold ---------------------------------------------------- */
.leo-shell { min-height: 100vh; }

.leo-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 248px;
  background: var(--leo-sidebar-bg);
  border-right: 1px solid var(--leo-border);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.24s ease;
  overflow-y: auto;
}

.leo-main {
  margin-left: 248px;
  min-height: 100vh;
  transition: margin-left 0.24s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

html.sidebar-collapsed .leo-sidebar { transform: translateX(-100%); }
html.sidebar-collapsed .leo-main { margin-left: 0; }

/* ---- Sidebar brand ------------------------------------------------------ */
.leo-brand {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 1rem 1.15rem;
  height: 61px;
  border-bottom: 1px solid var(--leo-border);
}
.leo-brand-badge {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--leo-brand-1);
  color: #fff;
  display: grid; place-items: center;
  font-size: 1rem;
  flex: none;
}
.leo-brand-name { font-weight: 700; font-size: 1rem; line-height: 1.1; color: var(--leo-text); letter-spacing: -0.01em; }
.leo-brand-role { font-size: 0.7rem; font-weight: 500; color: var(--leo-text-muted); }

/* ---- Sidebar nav -------------------------------------------------------- */
.leo-nav { padding: 0.6rem 0.65rem 1.5rem; flex: 1; }
.leo-nav-section {
  padding: 1rem 0.65rem 0.35rem;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--leo-sidebar-muted);
}
.leo-nav-link {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0.65rem;
  margin-bottom: 1px;
  border-radius: var(--leo-radius-sm);
  color: var(--leo-sidebar-text);
  font-weight: 500; font-size: 0.875rem;
  transition: background 0.12s, color 0.12s;
}
.leo-nav-link i { font-size: 1rem; width: 1.15rem; text-align: center; color: var(--leo-sidebar-muted); }
.leo-nav-link:hover { background: var(--leo-surface-3); color: var(--leo-text); }
.leo-nav-link.active { background: var(--leo-active-bg); color: var(--leo-active-text); font-weight: 600; }
.leo-nav-link.active i { color: var(--leo-active-text); }
.leo-nav-badge {
  margin-left: auto; font-size: 0.7rem; font-weight: 600;
  background: var(--leo-surface-3); color: var(--leo-text-muted);
  border-radius: 999px; padding: 0.05rem 0.5rem;
}

.leo-sidebar-footer {
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--leo-border);
  font-size: 0.75rem; color: var(--leo-text-muted);
}

/* ---- Header ------------------------------------------------------------- */
.leo-header {
  position: sticky; top: 0;
  z-index: 1030;
  display: flex; align-items: center; gap: 0.65rem;
  height: 61px;
  padding: 0 1.5rem;
  background: var(--leo-header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--leo-border);
}
.leo-icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--leo-border);
  background: var(--leo-surface);
  border-radius: var(--leo-radius-sm);
  color: var(--leo-text-muted);
  display: grid; place-items: center;
  font-size: 1rem;
  transition: all 0.12s;
  position: relative;
}
.leo-icon-btn:hover { color: var(--leo-text); border-color: var(--leo-border-strong); background: var(--leo-surface-2); }

.leo-search { position: relative; flex: 1; max-width: 380px; }
.leo-search i {
  position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%);
  color: var(--leo-text-muted); font-size: 0.9rem;
}
.leo-search input {
  width: 100%;
  height: 36px;
  padding: 0 0.85rem 0 2.25rem;
  border: 1px solid var(--leo-border);
  border-radius: var(--leo-radius-sm);
  background: var(--leo-surface);
  color: var(--leo-text);
  font-size: 0.875rem;
}
.leo-search input:focus { outline: none; border-color: var(--leo-brand-2); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.leo-search kbd {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%);
  background: var(--leo-surface-3); color: var(--leo-text-muted);
  border: 1px solid var(--leo-border); border-radius: 5px;
  font-size: 0.7rem; padding: 0.05rem 0.35rem; font-family: inherit;
}

.leo-header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

.leo-bell-dot {
  position: absolute; top: 6px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--leo-danger);
  border: 2px solid var(--leo-surface);
  display: none;
}
.leo-bell-dot.show { display: block; }

.leo-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--leo-brand-1);
  color: #fff; font-weight: 600; font-size: 0.8rem;
  display: grid; place-items: center; flex: none;
}

.leo-alerts-menu { width: 340px; max-width: 90vw; padding: 0; }
.leo-alerts-menu .dropdown-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; font-weight: 600; color: var(--leo-text);
}
.leo-alert-item {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.7rem 1rem; border-top: 1px solid var(--leo-border);
  color: var(--leo-text); font-size: 0.85rem;
}
.leo-alert-item:hover { background: var(--leo-surface-2); }
.leo-alert-ico {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-size: 0.9rem;
}

.dropdown-menu {
  border: 1px solid var(--leo-border);
  border-radius: var(--leo-radius);
  background: var(--leo-surface);
  font-size: 0.875rem;
}
.dropdown-item { border-radius: 6px; margin: 0 0.3rem; width: auto; padding: 0.45rem 0.7rem; }
.dropdown-menu { padding: 0.3rem 0; }

/* ---- Content ------------------------------------------------------------ */
.leo-content { padding: 1.5rem; flex: 1; max-width: 1600px; width: 100%; }

.leo-page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.leo-page-title { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.015em; margin: 0; color: var(--leo-text); }
.leo-page-subtitle { margin: 0.2rem 0 0; color: var(--leo-text-muted); font-size: 0.875rem; }
.leo-page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* Legacy headings in older views: keep them calm */
.leo-content h1.h3, .leo-content h2.h3 { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.015em; }
.leo-content h1.h3 > i, .leo-content h2.h3 > i { display: none; }

/* ---- Cards ---------------------------------------------------------------- */
.card {
  background: var(--leo-surface);
  border: 1px solid var(--leo-border);
  border-radius: var(--leo-radius);
  box-shadow: var(--leo-shadow);
  --bs-card-bg: var(--leo-surface);
}
.card.shadow-sm { box-shadow: var(--leo-shadow) !important; }
.card.border-0 { border: 1px solid var(--leo-border) !important; }
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--leo-border);
  padding: 0.85rem 1.15rem;
  font-weight: 600;
  font-size: 0.925rem;
}
.card-header h5, .card-header h6 { font-size: 0.925rem; font-weight: 600; margin: 0; }
.card-body { padding: 1.15rem; }

.leo-card-title { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.leo-card-title small { color: var(--leo-text-muted); font-weight: 400; }

/* ---- Stat tiles ----------------------------------------------------------- */
.leo-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.85rem; margin-bottom: 1.25rem; }
.leo-stat {
  display: flex; gap: 0.85rem; align-items: flex-start;
  background: var(--leo-surface);
  border: 1px solid var(--leo-border);
  border-radius: var(--leo-radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--leo-shadow);
  min-width: 0;
}
.leo-stat-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 1.05rem;
}
.leo-stat-body { min-width: 0; }
.leo-stat-label { font-size: 0.8rem; color: var(--leo-text-muted); font-weight: 500; }
.leo-stat-value { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; color: var(--leo-text); font-variant-numeric: tabular-nums; }
.leo-stat-sub { font-size: 0.78rem; color: var(--leo-text-muted); margin-top: 0.15rem; }

.leo-tone-primary { background: rgba(79, 70, 229, 0.1); color: #4f46e5; }
.leo-tone-success { background: rgba(18, 183, 106, 0.12); color: #039855; }
.leo-tone-warning { background: rgba(247, 144, 9, 0.12); color: #dc6803; }
.leo-tone-danger  { background: rgba(240, 68, 56, 0.12); color: #d92d20; }
.leo-tone-info    { background: rgba(11, 165, 236, 0.12); color: #0086c9; }
.leo-tone-neutral { background: var(--leo-surface-3); color: var(--leo-text-muted); }
[data-bs-theme="dark"] .leo-tone-primary { color: #a5b4fc; }
[data-bs-theme="dark"] .leo-tone-success { color: #6ce9a6; }
[data-bs-theme="dark"] .leo-tone-warning { color: #fec84b; }
[data-bs-theme="dark"] .leo-tone-danger  { color: #fda29b; }
[data-bs-theme="dark"] .leo-tone-info    { color: #7cd4fd; }

.leo-delta { display: inline-flex; align-items: center; gap: 0.15rem; font-weight: 600; font-size: 0.75rem; }
.leo-delta-up { color: var(--leo-success); }
.leo-delta-down { color: var(--leo-danger); }
.leo-delta-flat { color: var(--leo-text-muted); }

/* Legacy stat cards from older views */
.stats-card { border-left: 1px solid var(--leo-border); }
.stat-card { position: relative; overflow: hidden; }
.stat-card .stat-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 650; line-height: 1.2; }
.stat-card .stat-label { color: var(--leo-text-muted); font-size: 0.8rem; font-weight: 500; }

/* ---- Buttons ---------------------------------------------------------------- */
.btn { border-radius: var(--leo-radius-sm); font-weight: 500; font-size: 0.875rem; padding: 0.42rem 0.85rem; }
.btn-sm { font-size: 0.8rem; padding: 0.28rem 0.6rem; border-radius: 7px; }
.btn-primary {
  --bs-btn-bg: #4f46e5; --bs-btn-border-color: #4f46e5;
  --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
  --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
  --bs-btn-disabled-bg: #4f46e5; --bs-btn-disabled-border-color: #4f46e5;
  background: #4f46e5; border-color: #4f46e5;
}
.btn-primary:hover { background: #4338ca; border-color: #4338ca; box-shadow: none; filter: none; }
.btn-outline-primary { --bs-btn-color: #4f46e5; --bs-btn-border-color: #c7d2fe; --bs-btn-hover-bg: #4f46e5; --bs-btn-hover-border-color: #4f46e5; }
.btn-light, .btn-outline-secondary {
  --bs-btn-color: var(--leo-text-2); --bs-btn-bg: var(--leo-surface); --bs-btn-border-color: var(--leo-border-strong);
  --bs-btn-hover-color: var(--leo-text); --bs-btn-hover-bg: var(--leo-surface-2); --bs-btn-hover-border-color: var(--leo-border-strong);
  --bs-btn-active-bg: var(--leo-surface-3); --bs-btn-active-color: var(--leo-text);
}
.btn-ghost { background: transparent; border: none; color: var(--leo-text-muted); }
.btn-ghost:hover { background: var(--leo-surface-3); color: var(--leo-text); }

/* ---- Badges ----------------------------------------------------------------- */
.badge { font-weight: 600; border-radius: 6px; padding: 0.32em 0.6em; font-size: 0.72rem; }
.leo-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.72rem; font-weight: 600; line-height: 1;
  padding: 0.3rem 0.55rem; border-radius: 999px; white-space: nowrap;
}
.leo-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.leo-badge-success { background: rgba(18, 183, 106, 0.12); color: #027a48; }
.leo-badge-primary { background: rgba(79, 70, 229, 0.1); color: #4338ca; }
.leo-badge-warning { background: rgba(247, 144, 9, 0.14); color: #b54708; }
.leo-badge-danger  { background: rgba(240, 68, 56, 0.12); color: #b42318; }
.leo-badge-secondary { background: var(--leo-surface-3); color: var(--leo-text-muted); }
[data-bs-theme="dark"] .leo-badge-success { color: #6ce9a6; }
[data-bs-theme="dark"] .leo-badge-primary { color: #a5b4fc; }
[data-bs-theme="dark"] .leo-badge-warning { color: #fec84b; }
[data-bs-theme="dark"] .leo-badge-danger  { color: #fda29b; }

.leo-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; font-weight: 500; color: var(--leo-text-2);
  background: var(--leo-surface-3); border: 1px solid var(--leo-border);
  border-radius: 6px; padding: 0.15rem 0.45rem; white-space: nowrap;
}

.leo-score {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 24px; padding: 0 0.4rem;
  border-radius: 6px; font-weight: 700; font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.leo-score-success { background: rgba(18, 183, 106, 0.12); color: #027a48; }
.leo-score-primary { background: rgba(79, 70, 229, 0.1); color: #4338ca; }
.leo-score-warning { background: rgba(247, 144, 9, 0.14); color: #b54708; }
.leo-score-danger  { background: rgba(240, 68, 56, 0.12); color: #b42318; }
[data-bs-theme="dark"] .leo-score-success { color: #6ce9a6; }
[data-bs-theme="dark"] .leo-score-primary { color: #a5b4fc; }
[data-bs-theme="dark"] .leo-score-warning { color: #fec84b; }
[data-bs-theme="dark"] .leo-score-danger  { color: #fda29b; }

/* ---- Users ------------------------------------------------------------------ */
.leo-user-avatar {
  display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; font-weight: 600; letter-spacing: 0.02em;
  background: hsl(var(--hue, 240) 70% 94%);
  color: hsl(var(--hue, 240) 55% 38%);
}
[data-bs-theme="dark"] .leo-user-avatar { background: hsl(var(--hue, 240) 40% 22%); color: hsl(var(--hue, 240) 80% 80%); }
.leo-user-cell { display: inline-flex; align-items: center; gap: 0.6rem; color: inherit; min-width: 0; }
.leo-user-cell > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.leo-user-name { font-weight: 600; color: var(--leo-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.leo-user-email { font-size: 0.78rem; color: var(--leo-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
a.leo-user-cell:hover .leo-user-name { color: var(--leo-brand-1); }

/* ---- Tables ----------------------------------------------------------------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--leo-text); --bs-table-hover-bg: var(--leo-surface-2); margin-bottom: 0; font-size: 0.85rem; }
.table > :not(caption) > * > * { padding: 0.7rem 0.85rem; border-bottom-color: var(--leo-border); }
.table thead th {
  background: var(--leo-surface-2);
  border-bottom: 1px solid var(--leo-border);
  font-weight: 600; text-transform: uppercase;
  font-size: 0.7rem; letter-spacing: 0.04em;
  color: var(--leo-text-muted);
  white-space: nowrap;
}
.table tbody tr:last-child > * { border-bottom: none; }
.leo-table-card { padding: 0; overflow: hidden; }
.leo-table-card .table-responsive { margin: 0; }
.leo-table-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; border-top: 1px solid var(--leo-border);
  font-size: 0.8rem; color: var(--leo-text-muted);
}
.leo-row-link { cursor: pointer; }
.leo-cell-truncate { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leo-num { font-variant-numeric: tabular-nums; text-align: right; }

.pagination { --bs-pagination-color: var(--leo-text-2); --bs-pagination-bg: var(--leo-surface); --bs-pagination-border-color: var(--leo-border);
  --bs-pagination-hover-bg: var(--leo-surface-2); --bs-pagination-hover-color: var(--leo-text); --bs-pagination-hover-border-color: var(--leo-border);
  --bs-pagination-active-bg: #4f46e5; --bs-pagination-active-border-color: #4f46e5;
  --bs-pagination-disabled-bg: var(--leo-surface); --bs-pagination-disabled-color: var(--leo-text-muted); --bs-pagination-disabled-border-color: var(--leo-border);
  --bs-pagination-focus-box-shadow: none; }
.pagination-sm .page-link { min-width: 30px; text-align: center; }

/* ---- Filters / toolbar ------------------------------------------------------ */
.leo-toolbar {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--leo-border);
}
.leo-toolbar .form-control, .leo-toolbar .form-select { height: 34px; font-size: 0.85rem; padding-top: 0; padding-bottom: 0; }
.leo-toolbar .leo-grow { flex: 1 1 220px; min-width: 180px; }
.leo-toolbar .form-select { width: auto; min-width: 140px; }

.leo-tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--leo-border); margin-bottom: 1rem; overflow-x: auto; }
.leo-tab {
  padding: 0.55rem 0.85rem; color: var(--leo-text-muted); font-weight: 500; font-size: 0.875rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.leo-tab:hover { color: var(--leo-text); }
.leo-tab.active { color: var(--leo-active-text); border-bottom-color: var(--leo-brand-1); font-weight: 600; }
.leo-tab-count { font-size: 0.72rem; background: var(--leo-surface-3); color: var(--leo-text-muted); border-radius: 999px; padding: 0.05rem 0.45rem; margin-left: 0.2rem; }

/* ---- Forms ------------------------------------------------------------------ */
.form-control, .form-select {
  border-radius: var(--leo-radius-sm);
  border-color: var(--leo-border-strong);
  background-color: var(--leo-surface);
  color: var(--leo-text);
  font-size: 0.875rem;
}
.form-control:focus, .form-select:focus { border-color: var(--leo-brand-2); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); background-color: var(--leo-surface); color: var(--leo-text); }
.form-label { font-weight: 500; font-size: 0.82rem; color: var(--leo-text-2); margin-bottom: 0.3rem; }
.form-text { color: var(--leo-text-muted); }
.form-check-input:checked { background-color: #4f46e5; border-color: #4f46e5; }

/* ---- Description lists / detail pages -------------------------------------- */
.leo-dl { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 0.55rem 1rem; margin: 0; font-size: 0.85rem; }
.leo-dl dt { color: var(--leo-text-muted); font-weight: 500; }
.leo-dl dd { margin: 0; color: var(--leo-text); min-width: 0; overflow-wrap: anywhere; }

.leo-prose { white-space: pre-wrap; font-size: 0.875rem; line-height: 1.6; color: var(--leo-text-2); }

/* ---- Empty states ----------------------------------------------------------- */
.leo-empty { text-align: center; padding: 2.5rem 1rem; color: var(--leo-text-muted); }
.leo-empty i { font-size: 1.75rem; display: block; margin-bottom: 0.5rem; opacity: 0.6; }
.leo-empty-title { font-weight: 600; color: var(--leo-text-2); }
.leo-empty-text { font-size: 0.85rem; margin-top: 0.2rem; }

/* ---- Bars (inline mini charts) --------------------------------------------- */
.leo-bar-row { display: grid; grid-template-columns: 140px 1fr 56px; gap: 0.75rem; align-items: center; font-size: 0.82rem; margin-bottom: 0.55rem; }
.leo-bar-row:last-child { margin-bottom: 0; }
.leo-bar { height: 8px; background: var(--leo-surface-3); border-radius: 999px; overflow: hidden; }
.leo-bar > span { display: block; height: 100%; background: var(--leo-brand-2); border-radius: 999px; }
.leo-bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--leo-text-2); }

/* ---- Misc ------------------------------------------------------------------- */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.status-dot.online { background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.2); }
.status-dot.offline { background: #98a2b3; }

.modal-content { border: 1px solid var(--leo-border); border-radius: var(--leo-radius); background: var(--leo-surface); }
.modal-header, .modal-footer { border-color: var(--leo-border); }
.nav-tabs { --bs-nav-tabs-border-color: var(--leo-border); --bs-nav-tabs-link-active-bg: var(--leo-surface); --bs-nav-tabs-link-active-border-color: var(--leo-border) var(--leo-border) var(--leo-surface); }
.list-group { --bs-list-group-bg: var(--leo-surface); --bs-list-group-border-color: var(--leo-border); }
.alert { border-radius: var(--leo-radius-sm); font-size: 0.875rem; }
code { color: #c11574; }
[data-bs-theme="dark"] code { color: #f670c7; }

/* ---- Mobile drawer ---------------------------------------------------------- */
.leo-backdrop {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.5);
  z-index: 1035;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}

@media (max-width: 991.98px) {
  .leo-sidebar { transform: translateX(-100%); }
  .leo-main { margin-left: 0; }
  html.sidebar-open .leo-sidebar { transform: translateX(0); }
  html.sidebar-open .leo-backdrop { opacity: 1; pointer-events: auto; }
  html.sidebar-collapsed .leo-sidebar { transform: translateX(-100%); }
  html.sidebar-collapsed .leo-main { margin-left: 0; }
  .leo-search { max-width: none; }
  .leo-header { padding: 0 1rem; }
}

@media (max-width: 575.98px) {
  .leo-search { display: none; }
  .leo-content { padding: 1rem 0.85rem; }
  .leo-stats { grid-template-columns: 1fr 1fr; }
  .leo-bar-row { grid-template-columns: 90px 1fr 44px; }
}

/* Gentle fade-in */
@keyframes leoFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.leo-content > * { animation: leoFadeIn 0.25s ease-out; }

/* Toasts */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; }
