/* ── Dashboard Design Tokens (Phase 3 — POB unified: slate + indigo) ── */
/* Names kept for backward-compat; values swapped to indigo/cyan/slate so
   dashboard panels no longer paint a warm-paper layer on top of the slate
   page shell. `--d-bg` intentionally matches the outer page background
   (slate-50) so the panel visually blends into one surface.              */
:root {
  --d-navy: #0F172A;          /* slate-900 */
  --d-navy-mid: #1E293B;      /* slate-800 */
  --d-slate: #334155;         /* slate-700 */
  --d-teal: #6366F1;          /* was brand teal — now indigo-500 */
  --d-teal-dark: #4F46E5;     /* indigo-600 */
  --d-teal-ghost: rgba(99,102,241,0.08);
  --d-teal-soft: rgba(99,102,241,0.15);
  --d-amber: #F59E0B;
  --d-amber-ghost: rgba(245,158,11,0.1);
  --d-red: #EF4444;
  --d-red-ghost: rgba(239,68,68,0.1);
  --d-blue: #0EA5E9;          /* accent cyan */
  --d-blue-ghost: rgba(14,165,233,0.1);
  --d-green: #10B981;
  --d-green-ghost: rgba(16,185,129,0.1);
  --d-purple: #8B5CF6;
  --d-purple-ghost: rgba(139,92,246,0.1);
  --d-text-primary: #0F172A;
  --d-text-secondary: #475569;
  --d-text-muted: #94A3B8;
  --d-bg: #F8FAFC;            /* slate-50 — matches page shell to flatten the layering */
  --d-card-bg: #FFFFFF;
  --d-border: transparent;
  --d-border-light: transparent;
  --d-shadow: 0 1px 3px rgba(15,23,42,0.04), 0 1px 2px rgba(15,23,42,0.03);
  --d-shadow-hover: 0 4px 16px rgba(15,23,42,0.08);
  --d-table-header: #F1F5F9;  /* slate-100 */
  --d-line: rgba(15,23,42,0.06);
  --d-line-bold: rgba(15,23,42,0.12);
  --d-stripe: rgba(15,23,42,0.015);
  --d-backdrop: rgba(15,23,42,0.3);
}

/* ── Dark Mode Overrides (slate, matches DARK_THEME in designTokens.ts) ── */
html.dark {
  --d-text-primary: #F1F5F9;  /* slate-100 */
  --d-text-secondary: #CBD5E1;
  --d-text-muted: #94A3B8;
  --d-bg: #0F172A;            /* slate-900 — matches dark page shell */
  --d-card-bg: #1E293B;       /* slate-800 */
  --d-border: rgba(255,255,255,0.06);
  --d-border-light: rgba(255,255,255,0.03);
  --d-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --d-shadow-hover: 0 4px 16px rgba(0,0,0,0.18);
  --d-table-header: #334155;  /* slate-700 */
  --d-line: rgba(255,255,255,0.06);
  --d-line-bold: rgba(255,255,255,0.12);
  --d-stripe: rgba(255,255,255,0.02);
  --d-backdrop: rgba(0,0,0,0.5);
  --d-teal-ghost: rgba(99,102,241,0.15);
  --d-teal-soft: rgba(99,102,241,0.25);
  --d-amber-ghost: rgba(245,158,11,0.15);
  --d-red-ghost: rgba(239,68,68,0.15);
  --d-blue-ghost: rgba(14,165,233,0.15);
  --d-green-ghost: rgba(16,185,129,0.15);
  --d-purple-ghost: rgba(139,92,246,0.15);
}

/* ── Dashboard Shell ── */
.db-shell {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--d-bg);
  color: var(--d-text-primary);
  min-height: 100%;
}

/* ── Top Bar ── */
/* Phase 3 unification: background transparent (was white card) so the page
   header blends into the shell instead of floating on a separate card. */
