/* ==========================================================================
   Skoolyst Ads — Dashboard & Admin UI
   Extends the tokens in style.css. This file only adds app-shell layout,
   sidebar/topbar, cards, tables, forms, badges and other dashboard-only
   components. No colors are redefined here — everything reads from the
   :root tokens in style.css so the marketing site and the app stay in sync.
   ========================================================================== */

:root {
  --db-sidebar-w: 264px;
  --db-sidebar-w-collapsed: 84px;
  --db-topbar-h: 68px;
  --db-content-max: 1360px;

  --db-sidebar-bg: #0b1730;
  --db-sidebar-bg-active: rgba(255, 255, 255, 0.08);
  --db-sidebar-text: rgba(255, 255, 255, 0.68);
  --db-sidebar-text-active: #ffffff;
  --db-sidebar-border: rgba(255, 255, 255, 0.08);

  --admin-accent: #7c3aed;
  --admin-accent-light: rgba(124, 58, 237, 0.1);
}

/* ---------- Reset a couple of marketing-page rules inside the app ---------- */
body.db-body {
  background: var(--color-neutral-bg);
}

.db-body a { text-decoration: none; }

/* ---------- App shell ---------- */
.db-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.db-sidebar {
  width: var(--db-sidebar-w);
  flex: 0 0 var(--db-sidebar-w);
  background: var(--db-sidebar-bg);
  color: var(--db-sidebar-text);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform 0.25s ease;
}

.db-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.35rem 1.4rem;
  border-bottom: 1px solid var(--db-sidebar-border);
  color: #fff !important;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.db-sidebar__brand .sk-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-secondary);
  flex: 0 0 auto;
}

.db-sidebar__mode {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  margin-left: auto;
}

.db-sidebar--admin .db-sidebar__mode {
  background: var(--admin-accent);
  color: #fff;
}

.db-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.9rem;
}

.db-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  padding: 0.9rem 0.6rem 0.4rem;
}

.db-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--db-sidebar-text) !important;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  position: relative;
}

.db-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex: 0 0 auto; }

.db-nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--db-sidebar-text-active) !important;
}

.db-nav-link.active {
  background: var(--db-sidebar-bg-active);
  color: var(--db-sidebar-text-active) !important;
}

.db-nav-link.active::before {
  content: "";
  position: absolute;
  left: -0.9rem;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--color-secondary);
}

.db-sidebar--admin .db-nav-link.active::before { background: var(--admin-accent); }

.db-nav-link .db-nav-soon {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
}

.db-nav-link.disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.db-sidebar__footer {
  border-top: 1px solid var(--db-sidebar-border);
  padding: 1rem 1.1rem 1.2rem;
}

.db-switcher {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--db-sidebar-border);
  color: rgba(255, 255, 255, 0.85) !important;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}
.db-switcher:hover { background: rgba(255, 255, 255, 0.05); }
.db-switcher i:last-child { margin-left: auto; opacity: 0.6; font-size: 0.85rem; }

.db-user-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.db-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.db-sidebar--admin .db-avatar { background: var(--admin-accent); }

.db-user-card__name { color: #fff; font-size: 0.85rem; font-weight: 700; line-height: 1.2; }
.db-user-card__role { font-size: 0.74rem; color: rgba(255,255,255,0.45); }

.db-user-card__logout {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 1rem;
}
.db-user-card__logout:hover { color: #fff !important; }

/* Sidebar toggle button (mobile) */
.db-sidebar-toggle {
  border: 1px solid var(--color-neutral-border);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-neutral-text);
  flex: 0 0 auto;
}

.db-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9, 14, 26, 0.5);
  z-index: 1035;
}

/* ---------- Main column ---------- */
.db-main {
  margin-left: var(--db-sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.db-topbar {
  height: var(--db-topbar-h);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-neutral-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.db-topbar__title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
}

.db-topbar__crumb {
  font-size: 0.78rem;
  color: var(--color-neutral-muted);
  margin: 0;
}

.db-search {
  position: relative;
  max-width: 340px;
  flex: 1;
  display: none;
}
.db-search input {
  width: 100%;
  border: 1px solid var(--color-neutral-border);
  background: var(--color-neutral-bg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.8rem 0.5rem 2.2rem;
  font-size: 0.85rem;
}
.db-search input:focus { outline: none; border-color: var(--color-secondary); background: #fff; }
.db-search i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-neutral-muted-light);
  font-size: 0.9rem;
}

.db-topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.db-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-neutral-border);
  background: var(--color-white);
  color: var(--color-neutral-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 0 0 auto;
}
.db-icon-btn:hover { border-color: var(--color-secondary); color: var(--color-secondary); }
.db-icon-btn .db-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-danger);
  border: 1.5px solid #fff;
}

