/* Phase 4 Part 1 ? Digital Platform design tokens & shell */
:root,
[data-dp-theme="light"] {
  --dp-surface: #ffffff;
  --dp-surface-2: #f4f7fb;
  --dp-text: #0f172a;
  --dp-text-muted: #64748b;
  --dp-border: #e2e8f0;
  /* Brand accent is injected from Basic Settings (shell-chrome / admin layout). Keep a fallback only. */
  --dp-accent: var(--dp-brand-accent, #5d3fd3);
  --dp-accent-2: var(--dp-brand-accent-2, #7c8cff);
  --dp-accent-contrast: #ffffff;
  --dp-success: #16a34a;
  --dp-warning: #d97706;
  --dp-danger: #dc2626;
  --dp-info: #0284c7;
  --dp-focus-ring: 0 0 0 2px color-mix(in srgb, var(--dp-accent) 20%, transparent);
  --dp-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  --dp-radius: 12px;
  --dp-radius-sm: 8px;
}

/* Dark mode keeps the brand accent (injected inline from Settings) ? only surfaces change */
[data-dp-theme="dark"] {
  --dp-surface: #0f172a;
  --dp-surface-2: #1e293b;
  --dp-text: #f1f5f9;
  --dp-text-muted: #94a3b8;
  --dp-border: #334155;
  --dp-accent-contrast: #ffffff;
  --dp-success: #22c55e;
  --dp-warning: #f59e0b;
  --dp-danger: #ef4444;
  --dp-info: #38bdf8;
  --dp-focus-ring: 0 0 0 2px color-mix(in srgb, var(--dp-accent) 30%, transparent);
  --dp-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

[data-dp-contrast="high"] {
  --dp-text: #000000;
  --dp-border: #000000;
  --dp-focus-ring: 0 0 0 3px #000000;
}

[data-dp-theme="dark"][data-dp-contrast="high"] {
  /* Text may be pure white; borders/chrome stay muted (never #fff). */
  --dp-text: #ffffff;
  --dp-border: #64748b;
  --dp-focus-ring: 0 0 0 3px #94a3b8;
}

body.digital-platform {
  background: var(--dp-surface-2);
  color: var(--dp-text);
}

body.digital-platform a:focus-visible,
body.digital-platform button:focus-visible,
body.digital-platform input:focus-visible,
body.digital-platform select:focus-visible,
body.digital-platform textarea:focus-visible,
body.digital-platform [tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--dp-focus-ring);
}

.dp-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: var(--dp-accent);
  color: var(--dp-accent-contrast);
  padding: 0.5rem 1rem;
  border-radius: var(--dp-radius-sm);
}

.dp-skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.dp-card {
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  box-shadow: var(--dp-shadow);
  padding: 1rem 1.15rem;
}

.dp-metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dp-metric__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dp-text-muted);
}

.dp-metric__value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dp-text);
  line-height: 1.2;
}

.dp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--dp-accent) 12%, transparent);
  color: var(--dp-accent);
}

.dp-badge--success { background: color-mix(in srgb, var(--dp-success) 14%, transparent); color: var(--dp-success); }
.dp-badge--warning { background: color-mix(in srgb, var(--dp-warning) 14%, transparent); color: var(--dp-warning); }
.dp-badge--danger { background: color-mix(in srgb, var(--dp-danger) 14%, transparent); color: var(--dp-danger); }
.dp-badge--info { background: color-mix(in srgb, var(--dp-info) 14%, transparent); color: var(--dp-info); }

.dp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--dp-border);
  background: var(--dp-surface);
  color: var(--dp-text);
  border-radius: var(--dp-radius-sm);
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dp-btn:hover {
  background: color-mix(in srgb, var(--dp-accent) 8%, var(--dp-surface));
  border-color: color-mix(in srgb, var(--dp-accent) 30%, var(--dp-border));
}

.dp-btn--primary {
  background: var(--dp-accent);
  border-color: var(--dp-accent);
  color: var(--dp-accent-contrast);
}

.dp-btn--primary:hover {
  background: color-mix(in srgb, var(--dp-accent) 88%, #000);
  color: var(--dp-accent-contrast);
}

.dp-skeleton {
  display: block;
  background: linear-gradient(90deg, var(--dp-border), color-mix(in srgb, var(--dp-border) 40%, var(--dp-surface)), var(--dp-border));
  background-size: 200% 100%;
  animation: dp-shimmer 1.2s ease-in-out infinite;
  border-radius: 6px;
  min-height: 1rem;
}

@keyframes dp-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.dp-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--dp-text-muted);
}

.dp-empty__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.75rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--dp-accent) 10%, transparent);
  color: var(--dp-accent);
  font-size: 1.25rem;
}

.dp-drawer,
.dp-dialog {
  position: fixed;
  inset: 0;
  z-index: 1300;
  visibility: hidden;
  pointer-events: none;
}

.dp-drawer.is-open,
.dp-dialog.is-open {
  visibility: visible;
  pointer-events: auto;
}

.dp-drawer__backdrop,
.dp-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dp-drawer.is-open .dp-drawer__backdrop,
.dp-dialog.is-open .dp-dialog__backdrop {
  opacity: 1;
  pointer-events: auto;
}

.dp-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100%;
  background: var(--dp-surface, #fff);
  color: var(--dp-text, #0f172a);
  border-left: 1px solid var(--dp-border, #e2e8f0);
  box-shadow: var(--dp-shadow, 0 12px 32px rgba(15, 23, 42, 0.12));
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.dp-drawer.is-open .dp-drawer__panel {
  transform: translateX(0);
}

.dp-drawer__header,
.dp-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--dp-border, #e2e8f0);
}

.dp-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--dp-border, #e2e8f0);
  border-radius: var(--dp-radius-sm, 8px);
  background: transparent;
  color: var(--dp-text-muted, #64748b);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.dp-drawer__close:hover {
  color: var(--dp-text, #0f172a);
  background: var(--dp-surface-2, #f4f7fb);
}

.dp-drawer__body,
.dp-dialog__body {
  flex: 1;
  overflow: auto;
  padding: 1rem 1.15rem;
}

.dp-dialog__panel {
  position: fixed;
  left: 50%;
  top: 12%;
  transform: translate(-50%, -12px) scale(0.98);
  width: min(640px, 94vw);
  max-height: 80vh;
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  box-shadow: var(--dp-shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}

.dp-dialog.is-open .dp-dialog__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0) scale(1);
}

.dp-command-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--dp-border);
  padding: 1rem 1.15rem;
  font-size: 1rem;
  background: transparent;
  color: var(--dp-text);
}

.dp-command-input:focus {
  outline: none;
}

.dp-command-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  max-height: 55vh;
  overflow: auto;
}

.dp-command-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--dp-radius-sm);
  cursor: pointer;
  color: var(--dp-text);
  text-decoration: none;
}

.dp-command-item:hover,
.dp-command-item.is-active {
  background: color-mix(in srgb, var(--dp-accent) 10%, transparent);
}

.dp-command-item__meta {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--dp-text-muted);
}

.dp-data-table-wrap {
  overflow: auto;
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  background: var(--dp-surface);
}

.dp-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.dp-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--dp-surface-2);
  border-bottom: 1px solid var(--dp-border);
  padding: 0.7rem 0.85rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dp-text-muted);
}

.dp-data-table.dp-sticky-first td:first-child,
.dp-data-table.dp-sticky-first th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--dp-surface);
}

.dp-data-table.dp-sticky-first thead th:first-child {
  z-index: 3;
  background: var(--dp-surface-2);
}

.dp-data-table tbody td {
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--dp-border);
  color: var(--dp-text);
  font-size: 0.88rem;
}

.dp-form-shell {
  background: var(--dp-surface);
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius);
  padding: 1.15rem;
}

.dp-form-section {
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius-sm);
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.dp-form-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--dp-surface-2);
  cursor: pointer;
  font-weight: 700;
}

.dp-form-section__body {
  padding: 1rem;
}

.dp-form-section.is-collapsed .dp-form-section__body {
  display: none;
}

.dp-progress {
  height: 8px;
  background: var(--dp-border);
  border-radius: 999px;
  overflow: hidden;
}

.dp-progress__bar {
  height: 100%;
  background: var(--dp-accent);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.dp-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dp-hero__eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dp-text-muted);
}

.dp-hero__title {
  margin: 0.15rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dp-text);
}

.dp-alert {
  border-radius: var(--dp-radius-sm);
  border: 1px solid var(--dp-border);
  padding: 0.75rem 1rem;
  background: var(--dp-surface);
  color: var(--dp-text);
}

.dp-alert--warning {
  border-color: color-mix(in srgb, var(--dp-warning) 40%, var(--dp-border));
  background: color-mix(in srgb, var(--dp-warning) 10%, var(--dp-surface));
}

.dp-alert--danger {
  border-color: color-mix(in srgb, var(--dp-danger) 40%, var(--dp-border));
  background: color-mix(in srgb, var(--dp-danger) 10%, var(--dp-surface));
}

.dp-chart-card__body {
  min-height: 180px;
}

.dp-widget-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.85rem;
}

.dp-widget--sm { grid-column: span 3; }
.dp-widget--md { grid-column: span 6; }
.dp-widget--lg { grid-column: span 12; }

@media (max-width: 991px) {
  .dp-widget--sm,
  .dp-widget--md { grid-column: span 6; }
  .dp-drawer__panel {
    width: 100vw;
    top: auto;
    bottom: 0;
    height: min(85vh, 640px);
    border-left: 0;
    border-top: 1px solid var(--dp-border);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }
  .dp-drawer.is-open .dp-drawer__panel {
    transform: translateY(0);
  }
  .dp-dialog__panel {
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  .dp-dialog.is-open .dp-dialog__panel {
    transform: none;
  }
}

@media (max-width: 575px) {
  .dp-widget--sm,
  .dp-widget--md,
  .dp-widget--lg { grid-column: span 12; }
}

/* ?? Reusable thin scrollbar ?? */
.dp-scroll {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--dp-accent) 45%, var(--dp-border)) transparent;
}
.dp-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.dp-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.dp-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--dp-accent) 40%, var(--dp-border));
  border-radius: 999px;
}
.dp-scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--dp-accent) 65%, var(--dp-border));
}

/* Bridge legacy admin-shell with digital tokens */
body.digital-platform.admin-shell-refresh {
  background: var(--dp-surface-2);
  color: var(--dp-text);
}

body.digital-platform .header,
body.digital-platform .header__container {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text);
}

body.digital-platform .header__logo {
  border-color: var(--dp-border) !important;
}

body.digital-platform .header__nav {
  min-width: 0;
  gap: 10px !important;
}

body.digital-platform .header__nav__left {
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px !important;
}

body.digital-platform .header__nav__right {
  flex: 0 0 auto;
  flex-shrink: 0;
  gap: 8px !important;
  min-width: 0;
}

body.digital-platform .header__nav__admin {
  flex-shrink: 0;
}

body.digital-platform .header__nav__btn {
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
  background: var(--dp-surface) !important;
}

body.digital-platform .header__nav__btn:hover,
body.digital-platform .header__nav__btn:focus {
  color: var(--dp-accent-contrast) !important;
  background: var(--dp-accent) !important;
  border-color: var(--dp-accent) !important;
}

body.digital-platform .header__search {
  border-color: var(--dp-border) !important;
  background: var(--dp-surface) !important;
  max-width: 280px !important;
  flex: 1 1 auto;
  min-width: 140px;
  box-shadow: none !important;
}

body.digital-platform .header__search:focus-within {
  border-color: color-mix(in srgb, var(--dp-accent) 45%, var(--dp-border)) !important;
  box-shadow: none !important;
}