.db-topbar {
  background: transparent;
  border-bottom: none;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
/* Phase 3 unification: dropped DM Serif Display — POB uses Inter only. */
.db-topbar-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.db-topbar-sub {
  font-size: 12px;
  color: var(--d-text-muted);
  margin: 0;
}
.db-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Buttons ── Phase 3 unification: match POB's Button component tokens.
   POB base:  inline-flex items-center justify-center gap-2 font-semibold
              rounded-xl transition-all duration-150
   POB md:    px-4 py-2 text-sm (px=16px, py=8px, 14px text)
   POB primary:   bg-indigo-600 hover:bg-indigo-700 text-white shadow-sm
   POB secondary: bg-white hover:bg-slate-50 text-slate-700 border
                  border-slate-200 shadow-sm
   POB ghost:     bg-transparent hover:bg-slate-100 text-slate-600
   POB danger:    bg-rose-600 hover:bg-rose-700 text-white shadow-sm           */
.db-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
}
.db-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
}
/* Primary — indigo-600 (POB canonical). Legacy class name kept for BC. */
.db-btn--teal {
  background: #4F46E5;
  color: #fff;
}
.db-btn--teal:hover {
  background: #4338CA; /* indigo-700 */
}
/* Secondary — white card with slate border. */
.db-btn--secondary {
  background: #fff;
  color: #334155;      /* slate-700 */
  border: 1px solid #E2E8F0; /* slate-200 */
}
.db-btn--secondary:hover {
  background: #F8FAFC; /* slate-50 */
}
/* Ghost — transparent, hover slate-100. */
.db-btn--ghost {
  background: transparent;
  color: #475569;      /* slate-600 */
  border: none;
  box-shadow: none;
}
.db-btn--ghost:hover {
  background: #F1F5F9; /* slate-100 */
  color: #0F172A;      /* slate-900 */
}
/* Danger — rose-600. */
.db-btn--danger {
  background: #E11D48; /* rose-600 */
  color: #fff;
}
.db-btn--danger:hover {
  background: #BE123C; /* rose-700 */
}

/* Dark-mode overrides — mirror POB's darkVariants map. */
html.dark .db-btn--secondary {
  background: #334155; /* slate-700 */
  color: #E2E8F0;       /* slate-200 */
  border-color: #475569; /* slate-600 */
}
html.dark .db-btn--secondary:hover {
  background: #475569; /* slate-600 */
}
html.dark .db-btn--ghost {
  color: #CBD5E1;      /* slate-300 */
}
html.dark .db-btn--ghost:hover {
  background: #334155; /* slate-700 */
  color: #F1F5F9;
}

/* ── Card ── */
.db-card {
  background: var(--d-card-bg);
  border-radius: 18px;
  border: none;
  padding: 24px;
  box-shadow: var(--d-shadow);
}
.db-card--pad16 {
  padding: 16px;
}
.db-card--clickable {
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.db-card--clickable:hover {
  box-shadow: var(--d-shadow-hover);
}

/* ── Section Header ── */
.db-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.db-section-header__left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.db-section-header__title {
  font-size: 14px;
  font-weight: 800;
  color: var(--d-text-primary);
}
.db-section-header__badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--d-teal-ghost);
  color: var(--d-teal);
}

/* ── Metric ── */
.db-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.db-metric__label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--d-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.db-metric__row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.db-metric__icon { font-size: 16px; }
.db-metric__icon--lg { font-size: 22px; }
.db-metric__value {
  font-size: 24px;
  font-weight: 800;
  color: var(--d-text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.db-metric__value--lg { font-size: 32px; }
.db-metric__value--sm { font-size: 18px; }
.db-metric__sub {
  font-size: 11px;
  color: var(--d-text-secondary);
}
.db-metric__delta {
  font-size: 11px;
  font-weight: 700;
}

/* ── MiniBar ── */
.db-minibar {
  width: 100%;
  background: var(--d-border-light);
  border-radius: 3px;
  overflow: hidden;
}
.db-minibar--h6 { height: 6px; border-radius: 3px; }
.db-minibar--h8 { height: 8px; border-radius: 4px; }
.db-minibar--h10 { height: 10px; border-radius: 5px; }
.db-minibar__fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.5s;
}

/* ── Pill ── */
.db-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-block;
}

/* ── Chip Filter ── */
/* ── Chips (Phase E) ── POB filter-chip convention:
      inactive: bg-slate-100 text-slate-600, borderless
      active:   bg-indigo-600 text-white
      hover on inactive: bg-slate-200                                         */
.db-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.db-chip {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: #F1F5F9;                /* slate-100 */
  color: #64748B;                     /* slate-600 */
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s, color 0.15s;
}
html.dark .db-chip {
  background: #1E293B;                /* slate-800 */
  color: #CBD5E1;                     /* slate-300 */
}
.db-chip:hover:not(.db-chip--active) {
  background: #E2E8F0;                /* slate-200 */
  color: #0F172A;                     /* slate-900 */
}
html.dark .db-chip:hover:not(.db-chip--active) {
  background: #334155;
  color: #F1F5F9;
}
.db-chip--active {
  background: #4F46E5;                /* indigo-600 */
  color: #FFFFFF;
}
html.dark .db-chip--active {
  background: #6366F1;                /* indigo-500 for dark */
}

/* ── Period Toggle ── */
/* Period toggle — POB segmented-control pattern.
   Track: bg-white, rounded-xl, p-1, slate-200 border.
   Active tab: indigo-600 fill, white text, shadow-sm.
   Inactive: transparent, slate-500 hover → slate-100 bg + slate-900 text. */