.db-content {
  padding: 1.75rem;
  max-width: var(--db-content-max);
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 991.98px) {
  .db-sidebar { transform: translateX(-100%); }
  .db-sidebar.is-open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.35); }
  .db-sidebar.is-open ~ .db-sidebar-backdrop,
  body.db-sidebar-open .db-sidebar-backdrop { display: block; }
  .db-main { margin-left: 0; }
  .db-sidebar-toggle { display: inline-flex; }
  .db-content { padding: 1.25rem; }
}

@media (min-width: 992px) {
  .db-sidebar-toggle { display: none; }
}

/* ---------- Page headers ---------- */
.db-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.db-page-head h1,
.db-page-head h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.3rem;
}

.db-page-head p {
  color: var(--color-neutral-muted);
  margin: 0;
  font-size: 0.92rem;
  max-width: 560px;
}

/* ---------- Cards ---------- */
.db-card {
  background: var(--color-white);
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.db-card__header {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--color-neutral-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.db-card__header h2,
.db-card__header h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.db-card__header p {
  font-size: 0.8rem;
  color: var(--color-neutral-muted);
  margin: 0.15rem 0 0;
}

.db-card__body { padding: 1.35rem; }
.db-card__body--flush { padding: 0; }

/* ---------- Connected Apps drag-to-reorder (10.q) ---------- */
.db-app-card-col {
  transition: transform 0.15s ease;
}
.db-app-card-col.dragging {
  opacity: 0.4;
}
.db-app-card-col.dragging .db-card {
  box-shadow: none;
}

.db-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 42px;
  margin-left: -0.5rem;
  color: var(--color-neutral-muted-light);
  cursor: grab;
  font-size: 1.05rem;
}
.db-drag-handle:active {
  cursor: grabbing;
}

/* Stat cards */
.db-stat {
  background: var(--color-white);
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  height: 100%;
}

.db-stat__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex: 0 0 auto;
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.db-stat__icon--secondary { background: var(--color-secondary-light); color: var(--color-secondary); }
.db-stat__icon--success { background: rgba(13, 148, 136, 0.1); color: var(--color-success); }
.db-stat__icon--warning { background: rgba(217, 119, 6, 0.1); color: var(--color-warning); }
.db-stat__icon--admin { background: var(--admin-accent-light); color: var(--admin-accent); }

.db-stat__label {
  font-size: 0.78rem;
  color: var(--color-neutral-muted);
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.db-stat__value {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.db-stat__delta {
  font-size: 0.76rem;
  font-weight: 700;
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.db-stat__delta--up { color: var(--color-success); }
.db-stat__delta--down { color: var(--color-danger); }
.db-stat__delta--flat { color: var(--color-neutral-muted); }

/* ---------- Simple bar chart (CSS only, no library, no backend) ---------- */
.db-barchart {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  height: 170px;
  padding-top: 0.5rem;
}
.db-barchart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  justify-content: flex-end;
}
.db-barchart__bar {
  width: 100%;
  max-width: 26px;
  border-radius: 6px 6px 2px 2px;
  background: var(--color-secondary-light);
  position: relative;
  transition: transform 0.15s ease;
}
.db-barchart__bar span {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  border-radius: 6px 6px 2px 2px;
  background: var(--color-secondary);
}
.db-barchart__col:hover .db-barchart__bar { transform: scaleX(1.15); }
.db-barchart__label {
  font-size: 0.68rem;
  color: var(--color-neutral-muted-light);
  font-weight: 600;
}

/* ---------- Badges ---------- */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-status--active { background: rgba(13, 148, 136, 0.1); color: var(--color-success); }
.badge-status--pending { background: rgba(217, 119, 6, 0.1); color: var(--color-warning); }
.badge-status--paused { background: rgba(100, 116, 139, 0.12); color: var(--color-neutral-muted); }
.badge-status--rejected { background: rgba(220, 38, 38, 0.1); color: var(--color-danger); }
.badge-status--draft { background: var(--color-neutral-bg-alt); color: var(--color-neutral-muted-light); }
.badge-status--ended { background: rgba(100, 116, 139, 0.12); color: var(--color-neutral-muted-light); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--color-neutral-bg-alt);
  color: var(--color-neutral-text);
  border: 1px solid var(--color-neutral-border);
}

.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-neutral-text);
}
.app-chip__dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  flex: 0 0 auto;
}