body.digital-platform .header__search__input:focus,
body.digital-platform .header__search__input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

body.digital-platform .header__search__input {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  color: var(--dp-text) !important;
  background: transparent !important;
}

body.digital-platform .header__search__input::placeholder {
  color: var(--dp-text-muted);
}

body.digital-platform .header__search__icon {
  color: var(--dp-text-muted);
}

body.digital-platform .header__search .search-list {
  background: var(--dp-surface) !important;
  border: 1px solid var(--dp-border) !important;
  border-radius: var(--dp-radius) !important;
  box-shadow: var(--dp-shadow) !important;
  color: var(--dp-text);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--dp-accent) 45%, var(--dp-border)) transparent;
}

body.digital-platform .header__search .search-list::-webkit-scrollbar {
  width: 6px;
}
body.digital-platform .header__search .search-list::-webkit-scrollbar-track {
  background: transparent;
}
body.digital-platform .header__search .search-list::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--dp-accent) 40%, var(--dp-border));
  border-radius: 999px;
}

body.digital-platform .main-sidebar {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text);
}

body.digital-platform .main-content,
body.digital-platform footer {
  color: var(--dp-text);
}

body.digital-platform footer {
  background: var(--dp-surface);
  border-color: var(--dp-border);
}

body.digital-platform .custom--card,
body.digital-platform .section-card,
body.digital-platform .dashboard-item,
body.digital-platform .widget-card,
body.digital-platform .card {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text);
}

body.digital-platform .dropdown-menu {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
  box-shadow: var(--dp-shadow) !important;
}

body.digital-platform .dropdown-item {
  color: var(--dp-text) !important;
}

body.digital-platform .dropdown-item:hover,
body.digital-platform .dropdown-item:focus {
  background: color-mix(in srgb, var(--dp-accent) 12%, transparent) !important;
  color: var(--dp-text) !important;
}

body.digital-platform .shortcut-dropdown--panel .scroll {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--dp-accent) 45%, var(--dp-border)) transparent;
}
body.digital-platform .shortcut-dropdown--panel .scroll::-webkit-scrollbar {
  width: 6px;
}
body.digital-platform .shortcut-dropdown--panel .scroll::-webkit-scrollbar-track {
  background: transparent;
}
body.digital-platform .shortcut-dropdown--panel .scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--dp-accent) 40%, var(--dp-border));
  border-radius: 999px;
}
body.digital-platform .shortcut-dropdown--panel .scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--dp-accent) 65%, var(--dp-border));
}

/* Command palette polish */
.dp-dialog__backdrop {
  backdrop-filter: blur(2px);
}

.dp-command-palette__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.15rem 0.35rem;
}

.dp-command-palette__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dp-text);
}

.dp-command-palette__title i {
  color: var(--dp-accent);
}

.dp-command-palette__hint {
  font-size: 0.72rem;
  color: var(--dp-text-muted);
  border: 1px solid var(--dp-border);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

.dp-command-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.5rem 1rem 0.65rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--dp-border);
  border-radius: var(--dp-radius-sm);
  background: var(--dp-surface-2);
}

.dp-command-search:focus-within {
  box-shadow: none;
  border-color: color-mix(in srgb, var(--dp-accent) 45%, var(--dp-border));
}

.dp-command-search__icon {
  color: var(--dp-text-muted);
  font-size: 1.1rem;
  line-height: 1;
}

.dp-command-input {
  width: 100%;
  border: 0 !important;
  border-bottom: 0 !important;
  padding: 0 !important;
  font-size: 0.95rem;
  background: transparent !important;
  color: var(--dp-text);
  outline: none;
}

.dp-command-input:focus,
.dp-command-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.dp-command-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0.65rem 0.75rem;
  max-height: 50vh;
  overflow: auto;
}

.dp-command-heading {
  padding: 0.55rem 0.65rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--dp-text-muted);
}

.dp-command-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--dp-radius-sm);
  cursor: pointer;
  color: var(--dp-text);
  text-decoration: none;
}

.dp-command-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--dp-accent) 12%, transparent);
  color: var(--dp-accent);
  font-size: 1rem;
}

.dp-command-item__label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.88rem;
}

.dp-command-item__meta {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--dp-text-muted);
  background: color-mix(in srgb, var(--dp-text-muted) 12%, transparent);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}

.dp-command-item:hover,
.dp-command-item.is-active {
  background: color-mix(in srgb, var(--dp-accent) 12%, transparent);
  text-decoration: none;
  color: var(--dp-text);
}

.dp-command-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--dp-text-muted);
}

.dp-command-empty i {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.dp-command-palette__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--dp-border);
  font-size: 0.75rem;
  color: var(--dp-text-muted);
}

.dp-command-palette__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.dp-command-palette__keys kbd {
  display: inline-block;
  min-width: 1.4rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--dp-border);
  border-radius: 5px;
  background: var(--dp-surface-2);
  font-size: 0.68rem;
  font-family: inherit;
  color: var(--dp-text);
  text-align: center;
}

/* Notification drawer items */
.dp-notif-item {
  display: block;
  padding: 0.75rem 0.85rem;
  border-radius: var(--dp-radius-sm);
  text-decoration: none;
  color: var(--dp-text);
  border: 1px solid transparent;
  margin-bottom: 0.35rem;
}
.dp-notif-item:hover {
  background: color-mix(in srgb, var(--dp-accent) 10%, transparent);
  text-decoration: none;
  color: var(--dp-text);
}
.dp-notif-item__title {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.3;
}
.dp-notif-item__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--dp-text-muted);
}
.dp-notif-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--dp-accent) 14%, transparent);
  color: var(--dp-accent);
  font-weight: 600;
  text-transform: capitalize;
}
.dp-drawer__footer {
  padding: 0.75rem 1.15rem;
  border-top: 1px solid var(--dp-border);
}