.db-period-toggle {
  display: flex;
  gap: 2px;
  background: var(--d-card-bg, #fff);
  border: 1px solid #E2E8F0; /* slate-200 */
  border-radius: 12px;
  padding: 4px;
}
html.dark .db-period-toggle {
  background: #1E293B;                /* slate-800 */
  border-color: rgba(255,255,255,0.06);
}
.db-period-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  color: #64748B;                     /* slate-500 */
  box-shadow: none;
  transition: background-color 0.15s, color 0.15s;
}
.db-period-btn:hover:not(.db-period-btn--active) {
  background: #F1F5F9;                /* slate-100 */
  color: #0F172A;                     /* slate-900 */
}
html.dark .db-period-btn:hover:not(.db-period-btn--active) {
  background: #334155;                /* slate-700 */
  color: #F1F5F9;
}
.db-period-btn--active {
  background: #4F46E5;                /* indigo-600 */
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(15,23,42,0.1);
}
html.dark .db-period-btn--active {
  background: #6366F1;                /* indigo-500 for dark */
}

/* ── Nav Tabs ── */
.db-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--d-border);
  padding-bottom: 0;
}
.db-tab {
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  background: transparent;
  color: var(--d-text-muted);
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.db-tab--active {
  color: var(--d-teal);
  border-bottom-color: var(--d-teal);
}

/* ── Table row actions (Phase C.2): POB pattern hides row-level actions
   until the row is hovered. Keeps the table quieter by default, surfaces
   affordances on intent. Focus-within ensures keyboard users see them. */
.sites-grid > .sites-col-actions {
  opacity: 0;
  transition: opacity 0.15s;
}
.sites-grid:hover > .sites-col-actions,
.sites-grid:focus-within > .sites-col-actions {
  opacity: 1;
}

/* ── Dashboard Content Area ── */
.db-content {
  padding: 20px 28px;
}

/* ── Grid Layouts ── */
.db-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.db-grid-3-1-1 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.db-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

/* Sites tab */
.db-sites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.db-sites-count {
  font-size: 13px;
  color: var(--d-text-muted);
}
.db-sort-btns {
  display: flex;
  gap: 6px;
}
.db-sort-btn {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--d-border);
  background: var(--d-card-bg);
  color: var(--d-text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.db-sort-btn--active {
  border-color: var(--d-teal);
  background: var(--d-teal-ghost);
  color: var(--d-teal);
}
.db-sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 14px;
}

/* ── Sites v2 — Toolbar ── */
.db-sites-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--d-card-bg);
  border-radius: 12px;
  border: 1px solid var(--d-border);
  padding: 12px 20px;
  margin-bottom: 12px;
  box-shadow: var(--d-shadow);
}
.db-sites-toolbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.db-sites-toolbar__count {
  font-size: 15px;
  font-weight: 900;
}
.db-sites-toolbar__total {
  font-size: 13px;
  color: var(--d-text-muted);
}
.db-sites-toolbar__progress {
  width: 120px;
  height: 6px;
  background: var(--d-border-light);
  border-radius: 3px;
  overflow: hidden;
  margin-left: 4px;
}
.db-sites-toolbar__progress-fill {
  height: 100%;
  background: var(--d-teal);
  border-radius: 3px;
  transition: width 0.3s;
}
.db-sites-toolbar__legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--d-border);
}
.db-sites-toolbar__legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.db-sites-toolbar__legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.db-sites-toolbar__legend-label {
  font-size: 10px;
  color: var(--d-text-muted);
  font-weight: 600;
}
.db-sites-toolbar__actions {
  display: flex;
  gap: 6px;
}
.db-sites-toolbar__adjust-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--d-border);
  background: var(--d-card-bg);
  color: var(--d-text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ── Sites v2 — Filter Bar ── */
.db-sites-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--d-card-bg);
  border-radius: 12px;
  border: 1px solid var(--d-border);
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: var(--d-shadow);
}
.db-sites-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--d-border);
  background: var(--d-bg);
}
.db-sites-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  color: var(--d-text-primary);
  width: 100%;
  font-family: inherit;
}
.db-sites-clear-btn {
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  background: var(--d-red-ghost);
  color: var(--d-red);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ── Sites v2 — Filter Dropdown ── */
.db-filter-dropdown {
  position: relative;
}
.db-filter-dropdown__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s;
}
.db-filter-dropdown__btn--default {
  border: 1.5px solid var(--d-border);
  background: var(--d-card-bg);
  color: var(--d-text-secondary);
}
.db-filter-dropdown__btn--active {
  border: 1.5px solid var(--d-teal);
  background: var(--d-teal-ghost);
  color: var(--d-teal);
}
.db-filter-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  background: var(--d-card-bg);
  border-radius: 10px;
  border: 1px solid var(--d-border);
  box-shadow: 0 8px 30px rgba(10,22,40,0.12);
  min-width: 160px;
  padding: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.db-filter-dropdown__option {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}
