/* ===================================================================
   CUDWEARS refinements (loads after styles.css + midnight.css; the original
   template, layout and light theme are untouched).
   A. Sidebar: grouped, labelled, icon-led navigation
   B. Dark theme: "Purple & Cobalt" (replaces the old dark theme)
   =================================================================== */

/* ---------- A. SIDEBAR ---------- */
.sidebar-left .sidebar-header { font-size: .8rem; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: clip; padding-left: 4px; padding-right: 4px; text-align: center; }
.sidebar-tab-filter input#sidebarTabSearch { padding: .4rem .5rem; }

.sidebar-tabs { padding: 4px 0 calc(66px + env(safe-area-inset-bottom, 0px) + 20px); }
.nav-group { margin: 0 4px; border-top: 1px solid var(--g-border); }
.nav-group:first-child { border-top: 0; }
.nav-group[hidden] { display: none; }

.nav-group-head {
  width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: .4rem .2rem; margin: 0; background: transparent; border: 0; border-radius: 10px; cursor: pointer;
  color: var(--g-text-2); text-align: center; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.nav-group-head .ng-label { display: block; max-width: 100%; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.15; overflow-wrap: normal; word-break: normal; }
.nav-group-head .ng-chev { flex: 0 0 auto; font-size: 9px; line-height: 1; transition: transform .2s ease; }
.nav-group-head:hover { color: var(--g-heading); }
.nav-group-head:focus-visible { outline: 2px solid var(--g-accent); outline-offset: -2px; }
.nav-group.is-open > .nav-group-head { color: var(--g-heading); }
.nav-group.is-open > .nav-group-head .ng-chev { transform: rotate(180deg); }

.nav-group-body { display: none; gap: 4px; padding: 0 0 8px; }
.nav-group.is-open > .nav-group-body { display: grid; animation: ngIn .18s ease-out; }
@keyframes ngIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .nav-group.is-open > .nav-group-body { animation: none; } .nav-group-head .ng-chev { transition: none; } }

/* each page link: icon on top, label under it, 44px+ tap target */
.sidebar-tabs .nav-group-body .tab-button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; margin: 0; min-height: 56px; padding: .5rem .1rem; border-radius: 14px; border-width: 1px;
  font-size: 10px; line-height: 1.15; font-weight: 600; text-align: center;
}
.sidebar-tabs .nav-group-body .tab-button .bi { font-size: 18px; line-height: 1; color: var(--g-accent-2); }
.sidebar-tabs .nav-group-body .tab-button .tb-label { display: block; max-width: 100%; overflow-wrap: break-word; hyphens: none; }
.sidebar-tabs .nav-group-body .tab-button.active { border-top-width: 1px; border-bottom-width: 1px; font-weight: 700; }
.sidebar-tabs .nav-group-body .tab-button.active .bi { color: inherit; }
.sidebar-tabs .nav-group-body .tab-button .tab-badge { position: absolute; top: 3px; right: 4px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; font-size: 10px; line-height: 1; }
.sidebar-tabs .nav-group-body .tab-button:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 1px; }