/* ---------- Tables ---------- */
.db-table-wrap { overflow-x: auto; }

.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 720px;
}

.db-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-neutral-muted-light);
  font-weight: 700;
  padding: 0.85rem 1rem;
  background: var(--color-neutral-bg);
  border-bottom: 1px solid var(--color-neutral-border);
  white-space: nowrap;
}

.db-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-neutral-border-light);
  vertical-align: middle;
}

.db-table tbody tr:last-child td { border-bottom: none; }
.db-table tbody tr:hover { background: rgba(15, 64, 119, 0.02); }

.db-table__thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--color-neutral-bg-alt);
  flex: 0 0 auto;
}

.db-table__title { font-weight: 700; font-size: 0.88rem; margin: 0; }
.db-table__meta { font-size: 0.76rem; color: var(--color-neutral-muted); margin: 0; }

.db-table__actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
}

.db-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-neutral-border);
  background: var(--color-white);
  color: var(--color-neutral-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.db-action-btn:hover { border-color: var(--color-secondary); color: var(--color-secondary); }
.db-action-btn--danger:hover { border-color: var(--color-danger); color: var(--color-danger); }
.db-action-btn--success:hover { border-color: var(--color-success); color: var(--color-success); }

.db-toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 1rem 1.35rem;
  border-bottom: 1px solid var(--color-neutral-border-light);
}

.db-toolbar .db-search { display: flex; max-width: 280px; }

.db-filter-select {
  border: 1px solid var(--color-neutral-border);
  background: var(--color-white);
  border-radius: var(--radius-sm);
  padding: 0.5rem 2rem 0.5rem 0.8rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--color-neutral-text);
}
.db-filter-select:focus { outline: none; border-color: var(--color-secondary); }

.db-tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--color-neutral-border);
  padding: 0 1.35rem;
  overflow-x: auto;
}
.db-tab {
  padding: 0.85rem 0.2rem;
  margin-right: 1.4rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-neutral-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.db-tab.active { color: var(--color-primary); border-color: var(--color-primary); }
.db-sidebar--admin ~ .db-main .db-tab.active,
.admin-theme .db-tab.active { color: var(--admin-accent); border-color: var(--admin-accent); }
.db-tab .count {
  font-size: 0.68rem;
  background: var(--color-neutral-bg-alt);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  margin-left: 0.3rem;
  font-weight: 700;
}

.db-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.35rem;
  font-size: 0.82rem;
  color: var(--color-neutral-muted);
  flex-wrap: wrap;
  gap: 0.6rem;
}
.db-pagination__pages { display: flex; gap: 0.3rem; }
.db-page-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-neutral-border);
  background: var(--color-white);
  color: var(--color-neutral-text);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.db-page-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ---------- Empty state ---------- */
.db-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-neutral-muted);
}
.db-empty i { font-size: 2rem; color: var(--color-neutral-muted-light); margin-bottom: 0.75rem; display: inline-block; }
.db-empty h4 { font-size: 1rem; font-weight: 700; color: var(--color-neutral-text); margin-bottom: 0.35rem; }
.db-empty p { font-size: 0.86rem; max-width: 360px; margin: 0 auto 1rem; }

/* ---------- Forms ---------- */
.db-form-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-neutral-text);
  margin-bottom: 0.4rem;
  display: block;
}
.db-form-label .optional {
  font-weight: 500;
  color: var(--color-neutral-muted-light);
  text-transform: none;
  font-size: 0.76rem;
}

.db-input,
.db-textarea,
.db-select {
  width: 100%;
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-family: var(--font-family);
  color: var(--color-neutral-text);
  background: var(--color-white);
}
.db-input:focus, .db-textarea:focus, .db-select:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px var(--color-secondary-light);
}
.db-textarea { resize: vertical; min-height: 90px; }

.db-form-hint {
  font-size: 0.78rem;
  color: var(--color-neutral-muted-light);
  margin-top: 0.35rem;
}
.db-form-hint.is-count { display: flex; justify-content: space-between; }

