:root {
  --gradient: linear-gradient(90deg,#6366f1,#8b5cf6,#ec4899);
  --radius: 0.75rem;
  --glass-bg: rgba(255,255,255,0.55);
  --glass-border: rgba(255,255,255,0.3);
  --transition-fast: .15s ease;
  --color-bg-dark: #121417;
  --color-surface-dark: #1d2126;
  --color-border-dark: #2c333b;
  --color-text-muted-dark: #94a3b8;
}
html[data-theme='dark'] {
  color-scheme: dark;
  --bs-body-bg: var(--color-bg-dark);
  --bs-body-color: #e2e8f0;
  --bs-border-color: var(--color-border-dark);
  --glass-bg: rgba(30,34,39,0.55);
  --glass-border: rgba(255,255,255,0.08);
}
body {
  min-height:100vh;
  display:flex;
  flex-direction:column;
  background:radial-gradient(circle at 25% 15%,rgba(99,102,241,0.12),transparent),linear-gradient(180deg,rgba(99,102,241,0.05),transparent 40%);
  backdrop-filter: blur(0px);
  animation: fadeIn .4s;
}
@keyframes fadeIn {from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.gradient-text {background:var(--gradient);-background-clip:text;color:transparent}
.card-hover {transition: transform .3s, box-shadow .3s}
.card-hover:hover {transform:translateY(-4px);box-shadow:0 1rem 2rem -0.5rem rgba(0,0,0,.15)}
.icon-circle {width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center}
.blur-nav {backdrop-filter: blur(6px); background: var(--glass-bg); border-bottom:1px solid var(--glass-border)}
.footer-glass {backdrop-filter: blur(6px)}
.glass {background:var(--glass-bg)!important;border:1px solid var(--glass-border)!important}
.table thead th {white-space:nowrap}
.badge-soft {background:rgba(99,102,241,.15);color:#6366f1}
.badge-soft-success {background:rgba(16,185,129,.15);color:#10b981}
.badge-soft-danger {background:rgba(239,68,68,.2);color:#ef4444}
.badge-soft-warning {background:rgba(234,179,8,.2);color:#eab308}
.nav-link.active {font-weight:600; position:relative}
.nav-link.active::after {content:"";position:absolute;left:0;bottom:0;height:2px;width:100%;background:var(--gradient);border-radius:2px}
.landing-bg {background:linear-gradient(145deg,#f8fafc,#eef2ff)}
html[data-theme='dark'] .landing-bg {background:linear-gradient(145deg,#121417,#1d2126)}
.shadow-soft {box-shadow:0 8px 20px -6px rgba(0,0,0,.12)}
#content-wrapper {padding-top:4.75rem;padding-bottom:2rem;flex:1 0 auto}
.chart-card {position:relative;min-height:340px}
.stat-tile {position:relative;overflow:hidden}
.stat-tile::after {content:"";position:absolute;inset:0;opacity:.08;background:radial-gradient(circle at 70% 30%,#6366f1,transparent 70%);pointer-events:none}
.progress-xs {height:6px}
.animate-pulse {animation:pulse 1.5s infinite}
@keyframes pulse {0%,100%{opacity:1}50%{opacity:.4}}
.table-hover tbody tr {transition: background-color .12s}
.notif-menu {min-width:300px;max-height:360px}
html[data-theme='dark'] .card, html[data-theme='dark'] .modal-content {background:var(--color-surface-dark);border-color:var(--color-border-dark)}
html[data-theme='dark'] .text-muted {color:var(--color-text-muted-dark)!important}
.tag {display:inline-block;padding:.25rem .5rem;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.5px;border-radius:50rem;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.15)}
[data-table-density='compact'] table tbody tr td {padding:.35rem .5rem;font-size:.75rem}
.sidebar-mini {width:240px}
.rounded-xl {border-radius:1rem}
.filter-chip {cursor:pointer;transition:background .2s}
.filter-chip.active {background:var(--gradient);color:#fff}
.btn-gradient {background:var(--gradient);color:#fff;border:0}
.btn-gradient:hover {opacity:.9;color:#fff}
.table-ranking tbody tr:first-child {background:linear-gradient(90deg,rgba(234,179,8,.08),transparent)}
.badge-rank {font-size:.65rem}
html[data-theme='dark'] .blur-nav {background:rgba(20,23,27,0.75)}

/* ========================================
   Dark Mode - Additional Contrast Fixes
   ======================================== */

/* 1. Dropdown Menu */
html[data-theme='dark'] .dropdown-menu {
  background-color: var(--color-surface-dark);
  border-color: var(--color-border-dark);
}

html[data-theme='dark'] .dropdown-item {
  color: #e2e8f0;
}

html[data-theme='dark'] .dropdown-item:hover,
html[data-theme='dark'] .dropdown-item:focus {
  background-color: rgba(99, 102, 241, 0.15);
  color: #fff;
}

html[data-theme='dark'] .dropdown-divider {
  border-color: var(--color-border-dark);
}

/* 2. List Group (used in notifications) */
html[data-theme='dark'] .list-group-item {
  background-color: var(--color-surface-dark);
  border-color: var(--color-border-dark);
  color: #e2e8f0;
}

html[data-theme='dark'] .list-group-item:hover {
  background-color: rgba(99, 102, 241, 0.1);
}

/* 3. Form Controls (inputs, selects, textareas) */
html[data-theme='dark'] .form-control,
html[data-theme='dark'] .form-select {
  background-color: var(--color-surface-dark);
  border-color: var(--color-border-dark);
  color: #e2e8f0;
}

html[data-theme='dark'] .form-control:focus,
html[data-theme='dark'] .form-select:focus {
  background-color: var(--color-surface-dark);
  border-color: #6366f1;
  color: #e2e8f0;
  box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

html[data-theme='dark'] .form-control::placeholder {
  color: var(--color-text-muted-dark);
}

html[data-theme='dark'] .form-label {
  color: #e2e8f0;
}

html[data-theme='dark'] .form-check-label {
  color: #e2e8f0;
}

/* 4. Tables */
html[data-theme='dark'] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-border-color: var(--color-border-dark);
}

html[data-theme='dark'] .table-light {
  --bs-table-bg: var(--color-surface-dark);
  --bs-table-color: #e2e8f0;
}

html[data-theme='dark'] .table-striped > tbody > tr:nth-of-type(odd) {
  --bs-table-bg-type: rgba(255, 255, 255, 0.03);
}

html[data-theme='dark'] .table-hover > tbody > tr:hover {
  --bs-table-bg-state: rgba(99, 102, 241, 0.08);
}

html[data-theme='dark'] .table-bordered {
  border-color: var(--color-border-dark);
}

html[data-theme='dark'] thead {
  background-color: var(--color-surface-dark);
}

html[data-theme='dark'] .table thead th {
  background-color: var(--color-surface-dark);
  border-color: var(--color-border-dark);
  color: #e2e8f0;
}

/* 5. Card Header and Footer */
html[data-theme='dark'] .card-header {
  background-color: transparent;
  border-color: var(--color-border-dark);
  color: #e2e8f0;
}

html[data-theme='dark'] .card-footer {
  background-color: transparent;
  border-color: var(--color-border-dark);
}

html[data-theme='dark'] .bg-body-tertiary {
  background-color: var(--color-surface-dark) !important;
}

/* 6. Pagination */
html[data-theme='dark'] .page-link {
  background-color: var(--color-surface-dark);
  border-color: var(--color-border-dark);
  color: #e2e8f0;
}

html[data-theme='dark'] .page-link:hover {
  background-color: rgba(99, 102, 241, 0.15);
  border-color: var(--color-border-dark);
  color: #fff;
}

html[data-theme='dark'] .page-item.disabled .page-link {
  background-color: var(--color-bg-dark);
  border-color: var(--color-border-dark);
  color: var(--color-text-muted-dark);
}

html[data-theme='dark'] .page-item.active .page-link {
  background-color: #6366f1;
  border-color: #6366f1;
}

/* 7. Navigation Links */
html[data-theme='dark'] .nav-link {
  color: #cbd5e1;
}

html[data-theme='dark'] .nav-link:hover {
  color: #fff;
}

html[data-theme='dark'] .nav-link.active {
  color: #fff;
}

html[data-theme='dark'] .navbar-nav .nav-link {
  color: #cbd5e1;
}

html[data-theme='dark'] .navbar-nav .nav-link:hover,
html[data-theme='dark'] .navbar-nav .nav-link:focus {
  color: #fff;
}

/* 8. Buttons Outline */
html[data-theme='dark'] .btn-outline-secondary {
  color: #cbd5e1;
  border-color: var(--color-border-dark);
}

html[data-theme='dark'] .btn-outline-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #cbd5e1;
  color: #fff;
}

html[data-theme='dark'] .btn-outline-primary {
  color: #818cf8;
  border-color: #818cf8;
}

html[data-theme='dark'] .btn-outline-primary:hover {
  background-color: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

/* 9. Filter Chips (badges) */
html[data-theme='dark'] .filter-chip {
  background-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid var(--color-border-dark);
}

html[data-theme='dark'] .filter-chip:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

html[data-theme='dark'] .filter-chip.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

/* 10. Navbar Toggler (mobile) */
html[data-theme='dark'] .navbar-toggler {
  border-color: var(--color-border-dark);
}

html[data-theme='dark'] .navbar-toggler-icon {
  filter: invert(1);
}

/* 11. Badges and Alerts */
html[data-theme='dark'] .badge.bg-primary-subtle {
  background-color: rgba(99, 102, 241, 0.2) !important;
  color: #a5b4fc !important;
}

html[data-theme='dark'] .text-primary {
  color: #818cf8 !important;
}

/* 12. Progress bars */
html[data-theme='dark'] .progress {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 13. Borders general */
html[data-theme='dark'] .border-top,
html[data-theme='dark'] .border-bottom,
html[data-theme='dark'] .border {
  border-color: var(--color-border-dark) !important;
}

/* 14. DataTables (external library) */
html[data-theme='dark'] .dataTables_wrapper .dataTables_length,
html[data-theme='dark'] .dataTables_wrapper .dataTables_filter,
html[data-theme='dark'] .dataTables_wrapper .dataTables_info,
html[data-theme='dark'] .dataTables_wrapper .dataTables_paginate {
  color: #e2e8f0;
}

html[data-theme='dark'] .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #e2e8f0 !important;
}

html[data-theme='dark'] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: var(--color-border-dark) !important;
  color: #fff !important;
}

html[data-theme='dark'] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #6366f1 !important;
  border-color: #6366f1 !important;
  color: #fff !important;
}

html[data-theme='dark'] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  color: var(--color-text-muted-dark) !important;
}

/* 15. Button Group */
html[data-theme='dark'] .btn-group .btn-outline-secondary {
  border-color: var(--color-border-dark);
}

html[data-theme='dark'] .btn-group .btn-outline-secondary.active {
  background-color: rgba(99, 102, 241, 0.2);
  color: #fff;
}

/* Scrollbar custom */
::-webkit-scrollbar {width:10px}
::-webkit-scrollbar-track {background:transparent}
::-webkit-scrollbar-thumb {background:rgba(100,116,139,.35);border-radius:30px}
::-webkit-scrollbar-thumb:hover {background:rgba(100,116,139,.55)}

.alert-top {margin-top: 4.5rem !important; }
.fullheight {max-height: 100%!important}
.grecaptcha-badge {opacity:.3!important}
.notdisplay {display:none}
.copyable {cursor: pointer}
i.fas,span.borded{margin:5px!important}