@media (min-width: 768px) {
  .sidebar-tabs { padding-bottom: 24px; }
  .sidebar-tabs .nav-group-body .tab-button { flex-direction: row; justify-content: flex-start; gap: 8px; text-align: left; font-size: 12px; padding: .55rem .6rem; min-height: 44px; }
  .nav-group-head { flex-direction: row; justify-content: space-between; min-height: 40px; padding: .45rem .5rem; text-align: left; }
  .nav-group-head .ng-label { font-size: 10.5px; }
}
html[data-theme="dark"] {
  /* ── LUNA Core Variables ── */
  --luna-ice:      #f4f0e8;   /* lightest — text, highlights  */
  --luna-sky:      #ffdd00;   /* mid — borders, accents, progress */
  --luna-ocean:    #1c4571;   /* buttons, interactive, hover  */
  --luna-deep:     #330b2e;   /* cards, surfaces, sidebar     */
  --luna-midnight: #0c1d2f;   /* deepest — base backgrounds   */

  /* ── DM System Vars mapped to LUNA ── */
  --dm-bg:               #0c1d2f;
  --dm-surface:          #330b2e;
  --dm-sidebar-bg:       #330b2e;
  --dm-header-bg:        linear-gradient(135deg, #0c1d2f 0%, #330b2e 55%, #1c4571 100%);
  --dm-text:             #f4f0e8;
  --dm-border:           rgba(28,69,113, 0.55);
  --dm-card-bg:          #330b2e;
  --dm-input-bg:         rgba(51,11,46, 0.8);
  --dm-tab-btn-bg:       #330b2e;
  --dm-tab-btn-color:    #f4f0e8;
  --dm-sidebar-tabs-bg:  #0c1d2f;
  --dm-footer-nav-bg:    #330b2e;
  --dm-progress-color:   linear-gradient(90deg, #ffdd00, #f4f0e8);
  --dm-toast-bg:         #1c4571;
  --dm-toast-color:      #f4f0e8;
  --dm-breadcrumb-color: rgba(244,240,232, 0.75);

  /* ── Semantic overrides ── */
  --background-main:     #0c1d2f;
  --background-content:  #330b2e;
  --background-sidebar:  #330b2e;
  --text-color:          #f4f0e8;
  --border-color:        rgba(28,69,113, 0.55);
  --bg-surface:          #330b2e;
  --bg-surface-new:      #330b2e;
  --text-primary:        #f4f0e8;
  --text-primary-new:    #f4f0e8;
  --text-secondary:      #ffdd00;
  --text-secondary-new:  #ffdd00;
  --bg-hover:            rgba(28,69,113, 0.45);
  --bg-hover-new:        rgba(28,69,113, 0.45);
  --border-color-new:    rgba(28,69,113, 0.55);
  --color-white:         #330b2e;
  --color-grey-light-1:  #330b2e;
  --color-grey-light-2:  #0c1d2f;
  --color-grey-dark-1:   #f4f0e8;
  --color-grey-dark-2:   #ffdd00;
  --color-grey-mid-2:    #ffdd00;
  --highlight-strong:    rgba(28,69,113, 0.35);

  /* ── Interactive / accent overrides ── */
  --color-blue-primary:      #ffdd00;
  --color-blue-dark-1:       #f4f0e8;
  --color-teal-primary:      #ffdd00;
  --color-teal-light-1:      rgba(28,69,113, 0.2);
  --color-teal-dark-1:       #f4f0e8;
  --primary-color:            #1c4571;
  --primary-color-dark:       #330b2e;
  --active-border:            #ffdd00;
  --color-primary-new:        #1c4571;
  --color-primary-dark-new:   #330b2e;

  /* ── Shadows tuned for deep-ocean depth ── */
  --shadow-sm: 0 4px 6px -1px rgba(12,29,47, 0.5), 0 2px 4px -2px rgba(12,29,47, 0.4);
  --shadow-md: 0 10px 20px -3px rgba(12,29,47, 0.6), 0 4px 8px -4px rgba(12,29,47, 0.5);
}
html[data-theme="dark"] body {
  background-color: var(--dm-bg);
  background-image: radial-gradient(ellipse at 20% 10%, rgba(28,69,113, 0.18) 0%, transparent 55%),
                    radial-gradient(ellipse at 80% 90%, rgba(51,11,46, 0.25) 0%, transparent 55%);
  color: var(--dm-text);
}
html[data-theme="dark"] .sidebar-left {
  background: linear-gradient(180deg, #330b2e 0%, #0c1d2f 100%);
  border-right: 1px solid rgba(28,69,113, 0.4);
  box-shadow: 2px 0 16px rgba(12,29,47, 0.5);
}
html[data-theme="dark"] .sidebar-tabs {
  background: linear-gradient(180deg, #0c1d2f 0%, #081523 100%);
}
html[data-theme="dark"] .tab-button {
  background: rgba(51,11,46, 0.6);
  color: #f4f0e8;
  border-bottom: 1px solid rgba(28,69,113, 0.3);
  transition: all 0.25s ease;
}
html[data-theme="dark"] .tab-button:hover {
  background: linear-gradient(90deg, rgba(28,69,113, 0.55) 0%, rgba(28,69,113, 0.25) 100%);
  color: #f4f0e8;
  border-left: 3px solid #ffdd00;
}
html[data-theme="dark"] .content-header {
  background: linear-gradient(135deg, #0c1d2f 0%, #330b2e 55%, #1c4571 100%) !important;
  background-color: transparent !important;
  border-bottom: 1px solid rgba(255,221,0, 0.35);
  box-shadow: 0 2px 16px rgba(12,29,47, 0.6), 0 1px 0 rgba(255,221,0, 0.15) inset;
}
html[data-theme="dark"] .content-main {
  background: linear-gradient(160deg, #0c1d2f 0%, #2a0a27 50%, #0c1d2f 100%);
  background-attachment: fixed;
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .card-section,
html[data-theme="dark"] .list-item,
html[data-theme="dark"] .quick-contact-box,
html[data-theme="dark"] .contact-container {
  background: linear-gradient(145deg, #330b2e 0%, #2a0a27 100%);
  border: 1px solid rgba(28,69,113, 0.45);
  color: #f4f0e8;
  box-shadow: 0 4px 16px rgba(12,29,47, 0.4), inset 0 1px 0 rgba(244,240,232, 0.05);
}
html[data-theme="dark"] .card-header {
  border-bottom: 1px solid rgba(28,69,113, 0.45);
}
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .view-search,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  background: rgba(12,29,47, 0.7);
  border: 1px solid rgba(28,69,113, 0.5);
  color: #f4f0e8;
  backdrop-filter: blur(4px);
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .view-search:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus {
  background: rgba(51,11,46, 0.8);
  border-color: #ffdd00;
  color: #f4f0e8;
  box-shadow: 0 0 0 3px rgba(255,221,0, 0.2), 0 0 12px rgba(255,221,0, 0.1);
  outline: none;
}
html[data-theme="dark"] .footer-nav {
  background: linear-gradient(180deg, #330b2e 0%, #0c1d2f 100%);
  border-color: rgba(28,69,113, 0.4);
  box-shadow: 0 -4px 20px rgba(12,29,47, 0.5);
}
html[data-theme="dark"] .sidebar-right {
  background: linear-gradient(180deg, #330b2e 0%, #0c1d2f 100%);
  border-left: 1px solid rgba(28,69,113, 0.4);
}
html[data-theme="dark"] .footin {
  background: linear-gradient(135deg, #330b2e, #0c1d2f);
  color: #f4f0e8;
  border-top: 1px solid rgba(28,69,113, 0.35);
}
html[data-theme="dark"] .icon-box {
  background: linear-gradient(145deg, rgba(51,11,46, 0.9) 0%, rgba(12,29,47, 0.95) 100%);
  border: 1px solid rgba(28,69,113, 0.45);
  color: #f4f0e8;
  box-shadow: 0 2px 8px rgba(12,29,47, 0.4);
}
html[data-theme="dark"] .whitenho {
  background: linear-gradient(145deg, #330b2e, #2a0a27);
  color: #f4f0e8;
  border-bottom: 2px solid rgba(28,69,113, 0.4);
  border-top: 0.2rem solid rgba(255,221,0, 0.5);
}
html[data-theme="dark"] .bbgpc {
  background: linear-gradient(145deg, #330b2e 0%, #0c1d2f 100%);
  color: #f4f0e8;
  box-shadow: 7px 8px 20px rgba(12,29,47, 0.5);
}
html[data-theme="dark"] .modal-content {
  background: linear-gradient(145deg, #330b2e 0%, #0c1d2f 100%);
  border: 1px solid rgba(28,69,113, 0.5);
  box-shadow: 0 20px 60px rgba(12,29,47, 0.7), 0 0 0 1px rgba(255,221,0, 0.1) inset;
  color: #f4f0e8;
}
html[data-theme="dark"] .dropdown-menu {
  background: linear-gradient(160deg, #330b2e 0%, #0c1d2f 100%);
  border: 1px solid rgba(28,69,113, 0.5);
  box-shadow: 0 8px 32px rgba(12,29,47, 0.6);
  backdrop-filter: blur(12px);
}
html[data-theme="dark"] .dropdown-item {
  color: #f4f0e8;
  transition: background 0.2s ease, color 0.2s ease;
}
html[data-theme="dark"] .dropdown-item:hover {
  background: rgba(28,69,113, 0.4);
  color: #f4f0e8;
}
html[data-theme="dark"] .sidebar-tab-filter input {
  background: rgba(12,29,47, 0.7);
  color: #f4f0e8;
  border: 1px solid rgba(28,69,113, 0.5);
}
html[data-theme="dark"] .back-to-top {
  background: linear-gradient(135deg, #1c4571, #330b2e);
  color: #f4f0e8;
  box-shadow: 0 4px 16px rgba(12,29,47, 0.6), 0 0 12px rgba(255,221,0, 0.15);
  border: 1px solid rgba(255,221,0, 0.25);
}
html[data-theme="dark"] .back-to-top:hover {
  background: linear-gradient(135deg, #ffdd00, #1c4571);
  color: #0c1d2f;
  box-shadow: 0 6px 20px rgba(255,221,0, 0.3);
}
html[data-theme="dark"] #readingProgressBar {
  background: linear-gradient(90deg, #1c4571, #ffdd00, #f4f0e8);
  box-shadow: 0 0 8px rgba(255,221,0, 0.5);
}
html[data-theme="dark"] .dark-mode-toggle {
  background: rgba(28,69,113, 0.2);
  border: 1px solid rgba(255,221,0, 0.3);
  color: #f4f0e8;
}
html[data-theme="dark"] .dark-mode-toggle:hover {
  background: rgba(28,69,113, 0.4);
  border-color: #ffdd00;
  color: #f4f0e8;
  box-shadow: 0 0 10px rgba(255,221,0, 0.2);
}
html[data-theme="dark"] .breadcrumb-trail {
  color: rgba(244,240,232, 0.75);
}
html[data-theme="dark"] .breadcrumb-trail .bc-sep {
  opacity: 0.4;
}
html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #0c1d2f;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1c4571, #330b2e);
  border-radius: 10px;
  border: 2px solid #0c1d2f;
  background-clip: content-box;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffdd00, #1c4571);
}
html[data-theme="dark"] .callout {
  background: linear-gradient(135deg, rgba(28,69,113, 0.15) 0%, rgba(51,11,46, 0.2) 100%);
  color: #f4f0e8;
  border-left: 4px solid #ffdd00;
}
html[data-theme="dark"] .sidebar-right .widget {
  background: rgba(51,11,46, 0.55);
  border: 1px solid rgba(28,69,113, 0.4);
  color: #f4f0e8;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(12,29,47, 0.3), inset 0 1px 0 rgba(244,240,232, 0.05);
}
html[data-theme="dark"] #tab2 { background: linear-gradient(160deg, #0c1d2f 0%, #2a0a27 100%); }
html[data-theme="dark"] #tab2 .icon-item-explore {
  background: linear-gradient(145deg, rgba(51,11,46, 0.9) 0%, rgba(12,29,47, 0.95) 100%);
  border: 1px solid rgba(28,69,113, 0.45);
  color: #f4f0e8;
  box-shadow: 0 2px 8px rgba(12,29,47, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
html[data-theme="dark"] #tab2 .icon-item-explore span { color: #f4f0e8; }
html[data-theme="dark"] .forum-hero-overlay {
  background: linear-gradient(
    to top,
    rgba(12,29,47, 0.95) 0%,
    rgba(51,11,46, 0.6) 55%,
    transparent 100%
  );
}
html[data-theme="dark"] .forum-hero-shimmer {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,221,0, 0.85),
    rgba(244,240,232, 0.85),
    transparent
  );
}
html[data-theme="dark"] .forum-pill {
  background: rgba(28,69,113, 0.35);
  border: 1px solid rgba(255,221,0, 0.45);
  color: #f4f0e8;
  backdrop-filter: blur(8px);
}
html[data-theme="dark"] .forum-pill:hover {
  background: rgba(28,69,113, 0.6);
}
html[data-theme="dark"] .tab-button.active {
  background: linear-gradient(90deg, rgba(28,69,113, 0.5) 0%, rgba(51,11,46, 0.4) 100%);
  color: #f4f0e8;
  border-left: 0.31rem solid #ffdd00;
  box-shadow: inset 3px 0 10px rgba(255,221,0, 0.15);
  font-weight: 700;
}
html[data-theme="dark"] .nav-item.active {
  color: #ffdd00;
}
html[data-theme="dark"] .nav-item.active .bi {
  color: #ffdd00;
  filter: drop-shadow(0 0 6px rgba(255,221,0, 0.45));
}
html[data-theme="dark"] .nav-item.active .nav-label {
  color: #f4f0e8;
  font-weight: 700;
}
html[data-theme="dark"] .nav-item:hover {
  color: #f4f0e8;
}
html[data-theme="dark"] .icon-box:hover {
  background: linear-gradient(145deg, rgba(28,69,113, 0.5) 0%, rgba(51,11,46, 0.7) 100%);
  border-color: rgba(255,221,0, 0.5);
  box-shadow: 0 4px 16px rgba(255,221,0, 0.15), 0 0 0 1px rgba(255,221,0, 0.1) inset;
}
html[data-theme="dark"] .icon-box i {
  color: #ffdd00;
}
html[data-theme="dark"] .icon-box i:hover {
  color: #f4f0e8;
}
html[data-theme="dark"] .icon-label {
  color: #ffdd00;
}
html[data-theme="dark"] .grid-item {
  color: #f4f0e8;
}
html[data-theme="dark"] .grid-item .text {
  color: #ffdd00;
}
html[data-theme="dark"] .grid-item .text:hover {
  color: #f4f0e8;
}
html[data-theme="dark"] .grid-item:hover {
  box-shadow: 0 6px 20px rgba(255,221,0, 0.2);
}
html[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #1c4571 0%, #330b2e 100%);
  color: #f4f0e8;
  border: 1px solid rgba(255,221,0, 0.3);
  box-shadow: 0 2px 8px rgba(12,29,47, 0.4);
  transition: all 0.25s ease;
}
html[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #ffdd00 0%, #1c4571 100%);
  color: #0c1d2f;
  box-shadow: 0 4px 16px rgba(255,221,0, 0.3);
  transform: translateY(-2px);
}
html[data-theme="dark"] .btn-secondary {
  background: rgba(51,11,46, 0.6);
  color: #f4f0e8;
  border: 1px solid rgba(28,69,113, 0.5);
}
html[data-theme="dark"] .btn-secondary:hover {
  background: rgba(28,69,113, 0.45);
  color: #f4f0e8;
}
html[data-theme="dark"] .btn-submit-email,
html[data-theme="dark"] .btn-call {
  background: linear-gradient(135deg, #1c4571 0%, #330b2e 100%);
  color: #f4f0e8;
  border: 1px solid rgba(255,221,0, 0.3);
}
html[data-theme="dark"] .btn-submit-email:hover,
html[data-theme="dark"] .btn-call:hover {
  background: linear-gradient(135deg, #ffdd00, #1c4571);
  color: #0c1d2f;
}
html[data-theme="dark"] .btn-enter-capsule {
  background: linear-gradient(135deg, #1c4571, #ffdd00);
  color: #0c1d2f;
  box-shadow: 0 4px 16px rgba(255,221,0, 0.3);
}
html[data-theme="dark"] .stat-icon-courses { --icon-bg: rgba(28,69,113, 0.25); --icon-color: #ffdd00; }
html[data-theme="dark"] .stat-icon-providers { --icon-bg: rgba(51,11,46, 0.35); --icon-color: #f4f0e8; }
html[data-theme="dark"] .stat-icon-gigs { --icon-bg: rgba(28,69,113, 0.2); --icon-color: #ffdd00; }
html[data-theme="dark"] .card-section .header .see-all {
  color: #ffdd00;
}
html[data-theme="dark"] .card-section .header .see-all:hover {
  color: #f4f0e8;
}
html[data-theme="dark"] .stories {
  background-color: rgba(51,11,46, 0.5);
  border-bottom: 1px solid rgba(28,69,113, 0.4);
}
html[data-theme="dark"] .icons-social__link {
  color: #ffdd00;
}
html[data-theme="dark"] .icons-social__link:hover {
  color: #f4f0e8;
}
html[data-theme="dark"] #searchIcon {
  color: #f4f0e8;
}
html[data-theme="dark"] #searchIcon:hover {
  color: #ffdd00;
}
html[data-theme="dark"] #searchInput.active {
  background-color: rgba(51,11,46, 0.85);
  color: #f4f0e8;
  border-radius: 15px;
  border: 1px solid rgba(255,221,0, 0.4);
}
html[data-theme="dark"] mark.highlight {
  background-color: rgba(28,69,113, 0.4);
  color: #f4f0e8;
}
html[data-theme="dark"] .icon-divider {
  color: #ffdd00;
}
html[data-theme="dark"] .icon-divider::before,
html[data-theme="dark"] .icon-divider::after {
  background: rgba(28,69,113, 0.45);
}
html[data-theme="dark"] .icon-divider span {
  color: #ffdd00;
}
html[data-theme="dark"] .modal-close {
  color: #ffdd00;
}
html[data-theme="dark"] .modal-close:hover {
  color: #f4f0e8;
}
html[data-theme="dark"] .tab3-search-bar,
html[data-theme="dark"] .explore-search-bar {
  background: linear-gradient(135deg, #330b2e 0%, #0c1d2f 100%);
  border-bottom: 1px solid rgba(28,69,113, 0.4);
}
html[data-theme="dark"] .quote0 {
  background-color: rgba(51,11,46, 0.7);
  border-left: 8px solid #1c4571;
  border-bottom: 0.7px solid rgba(28,69,113, 0.5);
  color: #f4f0e8;
}
html[data-theme="dark"] .contact {
  background: rgba(28,69,113, 0.25);
  border-left: 2.3px solid rgba(255,221,0, 0.6);
  color: #f4f0e8;
}
html[data-theme="dark"] .sidebar-left .sidebar-header,
html[data-theme="dark"] .sidebar-left .sidebar-footer {
  background: linear-gradient(135deg, #0c1d2f 0%, #330b2e 100%);
  color: #f4f0e8;
  border-bottom: 1px solid rgba(28,69,113, 0.4);
}
html[data-theme="dark"] #tab2 .view-more-btn {
  background: rgba(51,11,46, 0.6);
  border: 1px solid rgba(28,69,113, 0.45);
  color: #f4f0e8;
}
html[data-theme="dark"] #tab2 .view-more-btn:hover {
  background: rgba(28,69,113, 0.5);
  color: #f4f0e8;
}
html[data-theme="dark"] .live-dot {
  background-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25), 0 0 8px rgba(34, 197, 94, 0.2);
}
html[data-theme="dark"] .custom-sidebar-gradient {
  background-image: linear-gradient(160deg, #0c1d2f 0%, #330b2e 55%, #1c4571 100%);
}
html[data-theme="dark"] .custom-header-gradient {
  background-image: linear-gradient(135deg, #0c1d2f 0%, #330b2e 55%, #1c4571 100%);
}
html[data-theme="dark"] .custom-slate-gradient {
  background-image: linear-gradient(135deg, #ffdd00 0%, #1c4571 60%, #330b2e 100%);
}
html[data-theme="dark"] .mobile-widgets a:hover {
  background-color: rgba(28,69,113, 0.3);
  color: #f4f0e8;
  border-left: 0.31rem solid #ffdd00;
}
html[data-theme="dark"] .pm-error { color: #ff8a80; }
html[data-theme="dark"] {
  --g-bg1:#13253f; --g-bg2:#0F1E33; --g-bg3:#0a1626;
  --g-surface:rgba(255,255,255,.075); --g-surface-2:rgba(255,255,255,.12); --g-solid:#18314f; --g-solid-2:#1d3a5a;
  --g-border:rgba(255,255,255,.15); --g-text:#F4F0E8; --g-text-2:#B9C4D4; --g-heading:#FBF8F2;
  --g-accent:#D2B27A; --g-accent-2:#B8945B; --g-on-accent:#0F1E33; --g-price:#E3C991; --g-good:#8fe0a0; --g-bad:#ff9d8f;
  --g-shadow:0 14px 30px -14px rgba(0,0,0,.65); --g-blur:blur(16px) saturate(120%);
  --g-header:rgba(15,30,51,.80); --g-nav:rgba(15,30,51,.88); --g-input:rgba(255,255,255,.09);
  --g-leaf-op:.07;
  /* legacy variables used by the older rules */
  --dm-bg:#0F1E33; --dm-surface:#18314f; --dm-sidebar-bg:#0e2138; --dm-header-bg:var(--g-header); --dm-text:#F4F0E8; --dm-border:rgba(255,255,255,.15);
  --dm-card-bg:rgba(255,255,255,.075); --dm-input-bg:rgba(255,255,255,.09); --dm-tab-btn-bg:rgba(255,255,255,.08); --dm-tab-btn-color:#E6E0D4;
  --dm-sidebar-tabs-bg:transparent; --dm-footer-nav-bg:rgba(15,30,51,.88); --dm-progress-color:linear-gradient(90deg,#B8945B,#E3C991);
  --dm-toast-bg:#1d3a5a; --dm-toast-color:#F4F0E8; --dm-breadcrumb-color:rgba(244,240,232,.85);
  --background-main:#0F1E33; --background-content:#10233b; --background-sidebar:#0e2138; --background-color:#0F1E33;
  --text-color:#F4F0E8; --border-color:rgba(255,255,255,.15); --bg-surface:#18314f; --bg-surface-new:#18314f;
  --text-primary:#FBF8F2; --text-primary-new:#FBF8F2; --text-secondary:#B9C4D4; --text-secondary-new:#B9C4D4;
  --bg-hover:rgba(255,255,255,.1); --bg-hover-new:rgba(255,255,255,.1); --border-color-new:rgba(255,255,255,.15);
  --color-white:#18314f; --color-grey-light-1:#18314f; --color-grey-light-2:#10233b; --color-grey-dark-1:#F4F0E8; --color-grey-dark-2:#B9C4D4; --color-grey-mid-1:rgba(255,255,255,.15); --color-grey-mid-2:#B9C4D4;
  --color-blue-primary:#D2B27A; --color-blue-dark-1:#EBD9B3; --color-blue-light-1:rgba(210,178,122,.16); --color-teal-primary:#D2B27A; --color-teal-light-1:rgba(210,178,122,.16); --color-teal-dark-1:#EBD9B3;
  --primary-color:#2E4A67; --primary-color-dark:#18314f; --text-on-primary-bg:#F4F0E8; --active-border:#D2B27A; --secondary-color:rgba(210,178,122,.2);
  --color-primary-new:#D2B27A; --color-primary-dark-new:#EBD9B3;
  --highlight-strong:rgba(210,178,122,.25); --border-radius-md:20px; --border-radius-sm:14px;
  --shadow-sm:0 8px 20px -10px rgba(0,0,0,.6); --shadow-md:0 16px 34px -14px rgba(0,0,0,.65);
  --leaf: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900' viewBox='0 0 900 900'><g fill='%23D2B27A' fill-opacity='.07'><path d='M640 40C820 120 880 330 800 520C700 440 600 260 640 40Z'/><path d='M60 600C250 560 430 640 500 860C300 880 120 800 60 600Z'/></g><g stroke='%23D2B27A' stroke-opacity='.08' stroke-width='3' fill='none'><path d='M650 60C700 200 760 350 795 510'/><path d='M70 620C220 650 390 740 490 850'/></g></svg>");
}
html[data-theme="dark"] { --g-bar: #112640; }
/* ---------- B. DARK THEME: PURPLE & COBALT ----------
   Midnight #0C1D2F · Plum #330B2E · Cobalt #1C4571 · Navy card #12243C · Signal yellow #FFDD00 · Brass #BB865E */
html[data-theme="dark"] {
  --g-bg1:#12243c; --g-bg2:#0c1d2f; --g-bg3:#081523; --g-bar:#12243c;
  --g-surface:rgba(51,11,46,.80); --g-surface-2:rgba(66,16,60,.92); --g-solid:#2a0a27; --g-solid-2:#330b2e;
  --g-border:rgba(255,255,255,.12); --g-text:#F4F0E8; --g-text-2:#BCC4D6; --g-heading:#FFFFFF;
  --g-accent:#FFDD00; --g-accent-2:#E0B27A; --g-on-accent:#0C1D2F; --g-price:#FFDD00; --g-good:#8fe0a0; --g-bad:#ff9d8f;
  --g-shadow:0 14px 30px -14px rgba(0,0,0,.7);
  --g-header:rgba(12,29,47,.88); --g-nav:rgba(12,29,47,.94); --g-input:rgba(255,255,255,.08);
  --dm-bg:#0c1d2f; --dm-surface:#330b2e; --dm-sidebar-bg:#0a1827; --dm-header-bg:var(--g-header); --dm-text:#F4F0E8; --dm-border:rgba(255,255,255,.12);
  --dm-card-bg:rgba(51,11,46,.80); --dm-input-bg:rgba(255,255,255,.08); --dm-tab-btn-bg:rgba(28,69,113,.55); --dm-tab-btn-color:#F4F0E8;
  --dm-sidebar-tabs-bg:transparent; --dm-footer-nav-bg:rgba(12,29,47,.94); --dm-progress-color:linear-gradient(90deg,#FFDD00,#E8943A);
  --dm-toast-bg:#330b2e; --dm-toast-color:#F4F0E8; --dm-breadcrumb-color:rgba(244,240,232,.85);
  --background-main:#0c1d2f; --background-content:#0f233b; --background-sidebar:#0a1827; --background-color:#0c1d2f;
  --text-color:#F4F0E8; --border-color:rgba(255,255,255,.12); --bg-surface:#330b2e; --bg-surface-new:#330b2e;
  --text-primary:#FFFFFF; --text-primary-new:#FFFFFF; --text-secondary:#BCC4D6; --text-secondary-new:#BCC4D6;
  --bg-hover:rgba(255,255,255,.10); --bg-hover-new:rgba(255,255,255,.10); --border-color-new:rgba(255,255,255,.12);
  --color-white:#330b2e; --color-grey-light-1:#330b2e; --color-grey-light-2:#12243c; --color-grey-dark-1:#F4F0E8; --color-grey-dark-2:#BCC4D6; --color-grey-mid-1:rgba(255,255,255,.14); --color-grey-mid-2:#BCC4D6;
  --color-blue-primary:#FFDD00; --color-blue-dark-1:#FFE966; --color-blue-light-1:rgba(255,221,0,.14); --color-teal-primary:#FFDD00; --color-teal-light-1:rgba(255,221,0,.14); --color-teal-dark-1:#FFE966;
  --primary-color:#1C4571; --primary-color-dark:#12243c; --text-on-primary-bg:#F4F0E8; --active-border:#FFDD00; --secondary-color:rgba(255,221,0,.18);
  --color-primary-new:#FFDD00; --color-primary-dark-new:#FFE966; --highlight-strong:rgba(255,221,0,.22);
  --mc-ink-brass:#E0B27A; --mc-chip-bg:rgba(28,69,113,.45); --mc-card-edge:rgba(255,255,255,.14); --leaf:none;
}

/* page, header, rails, bottom nav */
html[data-theme="dark"] body, html[data-theme="dark"] { background-color: #0c1d2f; }
html[data-theme="dark"] .content-main {
  background-image: radial-gradient(circle at 10% 4%, rgba(92,22,82,.42), transparent 46%), radial-gradient(circle at 96% 38%, rgba(28,69,113,.42), transparent 50%), linear-gradient(180deg,#12243c 0%,#0c1d2f 55%,#081523 100%);
  background-repeat: no-repeat; background-attachment: scroll; background-position: 0 0; background-size: auto;
}
html[data-theme="dark"] .content-header { background: rgba(12,29,47,.88) !important; border-bottom: 1px solid rgba(255,255,255,.10); }
html[data-theme="dark"] .sidebar-left { background: rgba(10,24,39,.78); border-right: 1px solid rgba(255,255,255,.10); box-shadow: none; }
html[data-theme="dark"] .sidebar-tabs { background: transparent; }
html[data-theme="dark"] .sidebar-right { background: rgba(10,24,39,.7); border-left: 1px solid rgba(255,255,255,.10); }
html[data-theme="dark"] .sidebar-left .sidebar-header, html[data-theme="dark"] .sidebar-left .sidebar-footer { background: linear-gradient(135deg,#1c4571,#12243c) !important; color: #F4F0E8; border-color: rgba(255,255,255,.10); }
html[data-theme="dark"] .footer-nav { background: rgba(12,29,47,.94); border-color: rgba(255,255,255,.10); box-shadow: 0 -10px 24px -14px rgba(0,0,0,.7); }
html[data-theme="dark"] .nav-item { color: #BCC4D6; }
html[data-theme="dark"] .nav-item.active { background: transparent; border: 0; color: #fff; }
html[data-theme="dark"] .nav-item.active .bi { background: rgba(255,221,0,.16); box-shadow: inset 0 0 0 1px rgba(255,221,0,.55); color: #FFDD00; }
html[data-theme="dark"] .nav-item.active .nav-label { color: #FFDD00; }

/* sidebar page links + group labels */
html[data-theme="dark"] .tab-button { background: rgba(28,69,113,.40); color: #F4F0E8; border-color: rgba(255,255,255,.10); box-shadow: none; }
html[data-theme="dark"] .tab-button:hover:not(.active) { background: rgba(28,69,113,.70); color: #fff; }
html[data-theme="dark"] .tab-button.active, html[data-theme="dark"] .tab-button.active * { background: linear-gradient(180deg,#FFE55C,#FFDD00); color: #0C1D2F !important; border-color: rgba(255,255,255,.35); box-shadow: 0 6px 14px -6px rgba(0,0,0,.6); }
html[data-theme="dark"] .tab-button.active .bi, html[data-theme="dark"] .tab-button.active .tb-label { background: none; }
html[data-theme="dark"] .nav-group { border-top-color: rgba(255,255,255,.10); }
html[data-theme="dark"] .nav-group-head { color: #BCC4D6; }
html[data-theme="dark"] .nav-group.is-open > .nav-group-head { color: #FFDD00; }
html[data-theme="dark"] .sidebar-tabs .nav-group-body .tab-button .bi { color: #E0B27A; }
html[data-theme="dark"] .sidebar-tab-filter input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: #F4F0E8; }

/* surfaces: plum cards on a midnight page, cobalt chips/pills */
html[data-theme="dark"] .card, html[data-theme="dark"] .card-section, html[data-theme="dark"] .list-item, html[data-theme="dark"] .quick-contact-box, html[data-theme="dark"] .contact-container,
html[data-theme="dark"] .alert, html[data-theme="dark"] .stat-card, html[data-theme="dark"] .action-item, html[data-theme="dark"] .accordion-item, html[data-theme="dark"] .table-responsive {
  background: linear-gradient(160deg,#3a0f34 0%,#330b2e 55%,#2a0a27 100%); color: #F4F0E8; border: 1px solid rgba(255,255,255,.10); box-shadow: 0 14px 30px -16px rgba(0,0,0,.75);
}
html[data-theme="dark"] .widget, html[data-theme="dark"] .sidebar-right .widget, html[data-theme="dark"] .widget.custom-slate-gradient { background: linear-gradient(160deg,#1c4571,#12243c) !important; color: #F4F0E8; border: 1px solid rgba(255,255,255,.12); }
html[data-theme="dark"] .card-header, html[data-theme="dark"] .card-footer { background: transparent; border-color: rgba(255,255,255,.10); color: #fff; }
html[data-theme="dark"] .modal-content, html[data-theme="dark"] .pm-dialog { background: linear-gradient(165deg,#3a0f34,#12243c); color: #F4F0E8; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 28px 70px -14px rgba(0,0,0,.8); }
html[data-theme="dark"] .pm-close { background: rgba(12,29,47,.75); color: #F4F0E8; border-color: rgba(255,255,255,.14); }
html[data-theme="dark"] .toast-notification { background: #330b2e; color: #F4F0E8; border: 1px solid rgba(255,255,255,.14); }
html[data-theme="dark"] .tab3-search-bar, html[data-theme="dark"] .explore-search-bar { background: #12243c; border-bottom-color: rgba(255,255,255,.10); }
html[data-theme="dark"] .form-select option, html[data-theme="dark"] .pm-input option { background: #12243c; color: #F4F0E8; }
html[data-theme="dark"] .dropdown-menu { background: #12243c; border-color: rgba(255,255,255,.12); }
html[data-theme="dark"] .dropdown-item { color: #F4F0E8; }
html[data-theme="dark"] .dropdown-item:hover { background: rgba(28,69,113,.7); color: #fff; }

/* hero: cobalt-to-plum panel */
html[data-theme="dark"] .home-hero {
  background: radial-gradient(circle at 88% 22%, rgba(255,221,0,.16), transparent 52%), linear-gradient(150deg,#1c4571 0%,#12243c 52%,#330b2e 115%);
  border: 1px solid rgba(255,255,255,.14);
}
html[data-theme="dark"] .home-hero h2 em { color: #FFDD00; }
html[data-theme="dark"] .hub-eyebrow { color: #FFDD00 !important; }

/* actions: yellow primary, cobalt secondary, yellow selected states */
html[data-theme="dark"] .btn-success, html[data-theme="dark"] .btn-whatsapp { background: linear-gradient(180deg,#FFE760,#FFDD00); color: #0C1D2F; border: 1px solid rgba(255,255,255,.35); }
html[data-theme="dark"] .btn-success:hover, html[data-theme="dark"] .btn-success:focus-visible, html[data-theme="dark"] .btn-whatsapp:hover { background: linear-gradient(180deg,#FFEE85,#FFE22E); color: #0C1D2F; }
html[data-theme="dark"] .btn.btn-primary, html[data-theme="dark"] .btn.btn-primary:hover, html[data-theme="dark"] .btn.btn-primary:focus, html[data-theme="dark"] .btn.btn-primary:active { background: linear-gradient(180deg,#2a68a8,#1c4571); color: #F4F0E8; border: 1px solid rgba(255,255,255,.18); }
html[data-theme="dark"] .btn.btn-dark, html[data-theme="dark"] .btn.btn-dark:hover { background: rgba(12,29,47,.8); color: #F4F0E8; border: 1px solid rgba(255,255,255,.14); }
html[data-theme="dark"] .chip.active, html[data-theme="dark"] .seg-btn.active, html[data-theme="dark"] .seg button.active { background: linear-gradient(180deg,#FFE760,#FFDD00); color: #0C1D2F; border-color: transparent; }
html[data-theme="dark"] .free-badge, html[data-theme="dark"] .s-name > span, html[data-theme="dark"] .s-name .badge { background: #FFDD00 !important; color: #0C1D2F !important; }
html[data-theme="dark"] .avatar { background: radial-gradient(circle at 30% 30%,#1c4571,#12243c); color: #FFDD00; border-color: #BB865E; }
html[data-theme="dark"] #readingProgressBar { background: linear-gradient(90deg,#FFDD00,#E8943A); }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0c1d2f; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: linear-gradient(180deg,#1c4571,#330b2e); border-color: #0c1d2f; }