.db-help-icon {
  color: var(--color-neutral-muted-light);
  font-size: 0.85rem;
  margin-left: 0.3rem;
  cursor: help;
  vertical-align: middle;
}
.db-help-icon:hover, .db-help-icon:focus-visible { color: var(--color-secondary); outline: none; }

.db-char-count.is-over { color: var(--color-danger); font-weight: 700; }

.db-checkgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem;
}

.db-check-card {
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.db-check-card:has(input:checked) {
  border-color: var(--color-secondary);
  background: var(--color-secondary-light);
}
.db-check-card input { accent-color: var(--color-secondary); width: 16px; height: 16px; flex: 0 0 auto; }
.db-check-card small { display: block; font-weight: 500; color: var(--color-neutral-muted); font-size: 0.74rem; }

.db-file-drop {
  border: 1.5px dashed var(--color-neutral-border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--color-neutral-muted);
  background: var(--color-neutral-bg);
  cursor: pointer;
}
.db-file-drop:hover { border-color: var(--color-secondary); }
.db-file-drop i { font-size: 1.6rem; color: var(--color-neutral-muted-light); margin-bottom: 0.5rem; display: block; }
.db-file-drop strong { color: var(--color-secondary); font-weight: 700; }

.db-file-drop.has-image {
  padding: 0;
  border-style: solid;
  overflow: hidden;
  background: var(--color-neutral-bg-alt);
}
.db-file-drop.has-image img { width: 100%; max-height: 220px; object-fit: cover; display: block; }

/* Toggle switch */
.db-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
}
.db-switch input { opacity: 0; width: 0; height: 0; }
.db-switch__track {
  position: absolute;
  inset: 0;
  background: var(--color-neutral-border);
  border-radius: 999px;
  transition: 0.15s;
}
.db-switch__track::before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.db-switch input:checked + .db-switch__track { background: var(--color-success); }
.db-switch input:checked + .db-switch__track::before { transform: translateX(18px); }
.db-switch input:focus-visible + .db-switch__track { outline: 2px solid var(--color-secondary); outline-offset: 2px; }

.db-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.75rem;
  overflow-x: auto;
}
.db-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--color-neutral-muted-light);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  padding-right: 1rem;
}
.db-step__num {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--color-neutral-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex: 0 0 auto;
}
.db-step.active { color: var(--color-neutral-text); }
.db-step.active .db-step__num { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.db-step.done .db-step__num { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.db-step-divider {
  width: 32px; height: 1.5px;
  background: var(--color-neutral-border);
  margin: 0 0.4rem;
  flex: 0 0 auto;
}

/* ---------- Ad preview panel (sticky) ---------- */
.db-preview-panel {
  position: sticky;
  top: calc(var(--db-topbar-h) + 1.25rem);
}

.db-preview-frame {
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-md);
  background: var(--color-neutral-bg);
  padding: 1rem;
}

.db-preview-tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}
.db-preview-tab {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-neutral-border);
  background: var(--color-white);
  color: var(--color-neutral-muted);
}
.db-preview-tab.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Compact preview version of the public ad-card component */
.pv-card {
  background: var(--color-white);
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.pv-card__media { height: 130px; background: var(--color-neutral-bg-alt); overflow: hidden; }
.pv-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-card__body { padding: 0.9rem 1rem; }
.pv-card__advertiser { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-secondary); }
.pv-card__title { font-size: 0.98rem; font-weight: 700; margin: 0.2rem 0; }
.pv-card__desc { font-size: 0.8rem; color: var(--color-neutral-muted); margin: 0 0 0.7rem; line-height: 1.5; }
.pv-card__cta { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--color-warning); color: #fff; font-size: 0.78rem; font-weight: 700; padding: 0.4rem 0.85rem; border-radius: var(--radius-sm); }

.pv-card--placement .pv-card__media { height: 90px; }
.pv-card--placement .pv-card__title { font-size: 0.85rem; }

/* ---------- Modal theming ---------- */
.db-modal .modal-content {
  border-radius: var(--radius-md);
  border: none;
}
.db-modal .modal-header { border-bottom: 1px solid var(--color-neutral-border-light); }
.db-modal .modal-footer { border-top: 1px solid var(--color-neutral-border-light); }
.db-modal .modal-title { font-weight: 800; font-size: 1.05rem; }

