/* ═══════════════════════════════════════════════════════════
   MONCLASS Platform — Custom Theme Overrides
   Professional UI: Roboto Font + Refined Color Palette
   ═══════════════════════════════════════════════════════════ */

/* ── 1. GLOBAL FONT OVERRIDE: Roboto ── */
:root {
  --vz-font-sans-serif: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  --vz-body-font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

*,
body,
html,
h1, h2, h3, h4, h5, h6,
p, span, a, li, td, th, label, input, select, textarea, button,
.nav-link, .dropdown-item, .form-control, .btn,
.card-title, .card-body, .table,
.breadcrumb-item, .page-title-box h4,
.menu-title, .navbar-nav,
.ff-secondary {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.01em;
}

/* ── 2. PROFESSIONAL COLOR PALETTE ── */
:root,
[data-bs-theme="light"] {
  /* Primary: Deep Professional Blue */
  --vz-primary:           #1e40af;
  --vz-primary-rgb:       30, 64, 175;
  --vz-primary-bg-subtle: #eff4ff;
  --vz-primary-text-emphasis: #162e7a;
  --vz-primary-border-subtle: #bfcfff;

  /* Secondary: Balanced Slate */
  --vz-secondary:         #475569;
  --vz-secondary-rgb:     71, 85, 105;
  --vz-secondary-bg-subtle: #f1f5f9;
  --vz-secondary-text-emphasis: #334155;
  --vz-secondary-border-subtle: #cbd5e1;

  /* Success: Mature Teal-Green */
  --vz-success:           #059669;
  --vz-success-rgb:       5, 150, 105;
  --vz-success-bg-subtle: #ecfdf5;
  --vz-success-text-emphasis: #047857;
  --vz-success-border-subtle: #a7f3d0;

  /* Warning: Warm Amber */
  --vz-warning:           #d97706;
  --vz-warning-rgb:       217, 119, 6;
  --vz-warning-bg-subtle: #fffbeb;
  --vz-warning-text-emphasis: #b45309;
  --vz-warning-border-subtle: #fde68a;

  /* Danger: Confident Red */
  --vz-danger:            #dc2626;
  --vz-danger-rgb:        220, 38, 38;
  --vz-danger-bg-subtle:  #fef2f2;
  --vz-danger-text-emphasis: #b91c1c;
  --vz-danger-border-subtle: #fecaca;

  /* Info: Clear Sky Blue */
  --vz-info:              #0284c7;
  --vz-info-rgb:          2, 132, 199;
  --vz-info-bg-subtle:    #f0f9ff;
  --vz-info-text-emphasis:#0369a1;
  --vz-info-border-subtle:#bae6fd;

  /* Body & Surface */
  --vz-body-bg:           #f8fafc;
  --vz-body-bg-rgb:       248, 250, 252;
  --vz-body-color:        #1e293b;
  --vz-body-color-rgb:    30, 41, 59;
  --vz-text-muted:        #94a3b8;
  --vz-border-color:      #e2e8f0;
  --vz-card-bg:           #ffffff;
  --vz-card-border-color: #e2e8f0;
  --vz-light:             #f1f5f9;
  --vz-light-rgb:         241, 245, 249;
  --vz-dark:              #0f172a;
  --vz-dark-rgb:          15, 23, 42;

  /* Emphasis & Headings */
  --vz-emphasis-color:    #0f172a;
  --vz-emphasis-color-rgb:15, 23, 42;
  --vz-heading-color:     #1e293b;
  --vz-secondary-color:   #64748b;
  --vz-secondary-color-rgb:100, 116, 139;

  /* Link */
  --vz-link-color:        #1e40af;
  --vz-link-color-rgb:    30, 64, 175;
  --vz-link-hover-color:  #1e3a8a;
  --vz-link-hover-color-rgb: 30, 58, 138;

  /* Header */
  --vz-header-bg:         #ffffff;
  --vz-header-border:     #e2e8f0;
  --vz-header-item-color: #1e293b;
  --vz-topnav-bg:         #ffffff;
  --vz-topnav-item-color: #475569;
  --vz-topnav-item-color-active: #1e40af;
}

/* ── 3. DARK MODE — Refined overlay (comfortable dark, GitHub Dark inspired) ── */
[data-bs-theme="dark"] {
  /* Surface colors — warm dark with subtle depth */
  --vz-body-bg:           #0d1117;
  --vz-body-bg-rgb:       13, 17, 23;
  --vz-body-color:        #c9d1d9;
  --vz-body-color-rgb:    201, 209, 217;
  --vz-text-muted:        #8b949e;
  --vz-border-color:      #30363d;
  --vz-border-color-translucent: rgba(255,255,255,0.06);
  --vz-card-bg:           #161b22;
  --vz-card-border-color: #30363d;
  --vz-light:             #1c2128;
  --vz-light-rgb:         28, 33, 40;
  --vz-dark:              #c9d1d9;
  --vz-dark-rgb:          201, 209, 217;

  /* Text & emphasis — soft, not blinding */
  --vz-emphasis-color:    #e6edf3;
  --vz-emphasis-color-rgb: 230, 237, 243;
  --vz-heading-color:     #e6edf3;
  --vz-secondary-color:   #8b949e;
  --vz-secondary-color-rgb: 139, 148, 158;
  --vz-tertiary-bg:       #0d1117;

  /* Brand accent colors */
  --vz-primary:           #58a6ff;
  --vz-primary-rgb:       88, 166, 255;
  --vz-primary-bg-subtle: #0d2240;
  --vz-primary-text-emphasis: #79c0ff;
  --vz-primary-border-subtle: #1f3d5c;

  --vz-success:           #3fb950;
  --vz-success-rgb:       63, 185, 80;
  --vz-success-bg-subtle: #0a1f0d;
  --vz-warning:           #d29922;
  --vz-warning-rgb:       210, 153, 34;
  --vz-warning-bg-subtle: #2a1f04;
  --vz-danger:            #f85149;
  --vz-danger-rgb:        248, 81, 73;
  --vz-danger-bg-subtle:  #300a09;
  --vz-info:              #58a6ff;
  --vz-info-rgb:          88, 166, 255;
  --vz-info-bg-subtle:    #0d2240;

  --vz-link-color:        #58a6ff;
  --vz-link-color-rgb:    88, 166, 255;
  --vz-link-hover-color:  #79c0ff;
  --vz-link-hover-color-rgb: 121, 192, 255;

  /* Topnav dark mode */
  --vz-topnav-bg:         #161b22;
  --vz-topnav-item-color: #8b949e;
  --vz-topnav-item-active-color: #e6edf3;

  /* Dropdown */
  --vz-dropdown-bg:       #1c2128;
  --vz-dropdown-link-color: #c9d1d9;
  --vz-dropdown-link-hover-color: #e6edf3;
  --vz-dropdown-link-hover-bg: #30363d;
  --vz-dropdown-link-active-bg: #0d2240;
  --vz-dropdown-border-color: #30363d;

  /* Input */
  --vz-input-bg-custom:   #0d1117;
  --vz-input-border-custom: #30363d;

  /* Footer */
  --vz-footer-bg:         #0d1117;
  --vz-footer-color:      #8b949e;

  /* Page title */
  --vz-page-title-box-shadow: none;
}

/* Dark mode card refinement */
[data-bs-theme="dark"] .card {
  background: var(--vz-card-bg);
  border-color: var(--vz-card-border-color);
}

/* Dark mode + dark topbar */
[data-bs-theme="dark"][data-topbar="dark"] {
  --vz-header-bg:         #161b22 !important;
  --vz-header-border:     #30363d !important;
  --vz-header-item-bg:    #1c2128 !important;
  --vz-topbar-user-bg:    #1c2128 !important;
}

/* ── 4. HEADER / TOPBAR REFINEMENT ── */

/* Override Velzon default [data-topbar=dark] which uses #6691e7 (Velzon blue)
   !important needed because app.min.css has TWO [data-topbar=dark] blocks,
   the second one (inside a @media? later cascade) sets --vz-header-bg:#6691e7 */
html[data-topbar="dark"] {
  --vz-header-bg:           #161b22 !important;
  --vz-header-border:       #30363d !important;
  --vz-header-item-color:   #c9d1d9 !important;
  --vz-header-item-bg:      #1c2128 !important;
  --vz-header-item-sub-color: #8b949e !important;
  --vz-topbar-user-bg:      #1c2128 !important;
  --vz-topbar-search-bg:    #0d1117 !important;
  --vz-topbar-search-color: #c9d1d9 !important;
}

/* Dark-mode + dark topbar combo */
html[data-bs-theme="dark"][data-topbar="dark"] {
  --vz-header-bg:           #0d1117 !important;
  --vz-header-border:       #30363d !important;
  --vz-header-item-color:   #c9d1d9 !important;
  --vz-header-item-bg:      #161b22 !important;
  --vz-header-item-sub-color: #8b949e !important;
  --vz-topbar-user-bg:      #161b22 !important;
}

.navbar-header {
  backdrop-filter: saturate(180%) blur(12px);
}

#page-topbar {
  border-bottom: 1px solid var(--vz-header-border);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* Dark topbar items should be light-colored */
[data-topbar="dark"] .header-item {
  color: rgba(255, 255, 255, 0.85) !important;
}
[data-topbar="dark"] .header-item:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px;
}
[data-topbar="dark"] .topbar-user .user-name-text,
[data-topbar="dark"] .topbar-user .user-name-sub-text {
  color: rgba(255, 255, 255, 0.85) !important;
}
[data-topbar="dark"] .app-search .form-control {
  background: var(--vz-topbar-search-bg) !important;
  color: var(--vz-topbar-search-color) !important;
  border-color: rgba(255,255,255,0.1) !important;
}
[data-topbar="dark"] .app-search .form-control::placeholder {
  color: rgba(255,255,255,0.4);
}
[data-topbar="dark"] .search-widget-icon {
  color: rgba(255,255,255,0.5) !important;
}