.db-filter-dropdown__backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
}

/* ── Sites v2 — Bulk Bar ── */
.db-sites-bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--d-teal-ghost);
  border-radius: 10px;
  border: 1.5px solid var(--d-teal);
  margin-bottom: 16px;
}
.db-sites-bulk-bar__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--d-teal);
}
.db-sites-bulk-bar__btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 7px;
  border: 1.5px solid var(--d-teal);
  background: var(--d-card-bg);
  color: var(--d-teal);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.db-sites-bulk-bar__cancel {
  padding: 6px 12px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--d-text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ── Sites v2 — Sort + Select All Row ── */
.db-sites-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.db-sites-select-all {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.db-sites-select-all__label {
  font-size: 11px;
  color: var(--d-text-muted);
  font-weight: 600;
}

/* ── Sites v2 — Checkbox ── */
.db-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.db-checkbox--unchecked {
  border: 2px solid var(--d-border);
  background: var(--d-card-bg);
}
.db-checkbox--checked {
  border: 2px solid var(--d-teal);
  background: var(--d-teal);
}

/* ── Sites v2 — Site Card v2 ── */
.db-site-card-v2 {
  background: var(--d-card-bg);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}
.db-site-card-v2:hover {
  box-shadow: var(--d-shadow-hover);
  transform: translateY(-2px);
}
.db-site-card-v2--selected {
  border: 1.5px solid var(--d-teal);
}
.db-site-card-v2--default {
  border: 1.5px solid var(--d-border);
  box-shadow: var(--d-shadow);
}
.db-site-card-v2__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--d-border-light);
}
.db-site-card-v2__header--selected {
  background: var(--d-teal-ghost);
}
.db-site-card-v2__header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.db-site-card-v2__name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--d-text-primary);
  line-height: 1.2;
}
.db-site-card-v2__subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.db-site-card-v2__subtitle span {
  font-size: 11px;
  color: var(--d-text-muted);
}
.db-site-card-v2__header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.db-site-card-v2__edit-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--d-text-muted);
  transition: all 0.15s;
  border: none;
  cursor: pointer;
}
.db-site-card-v2__edit-btn:hover {
  background: var(--d-bg);
}
.db-site-card-v2__body {
  padding: 14px 18px 16px;
}

/* ── Sites v2 — Score Ring ── */
.db-score-ring {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.db-score-ring__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
}
.db-score-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.db-score-info {
  flex: 1;
}
.db-score-info__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.db-score-info__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--d-text-primary);
}
.db-score-info__delta {
  font-size: 11px;
  font-weight: 700;
}
.db-score-info__audit-name {
  font-size: 11px;
  color: var(--d-text-muted);
  font-weight: 600;
}
.db-no-audit-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--d-text-muted);
  font-size: 12px;
  padding: 10px 0;
  margin-bottom: 8px;
}

/* ── Sites v2 — Audit Timeline Stepper ── */
.db-audit-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6px 0;
  gap: 0;
  margin-bottom: 14px;
}
.db-timeline-step-wrapper {
  display: flex;
  align-items: center;
}
.db-timeline-step-wrapper--grow {
  flex: 1;
}
.db-timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 48px;
}
.db-timeline-step__circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}
.db-timeline-step__circle--done {
  background: var(--d-teal);
  border: none;
}
.db-timeline-step__circle--active {
  background: var(--d-card-bg);
  border: 2.5px solid var(--d-teal);
  box-shadow: 0 0 0 4px rgba(15,186,154,0.1);
}
.db-timeline-step__circle--pending {
  background: var(--d-card-bg);
  border: 2px solid var(--d-border-light);
}
.db-timeline-step__num {
  font-size: 9px;
  font-weight: 800;
}
.db-timeline-step__label {
  font-size: 9px;
  text-align: center;
}
.db-timeline-step__label--done,
.db-timeline-step__label--active {
  color: var(--d-teal);
}
.db-timeline-step__label--active {
  font-weight: 800;
}
.db-timeline-step__label--done {
  font-weight: 600;
}
.db-timeline-step__label--pending {
  font-weight: 600;
  color: var(--d-text-muted);
}
.db-timeline-connector {
  flex: 1;
  height: 2px;
  margin: 0 2px;
  margin-bottom: 20px;
  border-radius: 1px;
  transition: background 0.3s;
}
.db-timeline-connector--done {
  background: var(--d-teal);
}
.db-timeline-connector--pending {
  background: var(--d-border-light);
}

