/* ==========================================================================
   Harbour (Moss edition) — admin layer for Bootstrap 5.3
   Layer 2 of 2. Loaded AFTER bootstrap.min.css and theme.css, on admin pages
   only. Everything here is scoped to .adm-shell and prefixed adm-, so a new
   vertical or console can be added the same way without touching theme.css.
   ========================================================================== */

.adm-shell {
  --adm-sidebar: 16.25rem;
  --adm-sidebar-collapsed: 4.5rem;
  --adm-topbar: 4.25rem;
  background: var(--bs-body-bg);
}

/* ---------- sidebar ---------- */
.adm-sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
  width: var(--adm-sidebar);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--hb-glass-line);
  background: var(--hb-surface);
  transition: transform .26s var(--hb-ease), width .26s var(--hb-ease);
}
.adm-sidebar-head { display: flex; align-items: center; gap: .5rem; height: var(--adm-topbar); padding: 0 1.25rem; border-bottom: 1px solid var(--hb-line-soft); }
.adm-nav { flex: 1; overflow-y: auto; padding: 1rem .75rem 1.5rem; }
.adm-nav-title { padding: 1rem .75rem .375rem; color: var(--bs-primary); font-family: var(--hb-mono); font-size: .625rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.adm-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .5625rem .875rem; margin-bottom: .125rem;
  border-radius: var(--bs-border-radius-pill);
  color: var(--bs-body-color); font-size: .8125rem; font-weight: 500; text-decoration: none;
  transition: background .16s var(--hb-ease), color .16s var(--hb-ease);
}
.adm-link .bi { font-size: 1rem; color: var(--hb-muted); transition: color .16s var(--hb-ease); }
.adm-link:hover { background: rgba(63, 107, 84, .1); color: var(--hb-ink); }
.adm-link:hover .bi { color: var(--bs-primary-text-emphasis); }
.adm-link.active { background: linear-gradient(135deg, rgba(111, 163, 122, .35), rgba(63, 107, 84, .35)); box-shadow: inset 0 0 0 1px rgba(111, 163, 122, .35); color: var(--hb-ink); font-weight: 600; }
.adm-link.active .bi { color: var(--bs-primary); }
.adm-link .badge { margin-left: auto; }
.adm-sidebar-foot { padding: .75rem; border-top: 1px solid var(--hb-line-soft); }
.adm-upsell { padding: 1rem; border-radius: var(--bs-border-radius-lg); border: 1px solid var(--hb-glass-line); background: linear-gradient(160deg, var(--hb-lilac), var(--hb-peach)); }

/* ---------- topbar + content column ---------- */
.adm-main { margin-left: var(--adm-sidebar); min-height: 100vh; transition: margin .26s var(--hb-ease); }
.adm-topbar {
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center; gap: 1rem;
  height: var(--adm-topbar); padding: 0 1.5rem;
  border-bottom: 1px solid var(--hb-glass-line);
  background: var(--hb-glass);
  backdrop-filter: blur(14px) saturate(160%);
}
.adm-search { position: relative; width: min(22rem, 40vw); }
.adm-search .bi { position: absolute; top: 50%; left: .75rem; color: var(--hb-faint); transform: translateY(-50%); }
.adm-search .form-control { padding-left: 2.25rem; border-radius: var(--bs-border-radius-pill); }
.adm-search .form-control:focus { background: var(--hb-input-bg); }
.adm-body { padding: 1.75rem 1.5rem 3rem; }

/* ---------- dashboard pieces ---------- */
.adm-welcome { position: relative; overflow: hidden; border-radius: var(--bs-border-radius-xl); border: 1px solid var(--hb-glass-line); background: var(--hb-liquid); }
.adm-welcome .blob { filter: blur(50px); opacity: .6; }
.adm-stat { position: relative; overflow: hidden; }
.adm-stat .adm-stat-spark { position: absolute; right: 0; bottom: 0; left: 0; height: 3.25rem; opacity: .9; pointer-events: none; }
.adm-trend { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 600; }
.adm-trend-up { color: var(--hb-mint-ink); }
.adm-trend-down { color: var(--hb-rose-ink); }

/* timeline used by recent activity */
.adm-timeline { position: relative; padding-left: 1.125rem; list-style: none; margin: 0; }
.adm-timeline::before { position: absolute; top: .375rem; bottom: .375rem; left: .3125rem; width: 1px; background: var(--bs-border-color); content: ""; }
.adm-timeline li { position: relative; padding: 0 0 1.125rem 1rem; }
.adm-timeline li::before { position: absolute; top: .3125rem; left: -.9375rem; width: .6875rem; height: .6875rem; border: 2px solid var(--hb-surface); border-radius: 50%; background: var(--bs-primary); box-shadow: 0 0 0 1px var(--bs-border-color); content: ""; }
.adm-timeline li.is-mint::before { background: var(--hb-mint-ink); }
.adm-timeline li.is-peach::before { background: var(--hb-peach-ink); }
.adm-timeline li.is-sky::before { background: var(--hb-sky-ink); }
.adm-timeline li:last-child { padding-bottom: 0; }

/* donut + bar fallbacks so the dashboard still reads if charts don't load */
.adm-chart { min-height: 15rem; }
.adm-chart-sm { min-height: 8.5rem; }

/* table controls */
.adm-table-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem 1.125rem; border-bottom: 1px solid var(--hb-line-soft); }
.adm-bulk { display: none; align-items: center; gap: .75rem; padding: .625rem 1.125rem; background: var(--bs-primary-bg-subtle); border-bottom: 1px solid var(--bs-primary-border-subtle); font-family: var(--hb-mono); font-size: .75rem; }
.adm-bulk.is-on { display: flex; }
.adm-status { display: inline-flex; align-items: center; gap: .375rem; font-size: .75rem; font-weight: 600; }
.adm-status .dot { width: .4375rem; height: .4375rem; border-radius: 50%; background: currentColor; }
.adm-status-live { color: var(--hb-mint-ink); }
.adm-status-draft { color: var(--hb-muted); }
.adm-status-review { color: var(--hb-lemon-ink); }
.adm-status-paused { color: var(--hb-peach-ink); }

/* settings */
.adm-settings-nav .adm-link { font-size: .8125rem; }
.adm-danger-zone { border-color: #eec4ba !important; background: #f9e7e2; }

/* ---------- responsive: sidebar becomes an off-canvas drawer ---------- */
@media (max-width: 1199.98px) {
  .adm-sidebar { transform: translateX(-100%); box-shadow: var(--bs-box-shadow-lg); }
  .adm-shell.is-nav-open .adm-sidebar { transform: none; }
  .adm-main { margin-left: 0; }
  .adm-scrim { position: fixed; inset: 0; z-index: 1035; background: rgba(8, 12, 10, .5); opacity: 0; visibility: hidden; transition: opacity .22s var(--hb-ease), visibility .22s; }
  .adm-shell.is-nav-open .adm-scrim { opacity: 1; visibility: visible; }
}
@media (max-width: 767.98px) {
  .adm-body { padding: 1.25rem 1rem 2.5rem; }
  .adm-topbar { padding: 0 1rem; }
  .adm-search { width: 100%; }
}

/* ---------- dark theme corrections for the admin layer ---------- */
[data-bs-theme="dark"] .adm-danger-zone { border-color: #4d2821 !important; background: #2c1612; }
[data-bs-theme="dark"] .adm-upsell { background: linear-gradient(160deg, #16281f, #33210f); }
[data-bs-theme="dark"] .adm-welcome { background: var(--hb-liquid); }
[data-bs-theme="dark"] .adm-scrim { background: rgba(0, 0, 0, .6); }