.topbar-badge-pulse {
  animation: none;
}

/* ── 4b. HORIZONTAL TOPNAV (below topbar) — Text overflow & dual-lang fix ── */
[data-layout="horizontal"] .navbar-menu .navbar-nav .nav-link {
  padding: 0.5rem 1rem !important;
  font-size: 13px;
  line-height: 1.25;
  white-space: normal !important;
}
[data-layout="horizontal"] .navbar-menu .navbar-nav .nav-link .lang-primary {
  font-size: 13px;
  line-height: 1.2;
}
[data-layout="horizontal"] .navbar-menu .navbar-nav .nav-link .lang-sub {
  font-size: 9.5px;
  line-height: 1;
  margin-top: 1px;
}
[data-layout="horizontal"] .navbar-menu {
  border-bottom: 1px solid var(--vz-border-color);
}
[data-layout="horizontal"] .topnav-hamburger {
  display: none;
}
/* Topnav colors — ensure active items use brand primary not Velzon blue */
[data-layout="horizontal"] .navbar-menu .navbar-nav .nav-link.active,
[data-layout="horizontal"] .navbar-menu .navbar-nav .nav-item:hover > .nav-link {
  color: var(--vz-primary) !important;
}

/* ── 5. SIDEBAR POLISH ── */
.app-menu.navbar-menu {
  border-right: 1px solid var(--vz-border-color);
}