/* ── Sites v2 — Details Grid ── */
.db-site-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.db-site-detail-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.db-site-detail-item__icon {
  color: var(--d-text-muted);
  display: flex;
}
.db-site-detail-item__label {
  font-size: 11px;
  color: var(--d-text-muted);
}
.db-site-detail-item__value {
  font-size: 11px;
  font-weight: 700;
}

/* ── Sites v2 — Card Footer ── */
.db-site-card-v2__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--d-border-light);
}
.db-site-card-v2__footer-text {
  font-size: 11px;
  color: var(--d-text-muted);
}
.db-site-card-v2__footer-count {
  font-weight: 700;
  color: var(--d-text-secondary);
}
.db-site-card-v2__view-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--d-teal);
  opacity: 0;
  transition: opacity 0.2s;
}
.db-site-card-v2:hover .db-site-card-v2__view-link {
  opacity: 1;
}

/* ── Sites v2 — No Audit Placeholder ── */
.db-sites-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  color: var(--d-text-muted);
}
.db-sites-empty__title {
  font-size: 15px;
  font-weight: 700;
  margin-top: 12px;
}
.db-sites-empty__subtitle {
  font-size: 12px;
  margin-top: 4px;
}
.db-sites-empty__clear-btn {
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--d-teal);
  color: white;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ── Sites v2 — Threshold Modal ── */
.db-threshold-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.db-threshold-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,22,40,0.4);
  backdrop-filter: blur(4px);
}
.db-threshold-modal {
  position: relative;
  background: var(--d-card-bg);
  border-radius: 16px;
  padding: 28px;
  width: 420px;
  box-shadow: 0 20px 60px rgba(10,22,40,0.2);
  z-index: 1;
}
.db-threshold-modal__title {
  font-size: 17px;
  font-weight: 900;
  margin: 0 0 4px;
}
.db-threshold-modal__subtitle {
  font-size: 12px;
  color: var(--d-text-muted);
  margin: 0 0 20px;
}
.db-threshold-modal__row {
  margin-bottom: 16px;
}
.db-threshold-modal__row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.db-threshold-modal__row-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.db-threshold-modal__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.db-threshold-modal__row-label {
  font-size: 13px;
  font-weight: 700;
}
.db-threshold-modal__row-value {
  font-size: 13px;
  font-weight: 800;
}
.db-threshold-modal__slider {
  width: 100%;
}
.db-threshold-modal__preview {
  background: var(--d-bg);
  border-radius: 10px;
  padding: 12px;
  margin-top: 16px;
  margin-bottom: 20px;
}
.db-threshold-modal__preview-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--d-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.db-threshold-modal__preview-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
}
.db-threshold-modal__preview-segment {
  display: flex;
  align-items: center;
  justify-content: center;
}
.db-threshold-modal__preview-segment span {
  font-size: 8px;
  font-weight: 800;
  color: white;
}
.db-threshold-modal__footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.db-threshold-modal__cancel-btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--d-border);
  background: var(--d-card-bg);
  color: var(--d-text-secondary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.db-threshold-modal__save-btn {
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  background: var(--d-teal);
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(15,186,154,0.3);
}

/* Site card inner */
.db-site-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.db-site-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--d-text-primary);
}
.db-site-sub {
  font-size: 11px;
  color: var(--d-text-muted);
}
.db-site-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.db-site-score {
  font-size: 20px;
  font-weight: 900;
  min-width: 48px;
  text-align: right;
}
.db-site-delta {
  font-size: 11px;
  font-weight: 700;
}
.db-site-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--d-text-muted);
}