/* Dark mode bridge for admin shell */
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh,
html[data-dp-theme="dark"] body.digital-platform {
  background: var(--dp-surface-2) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .header,
html[data-dp-theme="dark"] body.digital-platform .main-sidebar,
html[data-dp-theme="dark"] body.digital-platform .main-sidebar.collapsed,
html[data-dp-theme="dark"] body.digital-platform footer {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .custom--card,
html[data-dp-theme="dark"] body.digital-platform .section-card,
html[data-dp-theme="dark"] body.digital-platform .dashboard-item,
html[data-dp-theme="dark"] body.digital-platform .widget-card,
html[data-dp-theme="dark"] body.digital-platform .card,
html[data-dp-theme="dark"] body.digital-platform .modal-content,
html[data-dp-theme="dark"] body.digital-platform .table,
html[data-dp-theme="dark"] body.digital-platform .table > :not(caption) > * > *,
html[data-dp-theme="dark"] body.digital-platform .form--control,
html[data-dp-theme="dark"] body.digital-platform .form-control,
html[data-dp-theme="dark"] body.digital-platform .form-select,
html[data-dp-theme="dark"] body.digital-platform .input-group-text,
html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-selection--single,
html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-selection--multiple,
html[data-dp-theme="dark"] body.digital-platform .select2-dropdown {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-search--dropdown .select2-search__field {
  background: transparent !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .form--control::placeholder,
html[data-dp-theme="dark"] body.digital-platform .form-control::placeholder {
  color: var(--dp-text-muted) !important;
}

/* Section headers: harmonious animated accent wash (replaces static white-in-gradient heroes) */
@keyframes dp-gradient-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

body.digital-platform .dp-section-head,
body.digital-platform .section-card__head,
body.digital-platform .section-card__heading,
body.digital-platform .cust-record__hero,
body.digital-platform .group-dashboard-page .cust-record__hero,
body.digital-platform .treasury-ops-page > .cust-record__hero,
body.digital-platform .ul-page__hero,
body.digital-platform .roles-page__hero,
body.digital-platform .am-cat__hero,
body.digital-platform .am-cat__panel-head,
body.digital-platform .am-ops-form-panel__head,
body.digital-platform .report-section-head,
body.digital-platform .pipeline-column__head,
body.digital-platform .gov-hero,
body.digital-platform .governance-page > .cust-record__hero,
body.digital-platform .vault-hero,
body.digital-platform .am-modal__header,
body.digital-platform [class*="__hero"]:not(.dashboard-hero) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: color-mix(in srgb, var(--dp-accent) 18%, var(--dp-border)) !important;
  color: var(--dp-text) !important;
}

body.digital-platform .dp-section-head::before,
body.digital-platform .section-card__head::before,
body.digital-platform .section-card__heading::before,
body.digital-platform .cust-record__hero::before,
body.digital-platform .group-dashboard-page .cust-record__hero::before,
body.digital-platform .treasury-ops-page > .cust-record__hero::before,
body.digital-platform .ul-page__hero::before,
body.digital-platform .roles-page__hero::before,
body.digital-platform .am-cat__hero::before,
body.digital-platform .am-cat__panel-head::before,
body.digital-platform .am-ops-form-panel__head::before,
body.digital-platform .report-section-head::before,
body.digital-platform .pipeline-column__head::before,
body.digital-platform .gov-hero::before,
body.digital-platform .governance-page > .cust-record__hero::before,
body.digital-platform .vault-hero::before,
body.digital-platform [class*="__hero"]:not(.dashboard-hero)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    color-mix(in srgb, var(--dp-accent) 14%, var(--dp-surface)) 0%,
    color-mix(in srgb, var(--dp-accent-2, var(--dp-accent)) 10%, var(--dp-surface)) 38%,
    color-mix(in srgb, var(--dp-accent) 8%, var(--dp-surface-2)) 72%,
    color-mix(in srgb, var(--dp-accent-2, var(--dp-accent)) 12%, var(--dp-surface)) 100%
  );
  background-size: 220% 220%;
  animation: dp-gradient-flow 16s ease-in-out infinite;
}

body.digital-platform .dp-section-head > *,
body.digital-platform .section-card__head > *,
body.digital-platform .section-card__heading > *,
body.digital-platform .cust-record__hero > *,
body.digital-platform .ul-page__hero > *,
body.digital-platform .roles-page__hero > *,
body.digital-platform .am-cat__hero > *,
body.digital-platform .am-cat__panel-head > *,
body.digital-platform .pipeline-column__head > *,
body.digital-platform .gov-hero > *,
body.digital-platform .vault-hero > *,
body.digital-platform [class*="__hero"]:not(.dashboard-hero) > * {
  position: relative;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  body.digital-platform .dp-section-head::before,
  body.digital-platform .section-card__head::before,
  body.digital-platform .section-card__heading::before,
  body.digital-platform .cust-record__hero::before,
  body.digital-platform .ul-page__hero::before,
  body.digital-platform .roles-page__hero::before,
  body.digital-platform .am-cat__hero::before,
  body.digital-platform .pipeline-column__head::before,
  body.digital-platform .gov-hero::before,
  body.digital-platform [class*="__hero"]:not(.dashboard-hero)::before {
    animation: none;
  }
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__hero,
html[data-dp-theme="dark"] body.digital-platform .group-dashboard-page .cust-record__hero,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page > .cust-record__hero,
html[data-dp-theme="dark"] body.digital-platform [class*="__hero"],
html[data-dp-theme="dark"] body.digital-platform .dashboard-hero {
  background: var(--dp-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--dp-text) !important;
}

/* Dark mode: text & icon contrast */
html[data-dp-theme="dark"] body.digital-platform h1,
html[data-dp-theme="dark"] body.digital-platform h2,
html[data-dp-theme="dark"] body.digital-platform h3,
html[data-dp-theme="dark"] body.digital-platform h4,
html[data-dp-theme="dark"] body.digital-platform h5,
html[data-dp-theme="dark"] body.digital-platform h6,
html[data-dp-theme="dark"] body.digital-platform .card-title,
html[data-dp-theme="dark"] body.digital-platform .cust-record__name,
html[data-dp-theme="dark"] body.digital-platform .dashboard-top-bar__title,
html[data-dp-theme="dark"] body.digital-platform .text--dark,
html[data-dp-theme="dark"] body.digital-platform .text-dark,
html[data-dp-theme="dark"] body.digital-platform label,
html[data-dp-theme="dark"] body.digital-platform .form-label,
html[data-dp-theme="dark"] body.digital-platform .form--label,
html[data-dp-theme="dark"] body.digital-platform .form-check-label,
html[data-dp-theme="dark"] body.digital-platform .breadcrumb,
html[data-dp-theme="dark"] body.digital-platform .breadcrumb-item,
html[data-dp-theme="dark"] body.digital-platform .breadcrumb-item a {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .bg--white,
html[data-dp-theme="dark"] body.digital-platform .bg-white {
  background: var(--dp-surface) !important;
}

html[data-dp-theme="dark"] body.digital-platform .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--dp-text);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-striped-color: var(--dp-text);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
  --bs-table-hover-color: var(--dp-text);
}

html[data-dp-theme="dark"] body.digital-platform .text--muted,
html[data-dp-theme="dark"] body.digital-platform .text-muted {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .dropdown-menu,
html[data-dp-theme="dark"] body.digital-platform .shortcut-dropdown--panel,
html[data-dp-theme="dark"] body.digital-platform .notification-dropdown {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
  box-shadow: var(--dp-shadow) !important;
}

html[data-dp-theme="dark"] body.digital-platform .custom--dropdown .dropdown-menu {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  box-shadow: var(--dp-shadow) !important;
}

html[data-dp-theme="dark"] body.digital-platform .custom--dropdown .dropdown-menu li {
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] body.digital-platform .custom--dropdown .dropdown-menu .dropdown-title {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .custom--dropdown .dropdown-menu .dropdown-item {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .custom--dropdown .dropdown-menu .dropdown-item:hover,
html[data-dp-theme="dark"] body.digital-platform .custom--dropdown .dropdown-menu .dropdown-item:focus,
html[data-dp-theme="dark"] body.digital-platform .custom--dropdown .dropdown-menu .dropdown-item:active {
  background: color-mix(in srgb, var(--dp-accent) 12%, transparent) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .dropdown-menu .border-bottom {
  border-color: var(--dp-border) !important;
}

/* Remap page-level design tokens used by cust-record / treasury modules */
html[data-dp-theme="dark"] body.digital-platform .cust-record,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page {
  --cr-surface: var(--dp-surface);
  --cr-ink: var(--dp-text);
  --cr-muted: var(--dp-text-muted);
  --cr-line: var(--dp-border);
  --cr-wash: var(--dp-surface-2);
  --tr-surface: var(--dp-surface);
  --tr-ink: var(--dp-text);
  --tr-muted: var(--dp-text-muted);
  --tr-line: var(--dp-border);
  --tr-wash: var(--dp-surface-2);
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__metric,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .cust-record__metric,
html[data-dp-theme="dark"] body.digital-platform .section-card,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .section-card,
html[data-dp-theme="dark"] body.digital-platform .cust-record .section-card,
html[data-dp-theme="dark"] body.digital-platform .cust-record__workspace,
html[data-dp-theme="dark"] body.digital-platform .cust-record__chip,
html[data-dp-theme="dark"] body.digital-platform .cust-record__edit-toggle,
html[data-dp-theme="dark"] body.digital-platform .cust-record__doc-card,
html[data-dp-theme="dark"] body.digital-platform .cust-record__table-wrap,
html[data-dp-theme="dark"] body.digital-platform .cust-record__repeater-row,
html[data-dp-theme="dark"] body.digital-platform .cust-record__flag-field,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page > form.row,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page form.row.g-2.mb-3,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .treasury-filter-bar {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .section-card__heading,
html[data-dp-theme="dark"] body.digital-platform .section-card__head,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .section-card__heading,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .section-card__head,
html[data-dp-theme="dark"] body.digital-platform .cust-record .section-card__heading {
  background: var(--dp-surface-2) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__metric-label,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .cust-record__metric-label {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__metric-value,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .cust-record__metric-value {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__tab-content {
  background: var(--dp-surface-2) !important;
}

html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .list-group-item {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .list-group-item:hover {
  background: color-mix(in srgb, var(--dp-accent) 8%, var(--dp-surface)) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .shortcut-dropdown__row,
html[data-dp-theme="dark"] body.digital-platform .shortcut-dropdown__label {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .shortcut-dropdown--panel .dropdown-title,
html[data-dp-theme="dark"] body.digital-platform .header__search .search-list__heading,
html[data-dp-theme="dark"] body.digital-platform .header__search .search-list__meta {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .header__search .search-list__link,
html[data-dp-theme="dark"] body.digital-platform .header__search .search-list__title {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .header__search .search-list__icon {
  background: color-mix(in srgb, var(--dp-accent) 18%, transparent) !important;
  color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .sidebar-link,
html[data-dp-theme="dark"] body.digital-platform .sidebar-txt {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .main-sidebar .sidebar-item > .sidebar-link:hover,
html[data-dp-theme="dark"] body.digital-platform .main-sidebar .sidebar-item > .sidebar-link:focus {
  background: color-mix(in srgb, var(--dp-accent) 12%, transparent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .dp-drawer__panel,
html[data-dp-theme="dark"] body.digital-platform .dp-dialog__panel {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .border-start,
html[data-dp-theme="dark"] body.digital-platform .border-end,
html[data-dp-theme="dark"] body.digital-platform .border-bottom,
html[data-dp-theme="dark"] body.digital-platform .border-top {
  border-color: var(--dp-border) !important;
}

/* Shell refresh overrides ? beat inline #fff rules from admin-shell-refresh */
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh {
  background: var(--dp-surface-2) !important;
}

html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh .header,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh .header__container,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh .header__logo {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh .header.nav-collapsed .header__logo {
  background: linear-gradient(145deg, var(--dp-accent) 0%, color-mix(in srgb, var(--dp-accent) 78%, #000) 100%) !important;
  border-color: color-mix(in srgb, var(--dp-accent) 25%, var(--dp-border)) !important;
}

html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .header.nav-collapsed .header__logo {
  background: transparent !important;
  border-color: transparent !important;
}

html[data-dp-theme="dark"] body.digital-platform .os-theme-light > .os-scrollbar > .os-scrollbar-track,
html[data-dp-theme="dark"] body.digital-platform .os-theme-dark > .os-scrollbar > .os-scrollbar-track {
  background: transparent !important;
}

html[data-dp-theme="dark"] body.digital-platform .os-theme-light > .os-scrollbar > .os-scrollbar-track > .os-scrollbar-handle,
html[data-dp-theme="dark"] body.digital-platform .os-theme-dark > .os-scrollbar > .os-scrollbar-track > .os-scrollbar-handle {
  background: color-mix(in srgb, var(--dp-text-muted) 55%, transparent) !important;
}

html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh .main-sidebar,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh .main-sidebar.collapsed,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh .main-sidebar:not(.collapsed) {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar > .sidebar-menu > .sidebar-item:not(.admin-nav-more) > .sidebar-dropdown-menu,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .os-content > .sidebar-menu > .sidebar-item:not(.admin-nav-more) > .sidebar-dropdown-menu,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-item:not(.admin-nav-more) .sidebar-dropdown-item > .sidebar-dropdown-menu,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .admin-nav-more > .sidebar-dropdown-menu.admin-nav-more-menu,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-menu {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
  box-shadow: var(--dp-shadow) !important;
}

html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-menu .sidebar-link,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-item > .sidebar-link,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar > .sidebar-menu > .sidebar-item:not(.admin-nav-more) > .sidebar-dropdown-menu > .sidebar-item > .sidebar-link {
  color: var(--dp-text) !important;
  background: transparent !important;
}

html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-menu .sidebar-txt {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-menu .sidebar-link:hover,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-menu .sidebar-link:focus,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-menu .sidebar-link.active,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-item > .sidebar-link:hover,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-item > .sidebar-link:focus,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-item > .sidebar-link.active,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar > .sidebar-menu > .sidebar-item:not(.admin-nav-more) > .sidebar-dropdown-menu > .sidebar-item > .sidebar-link:hover,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar > .sidebar-menu > .sidebar-item:not(.admin-nav-more) > .sidebar-dropdown-menu > .sidebar-item > .sidebar-link:focus,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar > .sidebar-menu > .sidebar-item:not(.admin-nav-more) > .sidebar-dropdown-menu > .sidebar-item > .sidebar-link.active {
  background: color-mix(in srgb, var(--dp-accent) 12%, transparent) !important;
  color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-menu .sidebar-link:hover .sidebar-txt,
html[data-dp-theme="dark"] body.digital-platform.admin-shell-refresh.admin-nav-top .main-sidebar .sidebar-dropdown-menu .sidebar-link.active .sidebar-txt {
  color: var(--dp-accent) !important;
}

/* Shortcut panel icon variants */
html[data-dp-theme="dark"] body.digital-platform .shortcut-dropdown__icon--muted {
  background: color-mix(in srgb, var(--dp-text-muted) 16%, var(--dp-surface)) !important;
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .shortcut-dropdown__row:hover {
  background: color-mix(in srgb, var(--dp-accent) 10%, transparent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .shortcut-dropdown__arrow {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .shortcut-dropdown__row:hover .shortcut-dropdown__arrow {
  color: var(--dp-accent) !important;
}

/* Remap module design tokens used across admin pages */
html[data-dp-theme="dark"] body.digital-platform .roles-page,
html[data-dp-theme="dark"] body.digital-platform .am-settings,
html[data-dp-theme="dark"] body.digital-platform .cust-record,
html[data-dp-theme="dark"] body.digital-platform .cust-create,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page,
html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page,
html[data-dp-theme="dark"] body.digital-platform .savings-ops-page,
html[data-dp-theme="dark"] body.digital-platform .group-ops-page,
html[data-dp-theme="dark"] body.digital-platform .group-dashboard-page,
html[data-dp-theme="dark"] body.digital-platform .admin-dashboard,
html[data-dp-theme="dark"] body.digital-platform .am-filter-bar,
html[data-dp-theme="dark"] body.digital-platform .group-savings-dashboard,
html[data-dp-theme="dark"] body.digital-platform .group-savings-page,
html[data-dp-theme="dark"] body.digital-platform .group-repayment-page,
html[data-dp-theme="dark"] body.digital-platform .group-collection-workspace,
html[data-dp-theme="dark"] body.digital-platform .ul-page,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page {
  --rp-surface: var(--dp-surface);
  --rp-ink: var(--dp-text);
  --rp-muted: var(--dp-text-muted);
  --rp-line: var(--dp-border);
  --rp-wash: var(--dp-surface-2);
  --bs-ink: var(--dp-text);
  --bs-muted: var(--dp-text-muted);
  --bs-line: var(--dp-border);
  --bs-wash: var(--dp-surface-2);
  --bs-surface: var(--dp-surface);
  --cr-surface: var(--dp-surface);
  --cr-ink: var(--dp-text);
  --cr-muted: var(--dp-text-muted);
  --cr-line: var(--dp-border);
  --cr-wash: var(--dp-surface-2);
  --tr-surface: var(--dp-surface);
  --tr-ink: var(--dp-text);
  --tr-muted: var(--dp-text-muted);
  --tr-line: var(--dp-border);
  --tr-wash: var(--dp-surface-2);
  --cat-surface: var(--dp-surface);
  --cc-surface: var(--dp-surface);
  --geo-surface: var(--dp-surface);
  --rd-surface: var(--dp-surface);
  --am-surface: var(--dp-surface);
}

/* Roles & permissions page */
html[data-dp-theme="dark"] body.digital-platform .roles-page__hero,
html[data-dp-theme="dark"] body.digital-platform .roles-page__stat,
html[data-dp-theme="dark"] body.digital-platform .role-card,
html[data-dp-theme="dark"] body.digital-platform .roles-page__panel,
html[data-dp-theme="dark"] body.digital-platform .roles-page__panel-head,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__summary,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__perm-shell,
html[data-dp-theme="dark"] body.digital-platform .roles-perm-module {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-page__stat-label,
html[data-dp-theme="dark"] body.digital-platform .role-card__metric-label,
html[data-dp-theme="dark"] body.digital-platform .roles-page__section-note,
html[data-dp-theme="dark"] body.digital-platform .role-card__meta {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-page__stat-value,
html[data-dp-theme="dark"] body.digital-platform .roles-page__title,
html[data-dp-theme="dark"] body.digital-platform .roles-page__section-title,
html[data-dp-theme="dark"] body.digital-platform .role-card__name,
html[data-dp-theme="dark"] body.digital-platform .role-card__metric-value {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-page .btn-outline--base {
  background-color: var(--dp-surface) !important;
  border-color: color-mix(in srgb, var(--dp-accent) 40%, var(--dp-border)) !important;
  color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-page .btn-outline--base:hover,
html[data-dp-theme="dark"] body.digital-platform .roles-page .btn-outline--base:focus {
  background-color: var(--dp-accent) !important;
  border-color: var(--dp-accent) !important;
  color: var(--dp-accent-contrast) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-page__table th,
html[data-dp-theme="dark"] body.digital-platform .roles-page__table td {
  color: var(--dp-text) !important;
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-page__table th {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-page__table tbody tr:hover {
  background: color-mix(in srgb, var(--dp-accent) 6%, transparent) !important;
}

/* Roles create/edit — permission shell */
html[data-dp-theme="dark"] body.digital-platform .roles-edit__main,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__main-head,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__name-field,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__search,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__type-btn,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__flag,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__footer,
html[data-dp-theme="dark"] body.digital-platform .roles-perm-module__toggle,
html[data-dp-theme="dark"] body.digital-platform .roles-perm-item,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__stat-list li {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-edit__main-title,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__summary-name,
html[data-dp-theme="dark"] body.digital-platform .roles-perm-module__title,
html[data-dp-theme="dark"] body.digital-platform .roles-perm-item__label,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__stat-list strong {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-edit__main-lead,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__summary-lead,
html[data-dp-theme="dark"] body.digital-platform .roles-perm-module__count,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__stat-list span,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__footer-note,
html[data-dp-theme="dark"] body.digital-platform .roles-edit__coverage-top {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-edit__scope-note--admin {
  color: #93c5fd !important;
  background: color-mix(in srgb, #3b82f6 16%, var(--dp-surface)) !important;
  border-color: color-mix(in srgb, #3b82f6 28%, var(--dp-border)) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-edit__scope-note--staff {
  color: #6ee7b7 !important;
  background: color-mix(in srgb, #10b981 16%, var(--dp-surface)) !important;
  border-color: color-mix(in srgb, #10b981 28%, var(--dp-border)) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-edit__scope-badge--admin {
  color: #93c5fd !important;
  background: color-mix(in srgb, #3b82f6 18%, var(--dp-surface)) !important;
  border-color: color-mix(in srgb, #3b82f6 30%, var(--dp-border)) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-edit__scope-badge--staff {
  color: #6ee7b7 !important;
  background: color-mix(in srgb, #10b981 18%, var(--dp-surface)) !important;
  border-color: color-mix(in srgb, #10b981 30%, var(--dp-border)) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-edit__type-btn.is-active {
  color: var(--dp-accent) !important;
  border-color: color-mix(in srgb, var(--dp-accent) 40%, var(--dp-border)) !important;
  background: color-mix(in srgb, var(--dp-accent) 12%, var(--dp-surface)) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-perm-module__toggle:hover,
html[data-dp-theme="dark"] body.digital-platform .roles-perm-module__toggle[aria-expanded="true"] {
  background: color-mix(in srgb, var(--dp-accent) 8%, var(--dp-surface)) !important;
}

html[data-dp-theme="dark"] body.digital-platform .roles-perm-item.is-checked {
  border-color: color-mix(in srgb, var(--dp-accent) 40%, var(--dp-border)) !important;
  background: color-mix(in srgb, var(--dp-accent) 10%, var(--dp-surface)) !important;
}

/* Basic settings & similar stat-card layouts */
html[data-dp-theme="dark"] body.digital-platform .am-settings__hero,
html[data-dp-theme="dark"] body.digital-platform .am-settings__stat,
html[data-dp-theme="dark"] body.digital-platform .am-settings__pill,
html[data-dp-theme="dark"] body.digital-platform .am-settings__account-preview,
html[data-dp-theme="dark"] body.digital-platform .am-settings__segment,
html[data-dp-theme="dark"] body.digital-platform .am-settings__tab-panel,
html[data-dp-theme="dark"] body.digital-platform .am-settings__card,
html[data-dp-theme="dark"] body.digital-platform .am-settings__form-card {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__stat-label,
html[data-dp-theme="dark"] body.digital-platform .am-settings__hero-lead,
html[data-dp-theme="dark"] body.digital-platform .am-settings__account-preview-label,
html[data-dp-theme="dark"] body.digital-platform .am-settings__segment small {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__stat-value,
html[data-dp-theme="dark"] body.digital-platform .am-settings__hero-title,
html[data-dp-theme="dark"] body.digital-platform .am-settings__pill strong {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__nav .nav-link {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__nav .nav-link.active,
html[data-dp-theme="dark"] body.digital-platform .am-settings__nav .nav-link:hover {
  color: var(--dp-accent) !important;
  background: color-mix(in srgb, var(--dp-accent) 10%, transparent) !important;
}

/* Vertical sidebar dropdowns (non-top-nav layout) */
html[data-dp-theme="dark"] body.digital-platform .main-sidebar .sidebar-dropdown-menu {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] body.digital-platform .main-sidebar .sidebar-dropdown-menu .sidebar-link,
html[data-dp-theme="dark"] body.digital-platform .main-sidebar .sidebar-dropdown-menu .sidebar-txt {
  color: var(--dp-text) !important;
}

/* Select2 ? page styles force #fff; override for dark mode */
html[data-dp-theme="dark"] body.digital-platform .select2-dropdown,
html[data-dp-theme="dark"] body.digital-platform .select2-dropdown.am-form-select2-dd,
html[data-dp-theme="dark"] body.digital-platform .select2-dropdown.ul-filter-select2-dd,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .select2-dropdown,
html[data-dp-theme="dark"] body.digital-platform .cust-record .select2-dropdown {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  box-shadow: var(--dp-shadow) !important;
}

html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-selection--single,
html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-selection--multiple,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .form--control,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .form-control,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page select.form--control {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
  box-shadow: none !important;
}

html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .form-select,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page select.form--control {
  background-color: var(--dp-surface) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right .75rem center !important;
  background-size: 1rem !important;
}

html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-results__option,
html[data-dp-theme="dark"] body.digital-platform .select2-dropdown.am-form-select2-dd .select2-results__option,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .select2-container--default .select2-results__option {
  background-color: var(--dp-surface) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-results__option--highlighted,
html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-dp-theme="dark"] body.digital-platform .select2-dropdown.am-form-select2-dd .select2-results__option--highlighted,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .select2-container--default .select2-results__option--highlighted {
  background-color: var(--dp-accent) !important;
  color: var(--dp-accent-contrast) !important;
}

html[data-dp-theme="dark"] body.digital-platform .select2-container--default .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted),
html[data-dp-theme="dark"] body.digital-platform .select2-dropdown.am-form-select2-dd .select2-results__option[aria-selected="true"]:not(.select2-results__option--highlighted) {
  background-color: color-mix(in srgb, var(--dp-accent) 14%, var(--dp-surface)) !important;
  color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .select2-dropdown .select2-search--dropdown .select2-search__field {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

/* Treasury alerts ? readable warning tone on dark surfaces */
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .treasury-alert {
  background: color-mix(in srgb, var(--dp-warning) 14%, var(--dp-surface)) !important;
  border-color: color-mix(in srgb, var(--dp-warning) 35%, var(--dp-border)) !important;
  border-left-color: var(--dp-warning) !important;
  color: #fde68a !important;
}

html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .treasury-alert strong,
html[data-dp-theme="dark"] body.digital-platform .treasury-ops-page .treasury-alert b {
  color: #fef3c7 !important;
}

/* Ghost action buttons (Vaults, Settings, etc.) */
html[data-dp-theme="dark"] body.digital-platform .cust-record__action-btn,
html[data-dp-theme="dark"] body.digital-platform .cust-record__action-btn--ghost {
  background: var(--dp-surface) !important;
  border-color: color-mix(in srgb, var(--dp-accent) 35%, var(--dp-border)) !important;
  color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__action-btn:hover,
html[data-dp-theme="dark"] body.digital-platform .cust-record__action-btn:focus,
html[data-dp-theme="dark"] body.digital-platform .cust-record__action-btn--ghost:hover,
html[data-dp-theme="dark"] body.digital-platform .cust-record__action-btn--ghost:focus {
  background: var(--dp-accent) !important;
  border-color: var(--dp-accent) !important;
  color: var(--dp-accent-contrast) !important;
}

/* Collapsed header: keep right cluster visible */
@media screen and (min-width: 992px) {
  body.digital-platform .header.nav-collapsed .header__nav,
  body.digital-platform.admin-shell-refresh .header.nav-collapsed .header__nav {
    width: calc(100% - 72px) !important;
    min-width: 0;
  }

  body.digital-platform.admin-nav-top .header.nav-collapsed .header__logo {
    width: auto;
    flex-shrink: 0;
  }

  body.digital-platform.admin-nav-top .header.nav-collapsed .header__nav {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
  }
}

@media screen and (max-width: 1399px) {
  body.digital-platform .header__nav__right [data-dp-open-activity] {
    display: none !important;
  }
}

/* ?? Tooltips: branded, always above header/nav chrome (system-wide) ?? */
.tooltip {
  z-index: 9999 !important;
}

.tooltip .tooltip-inner {
  background: var(--dp-accent, hsl(var(--base-h, 221) var(--base-s, 83%) var(--base-l, 53%))) !important;
  color: var(--dp-accent-contrast, #ffffff) !important;
  border: 0 !important;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--dp-accent, hsl(var(--base-h, 221) var(--base-s, 83%) var(--base-l, 53%))) 35%, transparent) !important;
}

.tooltip .tooltip-arrow::before,
.tooltip .arrow::before {
  border-top-color: var(--dp-accent, hsl(var(--base-h, 221) var(--base-s, 83%) var(--base-l, 53%))) !important;
}

.bs-tooltip-bottom .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before {
  border-top-color: transparent !important;
  border-bottom-color: var(--dp-accent, hsl(var(--base-h, 221) var(--base-s, 83%) var(--base-l, 53%))) !important;
}

.bs-tooltip-start .tooltip-arrow::before,
.bs-tooltip-left .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before {
  border-top-color: transparent !important;
  border-left-color: var(--dp-accent, hsl(var(--base-h, 221) var(--base-s, 83%) var(--base-l, 53%))) !important;
}

.bs-tooltip-end .tooltip-arrow::before,
.bs-tooltip-right .tooltip-arrow::before,
.bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before {
  border-top-color: transparent !important;
  border-right-color: var(--dp-accent, hsl(var(--base-h, 221) var(--base-s, 83%) var(--base-l, 53%))) !important;
}

/* Operations Intelligence ? tiles, nav, cards in dark mode */
html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-nav,
html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-tile,
html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-rule-card,
html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-health-card {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-nav__link:not(.is-active) {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-tile:hover {
  color: var(--dp-text) !important;
  border-color: color-mix(in srgb, var(--dp-accent) 35%, var(--dp-border)) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-tile__hint,
html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-kpi-dl dt,
html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-empty {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-rule-card__title,
html[data-dp-theme="dark"] body.digital-platform .ops-intelligence-page .oi-kpi-dl dd {
  color: var(--dp-text) !important;
}

/* -- Dark mode gap pass: dashboard, cust-record leftovers, filters, group, settings -- */

html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__quick-card,
html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__queue-card,
html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__panel,
html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__hero,
html[data-dp-theme="dark"] body.digital-platform .cust-record__pane-intro,
html[data-dp-theme="dark"] body.digital-platform .cust-record__note-card,
html[data-dp-theme="dark"] body.digital-platform .cust-record__account-tile,
html[data-dp-theme="dark"] body.digital-platform .cust-record__photo-rail,
html[data-dp-theme="dark"] body.digital-platform .cust-record__field-group,
html[data-dp-theme="dark"] body.digital-platform .group-savings-dashboard__metric,
html[data-dp-theme="dark"] body.digital-platform .group-savings-dashboard__panel,
html[data-dp-theme="dark"] body.digital-platform .group-savings-dashboard__link,
html[data-dp-theme="dark"] body.digital-platform .am-filter-bar.cust-record__panel,
html[data-dp-theme="dark"] body.digital-platform .am-filter-bar,
html[data-dp-theme="dark"] body.digital-platform .cust-record__panel,
html[data-dp-theme="dark"] body.digital-platform .portfolio-account-card,
html[data-dp-theme="dark"] body.digital-platform .portfolio-period-strip {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__quick-card .text-muted,
html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__quick-card small,
html[data-dp-theme="dark"] body.digital-platform .cust-record__pane-intro-desc,
html[data-dp-theme="dark"] body.digital-platform .group-savings-dashboard__metric-label,
html[data-dp-theme="dark"] body.digital-platform .portfolio-period-strip__label,
html[data-dp-theme="dark"] body.digital-platform .portfolio-period-strip__meta {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__quick-card strong,
html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__quick-card h3,
html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__quick-card h4,
html[data-dp-theme="dark"] body.digital-platform .cust-record__pane-intro-title,
html[data-dp-theme="dark"] body.digital-platform .group-savings-dashboard__metric-value,
html[data-dp-theme="dark"] body.digital-platform .group-savings-dashboard__panel-title,
html[data-dp-theme="dark"] body.digital-platform .portfolio-period-strip__value {
  color: var(--dp-text) !important;
}

/* Metric / icon wells ? avoid harsh white squares */
html[data-dp-theme="dark"] body.digital-platform .cust-record__metric-icon,
html[data-dp-theme="dark"] body.digital-platform .admin-dashboard__quick-icon,
html[data-dp-theme="dark"] body.digital-platform .group-context-bar__metric .customer-context-bar__metric,
html[data-dp-theme="dark"] body.digital-platform .customer-context-bar__avatar,
html[data-dp-theme="dark"] body.digital-platform .group-dashboard-page .cust-record__metric-icon {
  background: color-mix(in srgb, var(--dp-accent) 16%, var(--dp-surface)) !important;
  color: var(--dp-accent) !important;
  border-color: color-mix(in srgb, var(--dp-accent) 22%, var(--dp-border)) !important;
}

/* Typed metric wells are defined in the text-only-white pass below */

/* Status badges with white fills */
html[data-dp-theme="dark"] body.digital-platform .badge.bg-success,
html[data-dp-theme="dark"] body.digital-platform .badge.bg-success-soft,
html[data-dp-theme="dark"] body.digital-platform .cust-record__status-pill--active,
html[data-dp-theme="dark"] body.digital-platform span.badge[class*="success"] {
  background: color-mix(in srgb, var(--dp-success) 22%, var(--dp-surface)) !important;
  color: #86efac !important;
  border: 1px solid color-mix(in srgb, var(--dp-success) 40%, var(--dp-border)) !important;
}

/* Filter bar controls ? beat #fff !important */
html[data-dp-theme="dark"] body.digital-platform .am-filter-bar .form--control,
html[data-dp-theme="dark"] body.digital-platform .am-filter-bar .form-control,
html[data-dp-theme="dark"] body.digital-platform .am-filter-bar .select2-container--default .select2-selection--single,
html[data-dp-theme="dark"] body.digital-platform .am-filter-bar .select2-container--default .select2-selection--multiple,
html[data-dp-theme="dark"] body.digital-platform .am-date-field .form--control {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-filter-bar .select2-container--default .select2-selection__rendered,
html[data-dp-theme="dark"] body.digital-platform .am-filter-bar .select2-container--default .select2-selection__placeholder {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-filter-bar .form--label,
html[data-dp-theme="dark"] body.digital-platform .am-filter-bar label {
  color: var(--dp-text-muted) !important;
}

/* Tables: readable headers on dark surfaces */
html[data-dp-theme="dark"] body.digital-platform .cust-record__table thead th,
html[data-dp-theme="dark"] body.digital-platform .table thead th,
html[data-dp-theme="dark"] body.digital-platform .group-ops-page table thead th,
html[data-dp-theme="dark"] body.digital-platform .group-dashboard-page table thead th {
  color: var(--dp-text-muted) !important;
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__table tbody td,
html[data-dp-theme="dark"] body.digital-platform .group-dashboard-page table tbody td {
  color: var(--dp-text) !important;
  border-color: var(--dp-border) !important;
}

/* Group ops panel heads / meetings metrics */
html[data-dp-theme="dark"] body.digital-platform .group-ops-panel__head,
html[data-dp-theme="dark"] body.digital-platform .group-ops-panel__foot,
html[data-dp-theme="dark"] body.digital-platform .group-ops-panel,
html[data-dp-theme="dark"] body.digital-platform .cust-record__metrics .cust-record__metric {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__metric-label {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__metric-value {
  color: var(--dp-text) !important;
}

/* Settings layout tiles + residual cards */
html[data-dp-theme="dark"] body.digital-platform .am-settings__card,
html[data-dp-theme="dark"] body.digital-platform .am-settings__form-card,
html[data-dp-theme="dark"] body.digital-platform .am-settings__segment,
html[data-dp-theme="dark"] body.digital-platform .am-settings__tab-panel,
html[data-dp-theme="dark"] body.digital-platform .am-settings__layout-option,
html[data-dp-theme="dark"] body.digital-platform .am-settings [class*="__card"],
html[data-dp-theme="dark"] body.digital-platform .am-settings [class*="layout"] {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__card .form--label,
html[data-dp-theme="dark"] body.digital-platform .am-settings__form-card .form--label,
html[data-dp-theme="dark"] body.digital-platform .am-settings h3,
html[data-dp-theme="dark"] body.digital-platform .am-settings h4,
html[data-dp-theme="dark"] body.digital-platform .am-settings h5,
html[data-dp-theme="dark"] body.digital-platform .am-settings .section-title,
html[data-dp-theme="dark"] body.digital-platform .am-settings p,
html[data-dp-theme="dark"] body.digital-platform .am-settings small {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings .text-muted,
html[data-dp-theme="dark"] body.digital-platform .am-settings__hero-lead,
html[data-dp-theme="dark"] body.digital-platform .am-settings__segment small {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings .form--control,
html[data-dp-theme="dark"] body.digital-platform .am-settings .form-control {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

/* Empty states inside white-turned-dark cards */
html[data-dp-theme="dark"] body.digital-platform .cust-record__empty-state,
html[data-dp-theme="dark"] body.digital-platform .cust-record__empty-state p,
html[data-dp-theme="dark"] body.digital-platform .group-savings-dashboard__panel .text-muted {
  color: var(--dp-text-muted) !important;
}

/* Danger/outline action readability on dark */
html[data-dp-theme="dark"] body.digital-platform .btn-outline--danger,
html[data-dp-theme="dark"] body.digital-platform .btn.btn-outline--danger {
  color: #fca5a5 !important;
  border-color: color-mix(in srgb, var(--dp-danger) 55%, var(--dp-border)) !important;
  background: transparent !important;
}

/* Settings sections + nav layout cards */
html[data-dp-theme="dark"] body.digital-platform .am-settings__section,
html[data-dp-theme="dark"] body.digital-platform .am-settings__section-head,
html[data-dp-theme="dark"] body.digital-platform .am-settings__nav-card,
html[data-dp-theme="dark"] body.digital-platform .am-settings__shell,
html[data-dp-theme="dark"] body.digital-platform .am-settings__body {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__section-title,
html[data-dp-theme="dark"] body.digital-platform .am-settings__nav-card__title {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__section-desc,
html[data-dp-theme="dark"] body.digital-platform .am-settings__nav-card__desc {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__section-icon {
  background: color-mix(in srgb, var(--dp-accent) 16%, var(--dp-surface)) !important;
  color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__nav-card.is-selected {
  border-color: color-mix(in srgb, var(--dp-accent) 45%, var(--dp-border)) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--dp-accent) 35%, transparent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings__nav-card__preview,
html[data-dp-theme="dark"] body.digital-platform .am-settings__nav-card__stage,
html[data-dp-theme="dark"] body.digital-platform .am-settings__nav-card__rail,
html[data-dp-theme="dark"] body.digital-platform .am-settings__nav-card__bar {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
}

/* ?? Dark mode: only text may be white; mute borders, icons, wells, chrome ?? */

html[data-dp-theme="dark"] body.digital-platform .header__nav__btn,
html[data-dp-theme="dark"] body.digital-platform .header__nav__right .ti,
html[data-dp-theme="dark"] body.digital-platform .header__nav__right i,
html[data-dp-theme="dark"] body.digital-platform .header__search__icon,
html[data-dp-theme="dark"] body.digital-platform .navbar-user .ti,
html[data-dp-theme="dark"] body.digital-platform .sidebar-menu .ti,
html[data-dp-theme="dark"] body.digital-platform .sidebar-link .ti {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .header__nav__btn:hover,
html[data-dp-theme="dark"] body.digital-platform .header__nav__btn:hover .ti,
html[data-dp-theme="dark"] body.digital-platform .header__nav__btn:focus .ti {
  color: var(--dp-accent-contrast) !important;
}

html[data-dp-theme="dark"] body.digital-platform .navbar-user__thumb,
html[data-dp-theme="dark"] body.digital-platform .navbar-user img,
html[data-dp-theme="dark"] body.digital-platform .header__nav__admin img,
html[data-dp-theme="dark"] body.digital-platform .header__nav__admin button img,
html[data-dp-theme="dark"] body.digital-platform .header .avatar,
html[data-dp-theme="dark"] body.digital-platform .header [class*="avatar"] {
  background: var(--dp-surface-2) !important;
  background-color: var(--dp-surface-2) !important;
  border: 1px solid var(--dp-border) !important;
  box-shadow: none !important;
}

/* Status pills ? no light/white fills */
html[data-dp-theme="dark"] body.digital-platform .cust-record__status-pill--active,
html[data-dp-theme="dark"] body.digital-platform .cust-record__status-pill--verified {
  background: rgba(34, 197, 94, .16) !important;
  color: #86efac !important;
  border-color: rgba(34, 197, 94, .35) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__status-pill--inactive {
  background: rgba(239, 68, 68, .16) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, .35) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__status-pill--pending {
  background: rgba(245, 158, 11, .16) !important;
  color: #fde68a !important;
  border-color: rgba(245, 158, 11, .35) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__status-pill--unverified,
html[data-dp-theme="dark"] body.digital-platform .cust-record__status-pill--muted {
  background: var(--dp-surface-2) !important;
  color: var(--dp-text-muted) !important;
  border-color: var(--dp-border) !important;
}

/* Metric icon wells ? tinted, never near-white */
html[data-dp-theme="dark"] body.digital-platform .cust-record__metric-icon {
  background: rgba(93, 63, 211, .18) !important;
  color: var(--dp-accent) !important;
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__metric--primary .cust-record__metric-icon {
  background: rgba(93, 63, 211, .18) !important;
  color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__metric--success .cust-record__metric-icon {
  background: rgba(34, 197, 94, .16) !important;
  color: #4ade80 !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__metric--warning .cust-record__metric-icon {
  background: rgba(245, 158, 11, .16) !important;
  color: #fbbf24 !important;
}

html[data-dp-theme="dark"] body.digital-platform .cust-record__metric--info .cust-record__metric-icon {
  background: rgba(56, 189, 248, .16) !important;
  color: #38bdf8 !important;
}

/* Settings inputs + input-group chrome */
html[data-dp-theme="dark"] body.digital-platform .am-settings .form--control,
html[data-dp-theme="dark"] body.digital-platform .am-settings .form-control,
html[data-dp-theme="dark"] body.digital-platform .am-settings .input--group .form--control,
html[data-dp-theme="dark"] body.digital-platform .am-settings .input--group .input-group-text,
html[data-dp-theme="dark"] body.digital-platform .am-settings .input-group-text,
html[data-dp-theme="dark"] body.digital-platform .am-settings input[type="color"],
html[data-dp-theme="dark"] body.digital-platform .am-settings select.form--control {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
  box-shadow: none !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-settings .input--group .input-group-text {
  border-left-color: var(--dp-border) !important;
}

/* Context bars */
html[data-dp-theme="dark"] body.digital-platform .group-context-bar,
html[data-dp-theme="dark"] body.digital-platform .customer-context-bar {
  --gcb-surface: var(--dp-surface);
  --gcb-wash: var(--dp-surface-2);
  --gcb-line: var(--dp-border);
  --gcb-ink: var(--dp-text);
  --gcb-muted: var(--dp-text-muted);
  --ccb-surface: var(--dp-surface);
  --ccb-wash: var(--dp-surface-2);
  --ccb-line: var(--dp-border);
  --ccb-ink: var(--dp-text);
  --ccb-muted: var(--dp-text-muted);
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .group-context-bar__metric,
html[data-dp-theme="dark"] body.digital-platform .customer-context-bar__metric,
html[data-dp-theme="dark"] body.digital-platform .group-context-bar__cta,
html[data-dp-theme="dark"] body.digital-platform .customer-context-bar__cta {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

/* Group payment collection (GPC) ? was solid white cards */
html[data-dp-theme="dark"] body.digital-platform .group-collection-workspace {
  --gpc-surface: var(--dp-surface);
  --gpc-wash: var(--dp-surface-2);
  --gpc-line: var(--dp-border);
  --gpc-ink: var(--dp-text);
  --gpc-muted: var(--dp-text-muted);
  --gpc-blue-soft: rgba(37, 99, 235, .18);
  --gpc-green-soft: rgba(5, 150, 105, .18);
  --gpc-orange-soft: rgba(217, 119, 6, .18);
  --gpc-purple-soft: rgba(93, 63, 211, .18);
}

html[data-dp-theme="dark"] body.digital-platform .gpc-summary-card,
html[data-dp-theme="dark"] body.digital-platform .gpc-summary-card--total,
html[data-dp-theme="dark"] body.digital-platform .gpc-context-bar,
html[data-dp-theme="dark"] body.digital-platform .gpc-toolbar-primary,
html[data-dp-theme="dark"] body.digital-platform .gpc-table-shell,
html[data-dp-theme="dark"] body.digital-platform .gpc-table-footer,
html[data-dp-theme="dark"] body.digital-platform .group-collection-denom,
html[data-dp-theme="dark"] body.digital-platform .group-collection-denom__head,
html[data-dp-theme="dark"] body.digital-platform .gpc-branch-chip,
html[data-dp-theme="dark"] body.digital-platform .gpc-btn--outline-blue,
html[data-dp-theme="dark"] body.digital-platform .gpc-btn--outline-green,
html[data-dp-theme="dark"] body.digital-platform .gpc-btn--outline-orange,
html[data-dp-theme="dark"] body.digital-platform .gpc-card-btn--ghost,
html[data-dp-theme="dark"] body.digital-platform .gpc-card-btn--outline-orange,
html[data-dp-theme="dark"] body.digital-platform .gpc-collect-now,
html[data-dp-theme="dark"] body.digital-platform .gpc-pagination__select,
html[data-dp-theme="dark"] body.digital-platform .gpc-pagination__pages button:not(.is-active) {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
  box-shadow: none !important;
}

html[data-dp-theme="dark"] body.digital-platform .gpc-context-bar,
html[data-dp-theme="dark"] body.digital-platform .gpc-table-footer,
html[data-dp-theme="dark"] body.digital-platform .group-collection-denom__head,
html[data-dp-theme="dark"] body.digital-platform .gpc-branch-chip,
html[data-dp-theme="dark"] body.digital-platform .group-payment-collection-table thead th,
html[data-dp-theme="dark"] body.digital-platform .gpc-collect-now {
  background: var(--dp-surface-2) !important;
}

html[data-dp-theme="dark"] body.digital-platform .gpc-summary-card__metric-value,
html[data-dp-theme="dark"] body.digital-platform .gpc-context-bar__title,
html[data-dp-theme="dark"] body.digital-platform .gpc-customer-name,
html[data-dp-theme="dark"] body.digital-platform .group-payment-collection-table .gpc-col-money {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .gpc-summary-card__metric-label,
html[data-dp-theme="dark"] body.digital-platform .gpc-summary-card__footnote,
html[data-dp-theme="dark"] body.digital-platform .gpc-customer-meta,
html[data-dp-theme="dark"] body.digital-platform .gpc-table-footer__info,
html[data-dp-theme="dark"] body.digital-platform .group-payment-collection-table thead th {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .group-payment-collection-table tbody td,
html[data-dp-theme="dark"] body.digital-platform .group-payment-collection-table tbody tr:nth-child(even) > td {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .group-payment-collection-table tbody tr:nth-child(even) > td {
  background: var(--dp-surface-2) !important;
}

html[data-dp-theme="dark"] body.digital-platform .gpc-summary-card__metric-icon {
  border: 1px solid var(--dp-border) !important;
}

html[data-dp-theme="dark"] body.digital-platform .gpc-info-banner {
  background: rgba(56, 189, 248, .12) !important;
  border-color: rgba(56, 189, 248, .3) !important;
  color: #7dd3fc !important;
}

/* Workspace / currency chips under header */
html[data-dp-theme="dark"] body.digital-platform .admin-workspace-chip,
html[data-dp-theme="dark"] body.digital-platform .workspace-chip,
html[data-dp-theme="dark"] body.digital-platform [class*="workspace"] .badge,
html[data-dp-theme="dark"] body.digital-platform .header [class*="chip"],
html[data-dp-theme="dark"] body.digital-platform .btn-outline--base,
html[data-dp-theme="dark"] body.digital-platform .btn.btn-outline--base {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

/* Generic catch: light utility backgrounds on admin pages */
html[data-dp-theme="dark"] body.digital-platform .bg-light,
html[data-dp-theme="dark"] body.digital-platform .bg-white,
html[data-dp-theme="dark"] body.digital-platform .bg--white {
  background: var(--dp-surface) !important;
  background-color: var(--dp-surface) !important;
}

html[data-dp-theme="dark"] body.digital-platform .border,
html[data-dp-theme="dark"] body.digital-platform .border-top,
html[data-dp-theme="dark"] body.digital-platform .border-bottom,
html[data-dp-theme="dark"] body.digital-platform .border-start,
html[data-dp-theme="dark"] body.digital-platform .border-end {
  border-color: var(--dp-border) !important;
}

/* Floating action / scroll-top: keep blue button; arrow uses accent-contrast (ok on solid) */
html[data-dp-theme="dark"] body.digital-platform .scroll-to-top,
html[data-dp-theme="dark"] body.digital-platform .back-to-top {
  background: var(--dp-accent) !important;
  border-color: var(--dp-accent) !important;
}

/* Form / Document Engine ops pages */
html[data-dp-theme="dark"] body.digital-platform .fe-ops-page .fe-breadcrumb a,
html[data-dp-theme="dark"] body.digital-platform .fe-ops-page .cust-record__name,
html[data-dp-theme="dark"] body.digital-platform .doc-preview-hub .cust-record__eyebrow {
  color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] body.digital-platform .fe-ops-page .fe-table tbody tr:hover {
  background: color-mix(in srgb, var(--dp-accent) 6%, var(--dp-surface)) !important;
}

html[data-dp-theme="dark"] body.digital-platform .doc-preview-hub .fe-doc-preview-frame,
html[data-dp-theme="dark"] body.digital-platform .doc-preview-hub .fe-list-panel {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] body.digital-platform .doc-preview-hub .fe-doc-preview-frame__toolbar {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text-muted) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Admin UI uniformity pass — shared widgets, legacy shells, module surfaces
   ═══════════════════════════════════════════════════════════════════════════ */

/* Standard empty state */
body.digital-platform .dp-empty-state,
body.digital-platform .aglu-empty,
body.digital-platform .cust-record__empty-state,
body.digital-platform .pipeline-column__empty,
body.digital-platform .gpc-empty {
  background: var(--dp-surface) !important;
  border: 1px dashed color-mix(in srgb, var(--dp-accent) 22%, var(--dp-border)) !important;
  border-radius: var(--dp-radius);
  color: var(--dp-text-muted) !important;
}

body.digital-platform .dp-empty-state__title,
body.digital-platform .aglu-empty__title,
body.digital-platform .cust-record__empty-state h3,
body.digital-platform .pipeline-column__empty-title {
  color: var(--dp-text) !important;
}

body.digital-platform .dp-empty-state__icon,
body.digital-platform .aglu-empty__icon {
  background: color-mix(in srgb, var(--dp-accent) 14%, var(--dp-surface)) !important;
  color: var(--dp-accent) !important;
}

/* Textareas, file uploads, toggle option cards */
html[data-dp-theme="dark"] body.digital-platform textarea.form--control,
html[data-dp-theme="dark"] body.digital-platform textarea.form-control,
html[data-dp-theme="dark"] body.digital-platform .form--control[type="file"],
html[data-dp-theme="dark"] body.digital-platform .signature-upload,
html[data-dp-theme="dark"] body.digital-platform .upload-zone,
html[data-dp-theme="dark"] body.digital-platform .file-upload-card,
html[data-dp-theme="dark"] body.digital-platform .option-toggle-card,
html[data-dp-theme="dark"] body.digital-platform .pm-option-card,
html[data-dp-theme="dark"] body.digital-platform .field-agent-card {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

/* AM/PM time picker (role access times) */
html[data-dp-theme="dark"] body.digital-platform .rat-time-ampm .btn,
html[data-dp-theme="dark"] body.digital-platform .time-ampm-btn,
html[data-dp-theme="dark"] body.digital-platform .am-pm-toggle .btn,
html[data-dp-theme="dark"] body.digital-platform [class*="ampm"] .btn:not(.active) {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .rat-time-ampm .btn.active,
html[data-dp-theme="dark"] body.digital-platform .time-ampm-btn.active,
html[data-dp-theme="dark"] body.digital-platform .am-pm-toggle .btn.active {
  background: var(--dp-accent) !important;
  border-color: var(--dp-accent) !important;
  color: var(--dp-accent-contrast) !important;
}

/* Modals — body/footer surfaces */
html[data-dp-theme="dark"] body.digital-platform .am-modal,
html[data-dp-theme="dark"] body.digital-platform .custom--modal.am-modal {
  --am-ink: var(--dp-text);
  --am-muted: var(--dp-text-muted);
  --am-line: var(--dp-border);
  --am-wash: var(--dp-surface-2);
  --am-surface: var(--dp-surface);
}

html[data-dp-theme="dark"] body.digital-platform .am-modal .modal-content,
html[data-dp-theme="dark"] body.digital-platform .am-modal__body,
html[data-dp-theme="dark"] body.digital-platform .am-modal__footer,
html[data-dp-theme="dark"] body.digital-platform .am-sysinfo__tabs,
html[data-dp-theme="dark"] body.digital-platform .am-sysinfo__list,
html[data-dp-theme="dark"] body.digital-platform .am-sysinfo__row {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-sysinfo__row:nth-child(even) {
  background: var(--dp-surface-2) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-sysinfo__tabs .nav-link:not(.active) {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-sysinfo__row dt {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-sysinfo__row dd {
  color: var(--dp-text-muted) !important;
}

/* Air Datepicker popup */
html[data-dp-theme="dark"] body.digital-platform .am-datepicker.datepicker,
html[data-dp-theme="dark"] body.digital-platform .datepicker.datepicker {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
  box-shadow: var(--dp-shadow) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-datepicker .datepicker--nav,
html[data-dp-theme="dark"] body.digital-platform .am-datepicker .datepicker--content,
html[data-dp-theme="dark"] body.digital-platform .am-datepicker .datepicker--buttons {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-datepicker .datepicker--nav-title,
html[data-dp-theme="dark"] body.digital-platform .am-datepicker .datepicker--day-name,
html[data-dp-theme="dark"] body.digital-platform .am-datepicker .datepicker--cell {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-date-field .form--control.datepicker-here,
html[data-dp-theme="dark"] body.digital-platform .am-date-field .form--control.js-am-datepicker {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

/* Legacy user list shell (.ul-page) */
html[data-dp-theme="dark"] body.digital-platform .ul-page {
  --ul-surface: var(--dp-surface-2);
  --ul-card: var(--dp-surface);
  --ul-ink: var(--dp-text);
  --ul-muted: var(--dp-text-muted);
  --ul-line: var(--dp-border);
}

html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-stat,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-toolbar,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-toolbar__search,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-filter,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-filter__control,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-table-wrap,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-table tbody tr,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-pagination,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-toolbar__refine,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-bulk-bar {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-table tbody tr:nth-child(even) {
  background: var(--dp-surface-2) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-stat__label,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-customer__username,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-customer__branch {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-stat__value,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-table thead th,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-table tbody td {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-table tbody td .text-muted,
html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-table tbody td code {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-badge--verified {
  background: color-mix(in srgb, var(--dp-success) 20%, var(--dp-surface)) !important;
  color: #86efac !important;
}

html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-badge--pending {
  background: color-mix(in srgb, var(--dp-warning) 20%, var(--dp-surface)) !important;
  color: #fde68a !important;
}

html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-badge--inactive {
  background: color-mix(in srgb, var(--dp-danger) 18%, var(--dp-surface)) !important;
  color: #fca5a5 !important;
}

html[data-dp-theme="dark"] body.digital-platform .ul-page .ul-status__overall--active {
  background: color-mix(in srgb, var(--dp-success) 22%, var(--dp-surface)) !important;
  color: #86efac !important;
}

/* Catalog / ops / vault / ledger / loan list shells */
html[data-dp-theme="dark"] body.digital-platform .am-cat,
html[data-dp-theme="dark"] body.digital-platform .am-cat-entry,
html[data-dp-theme="dark"] body.digital-platform .am-ops-page,
html[data-dp-theme="dark"] body.digital-platform .vault-page,
html[data-dp-theme="dark"] body.digital-platform .am-ledger-page,
html[data-dp-theme="dark"] body.digital-platform .am-loan-page,
html[data-dp-theme="dark"] body.digital-platform .report-hub-page,
html[data-dp-theme="dark"] body.digital-platform .book-loan-page,
html[data-dp-theme="dark"] body.digital-platform .aglu-page,
html[data-dp-theme="dark"] body.digital-platform .governance-page,
html[data-dp-theme="dark"] body.digital-platform .pipeline-page,
html[data-dp-theme="dark"] body.digital-platform .pricing-ops-page,
html[data-dp-theme="dark"] body.digital-platform .pm-page {
  --cat-surface: var(--dp-surface);
  --cc-surface: var(--dp-surface);
  --am-surface: var(--dp-surface);
  --rd-surface: var(--dp-surface);
  --pl-surface: var(--dp-surface);
  --rp-surface: var(--dp-surface);
}

html[data-dp-theme="dark"] body.digital-platform .am-cat__hero,
html[data-dp-theme="dark"] body.digital-platform .am-cat__panel,
html[data-dp-theme="dark"] body.digital-platform .am-cat__panel-head,
html[data-dp-theme="dark"] body.digital-platform .am-cat__toolbar,
html[data-dp-theme="dark"] body.digital-platform .am-cat__search-bar,
html[data-dp-theme="dark"] body.digital-platform .am-cat__metric,
html[data-dp-theme="dark"] body.digital-platform .am-cat-entry__panel,
html[data-dp-theme="dark"] body.digital-platform .am-cat-entry__toggle,
html[data-dp-theme="dark"] body.digital-platform .am-ops-form-panel,
html[data-dp-theme="dark"] body.digital-platform .am-ops-form-panel__head,
html[data-dp-theme="dark"] body.digital-platform .am-ops-branch-card,
html[data-dp-theme="dark"] body.digital-platform .am-ops-branch-card__head,
html[data-dp-theme="dark"] body.digital-platform .am-ops-pill-tabs__link,
html[data-dp-theme="dark"] body.digital-platform .vault-panel,
html[data-dp-theme="dark"] body.digital-platform .vault-stat,
html[data-dp-theme="dark"] body.digital-platform .vault-flow,
html[data-dp-theme="dark"] body.digital-platform .am-ledger-nav,
html[data-dp-theme="dark"] body.digital-platform .am-ledger-metric,
html[data-dp-theme="dark"] body.digital-platform .am-ledger-filters,
html[data-dp-theme="dark"] body.digital-platform .am-ledger-filters__head,
html[data-dp-theme="dark"] body.digital-platform .am-ledger-edit-banner,
html[data-dp-theme="dark"] body.digital-platform .am-loan-metric,
html[data-dp-theme="dark"] body.digital-platform .am-loan-ledger-toggle,
html[data-dp-theme="dark"] body.digital-platform .am-loan-search .input--group,
html[data-dp-theme="dark"] body.digital-platform .am-lookup-nav,
html[data-dp-theme="dark"] body.digital-platform .am-lookup-metric,
html[data-dp-theme="dark"] body.digital-platform .am-lookup-edit-banner,
html[data-dp-theme="dark"] body.digital-platform .report-hub-icon-btn,
html[data-dp-theme="dark"] body.digital-platform .report-section-head,
html[data-dp-theme="dark"] body.digital-platform .dash-card,
html[data-dp-theme="dark"] body.digital-platform .report-card,
html[data-dp-theme="dark"] body.digital-platform .savings-report-card {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-cat__hero-lead,
html[data-dp-theme="dark"] body.digital-platform .am-cat__metric-label,
html[data-dp-theme="dark"] body.digital-platform .report-card__dates,
html[data-dp-theme="dark"] body.digital-platform .savings-report-card__meta {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-cat__metric-value,
html[data-dp-theme="dark"] body.digital-platform .report-card__title,
html[data-dp-theme="dark"] body.digital-platform .savings-report-card__title {
  color: var(--dp-text) !important;
}

/* Assign GL users */
html[data-dp-theme="dark"] body.digital-platform .aglu-filter,
html[data-dp-theme="dark"] body.digital-platform .aglu-filter__placeholder,
html[data-dp-theme="dark"] body.digital-platform .aglu-assign__shell,
html[data-dp-theme="dark"] body.digital-platform .aglu-assign__identity,
html[data-dp-theme="dark"] body.digital-platform .aglu-assign__search-wrap,
html[data-dp-theme="dark"] body.digital-platform .aglu-listbox,
html[data-dp-theme="dark"] body.digital-platform .aglu-page .aglu-list,
html[data-dp-theme="dark"] body.digital-platform .aglu-mover,
html[data-dp-theme="dark"] body.digital-platform .aglu-assign__footer {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .aglu-filter__hint,
html[data-dp-theme="dark"] body.digital-platform .aglu-assign__meta,
html[data-dp-theme="dark"] body.digital-platform .aglu-listbox__count,
html[data-dp-theme="dark"] body.digital-platform .aglu-assign__hint {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .aglu-filter__title,
html[data-dp-theme="dark"] body.digital-platform .aglu-assign__name,
html[data-dp-theme="dark"] body.digital-platform .aglu-listbox__title {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .aglu-page .aglu-list option:checked,
html[data-dp-theme="dark"] body.digital-platform .aglu-page .aglu-list option:hover {
  background: color-mix(in srgb, var(--dp-accent) 22%, var(--dp-surface)) !important;
  color: var(--dp-text) !important;
}

/* Governance */
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-nav,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-panel,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-health-row,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-changes-card,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-matrix-shell,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-matrix-shell thead th,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-matrix-shell tbody td:first-child {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-changes-card__title,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-panel__title {
  color: var(--dp-text) !important;
}

/* Loan pipeline kanban */
html[data-dp-theme="dark"] body.digital-platform .pipeline-page,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline {
  --pl-card: var(--dp-surface);
  --pl-wash: var(--dp-surface-2);
  --pl-ink: var(--dp-text);
  --pl-muted: var(--dp-text-muted);
  --pl-line: var(--dp-border);
}

html[data-dp-theme="dark"] body.digital-platform .am-pipeline__hero,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline__metric,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline__toolbar,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline__column,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline__column-head,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline__column-body,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline__card,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline-card,
html[data-dp-theme="dark"] body.digital-platform .pipeline-board,
html[data-dp-theme="dark"] body.digital-platform .pipeline-column,
html[data-dp-theme="dark"] body.digital-platform .pipeline-card,
html[data-dp-theme="dark"] body.digital-platform .pipeline-column__body,
html[data-dp-theme="dark"] body.digital-platform .pipeline-toolbar,
html[data-dp-theme="dark"] body.digital-platform .pipeline-metric {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-pipeline__column-title,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline__column-title span,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline-card__title,
html[data-dp-theme="dark"] body.digital-platform .pipeline-column__title,
html[data-dp-theme="dark"] body.digital-platform .pipeline-card__title,
html[data-dp-theme="dark"] body.digital-platform .pipeline-card__amount {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .pipeline-column__head-title {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .am-pipeline__empty p,
html[data-dp-theme="dark"] body.digital-platform .am-pipeline__column-meta,
html[data-dp-theme="dark"] body.digital-platform .pipeline-card__meta,
html[data-dp-theme="dark"] body.digital-platform .pipeline-column__empty-text {
  color: var(--dp-text-muted) !important;
}

/* Payment methods sidebar + options */
html[data-dp-theme="dark"] body.digital-platform .pm-method-card,
html[data-dp-theme="dark"] body.digital-platform .pm-option-card,
html[data-dp-theme="dark"] body.digital-platform .pm-sidebar,
html[data-dp-theme="dark"] body.digital-platform .pm-detail-panel,
html[data-dp-theme="dark"] body.digital-platform .payment-method-list__item {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .pm-method-card__name,
html[data-dp-theme="dark"] body.digital-platform .pm-detail-panel__title {
  color: var(--dp-text) !important;
}

/* Pricing simulator breakdown rows */
html[data-dp-theme="dark"] body.digital-platform .pricing-breakdown__row,
html[data-dp-theme="dark"] body.digital-platform .pricing-breakdown__row--alt,
html[data-dp-theme="dark"] body.digital-platform .pricing-sim-row,
html[data-dp-theme="dark"] body.digital-platform .pricing-sim-row--highlight {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .pricing-breakdown__row--alt,
html[data-dp-theme="dark"] body.digital-platform .pricing-sim-row:nth-child(even) {
  background: var(--dp-surface-2) !important;
}

/* Financial transaction detail grid */
html[data-dp-theme="dark"] body.digital-platform .fin-tx-detail__cell,
html[data-dp-theme="dark"] body.digital-platform .fin-tx-detail-grid > div,
html[data-dp-theme="dark"] body.digital-platform .tx-detail-card,
html[data-dp-theme="dark"] body.digital-platform .quick-link-btn {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .fin-tx-detail__label,
html[data-dp-theme="dark"] body.digital-platform .tx-detail-card__label {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .fin-tx-detail__value,
html[data-dp-theme="dark"] body.digital-platform .tx-detail-card__value,
html[data-dp-theme="dark"] body.digital-platform .quick-link-btn {
  color: var(--dp-text) !important;
}

/* Integration dashboard inner panels */
html[data-dp-theme="dark"] body.digital-platform .integration-page .card-body.bg-light,
html[data-dp-theme="dark"] body.digital-platform .integration-page .card .empty-panel,
html[data-dp-theme="dark"] body.digital-platform .integration-dashboard__panel-body {
  background: var(--dp-surface-2) !important;
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .integration-page .card-header.bg-white {
  background: var(--dp-surface-2) !important;
  color: var(--dp-text) !important;
  border-color: var(--dp-border) !important;
}

/* Gateway edit */
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-hero,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-stat,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-panel,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-panel__head,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-currency-card,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-currency-card__head,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-currency-section,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-footer,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-form-generator .card-header,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-panel,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-sidebar-item,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-option-card {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-panel__head,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-currency-section,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-form-generator .card-header {
  background: var(--dp-surface-2) !important;
}

html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-hero__title,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-stat__value,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-panel__title,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-currency-card__title,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-currency-config__title,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-hero__meta code {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-hero__eyebrow,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-hero__meta,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-stat__label,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-panel__lead,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-footer__hint,
html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-currency-section__title {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .gw-edit-page .gw-edit-footer {
  background: color-mix(in srgb, var(--dp-surface) 95%, transparent) !important;
}

/* Branch staff field-agent / signature cards */
html[data-dp-theme="dark"] body.digital-platform .bs-field-agent-card,
html[data-dp-theme="dark"] body.digital-platform .bs-signature-upload,
html[data-dp-theme="dark"] body.digital-platform .branch-staff-form .toggle-card {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

/* Preloader */
html[data-dp-theme="dark"] body.digital-platform .preloader,
html[data-dp-theme="dark"] body.digital-platform .loader-wrapper {
  background: color-mix(in srgb, var(--dp-surface-2) 92%, transparent) !important;
}

/* Pagination in dark containers */
html[data-dp-theme="dark"] body.digital-platform .pagination .page-link {
  background: var(--dp-surface) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .pagination .page-item.active .page-link {
  background: var(--dp-accent) !important;
  border-color: var(--dp-accent) !important;
  color: var(--dp-accent-contrast) !important;
}

/* Financial / savings ops surfaces */
html[data-dp-theme="dark"] body.digital-platform .ft-ops-page .ft-kv__item,
html[data-dp-theme="dark"] body.digital-platform .ft-ops-page .ft-pm-nav__item,
html[data-dp-theme="dark"] body.digital-platform .ft-ops-page .ft-pm-option,
html[data-dp-theme="dark"] body.digital-platform .ft-ops-page .ft-tx-link,
html[data-dp-theme="dark"] body.digital-platform .savings-ops-page .report-tile,
html[data-dp-theme="dark"] body.digital-platform .pricing-ops-page .pricing-breakdown__row,
html[data-dp-theme="dark"] body.digital-platform .pricing-ops-page .pricing-breakdown__row--muted,
html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-toolbar,
html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-panel,
html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-day-row,
html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-time-field__ampm,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-list-panel,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-list-panel__head,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-stat,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-nav,
html[data-dp-theme="dark"] body.digital-platform .integration-page .list-group-item {
  background: var(--dp-surface) !important;
  background-image: none !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ft-ops-page .ft-kv__label,
html[data-dp-theme="dark"] body.digital-platform .savings-ops-page .report-tile small,
html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-panel__note,
html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-toolbar__hint,
html[data-dp-theme="dark"] body.digital-platform .governance-page .gov-list-panel__title {
  color: var(--dp-text-muted) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ft-ops-page .ft-kv__value,
html[data-dp-theme="dark"] body.digital-platform .savings-ops-page .report-tile__title,
html[data-dp-theme="dark"] body.digital-platform .ft-ops-page .ft-tx-link span,
html[data-dp-theme="dark"] body.digital-platform .pricing-ops-page .pricing-breakdown__row strong {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .ft-ops-page .ft-pm-nav__item.is-active,
html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-day-row:nth-child(even) {
  background: var(--dp-surface-2) !important;
}

html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-day-row__status--open {
  background: color-mix(in srgb, var(--dp-success) 18%, var(--dp-surface)) !important;
  color: #86efac !important;
}

html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-time-field__ampm-btn:not(.is-active) {
  background: var(--dp-surface-2) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] body.digital-platform .rat-page .rat-time-field__ampm-btn.is-active {
  background: var(--dp-accent) !important;
  color: var(--dp-accent-contrast) !important;
}

html[data-dp-theme="dark"] body.digital-platform .savings-ops-page .report-tile__actions a {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

/* CKEditor 5 — dark mode (manual gateway guidelines, CMS, notifications, etc.) */
html[data-dp-theme="dark"] .ck.ck-editor {
  --ck-color-base-background: var(--dp-surface);
  --ck-color-base-foreground: var(--dp-surface-2);
  --ck-color-base-border: var(--dp-border);
  --ck-color-base-text: var(--dp-text);
  --ck-color-base-active: var(--dp-surface-2);
  --ck-color-base-active-focus: color-mix(in srgb, var(--dp-accent) 22%, var(--dp-surface-2));
  --ck-color-base-focus: color-mix(in srgb, var(--dp-accent) 18%, var(--dp-surface));
  --ck-color-focus-border: var(--dp-accent);
  --ck-color-text: var(--dp-text);
  --ck-color-shadow-drop: var(--dp-shadow);
  --ck-color-shadow-inner: rgba(0, 0, 0, 0.25);
  --ck-color-button-default-background: transparent;
  --ck-color-button-default-hover-background: color-mix(in srgb, var(--dp-text) 8%, var(--dp-surface-2));
  --ck-color-button-default-active-background: color-mix(in srgb, var(--dp-text) 12%, var(--dp-surface-2));
  --ck-color-button-on-background: color-mix(in srgb, var(--dp-accent) 22%, var(--dp-surface-2));
  --ck-color-button-on-hover-background: color-mix(in srgb, var(--dp-accent) 30%, var(--dp-surface-2));
  --ck-color-button-on-active-background: color-mix(in srgb, var(--dp-accent) 35%, var(--dp-surface-2));
  --ck-color-button-on-color: var(--dp-text);
  --ck-color-button-on-disabled-background: var(--dp-surface-2);
  --ck-color-dropdown-panel-background: var(--dp-surface);
  --ck-color-dropdown-panel-border: var(--dp-border);
  --ck-color-input-background: var(--dp-surface-2);
  --ck-color-input-border: var(--dp-border);
  --ck-color-input-text: var(--dp-text);
  --ck-color-input-disabled-background: var(--dp-surface);
  --ck-color-input-disabled-border: var(--dp-border);
  --ck-color-input-disabled-text: var(--dp-text-muted);
  --ck-color-list-background: var(--dp-surface);
  --ck-color-list-button-hover-background: color-mix(in srgb, var(--dp-accent) 10%, var(--dp-surface));
  --ck-color-list-button-on-background: color-mix(in srgb, var(--dp-accent) 20%, var(--dp-surface));
  --ck-color-list-button-on-text: var(--dp-text);
  --ck-color-panel-background: var(--dp-surface);
  --ck-color-panel-border: var(--dp-border);
  --ck-color-toolbar-background: var(--dp-surface-2);
  --ck-color-toolbar-border: var(--dp-border);
  --ck-color-tooltip-background: var(--dp-surface);
  --ck-color-tooltip-text: var(--dp-text);
  --ck-color-engine-placeholder-text: var(--dp-text-muted);
  --ck-color-link-default: var(--dp-info);
  --ck-color-link-selected-background: color-mix(in srgb, var(--dp-info) 22%, transparent);
}

html[data-dp-theme="dark"] .ck.ck-toolbar,
html[data-dp-theme="dark"] .ck-toolbar {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] .ck.ck-content,
html[data-dp-theme="dark"] .ck-content {
  background: var(--dp-surface) !important;
  color: var(--dp-text) !important;
  border-color: var(--dp-border) !important;
}

html[data-dp-theme="dark"] .ck.ck-content.ck-focused,
html[data-dp-theme="dark"] .ck-content.ck-focused {
  border-color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] .ck.ck-button,
html[data-dp-theme="dark"] a.ck.ck-button,
html[data-dp-theme="dark"] .ck.ck-button .ck-button__label,
html[data-dp-theme="dark"] .ck.ck-dropdown__button .ck-button__label {
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] .ck.ck-button:not(.ck-disabled):hover,
html[data-dp-theme="dark"] a.ck.ck-button:not(.ck-disabled):hover {
  background: color-mix(in srgb, var(--dp-text) 8%, var(--dp-surface-2)) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] .ck.ck-button.ck-on:not(.ck-disabled),
html[data-dp-theme="dark"] a.ck.ck-button.ck-on:not(.ck-disabled) {
  background: color-mix(in srgb, var(--dp-accent) 22%, var(--dp-surface-2)) !important;
  border-color: color-mix(in srgb, var(--dp-accent) 35%, var(--dp-border)) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] .ck.ck-button.ck-on:not(.ck-disabled):hover,
html[data-dp-theme="dark"] a.ck.ck-button.ck-on:not(.ck-disabled):hover {
  background: color-mix(in srgb, var(--dp-accent) 30%, var(--dp-surface-2)) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] .ck.ck-icon,
html[data-dp-theme="dark"] .ck.ck-icon * {
  color: var(--dp-text) !important;
  fill: var(--dp-text) !important;
}

html[data-dp-theme="dark"] .ck.ck-list__item .ck-button.ck-on,
html[data-dp-theme="dark"] .ck.ck-list__item .ck-button.ck-on:hover {
  background: var(--dp-accent) !important;
  color: var(--dp-accent-contrast) !important;
}

html[data-dp-theme="dark"] .ck.ck-input {
  background: var(--dp-surface-2) !important;
  border-color: var(--dp-border) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] .ck.ck-input:focus {
  border-color: var(--dp-accent) !important;
}

html[data-dp-theme="dark"] .ck.ck-editor__editable_inline,
html[data-dp-theme="dark"] .ck.ck-editor__editable:not(.ck-editor__nested-editable) {
  background: var(--dp-surface) !important;
  color: var(--dp-text) !important;
}

html[data-dp-theme="dark"] .gw-edit-page .editor-wrapper .ck.ck-editor {
  border-radius: 8px;
  overflow: hidden;
}

