
:root,
[data-bs-theme] {
  --bs-primary: #16a34a;
  --bs-primary-rgb: 22,163,74;
  --bs-success: #16a34a;
  --bs-success-rgb: 22,163,74;
  --bs-info: #0891b2;
  --bs-info-rgb: 8,145,178;
  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245,158,11;
  --bs-danger: #dc2626;
  --bs-danger-rgb: 220,38,38;
  --bs-link-color: #16a34a;
  --bs-link-color-rgb: 22,163,74;
  --bs-link-hover-color: #15803d;
  --bs-link-hover-color-rgb: 21,128,61;
}
.btn-primary {
  --bs-btn-bg: #16a34a; --bs-btn-border-color: #16a34a;
  --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d;
  --bs-btn-active-bg: #166534; --bs-btn-active-border-color: #166534;
  color: #fff;
}
.btn-outline-primary {
  --bs-btn-color: #16a34a; --bs-btn-border-color: #16a34a;
  --bs-btn-hover-bg: #16a34a; --bs-btn-hover-border-color: #16a34a;
  --bs-btn-hover-color: #fff;
}
.btn-success {
  --bs-btn-bg: #16a34a; --bs-btn-border-color: #16a34a;
  --bs-btn-hover-bg: #15803d; --bs-btn-hover-border-color: #15803d;
  color: #fff;
}
.btn-outline-success {
  --bs-btn-color: #16a34a; --bs-btn-border-color: #16a34a;
  --bs-btn-hover-bg: #16a34a; --bs-btn-border-color: #16a34a;
  --bs-btn-hover-color: #fff;
}