/* Campaigns tab */
.db-campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 14px;
}
.db-campaign-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.db-campaign-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--d-text-primary);
}
.db-campaign-type {
  font-size: 12px;
  color: var(--d-text-muted);
}
.db-campaign-stats {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  font-size: 12px;
}
.db-campaign-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.db-campaign-kpi {
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.db-campaign-kpi__val {
  font-size: 18px;
  font-weight: 900;
}
.db-campaign-kpi__label {
  font-size: 10px;
  color: var(--d-text-muted);
  font-weight: 600;
}

/* Heatmap tab */
.db-heatmap-legend {
  display: flex;
  gap: 10px;
  align-items: center;
}
.db-heatmap-legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
}
.db-heatmap-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.db-heatmap-legend-label {
  font-size: 10px;
  color: var(--d-text-muted);
}
.db-heatmap-table {
  border-collapse: separate;
  border-spacing: 4px;
  width: 100%;
}
.db-heatmap-th {
  font-size: 11px;
  font-weight: 700;
  color: var(--d-text-muted);
  padding: 4px 8px;
}
.db-heatmap-th--site {
  text-align: left;
  min-width: 180px;
}
.db-heatmap-th--type {
  text-align: center;
  color: var(--d-text-secondary);
}
.db-heatmap-th--avg {
  text-align: center;
  color: var(--d-text-primary);
}
.db-heatmap-site {
  font-size: 12px;
  font-weight: 600;
  color: var(--d-text-primary);
  padding: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.db-heat-cell {
  width: 48px;
  height: 32px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin: 0 auto;
}
.db-heat-cell--none {
  background: var(--d-border-light);
  color: var(--d-text-muted);
  opacity: 0.3;
}
.db-heat-cell--90 { background: #10B981; color: #fff; }
.db-heat-cell--80 { background: #6EE7B7; color: #fff; }
.db-heat-cell--70 { background: #FCD34D; color: #78350F; }
.db-heat-cell--60 { background: #FB923C; color: #fff; }
.db-heat-cell--low { background: #EF4444; color: #fff; }
.db-heatmap-avg {
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

/* ── Tooltip ── */
.db-tooltip {
  background: var(--d-navy);
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 8px 30px rgba(10,22,40,0.3);
}
.db-tooltip__title {
  font-weight: 700;
  margin-bottom: 4px;
}
.db-tooltip__row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.db-tooltip__swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.db-tooltip__name {
  color: #9CA3AF;
}
.db-tooltip__val {
  font-weight: 700;
}

/* ── Performance Extremes ── */
.db-extremes-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.db-extremes-label--top { color: var(--d-green); }
.db-extremes-label--bottom { color: var(--d-red); }
.db-extremes-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--d-border-light);
}
.db-extremes-rank {
  width: 18px;
  font-size: 10px;
  font-weight: 800;
  color: var(--d-text-muted);
  text-align: center;
}
.db-extremes-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--d-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.db-extremes-score {
  font-size: 13px;
  font-weight: 900;
}
.db-extremes-delta {
  font-size: 10px;
}

/* ── Campaign Tracker (Overview) ── */
.db-tracker-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--d-border-light);
}
.db-tracker-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.db-tracker-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--d-text-primary);
}
.db-tracker-bottom {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}
.db-tracker-meta {
  font-size: 10.5px;
  color: var(--d-text-muted);
}

/* ── NC Category Bar ── */
.db-nc-item { margin-bottom: 0; }
.db-nc-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}
.db-nc-cat {
  font-size: 11px;
  color: var(--d-text-secondary);
  font-weight: 600;
}
.db-nc-count {
  font-size: 11px;
  font-weight: 800;
  color: var(--d-text-primary);
}

/* ── Donut Legend ── */
.db-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.db-donut-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.db-donut-legend-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.db-donut-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.db-donut-legend-label {
  font-size: 12px;
  color: var(--d-text-secondary);
}
.db-donut-legend-val {
  font-size: 14px;
  font-weight: 800;
}

/* ── Color utility classes ── */
.c-teal { color: var(--d-teal); }
.c-green { color: var(--d-green); }
.c-amber { color: var(--d-amber); }
.c-red { color: var(--d-red); }
.c-blue { color: var(--d-blue); }
.c-purple { color: var(--d-purple); }
.c-muted { color: var(--d-text-muted); }
.c-secondary { color: var(--d-text-secondary); }
.c-primary { color: var(--d-text-primary); }
.bg-teal-ghost { background: var(--d-teal-ghost); }
.bg-green-ghost { background: var(--d-green-ghost); }
.bg-amber-ghost { background: var(--d-amber-ghost); }
.bg-red-ghost { background: var(--d-red-ghost); }
.bg-blue-ghost { background: var(--d-blue-ghost); }
.bg-purple-ghost { background: var(--d-purple-ghost); }
.bg-d-bg { background: var(--d-bg); }

/* ── Responsive overrides ── */
@media (max-width: 1024px) {
  .db-shell {
    margin: 0 -1.5rem -2rem !important;
  }
  .db-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
  .db-grid-3-1-1,
  .db-grid-3 {
    grid-template-columns: 1fr;
  }
  .db-topbar {
    padding: 12px 16px;
  }
  .db-content {
    padding: 16px;
  }
}
@media (max-width: 640px) {
  .db-grid-5 {
    grid-template-columns: repeat(2, 1fr);
  }
  .db-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .db-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .db-campaigns-grid,
  .db-sites-grid {
    grid-template-columns: 1fr;
  }
  .db-sites-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .db-sites-toolbar__legend {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
  }
  .db-sites-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .db-sites-select-row {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════════════
   MGMT — Management / Settings shared styles
   ══════════════════════════════════════════════ */

/* ── Shell / Layout ── */
.mgmt-shell { padding: 0; }
.mgmt-header { margin-bottom: 20px; }
.mgmt-header__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.mgmt-header__title { font-size: 20px; font-weight: 900; color: var(--d-text-primary); margin: 0; }
.mgmt-header__subtitle { font-size: 13px; color: var(--d-text-muted); margin: 4px 0 0; }
.mgmt-content { display: flex; flex-direction: column; gap: 16px; }
.mgmt-loading { display: flex; align-items: center; justify-content: center; padding: 80px 0; }

/* ── Count Bar ── */
.mgmt-count-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--d-card-bg); border-radius: 12px;
  border: 1px solid var(--d-border); padding: 12px 20px;
  margin-bottom: 12px; box-shadow: var(--d-shadow);
}
.mgmt-count-bar__left { display: flex; align-items: center; gap: 12px; }
.mgmt-count-bar__count { font-size: 15px; font-weight: 900; color: var(--d-text-primary); }
.mgmt-count-bar__label { font-size: 13px; color: var(--d-text-muted); }
.mgmt-count-bar__actions { display: flex; gap: 6px; }