.navbar-nav .nav-link {
  border-radius: 6px;
  margin: 1px 8px;
  padding: 8px 12px !important;
  transition: all .15s ease;
}

.navbar-nav .nav-link:hover {
  background: var(--vz-primary-bg-subtle);
  color: var(--vz-primary) !important;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-sm .nav-link.active {
  color: var(--vz-primary) !important;
  background: var(--vz-primary-bg-subtle);
  font-weight: 500;
}

.menu-title {
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--vz-text-muted) !important;
  padding: 12px 20px 4px !important;
}

/* ── 6. CARD & COMPONENT REFINEMENT ── */
.card {
  border: 1px solid var(--vz-border-color);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .2s, transform .2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--vz-border-color);
  font-weight: 600;
  padding: 14px 16px;
}

.card-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--vz-body-color);
}

/* ── 7. BUTTON REFINEMENT ── */
.btn-primary {
  background-color: var(--vz-primary) !important;
  border-color: var(--vz-primary) !important;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 6px;
  transition: all .15s;
}

.btn-primary:hover {
  background-color: #1e3a8a !important;
  border-color: #1e3a8a !important;
  box-shadow: 0 4px 12px rgba(30, 64, 175, .25);
}

.btn-soft-primary {
  color: var(--vz-primary) !important;
  background: var(--vz-primary-bg-subtle) !important;
  border-color: transparent !important;
}

.btn-soft-primary:hover {
  color: #fff !important;
  background: var(--vz-primary) !important;
}

.btn-success {
  background-color: var(--vz-success) !important;
  border-color: var(--vz-success) !important;
}