/* Keep primary/success text green; restore info/warning/danger to proper colors */
.text-primary   { color: #16a34a !important; }
.text-success   { color: #16a34a !important; }
.text-info      { color: #0891b2 !important; }
.text-warning   { color: #d97706 !important; }
.text-danger    { color: #dc2626 !important; }
.text-muted     { color: #6b7280 !important; }

.bg-primary     { background-color: #16a34a !important; color: #fff !important; }
.bg-success     { background-color: #16a34a !important; color: #fff !important; }
.bg-info        { background-color: #0891b2 !important; color: #fff !important; }
.bg-warning     { background-color: #f59e0b !important; color: #1f2937 !important; }
.bg-danger      { background-color: #dc2626 !important; color: #fff !important; }
.bg-secondary   { background-color: #6b7280 !important; color: #fff !important; }

/* Badges: proper semantic colors */
.badge.bg-info      { background-color: #0891b2 !important; }
.badge.bg-warning   { background-color: #f59e0b !important; color: #1f2937 !important; }
.badge.bg-danger    { background-color: #dc2626 !important; }
.badge.bg-secondary { background-color: #6b7280 !important; }

/* Dark mode adjustments */
[data-theme="dark"] .text-primary  { color: #4ade80 !important; }
[data-theme="dark"] .text-info     { color: #38bdf8 !important; }
[data-theme="dark"] .text-warning  { color: #fbbf24 !important; }
[data-theme="dark"] .text-danger   { color: #f87171 !important; }
[data-theme="dark"] .btn-primary {
  --bs-btn-bg: #22c55e; --bs-btn-border-color: #22c55e;
  --bs-btn-hover-bg: #4ade80; --bs-btn-hover-border-color: #4ade80;
  color: #000;
}
[data-theme="dark"] .bg-primary { background-color: #16a34a !important; }

:root {
  --admin-primary:   #16a34a;
  --admin-primary-dark: #15803d;
  --admin-primary-deep: #166534;
  --admin-accent:    #22c55e;
  --admin-success:   #16a34a;
  --admin-warning:   #f0b429;
  --admin-danger:    #e53e3e;
  --admin-info:      #0ea5e9;
  --admin-surface:   #f0fdf4;
  --admin-border:    #d1fae5;
  --admin-text:      #111827;
  --admin-glow:      rgba(22,163,74,0.12);
  --admin-glow-strong: rgba(22,163,74,0.22);
}

.admin-page { background: var(--admin-surface); min-height: 100vh; }
.admin-main-wrapper { background: var(--admin-surface); }

.admin-sidebar {
  background: linear-gradient(180deg, var(--admin-primary-deep) 0%, var(--admin-primary-dark) 100%);
  min-height: 100vh; width: 260px; position: fixed;
  padding: 1.5rem; overflow-y: auto; z-index: 1040;
  box-shadow: 4px 0 16px rgba(22,163,74,0.12);
}

.admin-sidebar-brand {
  color: #fff; font-weight: 800; font-size: 1.25rem;
  display: block; margin-bottom: 2rem; text-decoration: none;
}
.admin-sidebar-brand span { color: rgba(255,255,255,0.6); font-weight: 400; }
.admin-sidebar-brand i { color: #86efac; }

.admin-sidebar-menu { list-style: none; padding: 0; }
.admin-sidebar-menu li { margin-bottom: 0.2rem; }
.admin-sidebar-menu a {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 1rem;
  border-radius: 8px; color: rgba(209,250,229,0.7); font-weight: 500;
  font-size: 0.9rem; transition: all 0.2s ease; text-decoration: none;
}
.admin-sidebar-menu a:hover,
.admin-sidebar-menu a.active {
  background: rgba(255,255,255,0.12); color: #fff;
}
.admin-sidebar-menu a.active { background: rgba(255,255,255,0.18); font-weight: 600; }
.admin-sidebar-menu i { width: 20px; text-align: center; }
.admin-sidebar-menu .section-label {
  color: rgba(255,255,255,0.4); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 1px; padding: 0.75rem 1rem 0.25rem; font-weight: 700;
}

.admin-main { margin-left: 260px; padding: 1.5rem 2rem; }

.admin-header {
  background: #fff; border-radius: 12px; padding: 1rem 1.5rem; margin-bottom: 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 1px 4px rgba(22,163,74,0.08); border: 1px solid var(--admin-border);
}

.admin-stat-card {
  background: #fff; border-radius: 12px; padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 1px 4px rgba(22,163,74,0.08);
  border: 1px solid var(--admin-border);
  transition: all 0.3s ease;
}
.admin-stat-card:hover { box-shadow: 0 4px 16px var(--admin-glow); border-color: var(--admin-primary); }

.admin-stat-icon {
  width: 52px; height: 52px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1.375rem;
}
.admin-stat-icon.green  { background: var(--admin-glow); color: var(--admin-primary); }
.admin-stat-icon.teal   { background: rgba(20,184,166,0.1); color: #0d9488; }
.admin-stat-icon.blue   { background: rgba(59,130,246,0.1); color: #3b82f6; }
.admin-stat-icon.orange { background: rgba(245,158,11,0.1); color: #d97706; }
.admin-stat-icon.red    { background: rgba(239,68,68,0.1);  color: #dc2626; }

.admin-stat-value { font-size: 1.6rem; font-weight: 800; color: var(--admin-primary-dark); line-height: 1; }
.admin-stat-label { color: #6b7280; font-size: 0.8rem; }

.admin-card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 4px rgba(22,163,74,0.08); overflow: hidden;
  border: 1px solid var(--admin-border);
}
.admin-card-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--admin-border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--admin-surface);
}
.admin-card-title { font-weight: 700; color: var(--admin-primary-dark); margin: 0; font-size: 1rem; }

.admin-table { margin-bottom: 0; }
.admin-table th {
  background: var(--admin-surface); font-weight: 700; color: var(--admin-primary-dark);
  border-bottom: 2px solid var(--admin-glow-strong); padding: 0.875rem 1.25rem;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px;
}
.admin-table td { padding: 1rem 1.25rem; vertical-align: middle; font-size: 0.9rem; color: var(--admin-text); }
.admin-table tr:hover { background: var(--admin-surface); }
.admin-btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: 6px; }

.chart-placeholder {
  background: linear-gradient(135deg, var(--admin-surface), #dcfce7);
  border-radius: 8px; height: 250px; display: flex;
  align-items: center; justify-content: center;
  color: #9ca3af; font-weight: 600; border: 1px solid var(--admin-border);
}

.admin-sidebar .theme-toggle-btn,
.sidebar .theme-toggle-btn {
  background: none; border: 1px solid rgba(255,255,255,0.25); color: rgba(255,255,255,0.7);
  border-radius: 8px; padding: 0.5rem 0.75rem; cursor: pointer;
  font-size: 0.8rem; transition: all 0.2s ease; display: flex; align-items: center; gap: 6px;
}
.admin-sidebar .theme-toggle-btn:hover,
.sidebar .theme-toggle-btn:hover { border-color: #fff; color: #fff; }

@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .admin-sidebar.show { transform: translateX(0); }
  .admin-main { margin-left: 0; padding: 1rem; }
}

[data-theme="dark"] .admin-page,
[data-theme="dark"] .admin-main-wrapper { background: #000000 !important; }
[data-theme="dark"] .admin-main { background: #000000 !important; }

[data-theme="dark"] .admin-sidebar {
  background: linear-gradient(180deg, #000000 0%, #0a1a0a 100%) !important;
  box-shadow: 4px 0 16px rgba(0,0,0,0.5);
}
[data-theme="dark"] .admin-sidebar-menu a { color: rgba(209,250,229,0.55); }
[data-theme="dark"] .admin-sidebar-menu a:hover,
[data-theme="dark"] .admin-sidebar-menu a.active { background: rgba(74,222,128,0.12); color: #4ade80; }
[data-theme="dark"] .admin-sidebar-brand { color: #4ade80; }

[data-theme="dark"] .admin-header {
  background: #0d1a10 !important; border-color: #1a3020 !important; color: #e5e7eb;
}
[data-theme="dark"] .admin-card { background: #0d1a10 !important; border-color: #1a3020 !important; color: #e5e7eb; }
[data-theme="dark"] .admin-card-header { background: #000000 !important; border-color: #1a3020 !important; color: #d1fae5; }
[data-theme="dark"] .admin-card-title { color: #86efac; }

[data-theme="dark"] .admin-stat-card { background: #0d1a10 !important; border-color: #1a3020 !important; }
[data-theme="dark"] .admin-stat-card:hover { border-color: #22c55e !important; }
[data-theme="dark"] .admin-stat-value { color: #4ade80; }
[data-theme="dark"] .admin-stat-label { color: #9ca3af; }
[data-theme="dark"] .admin-stat-icon.green { background: rgba(74,222,128,0.1); color: #4ade80; }

[data-theme="dark"] .admin-table th { background: #000000; color: #d1fae5; border-color: #1a3020; }
[data-theme="dark"] .admin-table td { border-color: #1a3020; color: #d1d5db; }
[data-theme="dark"] .admin-table tr:hover { background: #111f14; }

[data-theme="dark"] .chart-placeholder { background: linear-gradient(135deg, #0d1a10, #000000); color: #4b5563; border-color: #1a3020; }

[data-theme="dark"] .form-control, [data-theme="dark"] .form-select {
  background: #000000; border-color: #1a3020; color: #e5e7eb;
}
[data-theme="dark"] .form-control:focus, [data-theme="dark"] .form-select:focus {
  border-color: #22c55e; box-shadow: 0 0 0 0.2rem rgba(34,197,94,0.2);
}
[data-theme="dark"] .form-label { color: #86efac; }
[data-theme="dark"] .modal-content { background: #0d1a10; border-color: #1a3020; color: #e5e7eb; }
[data-theme="dark"] .modal-header, [data-theme="dark"] .modal-footer { border-color: #1a3020; }

[data-theme="dark"] .table { color: #e5e7eb; }
[data-theme="dark"] .table th { background: #000000; color: #d1fae5; border-color: #1a3020; }
[data-theme="dark"] .table td { border-color: #1a3020; color: #d1d5db; }
[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) { background: #111f14; }

[data-theme="dark"] .list-group-item { background: #0d1a10; border-color: #1a3020; color: #e5e7eb; }
[data-theme="dark"] .badge.bg-light { background: #1a3020 !important; color: #d1fae5; }
[data-theme="dark"] .bg-light { background: #0d1a10 !important; }
[data-theme="dark"] .bg-white { background: #0d1a10 !important; }
[data-theme="dark"] .text-dark { color: #e5e7eb !important; }
[data-theme="dark"] .text-muted { color: #9ca3af !important; }
[data-theme="dark"] .border { border-color: #1a3020 !important; }
[data-theme="dark"] footer, [data-theme="dark"] .footer { background: #000000 !important; }

[data-theme="dark"] .card { background: #0d1a10 !important; border-color: #1a3020 !important; }
[data-theme="dark"] .card-header { background: #000000 !important; border-color: #1a3020 !important; }

/*
   Sidebar aliases — admin-sidebar.php uses
   class="sidebar" (not "admin-sidebar") so
   we alias the admin-sidebar rules here.
 */
.sidebar {
  background: linear-gradient(180deg, #166534 0%, #15803d 100%);
  min-height: 100vh;
  width: 260px;
  position: fixed;
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 1040;
  box-shadow: 4px 0 16px rgba(22,163,74,0.12);
}

/* Nav links inside admin sidebar */
.sidebar .nav-link {
  color: rgba(209,250,229,0.75);
  border-radius: 8px;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  transition: all 0.2s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: rgba(255,255,255,0.18) !important;
  color: #fff !important;
  font-weight: 600;
}

/* Dark mode aliases */
[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #000000 0%, #0a1a0a 100%) !important;
  box-shadow: 4px 0 16px rgba(0,0,0,0.5);
}
[data-theme="dark"] .sidebar .nav-link { color: rgba(209,250,229,0.55); }
[data-theme="dark"] .sidebar .nav-link:hover,
[data-theme="dark"] .sidebar .nav-link.active {
  background: rgba(74,222,128,0.12) !important;
  color: #4ade80 !important;
}

.pds-sidebar-icon {
    border-radius: 8px;
    object-fit: contain;
    transition: filter 0.2s ease;
}

[data-theme="dark"] .pds-sidebar-icon {
    filter: brightness(1.2) drop-shadow(0 0 4px rgba(74,222,128,0.25));
}

.admin-sidebar-panel {
  width: 260px;
  /* height set by JS to window.innerHeight — handles iOS Safari chrome correctly */
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1050;
  background: linear-gradient(180deg, #166534 0%, #15803d 100%);
  box-shadow: 4px 0 16px rgba(22,163,74,0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* panel clips; .admin-sidebar-body scrolls internally */
  transform: translateX(0);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}

.admin-sidebar-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.admin-sidebar-body {
  flex: 1 1 0;            /* 0 base so it only takes remaining space */
  min-height: 0;          /* critical: allows flex child to shrink & scroll */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0.5rem;
  /* Custom thin scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.admin-sidebar-body::-webkit-scrollbar { width: 4px; }
.admin-sidebar-body::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.admin-sidebar-foot {
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.admin-nav-section-label {
  display: block;
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .5rem 1rem;
  font-weight: 700;
}

.admin-sidebar-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.2s;
}
.admin-sidebar-close:hover { color: #fff; }

.admin-mobile-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 1040;
  background: linear-gradient(90deg, #166534 0%, #15803d 100%);
  box-shadow: 0 2px 8px rgba(22,163,74,0.2);
}

.admin-sidebar-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.2s;
}
.admin-sidebar-toggle:hover { background: rgba(255,255,255,0.1); }

.admin-mobile-theme-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
}

.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1045;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.admin-sidebar-backdrop.is-visible {
  display: block;
  opacity: 1;
}

@media (min-width: 992px) {
  .admin-mobile-topbar { display: none !important; }
  .admin-sidebar-close  { display: none !important; }
  .admin-sidebar-panel  {
    transform: translateX(0) !important;
    top: 0 !important;
    /* height overridden by JS inline style for accurate viewport measurement */
  }
  .admin-main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
  }
}

/*
   MOBILE (<992px): sidebar hidden by default,
   slides in as a drawer OVER content.
   Main content fills full width.
 */
@media (max-width: 991.98px) {
  .admin-sidebar-panel {
    transform: translateX(-100%);
    top: 0;
    /* height set by JS inline style — avoids iOS Safari 100vh bug */
  }
  .admin-sidebar-panel.is-open {
    transform: translateX(0);
  }
  .admin-main-wrapper {
    margin-left: 0 !important;
    padding-top: 52px; /* offset for fixed top navbar */
    min-height: 100vh;
  }
  .admin-main {
    margin-left: 0 !important;
  }
}

[data-theme="dark"] .admin-sidebar-panel {
  background: linear-gradient(180deg, #000000 0%, #0a1a0a 100%) !important;
  box-shadow: 4px 0 16px rgba(0,0,0,0.5);
}
[data-theme="dark"] .admin-mobile-topbar {
  background: linear-gradient(90deg, #000000 0%, #0a1a0a 100%) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
[data-theme="dark"] .admin-sidebar-panel .nav-link { color: rgba(209,250,229,0.55); }
[data-theme="dark"] .admin-sidebar-panel .nav-link:hover,
[data-theme="dark"] .admin-sidebar-panel .nav-link.active {
  background: rgba(74,222,128,0.12) !important;
  color: #4ade80 !important;
}
[data-theme="dark"] .admin-sidebar-toggle,
[data-theme="dark"] .admin-sidebar-close { color: #86efac; }

/*
   DARK MODE — COMPREHENSIVE FRAME FIX
   Covers all Bootstrap utility classes,
   inline-style backgrounds, and component
   patterns used across admin pages.
 */

[data-theme="dark"] body,
[data-theme="dark"] .admin-page,
[data-theme="dark"] .admin-main-wrapper,
[data-theme="dark"] .admin-main { background: #000 !important; color: #e5e7eb !important; }

[data-theme="dark"] .card,
[data-theme="dark"] .card-body { background: #0d1a10 !important; border-color: #1a3020 !important; color: #e5e7eb !important; }

[data-theme="dark"] .card-header,
[data-theme="dark"] .card-header.bg-white,
[data-theme="dark"] .card-footer { background: #091408 !important; border-color: #1a3020 !important; color: #d1fae5 !important; }

[data-theme="dark"] .bg-white  { background: #0d1a10 !important; color: #e5e7eb !important; }
[data-theme="dark"] .bg-light  { background: #091408 !important; color: #d1fae5 !important; }
[data-theme="dark"] .bg-body   { background: #000 !important; }

[data-theme="dark"] .table,
[data-theme="dark"] .table > :not(caption) > * > * { background: transparent !important; color: #d1d5db !important; border-color: #1a3020 !important; }

[data-theme="dark"] .table-light,
[data-theme="dark"] thead.table-light,
[data-theme="dark"] .table-light > * { background: #091408 !important; color: #d1fae5 !important; border-color: #1a3020 !important; }

[data-theme="dark"] .table thead th,
[data-theme="dark"] .table th { background: #091408 !important; color: #d1fae5 !important; border-color: #1a3020 !important; }

[data-theme="dark"] .table-hover > tbody > tr:hover > * { background: #111f14 !important; color: #e5e7eb !important; }

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { background: #0d1a10 !important; }

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-check-input,
[data-theme="dark"] .input-group-text { background: #091408 !important; border-color: #1a3020 !important; color: #e5e7eb !important; }

[data-theme="dark"] .form-control::placeholder { color: #6b7280 !important; }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus { border-color: #22c55e !important; box-shadow: 0 0 0 .2rem rgba(34,197,94,.18) !important; background: #0d1a10 !important; }
[data-theme="dark"] .form-label { color: #86efac !important; }
[data-theme="dark"] .form-text  { color: #9ca3af !important; }

[data-theme="dark"] .modal-content  { background: #0d1a10 !important; border-color: #1a3020 !important; color: #e5e7eb !important; }
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer   { background: #091408 !important; border-color: #1a3020 !important; }
[data-theme="dark"] .modal-title    { color: #d1fae5 !important; }
[data-theme="dark"] .btn-close      { filter: invert(1) grayscale(100%) brightness(200%); }

[data-theme="dark"] .dropdown-menu  { background: #0d1a10 !important; border-color: #1a3020 !important; }
[data-theme="dark"] .dropdown-item  { color: #d1fae5 !important; }
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus { background: #1a3020 !important; color: #fff !important; }
[data-theme="dark"] .dropdown-divider { border-color: #1a3020 !important; }

[data-theme="dark"] .list-group-item { background: #0d1a10 !important; border-color: #1a3020 !important; color: #e5e7eb !important; }
[data-theme="dark"] .list-group-item:hover { background: #111f14 !important; }
[data-theme="dark"] .list-group-item.active { background: #16a34a !important; border-color: #16a34a !important; }

[data-theme="dark"] .nav-tabs  { border-color: #1a3020 !important; }
[data-theme="dark"] .nav-tabs .nav-link { color: #86efac !important; }
[data-theme="dark"] .nav-tabs .nav-link.active,
[data-theme="dark"] .nav-tabs .nav-item.show .nav-link {
  background: #0d1a10 !important; border-color: #1a3020 #1a3020 #0d1a10 !important; color: #4ade80 !important;
}
[data-theme="dark"] .nav-pills .nav-link { color: #86efac !important; }
[data-theme="dark"] .nav-pills .nav-link.active { background: #16a34a !important; color: #fff !important; }

[data-theme="dark"] .alert-light   { background: #0d1a10 !important; border-color: #1a3020 !important; color: #d1fae5 !important; }
[data-theme="dark"] .alert-success { background: rgba(22,163,74,.15) !important; border-color: #16a34a !important; color: #86efac !important; }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.12) !important; border-color: #f59e0b !important; color: #fcd34d !important; }
[data-theme="dark"] .alert-danger  { background: rgba(220,38,38,.12) !important; border-color: #dc2626 !important; color: #fca5a5 !important; }
[data-theme="dark"] .alert-info    { background: rgba(8,145,178,.12) !important; border-color: #0891b2 !important; color: #7dd3fc !important; }

[data-theme="dark"] .badge.bg-light,
[data-theme="dark"] .badge.text-bg-light { background: #1a3020 !important; color: #d1fae5 !important; }

[data-theme="dark"] .page-link { background: #0d1a10 !important; border-color: #1a3020 !important; color: #86efac !important; }
[data-theme="dark"] .page-link:hover { background: #1a3020 !important; color: #4ade80 !important; }
[data-theme="dark"] .page-item.active .page-link { background: #16a34a !important; border-color: #16a34a !important; color: #fff !important; }
[data-theme="dark"] .page-item.disabled .page-link { background: #091408 !important; color: #4b5563 !important; }

[data-theme="dark"] .breadcrumb { background: transparent !important; }
[data-theme="dark"] .breadcrumb-item,
[data-theme="dark"] .breadcrumb-item a { color: #86efac !important; }
[data-theme="dark"] .breadcrumb-item.active { color: #9ca3af !important; }
[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: #4b5563 !important; }

/* Green-tinted light panels */
[data-theme="dark"] [style*="background:#f0fdf4"],
[data-theme="dark"] [style*="background: #f0fdf4"] { background: #091408 !important; border-color: #1a3020 !important; }

/* Blue-tinted light panels (alice.php chat bubbles) */
[data-theme="dark"] [style*="background:#f0f9ff"],
[data-theme="dark"] [style*="background: #f0f9ff"] { background: #050d1a !important; }

/* Generic light grey panels */
[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background: #f9fafb"] { background: #0d1a10 !important; color: #e5e7eb !important; }

/* Smart frame cards (ad-slots inline style) */
[data-theme="dark"] .smart-frame-card { background: #0d1a10 !important; border-color: #1a3020 !important; color: #e5e7eb !important; }

[data-theme="dark"] .text-dark    { color: #e5e7eb !important; }
[data-theme="dark"] .text-body    { color: #e5e7eb !important; }
[data-theme="dark"] .text-muted   { color: #9ca3af !important; }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3,
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 { color: #d1fae5 !important; }
[data-theme="dark"] p, [data-theme="dark"] span, [data-theme="dark"] label,
[data-theme="dark"] td, [data-theme="dark"] li { color: #d1d5db; }

[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end { border-color: #1a3020 !important; }

[data-theme="dark"] ::-webkit-scrollbar { width: 6px; height: 6px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #000; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #1a3020; border-radius: 4px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #22c55e; }

[data-theme="dark"] pre,
[data-theme="dark"] code { background: #091408 !important; color: #86efac !important; border-color: #1a3020 !important; }