/* ── Action Buttons ── */
.mgmt-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit; border: none; transition: all 0.15s;
}
.mgmt-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mgmt-action-btn--primary {
  background: var(--d-teal); color: #fff;
  box-shadow: 0 2px 8px rgba(15,186,154,0.3);
}
.mgmt-action-btn--primary:hover:not(:disabled) { background: var(--d-teal-dark); }
.mgmt-action-btn--secondary {
  background: #fff; color: var(--d-text-secondary);
  border: 1.5px solid var(--d-border);
}
.mgmt-action-btn--secondary:hover:not(:disabled) { background: var(--d-bg); }

/* ── Icon Button ── */
.mgmt-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--d-border); background: #fff;
  color: var(--d-text-muted); cursor: pointer; transition: all 0.15s;
}
.mgmt-icon-btn:hover { background: var(--d-bg); color: var(--d-text-secondary); border-color: var(--d-text-muted); }

/* ── Filter Bar + Search ── */
.mgmt-filter-bar {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.mgmt-search {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px;
  padding: 7px 12px; border-radius: 8px;
  border: 1.5px solid var(--d-border); background: var(--d-bg);
}
.mgmt-search input {
  border: none; background: transparent; outline: none;
  font-size: 12px; color: var(--d-text-primary); width: 100%; font-family: inherit;
}
.mgmt-search input::placeholder { color: var(--d-text-muted); }

/* ── Filter Chip (dropdown) ── */
.mgmt-filter-chip { position: relative; }
.mgmt-filter-chip__btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: all 0.15s;
}
.mgmt-filter-chip__btn--default {
  border: 1.5px solid var(--d-border); background: #fff; color: var(--d-text-secondary);
}
.mgmt-filter-chip__btn--active {
  border: 1.5px solid var(--d-teal); background: var(--d-teal-ghost); color: var(--d-teal);
}
.mgmt-filter-chip__backdrop { position: fixed; inset: 0; z-index: 99; }
.mgmt-filter-chip__menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 100;
  background: #fff; border-radius: 10px; border: 1px solid var(--d-border);
  box-shadow: 0 8px 30px rgba(10,22,40,0.12);
  min-width: 160px; padding: 4px; max-height: 220px; overflow-y: auto;
}
.mgmt-filter-chip__option {
  padding: 8px 12px; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: var(--d-text-primary); font-weight: 400;
}
.mgmt-filter-chip__option:hover { background: var(--d-bg); }
.mgmt-filter-chip__option--all { color: var(--d-text-muted); }
.mgmt-filter-chip__option--active {
  background: var(--d-teal-ghost); color: var(--d-teal); font-weight: 700;
}

/* ── Grids ── */
.mgmt-grid-340 {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.mgmt-grid-400 {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

/* ── Card ── */
.mgmt-card {
  background: var(--d-card-bg); border-radius: 14px;
  border: 1px solid var(--d-border); padding: 20px;
  box-shadow: var(--d-shadow); transition: all 0.2s;
}
.mgmt-card--hover:hover {
  box-shadow: var(--d-shadow-hover); transform: translateY(-2px);
}
.mgmt-card__header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 14px;
}
.mgmt-card__header-left { display: flex; align-items: center; gap: 12px; }
.mgmt-card__header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mgmt-card__name { font-size: 14px; font-weight: 800; color: var(--d-text-primary); line-height: 1.3; }
.mgmt-card__sub { font-size: 11.5px; color: var(--d-text-muted); margin-top: 2px; }
.mgmt-card__footer {
  font-size: 11px; color: var(--d-text-muted); margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--d-border-light);
}

/* ── Pill / Badge ── */
.mgmt-pill {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 6px; white-space: nowrap;
}

/* ── Avatar ── */
.mgmt-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}