.btn-outline-primary {
  color: var(--vz-primary);
  border-color: var(--vz-primary);
}

.btn-outline-primary:hover {
  background: var(--vz-primary);
  color: #fff;
}

/* ── 8. TABLE REFINEMENT ── */
.table > thead {
  background: var(--vz-light);
}

.table > thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--vz-secondary);
  border-bottom: 2px solid var(--vz-border-color);
  padding: 10px 14px;
}

.table > tbody td {
  padding: 12px 14px;
  vertical-align: middle;
  color: var(--vz-body-color);
  border-color: var(--vz-border-color);
}

.table-hover > tbody > tr:hover {
  background-color: var(--vz-primary-bg-subtle);
}

/* ── 9. BADGE REFINEMENT ── */
.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 4px;
  padding: 4px 8px;
}

.badge.bg-primary,
.badge.bg-primary-subtle {
  color: var(--vz-primary);
  background: var(--vz-primary-bg-subtle) !important;
}

.badge.bg-success-subtle {
  color: var(--vz-success);
  background: var(--vz-success-bg-subtle) !important;
}

.badge.bg-warning-subtle {
  color: var(--vz-warning);
  background: var(--vz-warning-bg-subtle) !important;
}

.badge.bg-danger-subtle {
  color: var(--vz-danger);
  background: var(--vz-danger-bg-subtle) !important;
}

.badge.bg-info-subtle {
  color: var(--vz-info);
  background: var(--vz-info-bg-subtle) !important;
}

/* ── 10. FORM INPUTS ── */
.form-control,
.form-select {
  border-radius: 6px;
  border-color: var(--vz-border-color);
  font-size: 14px;
  padding: 8px 12px;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--vz-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, .12);
}

.form-label {
  font-weight: 500;
  font-size: 13px;
  color: var(--vz-secondary);
  margin-bottom: 4px;
}

/* ── 11. BREADCRUMB ── */
.breadcrumb-item + .breadcrumb-item::before {
  color: var(--vz-text-muted);
}

.breadcrumb-item a {
  color: var(--vz-primary);
  font-weight: 500;
}

.breadcrumb-item.active {
  color: var(--vz-body-color);
  font-weight: 500;
}