/* ---------- Toasts ---------- */
.db-toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 340px;
}
.db-toast {
  background: #0f172a;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  animation: db-toast-in 0.2s ease;
}
.db-toast i { font-size: 1.05rem; margin-top: 0.05rem; }
.db-toast--success i { color: #4ade80; }
.db-toast--error i { color: #f87171; }
.db-toast--info i { color: #7dd3fc; }
@keyframes db-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Admin theme accents ---------- */
.admin-theme .btn-sk-primary,
.btn-admin-primary {
  background: var(--admin-accent);
}
.admin-theme .btn-sk-primary:hover,
.btn-admin-primary:hover { background: #6423d1; color: #fff; }
.admin-theme .sk-eyebrow,
.admin-theme .db-nav-link.active,
.admin-theme a:not(.btn) { color: var(--admin-accent); }
.admin-theme .db-input:focus,
.admin-theme .db-textarea:focus,
.admin-theme .db-select:focus,
.admin-theme .db-search input:focus {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 3px var(--admin-accent-light);
}

/* Approve / reject buttons used in admin moderation */
.btn-approve {
  background: rgba(13, 148, 136, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(13, 148, 136, 0.3);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
}
.btn-approve:hover { background: var(--color-success); color: #fff; }
.btn-reject {
  background: rgba(220, 38, 38, 0.08);
  color: var(--color-danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
}
.btn-reject:hover { background: var(--color-danger); color: #fff; }

/* ---------- Code / API docs ---------- */
/* api-docs.php now lives on the public site (views/layouts/public.php),
   not inside the dashboard shell — .db-content's padding never applies
   there, so this gives the doc layout its own equivalent spacing under
   the public navbar instead of sitting flush against it. */
.sk-public-page {
  padding: 2rem 1rem 4rem;
}

.db-doc-layout { display: flex; gap: 2rem; align-items: flex-start; }
.db-doc-nav {
  flex: 0 0 220px;
  position: sticky;
  /* Public navbar (.sk-navbar, py-3 + its content) runs taller than the
     dashboard's fixed --db-topbar-h — approximated here since it's not
     itself a fixed height. */
  top: calc(82px + 1.25rem);
}
.db-doc-nav a {
  display: block;
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
  color: var(--color-neutral-muted);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.db-doc-nav a:hover { color: var(--color-primary); background: var(--color-neutral-bg-alt); }
.db-doc-nav a.active { color: var(--color-primary); background: var(--color-primary-light); }
.db-doc-content { flex: 1; min-width: 0; }
.db-doc-section { margin-bottom: 2.75rem; scroll-margin-top: calc(82px + 1rem); }
.db-doc-section h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 0.6rem; }
.db-doc-section h3 { font-size: 1rem; font-weight: 700; margin: 1.4rem 0 0.6rem; }
.db-doc-section p { color: var(--color-neutral-text); font-size: 0.92rem; line-height: 1.65; }
.db-doc-section p.muted { color: var(--color-neutral-muted); }

.endpoint-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--color-neutral-bg);
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  margin: 0.9rem 0;
  flex-wrap: wrap;
}
.endpoint-verb {
  font-weight: 800;
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  color: #fff;
}
.endpoint-verb--get { background: #0d9488; }
.endpoint-verb--post { background: #4361ee; }
.endpoint-verb--patch { background: #d97706; }
.endpoint-verb--delete { background: #dc2626; }

.db-param-table { width: 100%; font-size: 0.85rem; border-collapse: collapse; }
.db-param-table th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--color-neutral-muted-light);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-neutral-border);
}
.db-param-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-neutral-border-light);
  vertical-align: top;
}
.db-param-table code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--color-secondary);
  background: var(--color-secondary-light);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
}
.param-required { color: var(--color-danger); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.param-optional { color: var(--color-neutral-muted-light); font-size: 0.7rem; text-transform: uppercase; }

.db-code-tabs { display: flex; gap: 0.3rem; margin-bottom: -1px; position: relative; z-index: 1; }
.db-code-tab {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  color: #94a3b8;
  background: #060a14;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
}
.db-code-tab.active { color: #fff; background: #0a0e1a; }

.key-reveal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--color-neutral-bg);
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
}
.key-reveal__value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1199.98px) {
  .db-doc-nav { display: none; }
}