/* ── Stats Grid ── */
.mgmt-stats-grid { display: grid; gap: 10px; }
.mgmt-stats-grid--3 { grid-template-columns: repeat(3, 1fr); }
.mgmt-stat-box {
  background: var(--d-bg); border-radius: 8px; padding: 10px;
  text-align: center;
}
.mgmt-stat-box__value { font-size: 16px; font-weight: 900; line-height: 1.2; }
.mgmt-stat-box__value--num { /* color set inline */ }
.mgmt-stat-box__value--text { font-size: 12px; font-weight: 700; }
.mgmt-stat-box__label { font-size: 11px; color: var(--d-text-muted); margin-top: 2px; }

/* ── Empty State ── */
.mgmt-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 20px; gap: 8px;
}
.mgmt-empty__title { font-size: 14px; font-weight: 700; color: var(--d-text-primary); }
.mgmt-empty__subtitle { font-size: 12px; color: var(--d-text-muted); }

/* ── Settings Group (used in OrgSettings cards) ── */
.mgmt-settings-group__header {
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--d-border-light);
}
.mgmt-settings-group__icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--d-teal-ghost); color: var(--d-teal);
  display: flex; align-items: center; justify-content: center;
}
.mgmt-settings-group__title { font-size: 14px; font-weight: 800; color: var(--d-text-primary); }

/* ── Settings Row (key-value pairs) ── */
.mgmt-settings-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
}
.mgmt-settings-row--border { border-bottom: 1px solid var(--d-border-light); }
.mgmt-settings-row__label { font-size: 12px; color: var(--d-text-secondary); }
.mgmt-settings-row__value { font-size: 12px; font-weight: 700; color: var(--d-text-primary); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .mgmt-count-bar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 16px; }
  .mgmt-count-bar__actions { width: 100%; }
  .mgmt-grid-340 { grid-template-columns: 1fr; }
  .mgmt-grid-400 { grid-template-columns: 1fr; }
  .mgmt-filter-bar { flex-direction: column; align-items: stretch; }
  .mgmt-search { min-width: unset; }
}
@media (max-width: 480px) {
  .mgmt-stats-grid--3 { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .mgmt-stat-box { padding: 8px 6px; }
  .mgmt-stat-box__value { font-size: 14px; }
  .mgmt-action-btn { padding: 7px 12px; font-size: 11px; }
}

/* ── Audit Cards Grid ── */
.db-audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 14px;
}
@media (max-width: 640px) {
  .db-audit-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════
   AP — Action Plan Module responsive styles
   ══════════════════════════════════════════════ */

/* ── Summary KPI Grid ── */
.ap-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

/* ── Count Bar ── */
.ap-count-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--d-card-bg);
  border-radius: 12px;
  border: 1px solid var(--d-border);
  padding: 12px 20px;
  margin-bottom: 12px;
  box-shadow: var(--d-shadow);
}
.ap-count-bar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Meta Grid (detail view) ── */
.ap-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

/* ── Detail Header ── */
.ap-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

/* ── Filter Bar ── */
.ap-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--d-card-bg);
  border-radius: 12px;
  border: 1px solid var(--d-border);
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: var(--d-shadow);
  flex-wrap: wrap;
}
.ap-filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 7px 12px;
  border-radius: 8px;
  min-width: 180px;
}

/* ── Card Stepper ── */
.ap-card-stepper {
  margin: 10px 30px 0;
}

/* ── Card Row Layout ── */
.ap-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.ap-card-row__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: 16px;
  flex-shrink: 0;
}

/* ── Create Modal ── */
.ap-create-modal {
  background: var(--d-card-bg);
  border-radius: 16px;
  padding: 28px;
  width: 520px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(10,22,40,0.2);
}
.ap-create-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Audit tile grid responsive ── */
@media (max-width: 1024px) {
  .audit-tile-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 640px) {
  .audit-tile-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Responsive: Tablet ── */
@media (max-width: 1024px) {
  .ap-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Responsive: Small Tablet / Large Phone ── */
@media (max-width: 768px) {
  .ap-summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .ap-count-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
  }
  .ap-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ap-detail-header {
    flex-direction: column;
    gap: 12px;
  }
  .ap-create-2col {
    grid-template-columns: 1fr;
  }
  .ap-card-stepper {
    margin: 10px 10px 0;
  }
  .ap-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .ap-filter-search {
    min-width: unset;
  }
}

/* ── Responsive: Phone ── */
@media (max-width: 640px) {
  .ap-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ap-card-stepper {
    margin: 10px 0 0;
  }
  .ap-card-row {
    flex-direction: column;
    gap: 8px;
  }
  .ap-card-row__right {
    flex-direction: row;
    align-items: center;
    margin-left: 0;
  }
  .ap-create-modal {
    padding: 20px;
  }
}

/* ── Responsive: Small Phone ── */
@media (max-width: 480px) {
  .ap-summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .ap-count-bar {
    padding: 12px 14px;
  }
}