/* ── 12. MONCLASS LOGO COLOR REFRESH ── */
.mc-logo-icon .mc-bar {
  background: linear-gradient(90deg, #1e40af, #0284c7) !important;
}

.mc-logo-text .mc-mon {
  background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}

.mc-logo-text .mc-cls {
  background: linear-gradient(135deg, #0284c7 0%, #059669 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}

.mc-logo-text .mc-reg {
  -webkit-text-fill-color: #0284c7 !important;
}

.mc-logo-text::after {
  background: linear-gradient(90deg, #1e40af, #0284c7, #059669) !important;
}

.mc-sm {
  background: linear-gradient(135deg, #1e40af 0%, #0284c7 100%) !important;
  box-shadow: 0 2px 8px rgba(30, 64, 175, .3) !important;
}

.mc-sm:hover {
  box-shadow: 0 4px 14px rgba(2, 132, 199, .4) !important;
}

/* Light theme logo */
.logo-light .mc-logo-text .mc-mon {
  background: linear-gradient(135deg, #ffffff 0%, #bfcfff 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}

.logo-light .mc-logo-icon .mc-bar {
  background: linear-gradient(90deg, #93c5fd, #38bdf8) !important;
}

.logo-light .mc-logo-text::after {
  background: linear-gradient(90deg, #93c5fd, #38bdf8, #34d399) !important;
}

/* ── 13. MODULE SWITCHER PILLS ── */
.module-switcher .mod-pill {
  font-weight: 500;
  border-radius: 6px;
  transition: all .15s;
}

.module-switcher .mod-pill:hover {
  background: var(--vz-primary-bg-subtle);
  color: var(--vz-primary);
}

.module-switcher .mod-pill.active {
  background: var(--vz-primary) !important;
  border-color: var(--vz-primary) !important;
  box-shadow: 0 2px 8px rgba(30, 64, 175, .25);
}

/* ── 14. AVATAR & USER ELEMENTS ── */
.avatar-xs, .avatar-sm, .avatar-md {
  border-radius: 8px;
}

.avatar-title {
  background: var(--vz-primary-bg-subtle);
  color: var(--vz-primary);
  font-weight: 600;
}

/* ── 15. DROPDOWN POLISH ── */
.dropdown-menu {
  border: 1px solid var(--vz-border-color);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  border-radius: 8px;
  padding: 6px;
}

.dropdown-item {
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  transition: all .1s;
}

.dropdown-item:hover {
  background: var(--vz-primary-bg-subtle);
  color: var(--vz-primary);
}

.dropdown-item.active,
.dropdown-item:active {
  background-color: var(--vz-primary-bg-subtle) !important;
  color: var(--vz-primary) !important;
}

/* ── 16. PROGRESS BAR ── */
.progress {
  border-radius: 99px;
  height: 6px;
  background: var(--vz-light);
}

.progress-bar {
  border-radius: 99px;
  background: var(--vz-primary);
}

/* ── 17. PAGINATION ── */
.page-link {
  border-radius: 6px !important;
  margin: 0 2px;
  border-color: var(--vz-border-color);
  color: var(--vz-body-color);
  font-weight: 500;
}

.page-item.active .page-link {
  background: var(--vz-primary);
  border-color: var(--vz-primary);
}

/* ── 18. MODAL ── */
.modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.12);
}

.modal-header {
  border-bottom: 1px solid var(--vz-border-color);
  padding: 16px 20px;
}

.modal-title {
  font-weight: 600;
  font-size: 16px;
}

/* ── 19. ALERT ── */
.alert {
  border-radius: 8px;
  font-weight: 500;
  border-width: 1px;
}

/* ── 20. CUSTOM SCROLLBAR ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── 21. EMPTY STATE ── */
.empty-state i {
  color: var(--vz-text-muted);
}

/* ── 22. SMOOTH TRANSITIONS ── */
a, .btn, .nav-link, .card, .dropdown-item, .form-control, .form-select, input, select {
  transition: all .15s ease;
}

/* ── 23. HOME NAV TILES FIX ── */
.home-nav-tile {
  font-weight: 500;
  border-radius: 8px;
  border-color: var(--vz-border-color);
}

.home-nav-tile:hover {
  border-color: var(--vz-primary);
  color: var(--vz-primary);
  background: var(--vz-primary-bg-subtle);
}

.home-nav-tile.active {
  background: var(--vz-primary) !important;
  border-color: var(--vz-primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(30, 64, 175, .2);
}

/* ── 24. HORIZONTAL LAYOUT FIXES ── */
body[data-layout="horizontal"] .navbar-nav .dropdown-menu,
body[data-layout="horizontal"] #navbar-nav .dropdown-menu {
  max-height: 75vh;
  overflow-y: auto;
}

body[data-layout="horizontal"] .navbar-nav .dropdown-menu .dropdown-menu {
  max-height: 60vh;
  overflow-y: auto;
}

/* ── 25. CHART AREA COLORS (for ApexCharts / Chart.js via CSS vars) ── */
:root {
  --chart-primary:   #1e40af;
  --chart-secondary: #475569;
  --chart-success:   #059669;
  --chart-warning:   #d97706;
  --chart-danger:    #dc2626;
  --chart-info:      #0284c7;
}

/* ── 26. HERO BANNER UPGRADE (Project Dashboard) ── */
.project-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #1e40af 100%) !important;
}

/* ── 27. GENERAL TYPOGRAPHY IMPROVEMENTS ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--vz-body-color);
}

p {
  line-height: 1.65;
  color: var(--vz-body-color);
}

small, .text-muted {
  color: var(--vz-text-muted) !important;
}

/* ── 28. TAB REFINEMENT ── */
.nav-tabs .nav-link {
  font-weight: 500;
  color: var(--vz-secondary);
  border-radius: 6px 6px 0 0;
}

.nav-tabs .nav-link.active {
  color: var(--vz-primary);
  font-weight: 600;
  border-bottom-color: var(--vz-primary);
}

.nav-pills .nav-link {
  border-radius: 6px;
  font-weight: 500;
}

.nav-pills .nav-link.active {
  background: var(--vz-primary);
  box-shadow: 0 2px 8px rgba(30, 64, 175, .2);
}

/* ── 29. TOOLTIP / POPOVER ── */
.tooltip-inner {
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
}

/* ── 30. FOOTER ── */
.footer {
  border-top: 1px solid var(--vz-border-color);
  font-size: 13px;
  color: var(--vz-text-muted);
}

/* ═══════════════════════════════════════════════════════════
   31. GLOBAL DARK MODE HARMONY — Seamless component styling
   GitHub Dark inspired: #0d1117 / #161b22 / #1c2128 / #30363d
   Text: #c9d1d9 (body) #8b949e (muted) #e6edf3 (headings only)
   ═══════════════════════════════════════════════════════════ */

/* --- Cards --- */
[data-bs-theme="dark"] .card {
  background: #161b22;
  border-color: #30363d;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
[data-bs-theme="dark"] .card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
[data-bs-theme="dark"] .card-header {
  background: #1c2128;
  border-color: #30363d;
}
[data-bs-theme="dark"] .card-title {
  color: #c9d1d9;
}
[data-bs-theme="dark"] .card-body {
  color: #c9d1d9;
}

/* --- Typography — tone down whites --- */
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 {
  color: #c9d1d9;
}
[data-bs-theme="dark"] p,
[data-bs-theme="dark"] span,
[data-bs-theme="dark"] li,
[data-bs-theme="dark"] td,
[data-bs-theme="dark"] label {
  color: #c9d1d9;
}
[data-bs-theme="dark"] .fw-bold,
[data-bs-theme="dark"] .fw-semibold,
[data-bs-theme="dark"] .fw-medium {
  color: #c9d1d9;
}
[data-bs-theme="dark"] .text-body,
[data-bs-theme="dark"] .text-dark {
  color: #c9d1d9 !important;
}
[data-bs-theme="dark"] small,
[data-bs-theme="dark"] .text-muted {
  color: #8b949e !important;
}
[data-bs-theme="dark"] a:not(.btn):not(.badge):not(.nav-link):not(.home-nav-tile) {
  color: #58a6ff;
}
[data-bs-theme="dark"] a:not(.btn):not(.badge):not(.nav-link):not(.home-nav-tile):hover {
  color: #79c0ff;
}

/* --- Buttons --- */
[data-bs-theme="dark"] .btn-primary {
  background-color: #1f6feb !important;
  border-color: #1f6feb !important;
}
[data-bs-theme="dark"] .btn-primary:hover {
  background-color: #388bfd !important;
  border-color: #388bfd !important;
  box-shadow: 0 4px 12px rgba(31,111,235,.3);
}
[data-bs-theme="dark"] .btn-soft-primary {
  background: rgba(88,166,255,.12) !important;
  color: #58a6ff !important;
  border: none !important;
}
[data-bs-theme="dark"] .btn-soft-primary:hover {
  background: rgba(88,166,255,.22) !important;
  color: #79c0ff !important;
}
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-outline-light {
  background: #1c2128;
  color: #c9d1d9;
  border-color: #30363d;
}
[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark"] .btn-outline-light:hover {
  background: #30363d;
  color: #e6edf3;
  border-color: #484f58;
}
[data-bs-theme="dark"] .btn-success {
  background-color: #238636 !important;
  border-color: #238636 !important;
}
[data-bs-theme="dark"] .btn-danger {
  background-color: #da3633 !important;
  border-color: #da3633 !important;
}

/* --- Badges — muted, no harsh solids --- */
[data-bs-theme="dark"] .badge.bg-danger,
[data-bs-theme="dark"] .badge.bg-danger-subtle {
  background: rgba(248,81,73,.15) !important;
  color: #f85149 !important;
}
[data-bs-theme="dark"] .badge.bg-warning,
[data-bs-theme="dark"] .badge.bg-warning-subtle {
  background: rgba(210,153,34,.15) !important;
  color: #d29922 !important;
}
[data-bs-theme="dark"] .badge.bg-success,
[data-bs-theme="dark"] .badge.bg-success-subtle {
  background: rgba(63,185,80,.15) !important;
  color: #3fb950 !important;
}
[data-bs-theme="dark"] .badge.bg-info,
[data-bs-theme="dark"] .badge.bg-info-subtle {
  background: rgba(88,166,255,.15) !important;
  color: #58a6ff !important;
}
[data-bs-theme="dark"] .badge.bg-primary,
[data-bs-theme="dark"] .badge.bg-primary-subtle {
  background: rgba(88,166,255,.15) !important;
  color: #58a6ff !important;
}
[data-bs-theme="dark"] .badge.bg-secondary,
[data-bs-theme="dark"] .badge.bg-secondary-subtle {
  background: rgba(139,148,158,.15) !important;
  color: #8b949e !important;
}

/* --- Tables --- */
[data-bs-theme="dark"] .table > thead {
  background: #1c2128;
}
[data-bs-theme="dark"] .table > thead th {
  color: #8b949e;
  border-color: #30363d;
}
[data-bs-theme="dark"] .table > tbody td {
  color: #c9d1d9;
  border-color: #21262d;
}
[data-bs-theme="dark"] .table-hover > tbody > tr:hover {
  background-color: rgba(88,166,255,.04);
}

/* --- Form inputs --- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: #0d1117;
  border-color: #30363d;
  color: #c9d1d9;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  border-color: #58a6ff;
  box-shadow: 0 0 0 3px rgba(88,166,255,.15);
  background: #0d1117;
  color: #c9d1d9;
}
[data-bs-theme="dark"] .form-control::placeholder {
  color: #484f58;
}
[data-bs-theme="dark"] .form-label {
  color: #8b949e;
}
[data-bs-theme="dark"] .input-group-text {
  background: #1c2128;
  border-color: #30363d;
  color: #8b949e;
}

/* --- Tabs --- */
[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: #8b949e;
}
[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
  color: #c9d1d9;
  border-color: transparent;
}
[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  color: #58a6ff;
  background: transparent;
  border-color: transparent transparent #58a6ff transparent;
}
[data-bs-theme="dark"] .nav-tabs-custom .nav-link {
  color: #8b949e;
}
[data-bs-theme="dark"] .nav-tabs-custom .nav-link.active {
  color: #58a6ff;
}
[data-bs-theme="dark"] .nav-pills .nav-link {
  color: #8b949e;
}
[data-bs-theme="dark"] .nav-pills .nav-link.active {
  background: #1f6feb;
  color: #fff;
}

/* --- Dropdown --- */
[data-bs-theme="dark"] .dropdown-menu {
  background: #1c2128;
  border-color: #30363d;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
[data-bs-theme="dark"] .dropdown-item {
  color: #c9d1d9;
}
[data-bs-theme="dark"] .dropdown-item:hover {
  background: rgba(88,166,255,.08);
  color: #e6edf3;
}
[data-bs-theme="dark"] .dropdown-item.active,
[data-bs-theme="dark"] .dropdown-item:active {
  background: rgba(88,166,255,.15) !important;
  color: #58a6ff !important;
}
[data-bs-theme="dark"] .dropdown-divider {
  border-color: #30363d;
}

/* --- Avatar/icon containers --- */
[data-bs-theme="dark"] .avatar-title {
  border-color: #30363d;
}
[data-bs-theme="dark"] .avatar-title.bg-danger-subtle { background: rgba(248,81,73,.12) !important; color: #f85149 !important; }
[data-bs-theme="dark"] .avatar-title.bg-warning-subtle { background: rgba(210,153,34,.12) !important; color: #d29922 !important; }
[data-bs-theme="dark"] .avatar-title.bg-success-subtle { background: rgba(63,185,80,.12) !important; color: #3fb950 !important; }
[data-bs-theme="dark"] .avatar-title.bg-info-subtle { background: rgba(88,166,255,.12) !important; color: #58a6ff !important; }
[data-bs-theme="dark"] .avatar-title.bg-primary-subtle { background: rgba(88,166,255,.12) !important; color: #58a6ff !important; }
[data-bs-theme="dark"] .avatar-title.bg-secondary-subtle { background: rgba(139,148,158,.12) !important; color: #8b949e !important; }
/* Soft bg helpers */
[data-bs-theme="dark"] .bg-danger-subtle { background-color: rgba(248,81,73,.1) !important; }
[data-bs-theme="dark"] .bg-warning-subtle { background-color: rgba(210,153,34,.1) !important; }
[data-bs-theme="dark"] .bg-success-subtle { background-color: rgba(63,185,80,.1) !important; }
[data-bs-theme="dark"] .bg-info-subtle { background-color: rgba(88,166,255,.1) !important; }
[data-bs-theme="dark"] .bg-primary-subtle { background-color: rgba(88,166,255,.1) !important; }
[data-bs-theme="dark"] .bg-secondary-subtle { background-color: rgba(139,148,158,.1) !important; }
[data-bs-theme="dark"] .bg-light { background-color: #1c2128 !important; }
[data-bs-theme="dark"] .text-danger { color: #f85149 !important; }
[data-bs-theme="dark"] .text-warning { color: #d29922 !important; }
[data-bs-theme="dark"] .text-success { color: #3fb950 !important; }
[data-bs-theme="dark"] .text-info { color: #58a6ff !important; }
[data-bs-theme="dark"] .text-primary { color: #58a6ff !important; }
[data-bs-theme="dark"] .text-secondary { color: #8b949e !important; }
[data-bs-theme="dark"] .text-white { color: #c9d1d9 !important; }

/* --- Modal --- */
[data-bs-theme="dark"] .modal-content {
  background: #161b22;
  border: 1px solid #30363d;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
}
[data-bs-theme="dark"] .modal-header {
  border-color: #30363d;
}
[data-bs-theme="dark"] .modal-footer {
  border-color: #30363d;
}
[data-bs-theme="dark"] .modal-title {
  color: #c9d1d9;
}

/* --- Alert --- */
[data-bs-theme="dark"] .alert-warning { background: rgba(210,153,34,.1); border-color: #2a1f04; color: #d29922; }
[data-bs-theme="dark"] .alert-danger { background: rgba(248,81,73,.1); border-color: #300a09; color: #f85149; }
[data-bs-theme="dark"] .alert-success { background: rgba(63,185,80,.1); border-color: #0a1f0d; color: #3fb950; }
[data-bs-theme="dark"] .alert-info { background: rgba(88,166,255,.1); border-color: #0d2240; color: #58a6ff; }
[data-bs-theme="dark"] .alert-primary { background: rgba(88,166,255,.1); border-color: #0d2240; color: #58a6ff; }

/* --- Progress bar --- */
[data-bs-theme="dark"] .progress {
  background: #21262d;
}
[data-bs-theme="dark"] .progress-bar {
  background: #1f6feb;
}

/* --- Pagination --- */
[data-bs-theme="dark"] .page-link {
  background: #161b22;
  border-color: #30363d;
  color: #c9d1d9;
}
[data-bs-theme="dark"] .page-link:hover {
  background: #1c2128;
  border-color: #484f58;
  color: #e6edf3;
}
[data-bs-theme="dark"] .page-item.active .page-link {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
}

/* --- Breadcrumb --- */
[data-bs-theme="dark"] .breadcrumb-item a {
  color: #58a6ff;
}
[data-bs-theme="dark"] .breadcrumb-item.active {
  color: #8b949e;
}
[data-bs-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
  color: #484f58;
}

/* --- Sidebar in dark mode --- */
[data-bs-theme="dark"] .app-menu.navbar-menu {
  border-right-color: #30363d;
}
[data-bs-theme="dark"] .navbar-nav .nav-link:hover {
  background: rgba(88,166,255,.08);
}
[data-bs-theme="dark"] .navbar-nav .nav-link.active {
  background: rgba(88,166,255,.12);
  color: #58a6ff !important;
}

/* --- Scrollbar --- */
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #30363d;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-track {
  background: #0d1117;
}

/* --- Footer --- */
[data-bs-theme="dark"] .footer {
  background: #0d1117;
  border-top-color: #30363d;
  color: #8b949e;
}

/* --- Borders & dividers --- */
[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start,
[data-bs-theme="dark"] .border-end {
  border-color: #30363d !important;
}

/* --- Topbar search overlay dark --- */
[data-bs-theme="dark"] .search-overlay {
  background: rgba(0,0,0,.65);
}
[data-bs-theme="dark"] kbd {
  background: #1c2128;
  border: 1px solid #30363d;
  color: #8b949e;
}

/* --- Logo colors in dark --- */
[data-bs-theme="dark"] .mc-logo-text .mc-mon {
  background: linear-gradient(135deg, #c9d1d9 0%, #8b949e 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}
[data-bs-theme="dark"] .mc-logo-text .mc-cls {
  background: linear-gradient(135deg, #58a6ff 0%, #3fb950 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
}
[data-bs-theme="dark"] .mc-logo-text .mc-reg {
  -webkit-text-fill-color: #58a6ff !important;
}
[data-bs-theme="dark"] .mc-logo-icon .mc-bar {
  background: linear-gradient(90deg, #58a6ff, #79c0ff) !important;
}
[data-bs-theme="dark"] .mc-logo-text::after {
  background: linear-gradient(90deg, #58a6ff, #79c0ff, #3fb950) !important;
}