/* =============================================
   DARK MODE - Shared Ergonomic Warm Dark Theme
   Rise Bright - risebright.com.au
   =============================================
   Reduces total luminance emitted to ease eye fatigue
   and support photosensitive users.

   Palette:
   - Base:      #13111a  (warm near-black body)
   - Surface-1: #16131e  (elevated sections)
   - Surface-2: #1e1a28  (cards, inputs, table headers)
   - Surface-3: #231f30  (hover states)
   - Border:    #2a2535
   - Text-1:    #e8e2f0  (~14:1 contrast, WCAG AAA)
   - Text-2:    #a8a0b8  (secondary text)
   ============================================= */


/* iPad Safari overflow fix - prevents decorative elements
   (floating shapes, bg orbs) from widening the page */
html, body { overflow-x: hidden; }

/* ================================================
   THEME TOGGLE COMPONENT - "Celestial Magic"
   Delightful sun/moon toggle with rich animations
   ================================================ */

.theme-toggle {
    position: relative;
    display: block;
    width: 60px;
    height: 30px;
    flex-shrink: 0;
}

.theme-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* Track - The sky canvas */
.theme-toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 30px;
    background: linear-gradient(180deg, #7dd3fc 0%, #38bdf8 50%, #0ea5e9 100%);
    cursor: pointer;
    transition: background 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Cloud wisps in day mode */
.theme-toggle-track::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 8px;
    width: 12px;
    height: 5px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.6s ease;
    box-shadow:
        6px 2px 0 -1px rgba(255, 255, 255, 0.5),
        -3px 3px 0 -1px rgba(255, 255, 255, 0.4);
    animation: rbCloudDrift 4s ease-in-out infinite;
}

@keyframes rbCloudDrift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

/* Aurora effect for dark mode */
.theme-toggle-track::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(34, 211, 238, 0.3) 25%,
        rgba(168, 85, 247, 0.4) 50%,
        rgba(34, 211, 238, 0.3) 75%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
    animation: rbAuroraShimmer 3s ease-in-out infinite;
    filter: blur(2px);
}

@keyframes rbAuroraShimmer {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.6;
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
}

/* Stars - more of them with varied sizes */
.theme-toggle-track .star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity, transform;
}

.theme-toggle-track .star:nth-child(1) {
    top: 5px; left: 8px;
    width: 2px; height: 2px;
    animation: rbTwinkle 2s ease-in-out infinite 0s;
}
.theme-toggle-track .star:nth-child(2) {
    top: 18px; left: 14px;
    width: 3px; height: 3px;
    animation: rbTwinkle 2.5s ease-in-out infinite 0.3s;
}
.theme-toggle-track .star:nth-child(3) {
    top: 7px; left: 22px;
    width: 2px; height: 2px;
    animation: rbTwinkle 1.8s ease-in-out infinite 0.6s;
}

/* Additional stars via pseudo-elements on the track wrapper */
.theme-toggle-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease 0.15s;
}

.theme-toggle-stars::before {
    content: '';
    position: absolute;
    top: 12px; left: 6px;
    width: 2px; height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow:
        20px -5px 0 0 white,
        12px 8px 0 -0.5px rgba(255,255,255,0.7),
        26px 6px 0 0 white;
    animation: rbTwinkle 2.2s ease-in-out infinite 0.9s;
}

/* Shooting star on hover */
.theme-toggle-stars::after {
    content: '';
    position: absolute;
    top: 8px;
    left: -10px;
    width: 15px;
    height: 2px;
    background: linear-gradient(90deg, transparent, white, transparent);
    border-radius: 2px;
    opacity: 0;
    transform: rotate(-25deg);
    transition: none;
}

@keyframes rbTwinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

@keyframes rbShootingStar {
    0% {
        left: -10px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        left: 40px;
        opacity: 0;
    }
}

/* The Sun/Moon orb */
.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 50%, #f59e0b 100%);
    box-shadow:
        0 0 8px rgba(251, 191, 36, 0.8),
        0 0 20px rgba(251, 191, 36, 0.4),
        0 0 40px rgba(251, 191, 36, 0.2),
        inset -2px -2px 4px rgba(234, 179, 8, 0.3);
    transition:
        transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.5s ease,
        box-shadow 0.5s ease;
    pointer-events: none;
    z-index: 2;
}

/* Sun rays - animated pulsing */
.theme-toggle-thumb::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: transparent;
    border: none;
    box-shadow:
        0 0 0 2px rgba(251, 191, 36, 0.3),
        0 0 0 5px rgba(251, 191, 36, 0.15),
        0 0 0 8px rgba(251, 191, 36, 0.05);
    transition: opacity 0.4s ease, transform 0.5s ease;
    animation: rbSunPulse 2s ease-in-out infinite;
}

@keyframes rbSunPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* Moon crater texture (appears in dark mode) */
.theme-toggle-thumb::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 3px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    transition:
        background 0.4s ease 0.25s,
        box-shadow 0.4s ease 0.25s,
        transform 0.4s ease;
    transform: scale(0);
}

/* Hover states */
.theme-toggle:hover .theme-toggle-thumb {
    box-shadow:
        0 0 10px rgba(251, 191, 36, 0.9),
        0 0 25px rgba(251, 191, 36, 0.5),
        0 0 45px rgba(251, 191, 36, 0.3),
        inset -2px -2px 4px rgba(234, 179, 8, 0.3);
}

.theme-toggle:hover .theme-toggle-track {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Focus state */
.theme-toggle input:focus-visible + .theme-toggle-track {
    outline: 2px solid white;
    outline-offset: 3px;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 0 0 4px rgba(59, 130, 246, 0.3);
}

/* ================================================
   DARK MODE STATE - Night sky transformation
   ================================================ */

[data-theme="dark"] .theme-toggle-track {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

/* Hide clouds, show aurora */
[data-theme="dark"] .theme-toggle-track::before {
    opacity: 0;
    transform: translateX(-20px);
}

[data-theme="dark"] .theme-toggle-track::after {
    opacity: 0.8;
}

/* Stars appear with twinkling */
[data-theme="dark"] .theme-toggle-track .star {
    opacity: 1;
}

[data-theme="dark"] .theme-toggle-stars {
    opacity: 1;
}

/* Shooting star on hover in dark mode */
[data-theme="dark"] .theme-toggle:hover .theme-toggle-stars::after {
    animation: rbShootingStar 0.8s ease-out forwards;
}

/* Moon transformation */
[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(30px);
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #cbd5e1 100%);
    box-shadow:
        0 0 10px rgba(226, 232, 240, 0.6),
        0 0 25px rgba(226, 232, 240, 0.3),
        inset -3px -3px 6px rgba(148, 163, 184, 0.4),
        inset 2px 2px 4px rgba(255, 255, 255, 0.8);
}

/* Sun rays disappear */
[data-theme="dark"] .theme-toggle-thumb::before {
    opacity: 0;
    transform: scale(0.5);
    animation: none;
}

/* Moon craters appear */
[data-theme="dark"] .theme-toggle-thumb::after {
    transform: scale(1);
    background: rgba(100, 116, 139, 0.4);
    box-shadow:
        -5px 4px 0 -2px rgba(100, 116, 139, 0.3),
        -8px -2px 0 -3px rgba(100, 116, 139, 0.2),
        3px 6px 0 -3px rgba(100, 116, 139, 0.25);
}

/* Dark mode hover */
[data-theme="dark"] .theme-toggle:hover .theme-toggle-thumb {
    box-shadow:
        0 0 12px rgba(226, 232, 240, 0.8),
        0 0 30px rgba(226, 232, 240, 0.4),
        0 0 50px rgba(167, 139, 250, 0.2),
        inset -3px -3px 6px rgba(148, 163, 184, 0.4),
        inset 2px 2px 4px rgba(255, 255, 255, 0.8);
}

/* Floating toggle for pages without nav */
.theme-toggle-float {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 38px;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

[data-theme="dark"] .theme-toggle-float {
    background: rgba(30, 26, 40, 0.95);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(139, 92, 246, 0.1);
}

/* Reduced motion - respect user preference */
@media (prefers-reduced-motion: reduce) {
    .theme-toggle-thumb {
        transition: transform 0.01s, background 0.01s, box-shadow 0.01s !important;
    }
    .theme-toggle-track {
        transition: background 0.01s !important;
    }
    .theme-toggle-thumb::before,
    .theme-toggle-track::before,
    .theme-toggle-track::after,
    .theme-toggle-track .star,
    .theme-toggle-stars::before {
        animation: none !important;
    }
}


/* ================================================
   CSS VARIABLE OVERRIDES
   Most pages use these vars for text colors,
   so overriding them handles the majority of text.
   ================================================ */

[data-theme="dark"] {
    --text-dark: #e8e2f0;
    --text-light: #a8a0b8;
    --primary-orange: #f7a94b;
    --primary-purple: #a78bfa;
    --accent-green: #34d399;
    --primary-blue: #60a5fa;
    --bg-light: #1a1722;
    --border-color: #2a2535;
}


/* ================================================
   BODY
   Overrides white, #fafafa, #f8fafc, and
   warm gradients used across various pages.
   ================================================ */

[data-theme="dark"] body {
    background: #13111a !important;
    color: #e8e2f0;
}

/* Role selector dark gradient (dashboard.html) */
[data-theme="dark"] body.role-selector-active {
    background: linear-gradient(135deg, #78350f 0%, #4c1d95 100%) !important;
}
[data-theme="dark"] .role-tile {
    background: rgba(30, 26, 40, 0.6);
    border-color: rgba(168, 160, 184, 0.2);
}
[data-theme="dark"] .role-tile:hover {
    background: rgba(30, 26, 40, 0.8);
}
[data-theme="dark"] .role-selector-subtitle {
    color: #a8a0b8;
}
[data-theme="dark"] .role-tile-desc {
    color: #a8a0b8;
}


/* ================================================
   TYPOGRAPHY
   ================================================ */

[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: #e8e2f0;
}

[data-theme="dark"] p,
[data-theme="dark"] li,
[data-theme="dark"] dd,
[data-theme="dark"] blockquote {
    color: #a8a0b8;
}

[data-theme="dark"] strong,
[data-theme="dark"] b {
    color: #e8e2f0;
}

[data-theme="dark"] a {
    color: #f7a94b;
}

[data-theme="dark"] a:hover {
    color: #fbbf24;
}


/* ================================================
   HEADER & NAV
   Deepened gradient for sticky headers used on
   about, privacy, terms, curriculum, learning-support pages.
   ================================================ */

[data-theme="dark"] header {
    background: linear-gradient(135deg, #78350f 0%, #6b2106 35%, #4c1d6e 100%) !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Keep nav links white (they're already white on the gradient header) */
[data-theme="dark"] .nav-links a,
[data-theme="dark"] nav a {
    color: white;
}

/* Logo text - keep white where it's on the header */
[data-theme="dark"] header .logo,
[data-theme="dark"] header .logo-name {
    color: white;
    -webkit-text-fill-color: white;
}

/* Sitemap-style header (white background variant) */
[data-theme="dark"] .header-content {
    color: #e8e2f0;
}

/* Sitemap logo uses indigo color - adjust for dark (scoped to .header-content only) */
[data-theme="dark"] .header-content a.logo {
    color: #a78bfa;
}


/* ================================================
   HERO SECTIONS
   Used on about, privacy, terms, curriculum,
   learning-support pages. Various warm gradients.
   ================================================ */

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #1c1917 0%, #1e1338 30%, #2a1a2e 60%, #1a1028 100%) !important;
}

[data-theme="dark"] .hero h1 {
    color: #e8e2f0;
}

[data-theme="dark"] .hero p,
[data-theme="dark"] .hero .subtitle,
[data-theme="dark"] .hero .last-updated {
    color: #a8a0b8;
}


/* ================================================
   BREADCRUMBS
   Light gray background sections
   ================================================ */

[data-theme="dark"] .breadcrumb {
    background: #16131e !important;
    color: #a8a0b8;
}


/* ================================================
   CONTENT SECTIONS
   .section used in about, privacy, terms,
   learning-support, curriculum pages.
   ================================================ */

/* Privacy/Terms style: white card sections with box-shadow */
[data-theme="dark"] .section {
    background: #1e1a28 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: #e8e2f0;
}

/* About/learning-support style: alternating section backgrounds */
[data-theme="dark"] .section:nth-child(even) {
    background: #1a1722 !important;
}

[data-theme="dark"] .section h2 {
    color: #e8e2f0;
    border-bottom-color: #f7a94b;
}

[data-theme="dark"] .section h3 {
    color: #e8e2f0;
}

[data-theme="dark"] .section p,
[data-theme="dark"] .section li {
    color: #a8a0b8;
}


/* ================================================
   CARDS & CARD-LIKE ELEMENTS
   White backgrounds -> dark surface
   ================================================ */

[data-theme="dark"] .card {
    background: #1e1a28 !important;
    color: #e8e2f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .toc {
    background: #1e1a28 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .value-card {
    background: #1e1a28 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* feature-card dark mode managed by index.html inline styles - no !important override here */

[data-theme="dark"] .expertise-list li {
    background: #1e1a28 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .condition-link {
    background: #1e1a28 !important;
    color: #e8e2f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}


/* ================================================
   BODY > .container
   Used as a card-like wrapper in contact, login,
   register pages (has white background and shadow).
   ================================================ */

[data-theme="dark"] body > .container {
    background: #1e1a28 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}


/* ================================================
   HIGHLIGHT & CALLOUT BOXES
   Various colored backgrounds across pages
   ================================================ */

/* Generic warm highlight (privacy, privacy-kids) */
[data-theme="dark"] .highlight-box {
    background: linear-gradient(135deg, #2a2235 0%, #231f30 100%) !important;
    border-left-color: #f7a94b;
    color: #e8e2f0;
}

/* Security variant (privacy) */
[data-theme="dark"] .highlight-box.security {
    background: linear-gradient(135deg, #1a2332 0%, #1e2838 100%) !important;
    border-left-color: #38bdf8;
}

/* Children variant (privacy) */
[data-theme="dark"] .highlight-box.children {
    background: linear-gradient(135deg, #1a2822 0%, #1e3028 100%) !important;
    border-left-color: #34d399;
}

[data-theme="dark"] .highlight-box h3,
[data-theme="dark"] .highlight-box h4 {
    color: #e8e2f0;
}

[data-theme="dark"] .highlight-box p {
    color: #a8a0b8;
}


/* ================================================
   CHALLENGE / SOLUTION BOXES
   Used in learning-support pages
   ================================================ */

[data-theme="dark"] .challenge {
    background: #2a1a1e !important;
    border-left-color: #f87171;
}

[data-theme="dark"] .solution {
    background: #1a2822 !important;
    border-left-color: #34d399;
}


/* ================================================
   RESEARCH BOX
   Light blue gradient in learning-support pages
   ================================================ */

[data-theme="dark"] .research-box {
    background: linear-gradient(135deg, #1a2332 0%, #1e2838 100%) !important;
}

[data-theme="dark"] .research-box h3 {
    color: #e8e2f0;
}

[data-theme="dark"] .stat-number {
    color: #f7a94b;
}

[data-theme="dark"] .stat-label {
    color: #a8a0b8;
}


/* ================================================
   OTHER CONDITIONS / RELATED LINKS
   Light gray sections in learning-support pages
   ================================================ */

[data-theme="dark"] .other-conditions {
    background: #1a1722 !important;
}

/* Strength items (autism) */
[data-theme="dark"] .strength-item {
    background: #1e1a28 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .strength-item h4 {
    color: #e8e2f0;
}

[data-theme="dark"] .strength-item p {
    color: #a8a0b8;
}

/* Sensory table header (autism) */
[data-theme="dark"] .sensory-table th {
    background: #231f30 !important;
    color: #e8e2f0;
}

[data-theme="dark"] .sensory-table td {
    color: #a8a0b8;
    border-color: #2a2535;
}

/* Interest example box (autism) */
[data-theme="dark"] .interest-example {
    background: linear-gradient(135deg, #2a1f3a 0%, #231f30 100%) !important;
    color: #e8e2f0;
}

/* Component cards (dyslexia) */
[data-theme="dark"] .component {
    background: #1e1a28 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .component h4 {
    color: #e8e2f0;
}

[data-theme="dark"] .component p {
    color: #a8a0b8;
}

/* Myth box (dyslexia) */
[data-theme="dark"] .myth-box {
    background: #2a1a1e !important;
    border-left-color: #f87171;
    color: #e8e2f0;
}

/* Research stat (dyslexia) */
[data-theme="dark"] .research-stat {
    background: linear-gradient(135deg, #1a2332 0%, #1e2838 100%) !important;
    color: #e8e2f0;
}

/* CRA cards (dyscalculia) */
[data-theme="dark"] .cra-card {
    background: #1e1a28 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cra-card h4 {
    color: #e8e2f0;
}

[data-theme="dark"] .cra-card p {
    color: #a8a0b8;
}

/* Manipulative items (dyscalculia) */
[data-theme="dark"] .manipulative-item {
    background: #1e1a28 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .manipulative-item h4 {
    color: #e8e2f0;
}

[data-theme="dark"] .manipulative-item p {
    color: #a8a0b8;
}

/* Coming soon banner (dyscalculia) */
[data-theme="dark"] .coming-soon-banner {
    background: linear-gradient(135deg, #2a2215 0%, #1e1a28 100%) !important;
    border-color: #b47a1a;
}

[data-theme="dark"] .coming-soon-banner h3 {
    color: #e8e2f0;
}

[data-theme="dark"] .coming-soon-banner p {
    color: #a8a0b8;
}

/* Manipulatives preview (dyscalculia) */
[data-theme="dark"] .manipulatives-preview {
    background: linear-gradient(135deg, #0d2822 0%, #132f2a 100%) !important;
    border-color: #0d7a6a;
}

[data-theme="dark"] .manipulatives-preview h3 {
    color: #e8e2f0;
}

[data-theme="dark"] .manipulatives-preview p {
    color: #a8a0b8;
}

/* Research box pink variant (dyscalculia) */
[data-theme="dark"] .research-box {
    background: linear-gradient(135deg, #2a1f3a 0%, #1e1a28 100%) !important;
}

[data-theme="dark"] .research-box h3 {
    color: #e8e2f0;
}

[data-theme="dark"] .research-box p {
    color: #a8a0b8;
}

/* Approach cards (general learning support) */
[data-theme="dark"] .approach-card {
    background: #1e1a28 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .approach-card h4 {
    color: #e8e2f0;
}

[data-theme="dark"] .approach-card p {
    color: #a8a0b8;
}

/* Strategy cards (general learning support) */
[data-theme="dark"] .strategy-card {
    background: #1e1a28 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .strategy-card h4 {
    color: #e8e2f0;
}

[data-theme="dark"] .strategy-card p {
    color: #a8a0b8;
}

/* Daily tip cards */
[data-theme="dark"] .daily-tip {
    background: linear-gradient(135deg, #2a1f3a 0%, #231f30 100%) !important;
    color: #e8e2f0;
}

/* Tip cards */
[data-theme="dark"] .tip-card {
    background: #1e1a28 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tip-card h4 {
    color: #e8e2f0;
}

[data-theme="dark"] .tip-card p {
    color: #a8a0b8;
}


/* ================================================
   CTA SECTIONS
   Orange/purple gradients - darken and mute
   ================================================ */

[data-theme="dark"] .cta-section {
    background: linear-gradient(135deg, #9a3412 0%, #7c2d12 50%, #581c87 100%) !important;
}

[data-theme="dark"] .btn-secondary {
    border-color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .btn-primary {
    background: #1e1a28;
    color: #f7a94b;
}


/* ================================================
   FOOTER
   Various footer styles - deepened
   ================================================ */

[data-theme="dark"] footer {
    background: #0d0b12 !important;
    color: #a8a0b8;
}

[data-theme="dark"] footer a {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.06);
}


/* ================================================
   FORM ELEMENTS
   Login, register, contact forms
   ================================================ */

[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #16131e !important;
    color: #e8e2f0;
    border-color: #2a2535 !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #6b6080;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: #a78bfa !important;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

/* Header login form - frosted glass on dark gradient header
   NOTE: selector must beat [data-theme="dark"] input:not(…):not(…) above (0-3-1).
   Using header input.login-input gives 0-2-2 + attribute = 0-3-2. */
[data-theme="dark"] header input.login-input,
[data-theme="dark"] header input.login-input:not([type="checkbox"]) {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
}

[data-theme="dark"] header input.login-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] header input.login-input:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] header .login-btn {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #7c2d12;
}

[data-theme="dark"] header .login-btn:hover {
    background: #fff !important;
}

[data-theme="dark"] header .login-link {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] header .login-divider {
    color: rgba(255, 255, 255, 0.3);
}

/* Page-level login/register submit buttons */
[data-theme="dark"] .login-btn,
[data-theme="dark"] .register-btn,
[data-theme="dark"] button[type="submit"] {
    background: linear-gradient(135deg, #f7a94b 0%, #a78bfa 100%);
    color: #13111a;
}


/* ================================================
   TABLES
   Privacy, terms, security, SLA pages
   ================================================ */

[data-theme="dark"] table {
    color: #e8e2f0;
}

[data-theme="dark"] th {
    background: #1e1a28 !important;
    color: #e8e2f0;
    border-color: #2a2535;
}

[data-theme="dark"] td {
    color: #a8a0b8;
    border-color: #2a2535;
}

[data-theme="dark"] tr:nth-child(even) {
    background: #1a1722;
}

[data-theme="dark"] tr:hover {
    background: #231f30;
}

/* Data tables (privacy, terms) */
[data-theme="dark"] .data-table th {
    background: #1a1722 !important;
}

[data-theme="dark"] .data-table tr:hover {
    background: #231f30 !important;
}

/* SLA tables */
[data-theme="dark"] .sla-table th {
    background: #1a1722 !important;
    color: #e8e2f0;
}

[data-theme="dark"] .sla-table td {
    border-color: #2a2535;
}

[data-theme="dark"] .sla-table tr:nth-child(even) {
    background: #16131e;
}


/* ================================================
   BADGES
   Privacy, security pages
   ================================================ */

[data-theme="dark"] .badge-green {
    background: #1a2822;
    color: #34d399;
}

[data-theme="dark"] .security-badge {
    background: #1a2822 !important;
    border-color: #34d399;
    color: #e8e2f0;
}


/* ================================================
   PAGE-SPECIFIC: SECURITY
   security.html - uses /css/style.css base
   ================================================ */

[data-theme="dark"] .security-page h1,
[data-theme="dark"] .sla-page h1 {
    color: #e8e2f0;
    border-bottom-color: #f7a94b;
}

[data-theme="dark"] .security-page h2,
[data-theme="dark"] .sla-page h2 {
    color: #e8e2f0;
}

[data-theme="dark"] .security-section {
    background: #1e1a28 !important;
    border-radius: 12px;
}

[data-theme="dark"] .contact-box {
    background: #1a2332 !important;
    border-color: #3b82f6;
}


/* ================================================
   PAGE-SPECIFIC: SLA
   sla.html - uses /css/style.css base
   ================================================ */

[data-theme="dark"] .highlight-box {
    border-color: #34d399;
}

/* The SLA highlight box uses green border */
[data-theme="dark"] .sla-page .highlight-box {
    background: #1a2822 !important;
    border-color: #34d399;
}


/* ================================================
   PAGE-SPECIFIC: SITEMAP
   sitemap.html - unique header/grid structure
   ================================================ */

[data-theme="dark"] .sitemap-section {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

[data-theme="dark"] .sitemap-section h2 {
    color: #a78bfa;
    border-bottom-color: #a78bfa;
}

[data-theme="dark"] .sitemap-section a {
    color: #e8e2f0;
}

[data-theme="dark"] .sitemap-section a:hover {
    color: #a78bfa;
}

[data-theme="dark"] .sitemap-section a::before {
    color: #a78bfa;
}

[data-theme="dark"] .page-description {
    color: #a8a0b8;
}


/* ================================================
   PAGE-SPECIFIC: PRIVACY-KIDS
   privacy-kids.html - colorful child-friendly
   ================================================ */

[data-theme="dark"] .promise-item {
    background: #1e1a28 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .parent-note {
    background: #1a2332 !important;
    border-left-color: #60a5fa;
}

[data-theme="dark"] .parent-note h4 {
    color: #60a5fa;
}

[data-theme="dark"] .speech-bubble {
    background: #1e1a28 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .speech-bubble::before {
    border-right-color: #1e1a28;
}

/* Privacy-kids button */
[data-theme="dark"] .btn {
    opacity: 0.95;
}


/* ================================================
   PAGE-SPECIFIC: LOGIN / REGISTER
   Centered card pages with gradient body
   ================================================ */

[data-theme="dark"] .login-wrapper .card,
[data-theme="dark"] .register-wrapper .card {
    background: #1e1a28 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border-color: #2a2535 !important;
}

[data-theme="dark"] .welcome-text,
[data-theme="dark"] .login-wrapper .logo-tagline,
[data-theme="dark"] .register-wrapper .logo-tagline {
    color: #a8a0b8;
}

/* Login page back-home link in dark mode */
[data-theme="dark"] .back-home {
    color: #a8a0b8;
}

/* Login page register link text */
[data-theme="dark"] .register-link {
    color: #a8a0b8;
}

/* Header tagline stays white */
[data-theme="dark"] header .logo-tagline {
    color: rgba(255, 255, 255, 0.9);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .divider {
    color: #2a2535;
}

[data-theme="dark"] .divider::before,
[data-theme="dark"] .divider::after {
    background: #2a2535;
}

/* Social login buttons */
[data-theme="dark"] .social-btn {
    background: #16131e !important;
    color: #e8e2f0;
    border-color: #2a2535;
}

[data-theme="dark"] .social-btn:hover {
    background: #231f30 !important;
}

/* Welcome box on register page */
[data-theme="dark"] .welcome-box {
    background: linear-gradient(135deg, #2a1f3a 0%, #1a2435 100%);
}

[data-theme="dark"] .welcome-box h3 {
    color: #f0e6ff;
}

[data-theme="dark"] .welcome-box p {
    color: #c4b8d8;
}

/* User-type info box on register */
[data-theme="dark"] .user-type-info {
    background: linear-gradient(135deg, #2a1f3a 0%, #1a2435 100%);
    color: #c4b8d8;
}

/* Referral banner on register */
[data-theme="dark"] .referral-banner {
    background: linear-gradient(135deg, #0d2818 0%, #132f1e 100%);
    border-color: #1a5c35;
}

[data-theme="dark"] .referral-banner .referral-text {
    color: #6ee7b7;
}

[data-theme="dark"] .referral-banner .referral-bonus {
    color: #a7f3d0;
}

/* Registration success modal */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.85);
}

[data-theme="dark"] .modal-content {
    background: #1e1a28;
}

[data-theme="dark"] .modal-content h2 {
    color: #e8e2f0;
}

[data-theme="dark"] .modal-message {
    color: #a8a0b8;
}

[data-theme="dark"] .modal-note {
    background: #2a1f3a;
    border-left-color: #f7a94b;
    color: #c4b8d8;
}

[data-theme="dark"] .modal-email {
    color: #a8a0b8;
}

/* Password requirements text */
[data-theme="dark"] .password-requirements {
    color: #a8a0b8;
}

/* ================================================
   GRADIENT TEXT PRESERVATION
   Gradient spans inside headings keep their effect;
   logo-name must stay opaque white on the header.
   ================================================ */


/* ================================================
   PAGE-SPECIFIC: AUSTRALIAN CURRICULUM
   australian-curriculum.html - states grid, subjects, mapping
   ================================================ */

/* State cards (VIC, NSW, QLD, etc.) */
[data-theme="dark"] .state-card {
    background: #1e1a28 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .state-code {
    color: #60a5fa;
}

[data-theme="dark"] .state-name {
    color: #e8e2f0;
}

[data-theme="dark"] .state-curriculum {
    color: #a8a0b8;
}

/* Subject cards (Mathematics, English) */
[data-theme="dark"] .subject-card {
    background: #1e1a28 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .subject-card h3 {
    color: #e8e2f0;
}

[data-theme="dark"] .subject-card li {
    color: #a8a0b8;
}

/* Year level badges (Foundation, Year 1, etc.) */
[data-theme="dark"] .year-badge {
    background: linear-gradient(135deg, #1a2332 0%, #1e1a28 100%);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

/* Mapping example container */
[data-theme="dark"] .mapping-example {
    background: linear-gradient(135deg, #1a1722 0%, #1e1a28 100%);
    border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .mapping-example h3 {
    color: #e8e2f0;
}

/* Individual mapping cards */
[data-theme="dark"] .mapping-card {
    background: #16131e !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-left-color: #60a5fa;
}

[data-theme="dark"] .mapping-card .mc-state {
    color: #60a5fa;
}

[data-theme="dark"] .mapping-card .mc-code {
    background: #1a2332;
    color: #a78bfa;
}

[data-theme="dark"] .mapping-card .mc-desc {
    color: #a8a0b8;
}


/* ================================================
   SCROLL & SELECTION
   ================================================ */

[data-theme="dark"] ::selection {
    background: rgba(167, 139, 250, 0.3);
    color: #e8e2f0;
}


/* ================================================
   SMOOTH TRANSITIONS
   Applied broadly for theme switch animation
   ================================================ */

body,
header,
footer,
main,
.hero,
.section,
.card,
.breadcrumb,
.container,
.toc,
.highlight-box,
.feature-card,
.value-card {
    transition:
        background 0.5s ease,
        background-color 0.5s ease,
        color 0.5s ease,
        box-shadow 0.5s ease,
        border-color 0.5s ease;
}


/* ================================================
   INTERNAL PAGES - Dashboards, Assessments, Learning
   ================================================ */

/* Dashboard cards and stats */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .child-card,
[data-theme="dark"] .activity-card,
[data-theme="dark"] .quick-action-card,
[data-theme="dark"] .metric-card {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

/* Welcome sections */
[data-theme="dark"] .welcome-section h1,
[data-theme="dark"] .section-title,
[data-theme="dark"] .page-title {
    color: #e8e2f0;
}

[data-theme="dark"] .welcome-section p,
[data-theme="dark"] .subtitle,
[data-theme="dark"] .description {
    color: #a8a0b8;
}

/* Tables (internal pages) */
[data-theme="dark"] .data-table,
[data-theme="dark"] .activity-table {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Assessment question cards */
[data-theme="dark"] .question-card,
[data-theme="dark"] .answer-option,
[data-theme="dark"] .option-card {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

[data-theme="dark"] .answer-option:hover,
[data-theme="dark"] .option-card:hover {
    background: #231f30 !important;
}

/* Progress bars and tracks */
[data-theme="dark"] .progress-track,
[data-theme="dark"] .progress-bar-bg {
    background: #2a2535;
}

/* Container/main backgrounds */
[data-theme="dark"] .main-content,
[data-theme="dark"] .dashboard-content,
[data-theme="dark"] .content-wrapper {
    background: #13111a;
}

/* Sidebars */
[data-theme="dark"] .sidebar,
[data-theme="dark"] .admin-sidebar,
[data-theme="dark"] .nav-sidebar {
    background: #16131e !important;
    border-color: #2a2535;
}

/* Tabs and navigation */
[data-theme="dark"] .tab,
[data-theme="dark"] .nav-tab {
    background: #1e1a28;
    color: #a8a0b8;
}

[data-theme="dark"] .tab.active,
[data-theme="dark"] .nav-tab.active {
    background: #231f30;
    color: #e8e2f0;
}

/* Lesson and learning content */
[data-theme="dark"] .lesson-card,
[data-theme="dark"] .lesson-content,
[data-theme="dark"] .content-block {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

/* Onboarding steps */
[data-theme="dark"] .step-card,
[data-theme="dark"] .onboarding-step,
[data-theme="dark"] .step-indicator {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Alerts and notifications */
[data-theme="dark"] .alert,
[data-theme="dark"] .notification {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Loading states */
[data-theme="dark"] .loading-spinner,
[data-theme="dark"] .skeleton {
    background: #231f30;
}

/* Student session specific */
[data-theme="dark"] .session-header,
[data-theme="dark"] .session-content {
    background: #1e1a28;
}

/* Admin specific */
[data-theme="dark"] .admin-card,
[data-theme="dark"] .admin-panel {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

/* Dashboard nav links */
[data-theme="dark"] .nav-item,
[data-theme="dark"] .sidebar-link {
    color: #a8a0b8;
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .sidebar-link:hover,
[data-theme="dark"] .nav-item.active,
[data-theme="dark"] .sidebar-link.active {
    background: #231f30;
    color: #e8e2f0;
}

/* Child avatar cards */
[data-theme="dark"] .child-avatar,
[data-theme="dark"] .avatar-container {
    background: #231f30;
    border-color: #2a2535;
}

/* Activity feeds */
[data-theme="dark"] .activity-item,
[data-theme="dark"] .activity-feed-item {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Progress indicators */
[data-theme="dark"] .progress-indicator,
[data-theme="dark"] .progress-ring {
    background: #2a2535;
}

/* Assessment panels */
[data-theme="dark"] .assessment-panel,
[data-theme="dark"] .assessment-container {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Learning journey milestones */
[data-theme="dark"] .milestone,
[data-theme="dark"] .journey-step {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Lesson browser */
[data-theme="dark"] .lesson-browser,
[data-theme="dark"] .lesson-list {
    background: #13111a;
}

[data-theme="dark"] .lesson-item,
[data-theme="dark"] .lesson-preview {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Profile sections */
[data-theme="dark"] .profile-section,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .data-section {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Admin dashboard panels */
[data-theme="dark"] .monitoring-panel,
[data-theme="dark"] .security-panel,
[data-theme="dark"] .materials-panel {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Admin tables */
[data-theme="dark"] .admin-table th {
    background: #1a1722 !important;
    color: #e8e2f0;
}

[data-theme="dark"] .admin-table td {
    border-color: #2a2535;
    color: #a8a0b8;
}

/* Verify/reset password pages */
[data-theme="dark"] .verify-container,
[data-theme="dark"] .reset-container,
[data-theme="dark"] .auth-container {
    background: #1e1a28;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Success/error states */
[data-theme="dark"] .success-message {
    background: #1a2822;
    border-color: #34d399;
    color: #34d399;
}

[data-theme="dark"] .error-message {
    background: #2a1a1e;
    border-color: #f87171;
    color: #f87171;
}

/* Welcome/onboarding progress */
[data-theme="dark"] .progress-steps,
[data-theme="dark"] .onboarding-progress {
    background: #16131e;
}

[data-theme="dark"] .step-dot,
[data-theme="dark"] .progress-dot {
    background: #2a2535;
}

[data-theme="dark"] .step-dot.active,
[data-theme="dark"] .progress-dot.active {
    background: #f7a94b;
}

/* Question options in assessments */
[data-theme="dark"] .option-button,
[data-theme="dark"] .choice-button {
    background: #1e1a28;
    border-color: #2a2535;
    color: #e8e2f0;
}

[data-theme="dark"] .option-button:hover,
[data-theme="dark"] .choice-button:hover {
    background: #231f30;
}

[data-theme="dark"] .option-button.selected,
[data-theme="dark"] .choice-button.selected {
    background: #231f30;
    border-color: #a78bfa;
}

/* Result cards */
[data-theme="dark"] .result-card,
[data-theme="dark"] .score-card {
    background: #1e1a28;
    border-color: #2a2535;
}

/* Timer components */
[data-theme="dark"] .timer,
[data-theme="dark"] .countdown {
    background: #1e1a28;
    color: #e8e2f0;
}

/* Dropdown menus */
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .user-menu {
    background: #1e1a28;
    border-color: #2a2535;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .dropdown-item {
    color: #a8a0b8;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #231f30;
    color: #e8e2f0;
}


/* ================================================
   INTERNAL PAGES - COMPREHENSIVE OVERRIDES
   Catch-all rules for dashboard/internal page elements
   ================================================ */

/* Container and main wrapper backgrounds */
[data-theme="dark"] .container {
    background: transparent;
}

/* Tabs container - white background override */
[data-theme="dark"] .tabs {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .tab {
    color: #a8a0b8;
    background: transparent;
}

[data-theme="dark"] .tab:hover {
    background: #231f30;
    color: #e8e2f0;
}

[data-theme="dark"] .tab.active {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
}

[data-theme="dark"] .tab-divider {
    background: #2a2535;
}

/* Welcome section text */
[data-theme="dark"] .welcome-text h1 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .welcome-text p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .welcome-date {
    color: #a8a0b8 !important;
}

/* Child cards - full dark mode */
[data-theme="dark"] .child-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .child-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .child-name {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .child-year {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .child-edit-btn {
    background: #231f30 !important;
    color: #a8a0b8;
}

[data-theme="dark"] .child-edit-btn:hover {
    background: #2a2535 !important;
    color: #e8e2f0;
}

/* Referral and subscription cards */
[data-theme="dark"] .referral-card,
[data-theme="dark"] .subscription-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .referral-card h3,
[data-theme="dark"] .subscription-card h3 {
    color: #e8e2f0;
}

[data-theme="dark"] .referral-card p,
[data-theme="dark"] .subscription-card p {
    color: #a8a0b8;
}

/* Quick action cards */
[data-theme="dark"] .quick-actions-grid .action-card,
[data-theme="dark"] .action-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .action-card:hover {
    background: #231f30 !important;
}

[data-theme="dark"] .action-card h4,
[data-theme="dark"] .action-card-title {
    color: #e8e2f0;
}

[data-theme="dark"] .action-card p,
[data-theme="dark"] .action-card-desc {
    color: #a8a0b8;
}

/* Stats grid cards */
[data-theme="dark"] .stats-grid .stat-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
    color: #e8e2f0;
}

[data-theme="dark"] .stat-value,
[data-theme="dark"] .stat-number {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .stat-label {
    color: #a8a0b8 !important;
}

/* Activity feed items */
[data-theme="dark"] .activity-feed,
[data-theme="dark"] .recent-activity {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

[data-theme="dark"] .activity-item {
    background: transparent;
    border-bottom-color: #2a2535;
}

[data-theme="dark"] .activity-item:hover {
    background: #231f30;
}

[data-theme="dark"] .activity-title,
[data-theme="dark"] .activity-name {
    color: #e8e2f0;
}

[data-theme="dark"] .activity-time,
[data-theme="dark"] .activity-meta {
    color: #a8a0b8;
}

/* Section headers */
[data-theme="dark"] .section-header h2,
[data-theme="dark"] .section-header h3 {
    color: #e8e2f0;
}

/* Dashboard panels */
[data-theme="dark"] .dashboard-panel,
[data-theme="dark"] .panel {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

[data-theme="dark"] .panel-header {
    background: #1a1722 !important;
    border-bottom-color: #2a2535;
    color: #e8e2f0;
}

[data-theme="dark"] .panel-body {
    background: #1e1a28;
}

/* Empty states */
[data-theme="dark"] .empty-state {
    background: #1e1a28;
    border-color: #2a2535;
}

[data-theme="dark"] .empty-state h3 {
    color: #e8e2f0;
}

[data-theme="dark"] .empty-state p {
    color: #a8a0b8;
}

/* Add child card special */
[data-theme="dark"] .add-child-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
    border-style: dashed !important;
}

[data-theme="dark"] .add-child-card:hover {
    background: #231f30 !important;
    border-color: #f97316 !important;
}

/* Modals */
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-content {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

[data-theme="dark"] .modal-header {
    background: #1a1722;
    border-bottom-color: #2a2535;
    color: #e8e2f0;
}

[data-theme="dark"] .modal-body {
    background: #1e1a28;
    color: #a8a0b8;
}

[data-theme="dark"] .modal-footer {
    background: #1a1722;
    border-top-color: #2a2535;
}

/* Form labels */
[data-theme="dark"] label {
    color: #e8e2f0;
}

[data-theme="dark"] .form-label {
    color: #e8e2f0;
}

[data-theme="dark"] .form-text,
[data-theme="dark"] .help-text {
    color: #a8a0b8;
}

/* Badges */
[data-theme="dark"] .badge {
    background: #231f30;
    color: #a8a0b8;
}

[data-theme="dark"] .badge-success {
    background: #1a2822;
    color: #34d399;
}

[data-theme="dark"] .badge-warning {
    background: #2a2215;
    color: #fbbf24;
}

[data-theme="dark"] .badge-danger {
    background: #2a1a1e;
    color: #f87171;
}

/* Progress circles and bars */
[data-theme="dark"] .progress-circle-bg,
[data-theme="dark"] .progress-bg {
    background: #2a2535 !important;
}

[data-theme="dark"] .progress-text {
    color: #e8e2f0;
}

/* Info boxes */
[data-theme="dark"] .info-box,
[data-theme="dark"] .tip-box {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

[data-theme="dark"] .info-box h4,
[data-theme="dark"] .tip-box h4 {
    color: #e8e2f0;
}

[data-theme="dark"] .info-box p,
[data-theme="dark"] .tip-box p {
    color: #a8a0b8;
}

/* Lists */
[data-theme="dark"] .list-item {
    background: #1e1a28;
    border-color: #2a2535;
}

[data-theme="dark"] .list-item:hover {
    background: #231f30;
}

/* Calendar/schedule */
[data-theme="dark"] .calendar,
[data-theme="dark"] .schedule {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

[data-theme="dark"] .calendar-day,
[data-theme="dark"] .schedule-slot {
    background: #16131e;
    border-color: #2a2535;
    color: #a8a0b8;
}

[data-theme="dark"] .calendar-day:hover,
[data-theme="dark"] .schedule-slot:hover {
    background: #231f30;
}

/* Student/child progress */
[data-theme="dark"] .progress-summary,
[data-theme="dark"] .learning-progress {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

/* Generic white backgrounds */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background-color:#fff"] {
    background: #1e1a28 !important;
}

/* Secondary buttons in dark mode */
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-outline {
    background: transparent;
    border-color: #2a2535;
    color: #a8a0b8;
}

[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn-outline:hover {
    background: #231f30;
    border-color: #a78bfa;
    color: #e8e2f0;
}

/* Ghost buttons */
[data-theme="dark"] .btn-ghost {
    background: transparent;
    color: #a8a0b8;
}

[data-theme="dark"] .btn-ghost:hover {
    background: #231f30;
    color: #e8e2f0;
}

/* Tooltips */
[data-theme="dark"] .tooltip {
    background: #231f30;
    color: #e8e2f0;
    border-color: #2a2535;
}

/* Dividers */
[data-theme="dark"] .divider,
[data-theme="dark"] hr {
    border-color: #2a2535;
    background: #2a2535;
}

/* Code blocks */
[data-theme="dark"] code,
[data-theme="dark"] pre {
    background: #16131e;
    color: #e8e2f0;
}

/* Scrollbars */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #13111a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #2a2535;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3a3545;
}


/* ================================================
   ADMIN DASHBOARD - COMPREHENSIVE DARK MODE
   Stats tiles, gauges, tables, modals, tiers
   ================================================ */

/* Stat cards with chart gauges */
[data-theme="dark"] .stat-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
    border-top-color: inherit !important;
}

[data-theme="dark"] .stat-card .stat-label {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .stat-card .stat-value {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .stat-card .stat-icon {
    opacity: 0.9;
}

[data-theme="dark"] .stat-card .stat-change.positive {
    color: #34d399 !important;
}

[data-theme="dark"] .stat-card .stat-change.negative {
    color: #f87171 !important;
}

[data-theme="dark"] .stat-card-text {
    color: #e8e2f0;
}

/* Chart.js canvas in stat cards */
[data-theme="dark"] .stat-card-chart canvas {
    filter: brightness(0.9) saturate(1.1);
}

/* Data tables */
[data-theme="dark"] .data-table {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .table-header {
    background: #1e1a28;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .table-header h2,
[data-theme="dark"] .table-header h3 {
    color: #e8e2f0;
}

[data-theme="dark"] .search-box {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .search-box::placeholder {
    color: #6b6080;
}

[data-theme="dark"] thead {
    background-color: #1a1722 !important;
}

[data-theme="dark"] th {
    background: #1a1722 !important;
    color: #a8a0b8 !important;
    border-color: #2a2535;
}

[data-theme="dark"] th.sortable:hover {
    background-color: #231f30 !important;
}

[data-theme="dark"] td {
    border-top-color: #2a2535 !important;
    color: #a8a0b8;
}

[data-theme="dark"] tbody tr:hover {
    background-color: #231f30 !important;
}

/* Filter bar */
[data-theme="dark"] .filter-bar {
    background: #1a1722 !important;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .filter-group label {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .filter-group select,
[data-theme="dark"] .filter-group input[type="date"] {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .filter-reset {
    background: transparent;
    border-color: #2a2535;
    color: #a8a0b8;
}

[data-theme="dark"] .filter-reset:hover {
    background: #231f30;
    border-color: #3a3545;
    color: #e8e2f0;
}

/* Date range buttons */
[data-theme="dark"] .date-range-btn {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .date-range-btn.active {
    background: #a78bfa !important;
    border-color: #a78bfa !important;
    color: #13111a !important;
}

[data-theme="dark"] .date-range-btn:hover:not(.active) {
    background: #231f30 !important;
    border-color: #3a3545 !important;
    color: #e8e2f0 !important;
}

/* Badges - role types */
[data-theme="dark"] .badge {
    opacity: 0.95;
}

[data-theme="dark"] .badge.active {
    background-color: #1a2822 !important;
    color: #34d399 !important;
}

[data-theme="dark"] .badge.inactive {
    background-color: #2a1a1e !important;
    color: #f87171 !important;
}

[data-theme="dark"] .badge.trial {
    background-color: #2a2215 !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .badge.parent {
    background-color: #1a2332 !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .badge.teacher {
    background-color: #1e1a38 !important;
    color: #a78bfa !important;
}

[data-theme="dark"] .badge.school {
    background-color: #231a38 !important;
    color: #c084fc !important;
}

[data-theme="dark"] .badge.student {
    background-color: #1a2822 !important;
    color: #34d399 !important;
}

[data-theme="dark"] .badge.admin {
    background-color: #2a1a1e !important;
    color: #f87171 !important;
}

[data-theme="dark"] .badge.children-count,
[data-theme="dark"] .badge.children-ok {
    background-color: #1a2822 !important;
    color: #34d399 !important;
}

[data-theme="dark"] .badge.children-full {
    background-color: #2a2215 !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .badge.children-over {
    background-color: #2a1a1e !important;
    color: #f87171 !important;
}

/* Button secondary/ghost in dark mode */
[data-theme="dark"] .btn-secondary {
    background: linear-gradient(135deg, #1e1a28 0%, #231f30 100%) !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: linear-gradient(135deg, #231f30 0%, #2a2535 100%) !important;
    border-color: #3a3545 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .btn-ghost {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .btn-ghost:hover {
    background: #231f30 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .btn-outline-primary {
    background: transparent !important;
    color: #a78bfa !important;
    border-color: #a78bfa !important;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: rgba(167, 139, 250, 0.15) !important;
}

/* Toast notifications */
[data-theme="dark"] .toast {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .toast.success {
    background-color: #1a2822 !important;
    color: #34d399 !important;
}

[data-theme="dark"] .toast.error {
    background-color: #2a1a1e !important;
    color: #f87171 !important;
}

[data-theme="dark"] .toast.warning {
    background-color: #2a2215 !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .toast.info {
    background-color: #1a2332 !important;
    color: #60a5fa !important;
}

/* Confirm modals */
[data-theme="dark"] .confirm-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] .confirm-header {
    background: #1a1722 !important;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .confirm-header.danger {
    background: #2a1a1e !important;
}

[data-theme="dark"] .confirm-header.warning {
    background: #2a2215 !important;
}

[data-theme="dark"] .confirm-header.info {
    background: #1a2332 !important;
}

[data-theme="dark"] .confirm-title {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .confirm-body {
    color: #a8a0b8 !important;
    background: #1e1a28;
}

[data-theme="dark"] .confirm-footer {
    border-top-color: #2a2535 !important;
    background: #1a1722;
}

[data-theme="dark"] .confirm-btn-cancel {
    background: linear-gradient(135deg, #1e1a28 0%, #231f30 100%) !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .confirm-btn-cancel:hover {
    background: linear-gradient(135deg, #231f30 0%, #2a2535 100%) !important;
    border-color: #3a3545 !important;
    color: #e8e2f0 !important;
}

/* Generic modals with inline styles */
[data-theme="dark"] .modal-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] .modal-header {
    background: #1a1722 !important;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .modal-header h2,
[data-theme="dark"] .modal-header h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .modal-body,
[data-theme="dark"] [class*="modal"] form {
    background: #1e1a28;
    color: #a8a0b8;
}

[data-theme="dark"] .modal .close,
[data-theme="dark"] [class*="Modal"] .close {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .modal .close:hover,
[data-theme="dark"] [class*="Modal"] .close:hover {
    color: #e8e2f0 !important;
}

/* Form groups in modals */
[data-theme="dark"] .form-group label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Health grid and cards */
[data-theme="dark"] .health-grid {
    background: transparent;
}

[data-theme="dark"] .health-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .health-card h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .health-metrics {
    background: transparent;
}

[data-theme="dark"] .health-metric {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .health-metric-label {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .health-metric-value {
    color: #e8e2f0 !important;
}

/* Quick health bar */
[data-theme="dark"] .quick-health-bar {
    background: #1e1a28;
}

[data-theme="dark"] .quick-health-item {
    color: #a8a0b8;
}

/* Empty and loading states */
[data-theme="dark"] .empty-state {
    color: #6b6080 !important;
}

[data-theme="dark"] .loading {
    color: #6b6080 !important;
}

/* Pagination */
[data-theme="dark"] .pagination-info {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .pagination-controls {
    border-top-color: #2a2535 !important;
}

/* Accounting tabs */
[data-theme="dark"] .accounting-tabs {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .accounting-subtab {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .accounting-subtab.active {
    color: #a78bfa !important;
    border-bottom-color: #a78bfa !important;
}

[data-theme="dark"] .accounting-content {
    background: transparent;
}

/* Re-engagement tier stats - override inline styles */
[data-theme="dark"] #reengagementStats > div {
    background: #1e1a28 !important;
    border-radius: 8px;
    padding: 1rem;
}

[data-theme="dark"] #reengagementStats [style*="color: #c2410c"],
[data-theme="dark"] #reengagementStats [style*="color: #9a3412"] {
    color: #fb923c !important;
}

[data-theme="dark"] #reengagementStats [style*="color: #16a34a"],
[data-theme="dark"] #reengagementStats [style*="color: #15803d"] {
    color: #34d399 !important;
}

[data-theme="dark"] #reengagementStats [style*="color: #7c3aed"],
[data-theme="dark"] #reengagementStats [style*="color: #6d28d9"] {
    color: #a78bfa !important;
}

[data-theme="dark"] #reengagementStats [style*="color: #475569"],
[data-theme="dark"] #reengagementStats [style*="color: #334155"] {
    color: #a8a0b8 !important;
}

/* Referral admin stats - override inline styles */
[data-theme="dark"] #referralAdminStats > div {
    background: #1e1a28 !important;
    border-radius: 8px;
    padding: 1rem;
}

[data-theme="dark"] #referralAdminStats [style*="color:"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #referralAdminStats [style*="font-size: 0.8rem"] {
    color: #a8a0b8 !important;
}

/* Referral section headers */
[data-theme="dark"] #referrals h3 {
    color: #e8e2f0 !important;
}

/* User profile modal content */
[data-theme="dark"] #viewUserModal .modal-content,
[data-theme="dark"] #editSubscriptionModal .modal-content,
[data-theme="dark"] #grantSubscriptionModal .modal-content,
[data-theme="dark"] #passwordModal .modal-content,
[data-theme="dark"] #addUserModal .modal-content,
[data-theme="dark"] #editQuestionModal .modal-content,
[data-theme="dark"] #adminChangePasswordModal .modal-content {
    background: #1e1a28 !important;
}

/* Error and success messages in modals */
[data-theme="dark"] .error-message {
    background: #2a1a1e !important;
    color: #f87171 !important;
}

[data-theme="dark"] .success-message {
    background: #1a2822 !important;
    color: #34d399 !important;
}

/* Inline styled divs with white/light backgrounds */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background-color: white"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background-color: #fff"] {
    background: #1e1a28 !important;
}

/* Inline styled borders */
[data-theme="dark"] [style*="border-bottom: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border-top: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #e2e8f0"] {
    border-color: #2a2535 !important;
}

/* Inline styled text colors */
[data-theme="dark"] [style*="color: #1e293b"],
[data-theme="dark"] [style*="color:#1e293b"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #475569"],
[data-theme="dark"] [style*="color:#475569"] {
    color: #a8a0b8 !important;
}

/* Close button in modals */
[data-theme="dark"] [style*="cursor: pointer"][style*="color: #64748b"] {
    color: #a8a0b8 !important;
}

/* Welcome section */
[data-theme="dark"] .welcome-section h1 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .welcome-section p {
    color: #a8a0b8 !important;
}

/* Admin badge in header */
[data-theme="dark"] .admin-badge {
    background-color: #f87171 !important;
}


/* ================================================
   ADMIN DASHBOARD - SPECIFIC SECTION FIXES
   View User, Pricing, Accounting, Modals
   ================================================ */

/* Pricing Formula Info Box */
[data-theme="dark"] #pricing [style*="background: #f0f9ff"],
[data-theme="dark"] [style*="background: #f0f9ff"] {
    background: #1a2332 !important;
    border-color: #2563eb !important;
}

[data-theme="dark"] #pricing [style*="color: #0369a1"],
[data-theme="dark"] [style*="color: #0369a1"] {
    color: #60a5fa !important;
}

[data-theme="dark"] #pricing [style*="color: #0c4a6e"],
[data-theme="dark"] [style*="color: #0c4a6e"] {
    color: #93c5fd !important;
}

/* Edit Pricing Modal */
[data-theme="dark"] #editPricingModal > div {
    background: #1e1a28 !important;
}

[data-theme="dark"] #editPricingModal h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editPricingModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editPricingModal input,
[data-theme="dark"] #editPricingModal textarea,
[data-theme="dark"] #editPricingModal select {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editPricingModal input::placeholder,
[data-theme="dark"] #editPricingModal textarea::placeholder {
    color: #6b6080 !important;
}

/* Price Preview section */
[data-theme="dark"] #pricePreview {
    background: #1a1722 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] #pricePreview strong {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #pricePreviewContent {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #editPricingModal button[type="button"] {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #editPricingModal button[type="button"]:hover {
    background: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* View User Modal */
[data-theme="dark"] #viewUserModal .modal-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] #viewUserModal .modal-header {
    background: #1a1722 !important;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] #viewUserModal h3,
[data-theme="dark"] #viewUserTitle {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #viewUserContent {
    background: #1e1a28 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #viewUserContent div {
    color: inherit;
}

[data-theme="dark"] #viewUserContent strong,
[data-theme="dark"] #viewUserContent h4,
[data-theme="dark"] #viewUserContent label {
    color: #e8e2f0 !important;
}

/* Admin Change Password Modal */
[data-theme="dark"] #adminChangePasswordModal .modal-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] #adminChangePasswordModal .modal-header {
    background: #1a1722 !important;
}

[data-theme="dark"] #adminChangePasswordModal form {
    background: #1e1a28 !important;
}

[data-theme="dark"] #adminChangePasswordModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #adminChangePasswordModal input {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #adminChangePasswordModal button[style*="background: white"],
[data-theme="dark"] #adminChangePasswordModal button[style*="border: 1px solid #d1d5db"] {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

/* Delete User Modal */
[data-theme="dark"] #deleteUserModal > div {
    background: #1e1a28 !important;
}

[data-theme="dark"] #deleteUserModal [style*="background: #fef2f2"] {
    background: #2a1a1e !important;
}

[data-theme="dark"] #deleteUserModal [style*="border: 1px solid #fecaca"] {
    border-color: #5c2a2a !important;
}

[data-theme="dark"] #deleteUserModal h3 {
    color: #f87171 !important;
}

[data-theme="dark"] #deleteUserModal p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #deleteUserModal [style*="color: #991b1b"] {
    color: #f87171 !important;
}

[data-theme="dark"] #deleteUserModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #deleteUserModal input,
[data-theme="dark"] #deleteUserModal textarea {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #deleteUserModal input[style*="border: 2px solid #fecaca"] {
    border-color: #5c2a2a !important;
}

[data-theme="dark"] #deleteUserName {
    color: #e8e2f0 !important;
}

/* Accounting Summary Cards - Quick Stats */
[data-theme="dark"] #accountingQuickSummary > div,
[data-theme="dark"] #accountingSummaryCards > div {
    border: 1px solid #2a2535;
}

/* Income card (green) */
[data-theme="dark"] #accountingQuickSummary [style*="background: #f0fdf4"],
[data-theme="dark"] #accountingSummaryCards [style*="background: #f0fdf4"] {
    background: #1a2822 !important;
}

[data-theme="dark"] #accountingQuickSummary [style*="color: #15803d"],
[data-theme="dark"] #accountingSummaryCards [style*="color: #15803d"] {
    color: #4ade80 !important;
}

[data-theme="dark"] #accountingQuickSummary [style*="color: #16a34a"],
[data-theme="dark"] #accountingSummaryCards [style*="color: #16a34a"],
[data-theme="dark"] #quickIncome,
[data-theme="dark"] #summaryTotalIncome {
    color: #34d399 !important;
}

/* Expenses card (red) */
[data-theme="dark"] #accountingQuickSummary [style*="background: #fef2f2"],
[data-theme="dark"] #accountingSummaryCards [style*="background: #fef2f2"] {
    background: #2a1a1e !important;
}

[data-theme="dark"] #accountingQuickSummary [style*="color: #b91c1c"],
[data-theme="dark"] #accountingSummaryCards [style*="color: #b91c1c"] {
    color: #fca5a5 !important;
}

[data-theme="dark"] #accountingQuickSummary [style*="color: #dc2626"],
[data-theme="dark"] #accountingSummaryCards [style*="color: #dc2626"],
[data-theme="dark"] #quickExpenses,
[data-theme="dark"] #summaryTotalExpenses {
    color: #f87171 !important;
}

/* Deductible card (blue) */
[data-theme="dark"] #accountingQuickSummary [style*="background: #f0f9ff"],
[data-theme="dark"] #accountingSummaryCards [style*="background: #f0f9ff"] {
    background: #1a2332 !important;
}

[data-theme="dark"] #accountingQuickSummary [style*="color: #0284c7"],
[data-theme="dark"] #accountingSummaryCards [style*="color: #0284c7"],
[data-theme="dark"] #quickDeductible,
[data-theme="dark"] #summaryDeductible {
    color: #38bdf8 !important;
}

/* Profit/Loss card (purple) */
[data-theme="dark"] #accountingQuickSummary [style*="background: #f5f3ff"],
[data-theme="dark"] #accountingSummaryCards [style*="background: #f5f3ff"],
[data-theme="dark"] #quickProfitCard,
[data-theme="dark"] #profitLossCard {
    background: #231a38 !important;
}

[data-theme="dark"] #accountingQuickSummary [style*="color: #6d28d9"],
[data-theme="dark"] #accountingSummaryCards [style*="color: #6d28d9"] {
    color: #c4b5fd !important;
}

[data-theme="dark"] #accountingQuickSummary [style*="color: #7c3aed"],
[data-theme="dark"] #accountingSummaryCards [style*="color: #7c3aed"],
[data-theme="dark"] #quickNetProfit,
[data-theme="dark"] #summaryNetProfit {
    color: #a78bfa !important;
}

/* Accounting subtabs */
[data-theme="dark"] .accounting-subtab {
    color: #a8a0b8 !important;
    background: transparent !important;
}

[data-theme="dark"] .accounting-subtab.active {
    color: #a78bfa !important;
    border-bottom-color: #a78bfa !important;
}

[data-theme="dark"] .accounting-subtab:hover:not(.active) {
    color: #e8e2f0 !important;
}

/* Reports sub-tab select and label */
[data-theme="dark"] #accountingReports label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #accountingReports select {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Category breakdown in reports */
[data-theme="dark"] #accountingReports h3 {
    color: #e8e2f0 !important;
}

/* Add User Modal */
[data-theme="dark"] #addUserModal .modal-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] #addUserModal .modal-header {
    background: #1a1722 !important;
}

[data-theme="dark"] #addUserModal h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addUserModal form {
    background: #1e1a28 !important;
}

[data-theme="dark"] #addUserModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addUserModal input,
[data-theme="dark"] #addUserModal select {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Grant Subscription Modal */
[data-theme="dark"] #grantSubscriptionModal .modal-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] #grantSubscriptionModal .modal-header {
    background: #1a1722 !important;
}

[data-theme="dark"] #grantSubscriptionModal h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #grantSubscriptionModal form {
    background: #1e1a28 !important;
}

[data-theme="dark"] #grantSubscriptionModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #grantSubscriptionModal input,
[data-theme="dark"] #grantSubscriptionModal select,
[data-theme="dark"] #grantSubscriptionModal textarea {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Edit Subscription Modal */
[data-theme="dark"] #editSubscriptionModal .modal-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] #editSubscriptionModal .modal-header {
    background: #1a1722 !important;
}

[data-theme="dark"] #editSubscriptionModal h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editSubscriptionModal form,
[data-theme="dark"] #editSubscriptionModal [style*="padding: 24px"] {
    background: #1e1a28 !important;
}

[data-theme="dark"] #editSubscriptionModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editSubscriptionModal input,
[data-theme="dark"] #editSubscriptionModal select {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Edit Question Modal */
[data-theme="dark"] #editQuestionModal .modal-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] #editQuestionModal .modal-header {
    background: #1a1722 !important;
}

[data-theme="dark"] #editQuestionModal h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editQuestionModal form {
    background: #1e1a28 !important;
}

[data-theme="dark"] #editQuestionModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editQuestionModal input,
[data-theme="dark"] #editQuestionModal select,
[data-theme="dark"] #editQuestionModal textarea {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Password Modal */
[data-theme="dark"] #passwordModal .modal-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] #passwordModal .modal-header {
    background: #1a1722 !important;
}

[data-theme="dark"] #passwordModal h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #passwordModal form {
    background: #1e1a28 !important;
}

[data-theme="dark"] #passwordModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #passwordModal input {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Expense/Income Modals */
[data-theme="dark"] #expenseModal,
[data-theme="dark"] #incomeModal,
[data-theme="dark"] #receiptModal,
[data-theme="dark"] #stripeSyncModal {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #expenseModal > div,
[data-theme="dark"] #incomeModal > div,
[data-theme="dark"] #receiptModal > div,
[data-theme="dark"] #stripeSyncModal > div {
    background: #1e1a28 !important;
}

[data-theme="dark"] #expenseModal h2,
[data-theme="dark"] #incomeModal h2,
[data-theme="dark"] #receiptModal h3,
[data-theme="dark"] #stripeSyncModal h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #expenseModal label,
[data-theme="dark"] #incomeModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #expenseModal input,
[data-theme="dark"] #expenseModal select,
[data-theme="dark"] #expenseModal textarea,
[data-theme="dark"] #incomeModal input,
[data-theme="dark"] #incomeModal select,
[data-theme="dark"] #incomeModal textarea {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Generic cancel buttons with light backgrounds */
[data-theme="dark"] button[style*="background: #f1f5f9"],
[data-theme="dark"] button[style*="background:#f1f5f9"] {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] button[style*="background: #f1f5f9"]:hover,
[data-theme="dark"] button[style*="background:#f1f5f9"]:hover {
    background: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Generic white/light background elements */
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background:#f8fafc"] {
    background: #1a1722 !important;
}

/* Text colors - slate variants */
[data-theme="dark"] [style*="color: #374151"],
[data-theme="dark"] [style*="color:#374151"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color:#334155"] {
    color: #e8e2f0 !important;
}

/* Border colors */
[data-theme="dark"] [style*="border: 1px solid #d1d5db"],
[data-theme="dark"] [style*="border:1px solid #d1d5db"],
[data-theme="dark"] [style*="border: 2px solid #e2e8f0"],
[data-theme="dark"] [style*="border:2px solid #e2e8f0"] {
    border-color: #2a2535 !important;
}

/* Force Reset Modal */
[data-theme="dark"] #forceResetModal .confirm-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] #forceResetModal .confirm-body {
    background: #1e1a28 !important;
}

[data-theme="dark"] #forceResetModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #forceResetModal input,
[data-theme="dark"] #forceResetModal textarea {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #forceResetModal p {
    color: #a8a0b8 !important;
}

/* Lock Account Modal */
[data-theme="dark"] #lockAccountModal .confirm-content {
    background: #1e1a28 !important;
}

[data-theme="dark"] #lockAccountModal .confirm-body {
    background: #1e1a28 !important;
}

[data-theme="dark"] #lockAccountModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #lockAccountModal input,
[data-theme="dark"] #lockAccountModal select,
[data-theme="dark"] #lockAccountModal textarea {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #lockAccountModal p {
    color: #a8a0b8 !important;
}

/* ================================================
   COMPREHENSIVE DARK MODE - ALL INTERNAL PAGES
   Covers: Auth flows, Assessments, Learning,
   Dashboards, Admin, Profile, Onboarding
   ================================================ */

/* === GLOBAL BODY & CONTAINERS === */

/* Override light gradient backgrounds on body */
[data-theme="dark"] body {
    background: #13111a !important;
    color: #e8e2f0 !important;
}

/* Generic white containers (internal pages only, NOT .section > .container on public pages) */
[data-theme="dark"] body > .container,
[data-theme="dark"] .main-content > .container,
[data-theme="dark"] .dashboard-content > .container,
[data-theme="dark"] .profile-container,
[data-theme="dark"] .welcome-card,
[data-theme="dark"] .result-card,
[data-theme="dark"] .form-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}
/* Public page sections: container is transparent (section bg handles colour) */
[data-theme="dark"] .section > .container {
    background: transparent !important;
}

/* === AUTH FLOW PAGES === */
/* verify-email, resend-verification, reset-password, forgot-password, force-change-password */

[data-theme="dark"] .reason-box {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: #f59e0b !important;
}

[data-theme="dark"] .reason-box .label {
    color: #fbbf24 !important;
}

[data-theme="dark"] .reason-box .reason-text {
    color: #fcd34d !important;
}

[data-theme="dark"] .requirements {
    background: #1a1722 !important;
}

[data-theme="dark"] .requirements h4,
[data-theme="dark"] .requirements ul,
[data-theme="dark"] .requirements li {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .requirements li.valid {
    color: #6ee7b7 !important;
}

[data-theme="dark"] .requirements li.invalid {
    color: #71717a !important;
}

[data-theme="dark"] .password-strength {
    background: #2a2535 !important;
}

[data-theme="dark"] .info-box {
    background: #1a1722 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .info-box a {
    color: #60a5fa !important;
}

[data-theme="dark"] .security-note {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .back-link {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .back-link:hover {
    color: #e8e2f0 !important;
}

/* === MESSAGE BOXES === */

[data-theme="dark"] .message,
[data-theme="dark"] .message.info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .message.error,
[data-theme="dark"] .error-message {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .message.success,
[data-theme="dark"] .success-message {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .message.warning {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: #f59e0b !important;
    color: #fcd34d !important;
}

/* === FORM ELEMENTS === */

[data-theme="dark"] .form-group label,
[data-theme="dark"] label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .subtitle,
[data-theme="dark"] .description {
    color: #a8a0b8 !important;
}

[data-theme="dark"] input:disabled,
[data-theme="dark"] select:disabled,
[data-theme="dark"] textarea:disabled {
    background: #16131e !important;
    color: #71717a !important;
}

/* === SPINNERS & LOADERS === */

[data-theme="dark"] .spinner,
[data-theme="dark"] .loader,
[data-theme="dark"] .loading-spinner {
    border-color: #2a2535 !important;
    border-top-color: #3b82f6 !important;
}

[data-theme="dark"] .loading-overlay,
[data-theme="dark"] .success-overlay {
    background: rgba(19, 17, 26, 0.95) !important;
}

[data-theme="dark"] .loading-text {
    color: #a8a0b8 !important;
}

/* === ASSESSMENT PAGES === */

[data-theme="dark"] .welcome-message,
[data-theme="dark"] .question-card,
[data-theme="dark"] .subject-card,
[data-theme="dark"] .feedback-card,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .results-header,
[data-theme="dark"] .strand-results,
[data-theme="dark"] .session-stats,
[data-theme="dark"] .strand-progress {
    background: #1e1a28 !important;
    color: #e8e2f0 !important;
}

/* Strand Progress component */
[data-theme="dark"] .strand-progress-title {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .strand-dot {
    background: #2a2535 !important;
}

[data-theme="dark"] .strand-dot.complete {
    background: #10b981 !important;
}

[data-theme="dark"] .strand-dot.current {
    background: #8b5cf6 !important;
}

[data-theme="dark"] .subject-card.selected {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .progress-bar,
[data-theme="dark"] .progress-bar-container,
[data-theme="dark"] .xp-bar-container {
    background: #2a2535 !important;
}

[data-theme="dark"] .strand-badge,
[data-theme="dark"] .question-number-badge,
[data-theme="dark"] .question-badge {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .option-btn {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .option-btn:hover {
    background: #2a2535 !important;
    border-color: #3d3847 !important;
}

[data-theme="dark"] .option-btn.selected {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .option-btn.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .option-btn.incorrect {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .option-letter {
    background: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .hint-btn,
[data-theme="dark"] .hint-text,
[data-theme="dark"] .hint-box,
[data-theme="dark"] .hint-display {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: #fbbf24 !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .feedback.correct,
[data-theme="dark"] .feedback-display.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .feedback.incorrect,
[data-theme="dark"] .feedback-display.incorrect {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .feedback-box {
    background: #1e1a28 !important;
}

[data-theme="dark"] .stat-item,
[data-theme="dark"] .result-stat,
[data-theme="dark"] .recommendations,
[data-theme="dark"] .summary-card,
[data-theme="dark"] .strand-result-item,
[data-theme="dark"] .strand-item {
    background: #231f30 !important;
    color: #e8e2f0 !important;
}

/* === STUDENT ASSESSMENT RESULT === */

[data-theme="dark"] .decision-card {
    background: #1e1a28 !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .recommendation-box {
    background: #1a1722 !important;
}

[data-theme="dark"] .recommendation-box .label {
    color: #60a5fa !important;
}

[data-theme="dark"] .recommendation-box .level {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .recommendation-box .reason {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .decision-btn.decline {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .decision-btn.decline:hover {
    background: #2a2535 !important;
}

[data-theme="dark"] .notes-section label {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .decision-made h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .decision-made p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .child-message {
    background: #1a1722 !important;
}

[data-theme="dark"] .child-message h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .child-message p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .action-btn.secondary {
    background: #1e1a28 !important;
    border-color: #3b82f6 !important;
    color: #60a5fa !important;
}

/* === LESSON & LEARNING PAGES === */

[data-theme="dark"] .lesson-card,
[data-theme="dark"] .lesson-item,
[data-theme="dark"] .topic-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .lesson-item:hover,
[data-theme="dark"] .topic-card:hover {
    background: #231f30 !important;
}

[data-theme="dark"] .break-reminder-modal,
[data-theme="dark"] .lesson-complete-modal {
    background: #1e1a28 !important;
}

[data-theme="dark"] .encouragement-message {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: #fbbf24 !important;
}

[data-theme="dark"] .visual-support,
[data-theme="dark"] .number-line {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .score-display {
    background: #231f30 !important;
}

/* Practice problem states */
[data-theme="dark"] .practice-correct {
    background: rgba(16, 185, 129, 0.1) !important;
}

[data-theme="dark"] .practice-incorrect {
    background: rgba(239, 68, 68, 0.1) !important;
}

[data-theme="dark"] .practice-hint {
    background: rgba(59, 130, 246, 0.1) !important;
}

/* === LESSONS BROWSER === */

[data-theme="dark"] .subject-tabs {
    background: #1e1a28 !important;
}

[data-theme="dark"] .progress-overview {
    background: #1e1a28 !important;
}

[data-theme="dark"] .progress-circle::after {
    background: #1e1a28 !important;
}

[data-theme="dark"] .status-badge {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .status-badge.completed {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .status-badge.in-progress {
    background: rgba(251, 191, 36, 0.15) !important;
    color: #fcd34d !important;
}

/* === LEARNING JOURNEY === */

[data-theme="dark"] .sidebar {
    background: #16131e !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .sidebar-header {
    background: #1a1722 !important;
}

[data-theme="dark"] .nav-item {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .nav-item:hover {
    background: #231f30 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .nav-item.active {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .nav-item.recommended {
    background: rgba(251, 191, 36, 0.1) !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .area-subsection-header {
    background: #1a1722 !important;
}

[data-theme="dark"] .area-subsection-header:hover {
    background: #231f30 !important;
}

[data-theme="dark"] .area-subsection.active {
    background: rgba(59, 130, 246, 0.1) !important;
}

[data-theme="dark"] .welcome-screen {
    background: #1e1a28 !important;
}

/* Strength/Improvement cards */
[data-theme="dark"] .strength-card,
[data-theme="dark"] [style*="background: #dcfce7"] {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
}

[data-theme="dark"] .improvement-card,
[data-theme="dark"] [style*="background: #fef3c7"] {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: #fbbf24 !important;
}

/* === PROGRESS REPORT === */

[data-theme="dark"] .report-header {
    background: #1e1a28 !important;
}

[data-theme="dark"] .child-select {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .report-section {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .quick-stat {
    background: #231f30 !important;
}

[data-theme="dark"] .recommendation-item {
    background: #231f30 !important;
}

/* === STUDENT SESSION === */

[data-theme="dark"] .progress-section {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .question-number {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .tts-btn {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .tts-btn:hover {
    background: #2a2535 !important;
}

[data-theme="dark"] .tts-btn.speaking {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

/* === CHILD ONBOARDING === */

[data-theme="dark"] .progress-container {
    background: #1e1a28 !important;
}

[data-theme="dark"] .step-circle {
    background: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .step-circle.active {
    background: #3b82f6 !important;
    color: white !important;
}

[data-theme="dark"] .step-circle.completed {
    background: #10b981 !important;
    color: white !important;
}

[data-theme="dark"] .option-item,
[data-theme="dark"] .checkbox-card,
[data-theme="dark"] .interest-tag,
[data-theme="dark"] .sensory-card {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .option-item:hover,
[data-theme="dark"] .checkbox-card:hover,
[data-theme="dark"] .interest-tag:hover,
[data-theme="dark"] .sensory-card:hover {
    background: #2a2535 !important;
}

[data-theme="dark"] .option-item.selected,
[data-theme="dark"] .checkbox-card.selected,
[data-theme="dark"] .interest-tag.selected,
[data-theme="dark"] .sensory-card.selected {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .consent-box {
    background: rgba(14, 165, 233, 0.1) !important;
    border-color: #0ea5e9 !important;
}

[data-theme="dark"] .review-section {
    background: #231f30 !important;
}

[data-theme="dark"] .privacy-notice {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: #fbbf24 !important;
    color: #fcd34d !important;
}

/* === PROFILE PAGES === */

[data-theme="dark"] .profile-header h1 {
    color: #60a5fa !important;
}

[data-theme="dark"] .profile-header p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .curriculum-info {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: #10b981 !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .why-needed {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: #fbbf24 !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .suburb-loading .spinner {
    border-color: #2a2535 !important;
    border-top-color: #3b82f6 !important;
}

/* === MY DATA PAGE === */

[data-theme="dark"] .data-section,
[data-theme="dark"] .consent-item,
[data-theme="dark"] .request-item {
    background: #231f30 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .status-active {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .status-withdrawn,
[data-theme="dark"] .status-pending {
    background: rgba(251, 191, 36, 0.15) !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .status-completed {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .status-in-progress {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .alert-warning {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: #fbbf24 !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

/* === DASHBOARD PAGES === */

[data-theme="dark"] .welcome-section {
    background: #1e1a28 !important;
}

[data-theme="dark"] .welcome-info h1 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .welcome-info p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .xp-section {
    background: #1e1a28 !important;
}

[data-theme="dark"] .level-info h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .level-info p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .section-title {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .subject-name {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .subject-level {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .quick-action-btn {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .quick-action-btn:hover {
    background: #231f30 !important;
}

[data-theme="dark"] .quick-action-btn .label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .achievements-section {
    background: #1e1a28 !important;
}

[data-theme="dark"] .achievements-header h3 {
    color: #e8e2f0 !important;
}

/* === TEACHER DASHBOARD === */

[data-theme="dark"] .student-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .student-name {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .year-level {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .parent-info {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .access-info {
    background: #1a1722 !important;
}

[data-theme="dark"] .access-date {
    color: #60a5fa !important;
}

[data-theme="dark"] .permissions-list {
    background: #231f30 !important;
}

[data-theme="dark"] .request-form {
    background: #1e1a28 !important;
}

[data-theme="dark"] .pending-requests {
    background: #1e1a28 !important;
}

/* === SCHOOL DASHBOARD === */

[data-theme="dark"] .section-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .data-table {
    background: #1e1a28 !important;
}

[data-theme="dark"] .data-table thead {
    background: #1a1722 !important;
}

[data-theme="dark"] .data-table th {
    color: #a8a0b8 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .data-table td {
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: #231f30 !important;
}

/* === ADMIN PAGES === */

[data-theme="dark"] .admin-card,
[data-theme="dark"] .admin-section {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

/* Admin inline text colors */
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#64748b"] {
    color: #a8a0b8 !important;
}

[data-theme="dark"] [style*="color: #1f2937"],
[data-theme="dark"] [style*="color:#1f2937"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] [style*="color: #374151"],
[data-theme="dark"] [style*="color:#374151"] {
    color: #e8e2f0 !important;
}

/* Admin alert boxes with inline styles */
[data-theme="dark"] [style*="background: #fee2e2"],
[data-theme="dark"] [style*="background:#fee2e2"] {
    background: rgba(239, 68, 68, 0.1) !important;
}

[data-theme="dark"] [style*="background: #dcfce7"],
[data-theme="dark"] [style*="background:#dcfce7"] {
    background: rgba(16, 185, 129, 0.1) !important;
}

[data-theme="dark"] [style*="background: #dbeafe"],
[data-theme="dark"] [style*="background:#dbeafe"] {
    background: rgba(59, 130, 246, 0.1) !important;
}

[data-theme="dark"] [style*="background: #fef2f2"],
[data-theme="dark"] [style*="background:#fef2f2"] {
    background: rgba(239, 68, 68, 0.1) !important;
}

[data-theme="dark"] [style*="background: #f0fdf4"],
[data-theme="dark"] [style*="background:#f0fdf4"] {
    background: rgba(16, 185, 129, 0.1) !important;
}

[data-theme="dark"] [style*="background: #eff6ff"],
[data-theme="dark"] [style*="background:#eff6ff"] {
    background: rgba(59, 130, 246, 0.1) !important;
}

[data-theme="dark"] [style*="background: #fffbeb"],
[data-theme="dark"] [style*="background:#fffbeb"] {
    background: rgba(251, 191, 36, 0.1) !important;
}

/* Light backgrounds commonly used */
[data-theme="dark"] [style*="background: #f9fafb"],
[data-theme="dark"] [style*="background:#f9fafb"] {
    background: #231f30 !important;
}

[data-theme="dark"] [style*="background: #f0f9ff"],
[data-theme="dark"] [style*="background:#f0f9ff"] {
    background: #1a1722 !important;
}

/* === MODAL BACKGROUNDS (GENERIC) === */

[data-theme="dark"] .modal,
[data-theme="dark"] .modal-content {
    background: #1e1a28 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .modal-header {
    background: #1a1722 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .modal-title {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .modal-message {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .modal-btn.secondary {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .modal-btn.secondary:hover {
    background: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Password modals */
[data-theme="dark"] .password-modal .modal-content {
    background: #1e1a28 !important;
}

/* === FOOTER === */

[data-theme="dark"] .footer {
    color: #71717a !important;
    border-color: #2a2535 !important;
}

/* === CELEBRATION/SUCCESS ELEMENTS === */

[data-theme="dark"] .celebration-title {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .celebration-subtitle {
    color: #a8a0b8 !important;
}

/* === TTS BUTTONS === */

[data-theme="dark"] .tts-button {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .tts-button:hover {
    background: #2a2535 !important;
}

/* === ACCESSIBILITY MODE OVERRIDES === */
/* Ensure dark mode doesn't break high contrast/muted modes */

[data-theme="dark"] .high-contrast body {
    background: #000 !important;
    color: #fff !important;
}

[data-theme="dark"] .high-contrast .question-card {
    background: #000 !important;
    border: 2px solid #fff !important;
}

/* === TEXT THAT USES CSS VARIABLES === */

[data-theme="dark"] [style*="color: var(--text-light)"] {
    color: #a8a0b8 !important;
}

[data-theme="dark"] [style*="color: var(--text-dark)"] {
    color: #e8e2f0 !important;
}

/* ================================================
   PARENT DASHBOARD - COMPREHENSIVE DARK MODE
   Referral, Subscription, Account, Tabs, Children
   ================================================ */

/* === REFERRAL SECTION === */

[data-theme="dark"] .referral-card {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .referral-card h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .referral-card p {
    color: #a8a0b8 !important;
}

/* Referral code box - elegant dark gradient */
[data-theme="dark"] .referral-code-box {
    background: linear-gradient(135deg,
        rgba(249, 115, 22, 0.15) 0%,
        rgba(147, 51, 234, 0.2) 100%) !important;
    border: 1px solid rgba(249, 115, 22, 0.3) !important;
}

[data-theme="dark"] .referral-code-box > div:first-child {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .referral-code-display {
    color: #f8fafc !important;
    text-shadow: 0 2px 10px rgba(249, 115, 22, 0.3);
}

[data-theme="dark"] .referral-copy-btn {
    background: #f97316 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3) !important;
}

[data-theme="dark"] .referral-copy-btn:hover {
    background: #fb923c !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4) !important;
}

[data-theme="dark"] .referral-copy-btn[style*="background: #9333ea"],
[data-theme="dark"] .referral-copy-btn[style*="background:#9333ea"] {
    background: #9333ea !important;
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.3) !important;
}

[data-theme="dark"] .referral-copy-btn[style*="background: #9333ea"]:hover,
[data-theme="dark"] .referral-copy-btn[style*="background:#9333ea"]:hover {
    background: #a855f7 !important;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.4) !important;
}

/* Referral stats grid */
[data-theme="dark"] .referral-stats-grid {
    gap: 1rem;
}

[data-theme="dark"] .referral-stat {
    background: linear-gradient(145deg, #231f30 0%, #1a1722 100%) !important;
    border: 1px solid #2a2535 !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

[data-theme="dark"] .referral-stat:hover {
    border-color: rgba(249, 115, 22, 0.3) !important;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.1) !important;
}

[data-theme="dark"] .referral-stat-value {
    color: #f8fafc !important;
    font-weight: 700 !important;
}

[data-theme="dark"] .referral-stat-label {
    color: #a8a0b8 !important;
}

/* Shareable link input */
[data-theme="dark"] .referral-share-link {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .referral-share-link:focus {
    border-color: #f97316 !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1) !important;
}

/* Shareable link label */
[data-theme="dark"] #referral label,
[data-theme="dark"] .referral-card label {
    color: #a8a0b8 !important;
}

/* === SUBSCRIPTION SECTION === */

[data-theme="dark"] .subscription-card {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] .subscription-header h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .subscription-info {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .btn-manage-subscription {
    background: linear-gradient(135deg, #f97316 0%, #9333ea 100%) !important;
    color: white !important;
}

/* === ACCOUNT SECTION === */

[data-theme="dark"] #account > div > div {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #account h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #account p {
    color: #a8a0b8 !important;
}

/* === NOTIFICATION TOGGLES === */

[data-theme="dark"] .notification-toggle {
    border-color: #2a2535 !important;
}

[data-theme="dark"] .notification-toggle label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .notification-toggle .toggle-desc {
    color: #71717a !important;
}

[data-theme="dark"] .toggle-slider {
    background-color: #3d3847 !important;
}

[data-theme="dark"] input:checked + .toggle-slider {
    background-color: #f97316 !important;
}

/* === TABS NAVIGATION === */

[data-theme="dark"] .tabs {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .tab {
    color: #a8a0b8 !important;
    background: transparent !important;
}

[data-theme="dark"] .tab:hover {
    color: #e8e2f0 !important;
    background: #231f30 !important;
}

[data-theme="dark"] .tab.active {
    color: #f97316 !important;
    background: rgba(249, 115, 22, 0.1) !important;
    border-color: #f97316 !important;
}

[data-theme="dark"] .tab svg {
    opacity: 0.7;
}

[data-theme="dark"] .tab.active svg {
    opacity: 1;
}

/* === CHILD CARDS === */

[data-theme="dark"] .child-card {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] .child-card:hover {
    border-color: rgba(249, 115, 22, 0.3) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .child-name {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .child-grade {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .child-stats {
    background: #16131e !important;
    border-radius: 8px !important;
}

[data-theme="dark"] .stat-label {
    color: #71717a !important;
}

[data-theme="dark"] .stat-value {
    color: #e8e2f0 !important;
}

/* === ADD CHILD BUTTON === */

[data-theme="dark"] .add-child-btn,
[data-theme="dark"] .add-child-card {
    background: #16131e !important;
    border: 2px dashed #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .add-child-btn:hover,
[data-theme="dark"] .add-child-card:hover {
    border-color: #f97316 !important;
    color: #f97316 !important;
    background: rgba(249, 115, 22, 0.05) !important;
}

/* === PROGRESS BARS === */

[data-theme="dark"] .progress-container {
    background: #2a2535 !important;
}

[data-theme="dark"] .progress-fill {
    background: linear-gradient(90deg, #f97316 0%, #9333ea 100%) !important;
}

/* === INLINE STYLE OVERRIDES FOR PARENT DASHBOARD === */

/* White backgrounds */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"] {
    background: #1e1a28 !important;
}

/* Specific heading colors */
[data-theme="dark"] [style*="color: #1e293b"],
[data-theme="dark"] [style*="color:#1e293b"] {
    color: #e8e2f0 !important;
}

/* Secondary text colors */
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] [style*="color:#64748b"] {
    color: #a8a0b8 !important;
}

/* Label colors */
[data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color:#334155"] {
    color: #e8e2f0 !important;
}

/* Muted text */
[data-theme="dark"] [style*="color: #94a3b8"],
[data-theme="dark"] [style*="color:#94a3b8"] {
    color: #71717a !important;
}

/* === WELCOME BANNER === */

[data-theme="dark"] .welcome-banner {
    background: linear-gradient(135deg,
        rgba(249, 115, 22, 0.1) 0%,
        rgba(147, 51, 234, 0.1) 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] .welcome-banner h1 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .welcome-banner p {
    color: #a8a0b8 !important;
}

/* === ACTIVITY CARDS === */

[data-theme="dark"] .activity-card {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] .activity-card h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .activity-card p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .activity-time {
    color: #71717a !important;
}

/* === QUICK ACTIONS === */

[data-theme="dark"] .quick-action {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .quick-action:hover {
    border-color: #f97316 !important;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.15) !important;
}

[data-theme="dark"] .quick-action-icon {
    background: rgba(249, 115, 22, 0.1) !important;
    color: #f97316 !important;
}

/* === EMPTY STATES === */

[data-theme="dark"] .empty-state {
    color: #71717a !important;
}

[data-theme="dark"] .empty-state h3 {
    color: #a8a0b8 !important;
}

/* === BADGES & LABELS === */

[data-theme="dark"] .badge,
[data-theme="dark"] .label {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .badge.success {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .badge.warning {
    background: rgba(251, 191, 36, 0.15) !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .badge.danger {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .badge.info {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
}

/* === TOOLTIPS === */

[data-theme="dark"] .tooltip {
    background: #16131e !important;
    color: #e8e2f0 !important;
    border: 1px solid #2a2535 !important;
}

/* === DROPDOWNS === */

[data-theme="dark"] .dropdown-menu {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .dropdown-item {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #231f30 !important;
    color: #e8e2f0 !important;
}

/* === LIGHT MODE GRADIENT FIX === */
/* Ensure light gradient backgrounds are overridden */

[data-theme="dark"] [style*="background: linear-gradient(135deg, #fef3c7"],
[data-theme="dark"] [style*="background:linear-gradient(135deg, #fef3c7"] {
    background: linear-gradient(135deg,
        rgba(249, 115, 22, 0.15) 0%,
        rgba(147, 51, 234, 0.2) 100%) !important;
}

/* ================================================
   SUBSCRIPTION SECTION - COMPREHENSIVE DARK MODE
   Cards, Plans, Modals, Trial Notice
   ================================================ */

/* === SUBSCRIPTION CARD === */

[data-theme="dark"] .subscription-card {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .subscription-header h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .btn-manage-subscription {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    transition: all 0.3s ease !important;
}

[data-theme="dark"] .btn-manage-subscription:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* === SUBSCRIPTION INFO GRID === */

[data-theme="dark"] .subscription-info {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .info-item {
    background: linear-gradient(145deg, #231f30 0%, #1a1722 100%) !important;
    border: 1px solid #2a2535 !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
}

[data-theme="dark"] .info-item:hover {
    border-color: rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1) !important;
}

[data-theme="dark"] .info-label {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .info-value {
    color: #f8fafc !important;
}

/* === SUBSCRIPTION MODAL === */

[data-theme="dark"] #subscriptionModal .modal-content {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .modal-close {
    background: #231f30 !important;
    color: #a8a0b8 !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] .modal-close:hover {
    background: #2a2535 !important;
    color: #e8e2f0 !important;
    border-color: #3d3847 !important;
}

[data-theme="dark"] .modal-header h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .modal-header p {
    color: #a8a0b8 !important;
}

/* === PLAN CARDS === */

[data-theme="dark"] .plan-card {
    background: #1e1a28 !important;
    border: 2px solid #2a2535 !important;
    transition: all 0.3s ease !important;
}

[data-theme="dark"] .plan-card:hover {
    border-color: #f97316 !important;
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.2) !important;
    transform: translateY(-4px) !important;
}

[data-theme="dark"] .plan-card.recommended {
    background: linear-gradient(145deg,
        rgba(249, 115, 22, 0.1) 0%,
        rgba(234, 88, 12, 0.15) 100%) !important;
    border-color: #f97316 !important;
}

[data-theme="dark"] .plan-card.recommended::before {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4) !important;
}

[data-theme="dark"] .plan-card.trial-card {
    background: linear-gradient(145deg,
        rgba(16, 185, 129, 0.1) 0%,
        rgba(5, 150, 105, 0.15) 100%) !important;
    border-color: #10b981 !important;
}

[data-theme="dark"] .plan-name {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .plan-price {
    color: #fb923c !important;
}

[data-theme="dark"] .plan-price .currency {
    color: #fb923c !important;
}

[data-theme="dark"] .plan-price .period {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .plan-savings {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .plan-features {
    border-top: 1px solid #2a2535 !important;
    padding-top: 1rem !important;
}

[data-theme="dark"] .plan-features li {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .plan-features li::before {
    color: #10b981 !important;
}

[data-theme="dark"] .plan-button {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    transition: all 0.3s ease !important;
}

[data-theme="dark"] .plan-button:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-2px) !important;
}

[data-theme="dark"] .plan-button.trial-button {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .plan-button.trial-button:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%) !important;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

[data-theme="dark"] .plan-button:disabled {
    background: #2a2535 !important;
    color: #71717a !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

/* === TRIAL NOTICE === */

[data-theme="dark"] .trial-notice {
    background: rgba(251, 191, 36, 0.1) !important;
    border: 2px solid rgba(251, 191, 36, 0.3) !important;
}

[data-theme="dark"] .trial-notice-text {
    color: #fcd34d !important;
}

[data-theme="dark"] .trial-notice-text strong {
    color: #fbbf24 !important;
}

/* === ADD CHILD MODAL === */

[data-theme="dark"] #addChildModal .modal-content {
    background: #1e1a28 !important;
    border: 1px solid #2a2535 !important;
}

/* Warning/disclaimer box in modal */
[data-theme="dark"] #addChildModal [style*="background: #fef3c7"],
[data-theme="dark"] [style*="background: #fef3c7"] {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

[data-theme="dark"] #addChildModal [style*="color: #92400e"],
[data-theme="dark"] [style*="color: #92400e"] {
    color: #fbbf24 !important;
}

[data-theme="dark"] #addChildModal [style*="color: #78350f"],
[data-theme="dark"] [style*="color: #78350f"] {
    color: #fcd34d !important;
}

/* Form section headers */
[data-theme="dark"] #addChildModal h3[style*="color: #1e40af"],
[data-theme="dark"] [style*="color: #1e40af"] {
    color: #60a5fa !important;
}

[data-theme="dark"] #addChildModal [style*="border-bottom: 2px solid #e2e8f0"] {
    border-bottom-color: #2a2535 !important;
}

/* Form labels */
[data-theme="dark"] #addChildModal label[style*="color: #334155"],
[data-theme="dark"] [style*="color: #334155"] {
    color: #e8e2f0 !important;
}

/* Form inputs in modal */
[data-theme="dark"] #addChildModal input[style*="border: 2px solid #e2e8f0"],
[data-theme="dark"] #addChildModal select[style*="border: 2px solid #e2e8f0"] {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addChildModal input:focus,
[data-theme="dark"] #addChildModal select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Checkbox labels */
[data-theme="dark"] #addChildModal label[style*="cursor: pointer"] span {
    color: #a8a0b8 !important;
}

/* === CURRENT PLAN BADGE === */

[data-theme="dark"] .current-plan-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
}

/* === SUBSCRIPTION STATUS BADGES === */

[data-theme="dark"] .subscription-badge {
    background: #231f30 !important;
    color: #a8a0b8 !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] .subscription-badge.active {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .subscription-badge.trial {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .subscription-badge.expired {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* === TRIAL SUBSCRIBE BUTTON === */

[data-theme="dark"] .trial-subscribe-btn {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3) !important;
}

[data-theme="dark"] .trial-subscribe-btn:hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%) !important;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4) !important;
}

/* ================================================
   ADMIN DASHBOARD - EDIT SUBSCRIPTION MODAL
   Comprehensive dark mode with improved UI/UX
   ================================================ */

/* === EDIT SUBSCRIPTION MODAL CONTAINER === */

[data-theme="dark"] #editSubscriptionModal {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #editSubscriptionModal > div,
[data-theme="dark"] #editSubscriptionModal .modal-content {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(59, 130, 246, 0.1) !important;
}

/* === MODAL HEADER === */

[data-theme="dark"] #editSubscriptionModal .modal-header {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.1) 0%,
        rgba(147, 51, 234, 0.1) 100%) !important;
    border-bottom: 1px solid #2a2535 !important;
    padding: 20px 24px !important;
}

[data-theme="dark"] #editSubscriptionModal .modal-header h2,
[data-theme="dark"] #editSubscriptionModal h2 {
    color: #f8fafc !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] #editSubscriptionModal .close {
    color: #a8a0b8 !important;
    background: #231f30 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

[data-theme="dark"] #editSubscriptionModal .close:hover {
    color: #e8e2f0 !important;
    background: #2a2535 !important;
    transform: scale(1.05) !important;
}

/* === FORM CONTAINER === */

[data-theme="dark"] #editSubscriptionForm {
    background: transparent !important;
}

/* === USER INFO BOX === */

[data-theme="dark"] #editUserInfo {
    background: linear-gradient(145deg, #231f30 0%, #1a1722 100%) !important;
    border: 1px solid #2a2535 !important;
    border-radius: 10px !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editUserInfo strong {
    color: #f8fafc !important;
}

[data-theme="dark"] #editUserInfo span {
    color: #a8a0b8 !important;
}

/* === FORM LABELS === */

[data-theme="dark"] #editSubscriptionModal label {
    color: #e8e2f0 !important;
}

/* === FORM INPUTS & SELECTS === */

[data-theme="dark"] #editSubscriptionModal input,
[data-theme="dark"] #editSubscriptionModal select,
[data-theme="dark"] #editSubscriptionModal textarea,
[data-theme="dark"] #editStatus,
[data-theme="dark"] #editPlanType,
[data-theme="dark"] #editExtendDays,
[data-theme="dark"] #editChildren,
[data-theme="dark"] #editNotes {
    background: #16131e !important;
    border: 2px solid #2a2535 !important;
    color: #e8e2f0 !important;
    transition: all 0.2s ease !important;
}

[data-theme="dark"] #editSubscriptionModal input:focus,
[data-theme="dark"] #editSubscriptionModal select:focus,
[data-theme="dark"] #editSubscriptionModal textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    outline: none !important;
}

[data-theme="dark"] #editSubscriptionModal input:hover,
[data-theme="dark"] #editSubscriptionModal select:hover,
[data-theme="dark"] #editSubscriptionModal textarea:hover {
    border-color: #3d3847 !important;
}

/* Select options */
[data-theme="dark"] #editSubscriptionModal option {
    background: #1e1a28 !important;
    color: #e8e2f0 !important;
}

/* === HELPER TEXT === */

[data-theme="dark"] #editSubscriptionModal [style*="color: #64748b"] {
    color: #71717a !important;
}

/* === ERROR & SUCCESS MESSAGES === */

[data-theme="dark"] #editSubError {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] #editSubSuccess {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

/* === BUTTONS === */

[data-theme="dark"] #editSubscriptionModal button[type="submit"] {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
    transition: all 0.3s ease !important;
}

[data-theme="dark"] #editSubscriptionModal button[type="submit"]:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-2px) !important;
}

[data-theme="dark"] #editSubscriptionModal button[onclick*="cancelSubscription"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important;
    transition: all 0.3s ease !important;
}

[data-theme="dark"] #editSubscriptionModal button[onclick*="cancelSubscription"]:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%) !important;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-2px) !important;
}

/* === RE-ENGAGEMENT STATS CARDS (ADMIN) === */

[data-theme="dark"] #reengagementStats > div {
    border: 1px solid #2a2535 !important;
}

/* Tier 1 - Orange */
[data-theme="dark"] #reengagementStats > div[style*="background: #fff7ed"],
[data-theme="dark"] [style*="background: #fff7ed"] {
    background: rgba(249, 115, 22, 0.1) !important;
    border-color: rgba(249, 115, 22, 0.2) !important;
}

[data-theme="dark"] [style*="color: #c2410c"] {
    color: #fb923c !important;
}

[data-theme="dark"] [style*="color: #9a3412"] {
    color: #fdba74 !important;
}

/* Tier 2 - Green */
[data-theme="dark"] #reengagementStats > div[style*="background: #f0fdf4"],
[data-theme="dark"] [style*="background: #f0fdf4"] {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

[data-theme="dark"] [style*="color: #16a34a"] {
    color: #34d399 !important;
}

[data-theme="dark"] [style*="color: #15803d"] {
    color: #6ee7b7 !important;
}

/* Tier 3 - Purple */
[data-theme="dark"] #reengagementStats > div[style*="background: #f5f3ff"],
[data-theme="dark"] [style*="background: #f5f3ff"] {
    background: rgba(139, 92, 246, 0.1) !important;
    border-color: rgba(139, 92, 246, 0.2) !important;
}

[data-theme="dark"] [style*="color: #7c3aed"] {
    color: #a78bfa !important;
}

/* === GRANT SUBSCRIPTION MODAL === */

[data-theme="dark"] #grantSubscriptionModal > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #grantSubscriptionModal .modal-header {
    background: linear-gradient(135deg,
        rgba(16, 185, 129, 0.1) 0%,
        rgba(5, 150, 105, 0.1) 100%) !important;
    border-bottom: 1px solid #2a2535 !important;
}

[data-theme="dark"] #grantSubscriptionModal h2 {
    color: #f8fafc !important;
}

[data-theme="dark"] #grantSubscriptionModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #grantSubscriptionModal input,
[data-theme="dark"] #grantSubscriptionModal select,
[data-theme="dark"] #grantSubscriptionModal textarea {
    background: #16131e !important;
    border: 2px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #grantSubscriptionModal input:focus,
[data-theme="dark"] #grantSubscriptionModal select:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* === VIEW USER MODAL IMPROVEMENTS === */

[data-theme="dark"] #viewUserModal > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #viewUserModal .modal-header {
    background: linear-gradient(135deg,
        rgba(249, 115, 22, 0.1) 0%,
        rgba(147, 51, 234, 0.1) 100%) !important;
    border-bottom: 1px solid #2a2535 !important;
}

/* View User sections */
[data-theme="dark"] #viewUserModal [style*="background: #f8fafc"],
[data-theme="dark"] #viewUserModal [style*="background:#f8fafc"] {
    background: #231f30 !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #viewUserModal h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #viewUserModal strong {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #viewUserModal span {
    color: #e8e2f0 !important;
}

/* === EDIT PRICING MODAL IMPROVEMENTS === */

[data-theme="dark"] #editPricingModal > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #editPricingModal .modal-header {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.1) 0%,
        rgba(99, 102, 241, 0.1) 100%) !important;
    border-bottom: 1px solid #2a2535 !important;
}

/* Price Preview Section */
[data-theme="dark"] #pricePreview {
    background: linear-gradient(145deg, #231f30 0%, #1a1722 100%) !important;
    border: 2px solid #2a2535 !important;
    border-radius: 12px !important;
}

[data-theme="dark"] #pricePreview h4 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #pricePreview span {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #pricePreview strong {
    color: #fb923c !important;
}

/* Pricing formula info */
[data-theme="dark"] #editPricingModal [style*="background: #f0f9ff"],
[data-theme="dark"] [style*="background: #f0f9ff"] {
    background: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] #editPricingModal [style*="color: #1e40af"] {
    color: #93c5fd !important;
}

/* ================================================
   ADMIN DASHBOARD - ALL MODALS DARK MODE
   Comprehensive coverage for all 16 modals
   ================================================ */

/* === CONFIRM MODAL (Generic Confirmation) === */

[data-theme="dark"] .confirm-modal {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .confirm-content {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .confirm-header {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.1) 0%,
        rgba(99, 102, 241, 0.1) 100%) !important;
    border-bottom: 1px solid #2a2535 !important;
}

[data-theme="dark"] .confirm-header.warning {
    background: linear-gradient(135deg,
        rgba(245, 158, 11, 0.15) 0%,
        rgba(217, 119, 6, 0.1) 100%) !important;
}

[data-theme="dark"] .confirm-header.danger {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.15) 0%,
        rgba(220, 38, 38, 0.1) 100%) !important;
}

[data-theme="dark"] .confirm-title {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .confirm-body {
    background: transparent !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .confirm-body p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .confirm-body label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .confirm-body input,
[data-theme="dark"] .confirm-body select,
[data-theme="dark"] .confirm-body textarea {
    background: #16131e !important;
    border: 1px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .confirm-body input:focus,
[data-theme="dark"] .confirm-body select:focus,
[data-theme="dark"] .confirm-body textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

[data-theme="dark"] .confirm-footer {
    background: transparent !important;
    border-top: 1px solid #2a2535 !important;
}

[data-theme="dark"] .confirm-btn-cancel {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .confirm-btn-cancel:hover {
    background: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .confirm-btn-confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
}

[data-theme="dark"] .confirm-btn-confirm:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
}

[data-theme="dark"] .confirm-btn-confirm.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

[data-theme="dark"] .confirm-btn-confirm.warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}

[data-theme="dark"] .confirm-btn-confirm.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

[data-theme="dark"] .confirm-btn-confirm.danger:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%) !important;
}

/* === FORCE RESET MODAL === */

[data-theme="dark"] #forceResetModal .confirm-content {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
}

[data-theme="dark"] #forceResetModal label[style*="color: #334155"] {
    color: #e8e2f0 !important;
}

/* === LOCK ACCOUNT MODAL === */

[data-theme="dark"] #lockAccountModal .confirm-content {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
}

[data-theme="dark"] #lockAccountModal [style*="background: #fef3c7"] {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
}

[data-theme="dark"] #lockAccountModal [style*="color: #92400e"] {
    color: #fbbf24 !important;
}

[data-theme="dark"] #lockAccountModal span {
    color: #a8a0b8 !important;
}

/* === EXPENSE MODAL === */

[data-theme="dark"] #expenseModal {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #expenseModal > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #expenseModal h2,
[data-theme="dark"] #expenseModalTitle {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #expenseModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #expenseModal span {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #expenseModal input,
[data-theme="dark"] #expenseModal select,
[data-theme="dark"] #expenseModal textarea {
    background: #16131e !important;
    border: 2px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #expenseModal input:focus,
[data-theme="dark"] #expenseModal select:focus,
[data-theme="dark"] #expenseModal textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

/* === INCOME MODAL === */

[data-theme="dark"] #incomeModal {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #incomeModal > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #incomeModal h2,
[data-theme="dark"] #incomeModalTitle {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #incomeModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #incomeModal input,
[data-theme="dark"] #incomeModal select,
[data-theme="dark"] #incomeModal textarea {
    background: #16131e !important;
    border: 2px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #incomeModal input:focus,
[data-theme="dark"] #incomeModal select:focus,
[data-theme="dark"] #incomeModal textarea:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* === RECEIPT MODAL === */

[data-theme="dark"] #receiptModal {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #receiptModal > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #receiptModal h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #receiptModal [style*="border: 2px dashed"] {
    border-color: #2a2535 !important;
    background: #16131e !important;
}

[data-theme="dark"] #receiptFileName {
    color: #71717a !important;
}

/* === STRIPE SYNC MODAL === */

[data-theme="dark"] #stripeSyncModal {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #stripeSyncModal > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] #stripeSyncModal h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #stripeSyncModal p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #stripeSyncModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #stripeSyncModal input {
    background: #16131e !important;
    border: 2px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #stripeSyncResult {
    background: #231f30 !important;
    border: 1px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

/* === PASSWORD MODAL === */

[data-theme="dark"] #passwordModal .modal-content {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #passwordModal .modal-header {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.1) 0%,
        rgba(99, 102, 241, 0.1) 100%) !important;
    border-bottom: 1px solid #2a2535 !important;
}

[data-theme="dark"] #passwordModal h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #passwordModal .close,
[data-theme="dark"] #closePasswordModal {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #passwordModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #passwordModal input {
    background: #16131e !important;
    border: 2px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #passwordError {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] #passwordSuccess {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: #6ee7b7 !important;
}

/* === ADD USER MODAL === */

[data-theme="dark"] #addUserModal .modal-content {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #addUserModal .modal-header {
    background: linear-gradient(135deg,
        rgba(59, 130, 246, 0.1) 0%,
        rgba(99, 102, 241, 0.1) 100%) !important;
    border-bottom: 1px solid #2a2535 !important;
}

[data-theme="dark"] #addUserModal h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addUserModal label[style*="color: #374151"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addUserModal small {
    color: #71717a !important;
}

[data-theme="dark"] #addUserModal span {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #addUserModal input,
[data-theme="dark"] #addUserModal select {
    background: #16131e !important;
    border: 1px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addUserModal button[type="button"][onclick*="close"] {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #addUserModal button[type="submit"] {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

/* === EDIT QUESTION MODAL === */

[data-theme="dark"] #editQuestionModal .modal-content {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #editQuestionModal .modal-header {
    background: linear-gradient(135deg,
        rgba(147, 51, 234, 0.1) 0%,
        rgba(124, 58, 237, 0.1) 100%) !important;
    border-bottom: 1px solid #2a2535 !important;
}

[data-theme="dark"] #editQuestionModal h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editQuestionModal label[style*="color: #374151"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editQuestionModal input,
[data-theme="dark"] #editQuestionModal select,
[data-theme="dark"] #editQuestionModal textarea {
    background: #16131e !important;
    border: 1px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #editQuestionModal button[onclick*="close"] {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #editQuestionModal button[type="submit"] {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
}

/* === VIEW USER MODAL (Extended) === */

[data-theme="dark"] #viewUserModal .modal-content {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #viewUserModal h3,
[data-theme="dark"] #viewUserTitle {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #viewUserContent {
    color: #c4bdd4 !important;
}

/* View User Modal: section cards, labels, values, tables, auth badges */

.vu-section {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
}

.vu-section-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.vu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.vu-label {
    font-size: 12px;
    color: #64748b;
    display: block;
    margin-bottom: 2px;
}

.vu-value {
    font-weight: 500;
    color: #1e293b;
}

.vu-muted {
    color: #64748b;
}

.vu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.vu-table th {
    text-align: left;
    padding: 8px 4px;
    font-weight: 500;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.vu-table td {
    padding: 8px 4px;
    border-bottom: 1px solid #e2e8f0;
}

.vu-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Auth method badges */
.vu-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
}

.vu-auth-google {
    background: #f8f9fa;
    border: 1px solid #dadce0;
    color: #3c4043;
}

.vu-auth-email {
    background: #64748b;
    color: #fff;
}

/* Dark mode overrides */
[data-theme="dark"] .vu-section {
    background: rgba(42, 37, 53, 0.5) !important;
    border: 1px solid #2a2535;
}

[data-theme="dark"] .vu-section-title {
    color: #8b83a0 !important;
}

[data-theme="dark"] .vu-label {
    color: #8b83a0 !important;
}

[data-theme="dark"] .vu-value {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .vu-muted {
    color: #8b83a0 !important;
}

[data-theme="dark"] .vu-table th {
    color: #8b83a0 !important;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .vu-table td {
    color: #c4bdd4 !important;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .vu-actions {
    border-top-color: #2a2535 !important;
}

[data-theme="dark"] .vu-auth-google {
    background: rgba(66, 133, 244, 0.12) !important;
    border-color: rgba(66, 133, 244, 0.3) !important;
    color: #93bbfc !important;
}

[data-theme="dark"] .vu-auth-email {
    background: #3d3847 !important;
    color: #c4bdd4 !important;
}

/* === ADMIN CHANGE PASSWORD MODAL === */

[data-theme="dark"] #adminChangePasswordModal .modal-content {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #adminChangePasswordModal .modal-header {
    background: linear-gradient(135deg,
        rgba(245, 158, 11, 0.1) 0%,
        rgba(217, 119, 6, 0.1) 100%) !important;
    border-bottom: 1px solid #2a2535 !important;
}

[data-theme="dark"] #adminChangePasswordModal h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #adminChangePasswordModal label[style*="color: #374151"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #adminChangePasswordModal input {
    background: #16131e !important;
    border: 1px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #adminChangePasswordModal button[onclick*="close"] {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #adminChangePasswordModal button[type="submit"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

/* === DELETE USER MODAL === */

[data-theme="dark"] #deleteUserModal {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #deleteUserModal > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5) !important;
}

/* Delete modal red header */
[data-theme="dark"] #deleteUserModal > div > div:first-child {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.2) 0%,
        rgba(220, 38, 38, 0.15) 100%) !important;
    border-bottom: 1px solid rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] #deleteUserModal h3 {
    color: #fca5a5 !important;
}

/* Warning box in delete modal */
[data-theme="dark"] #deleteUserModal [style*="background: #fef2f2"] {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] #deleteUserModal [style*="color: #991b1b"] {
    color: #fca5a5 !important;
}

[data-theme="dark"] #deleteUserModal p {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #deleteUserName {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #deleteUserModal input {
    background: #16131e !important;
    border: 1px solid #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #deleteUserModal button[onclick*="close"] {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

/* === GENERIC BUTTON IMPROVEMENTS === */

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
}

[data-theme="dark"] .btn-secondary {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .btn-outline-primary {
    background: transparent !important;
    border: 2px solid #3b82f6 !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

/* ================================================
   STUDENT DASHBOARD - Additional Styling
   ================================================ */

/* Assessment Banner - the "Take assessment" notification */
[data-theme="dark"] .assessment-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.1) 100%) !important;
    border-color: rgba(245, 158, 11, 0.4) !important;
}

[data-theme="dark"] .assessment-banner h3 {
    color: #fbbf24 !important;
}

[data-theme="dark"] .assessment-banner p {
    color: #fcd34d !important;
}

[data-theme="dark"] .assessment-banner .btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
}

[data-theme="dark"] .assessment-banner .btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}

/* Progress bar container */
[data-theme="dark"] .progress-bar-container {
    background: #2a2535 !important;
}

/* Progress label text */
[data-theme="dark"] .progress-label {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .progress-label span {
    color: #a8a0b8 !important;
}

/* XP display card (gamification.css sets background: white) */
[data-theme="dark"] .xp-display {
    background: #1e1a28 !important;
    box-shadow: none !important;
}

/* XP display amount and label */
[data-theme="dark"] .xp-display .amount {
    color: #c4b5fd !important;
}

[data-theme="dark"] .xp-display .label {
    color: #a8a0b8 !important;
}

/* XP bar container background */
[data-theme="dark"] .xp-bar-container {
    background: #2a2535 !important;
}

/* XP bar labels */
[data-theme="dark"] .xp-bar-label {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .xp-bar-label span {
    color: #a8a0b8 !important;
}

/* Locked achievement badges */
[data-theme="dark"] .achievement-badge.locked {
    background: #2a2535 !important;
    opacity: 0.6 !important;
}

/* Streak badge in student dashboard */
[data-theme="dark"] .streak-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* Subject icons background in dark mode */
[data-theme="dark"] .subject-card.maths .subject-icon {
    background: rgba(59, 130, 246, 0.2) !important;
}

[data-theme="dark"] .subject-card.english .subject-icon {
    background: rgba(34, 197, 94, 0.2) !important;
}

/* View All link */
[data-theme="dark"] .view-all-link {
    color: #93c5fd !important;
}

/* Learning path cards */
[data-theme="dark"] .path-card {
    background: #1e1a28 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .path-week-indicator {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .path-progress-info .pct {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .path-progress-info .detail {
    color: #a8a0b8 !important;
}

/* Week dots */
[data-theme="dark"] .week-dot.future {
    background: #2a2535 !important;
    color: #6b6280 !important;
}

/* Focus pills */
[data-theme="dark"] .focus-pill {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
}

/* Milestone goal */
[data-theme="dark"] .milestone-goal {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1)) !important;
}

[data-theme="dark"] .milestone-goal .text {
    color: #fbbf24 !important;
}

/* Path progress ring SVG text */
[data-theme="dark"] .path-progress-ring text {
    fill: #e8e2f0 !important;
}

/* Path progress ring track circle */
[data-theme="dark"] .path-progress-ring circle:first-of-type {
    stroke: #2a2535 !important;
}

/* ================================================
   TEACHER DASHBOARD - Additional Styling
   ================================================ */

/* Request cards in pending tab */
[data-theme="dark"] .request-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

/* Request status badges */
[data-theme="dark"] .request-status.pending {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .request-status.approved {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

[data-theme="dark"] .request-status.denied {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

/* Teacher tabs container */
[data-theme="dark"] .tabs {
    background: #1a1722 !important;
    border-color: #2a2535 !important;
}

/* Teacher tab buttons */
[data-theme="dark"] .tab {
    background: transparent !important;
    color: #a8a0b8 !important;
    border-color: transparent !important;
}

[data-theme="dark"] .tab:hover {
    background: #231f30 !important;
    color: #e8e2f0 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .tab.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    border-color: transparent !important;
}

[data-theme="dark"] .tab svg {
    stroke: currentColor !important;
}

/* Tab divider */
[data-theme="dark"] .tab-divider {
    background: #2a2535 !important;
}

/* Notification badge in tabs */
[data-theme="dark"] .notification-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
}

/* Form buttons in teacher dashboard */
[data-theme="dark"] .btn-submit {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
    color: white !important;
}

[data-theme="dark"] .btn-submit:hover {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%) !important;
}

/* Teacher dashboard form group labels */
[data-theme="dark"] .request-form label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .request-form small {
    color: #71717a !important;
}

[data-theme="dark"] .request-form h2 {
    color: #e8e2f0 !important;
}

/* Pending requests section heading */
[data-theme="dark"] .pending-requests h2 {
    color: #e8e2f0 !important;
}

/* Permission items in student cards */
[data-theme="dark"] .permission-item.enabled {
    color: #4ade80 !important;
}

[data-theme="dark"] .permission-item.disabled {
    color: #71717a !important;
}

/* Teacher Password Modal - inline styles override */
[data-theme="dark"] #passwordModal > div {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #passwordModal > div > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #passwordModal [style*="border-bottom: 1px solid #e2e8f0"] {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] #passwordModal [style*="color: #64748b"] {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #passwordModal [style*="color: #334155"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #passwordModal input[style*="border: 2px solid #e2e8f0"] {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #passwordModal [style*="background: #f1f5f9"] {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #passwordModal [style*="background: #3b82f6"] {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

/* Error and success messages in password modal */
[data-theme="dark"] #passwordError {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] #passwordSuccess {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

/* ================================================
   SCHOOL DASHBOARD - Modals
   ================================================ */

/* === ADD STUDENT MODAL === */
[data-theme="dark"] #addStudentModal > div:first-child {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #addStudentModal .modal-content,
[data-theme="dark"] #addStudentModal > div > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #addStudentModal [style*="border-bottom: 1px solid #e2e8f0"] {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] #addStudentModal h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addStudentModal .close,
[data-theme="dark"] #addStudentModal [style*="color: #64748b"] {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #addStudentModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addStudentModal input,
[data-theme="dark"] #addStudentModal select {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addStudentModal small {
    color: #71717a !important;
}

[data-theme="dark"] #addStudentModal [style*="background: #f1f5f9"],
[data-theme="dark"] #cancelAddStudent {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #addStudentModal [style*="background: #3b82f6"],
[data-theme="dark"] #submitAddStudent {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

[data-theme="dark"] #addStudentMessage {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

/* === BULK UPLOAD STUDENTS MODAL === */
[data-theme="dark"] #bulkUploadStudentsModal > div:first-child {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #bulkUploadStudentsModal .modal-content,
[data-theme="dark"] #bulkUploadStudentsModal > div > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #bulkUploadStudentsModal [style*="border-bottom: 1px solid #e2e8f0"] {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] #bulkUploadStudentsModal h2,
[data-theme="dark"] #bulkUploadStudentsModal h4 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #bulkUploadStudentsModal .close {
    color: #a8a0b8 !important;
}

/* Blue info box */
[data-theme="dark"] #bulkUploadStudentsModal [style*="background: #f0f9ff"] {
    background: rgba(59, 130, 246, 0.1) !important;
    border-left-color: #3b82f6 !important;
}

[data-theme="dark"] #bulkUploadStudentsModal [style*="color: #1e40af"] {
    color: #60a5fa !important;
}

[data-theme="dark"] #bulkUploadStudentsModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #bulkUploadStudentsModal p,
[data-theme="dark"] #bulkUploadStudentsModal small {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #bulkUploadStudentsModal input[type="file"] {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Preview box */
[data-theme="dark"] #uploadPreview {
    background: #231f30 !important;
}

[data-theme="dark"] #uploadPreview h4 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #previewText {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #cancelBulkUploadStudents {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #submitBulkUploadStudents {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

[data-theme="dark"] #downloadStudentTemplate {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

/* === ADD TEACHER MODAL === */
[data-theme="dark"] #addTeacherModal > div:first-child {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #addTeacherModal .modal-content,
[data-theme="dark"] #addTeacherModal > div > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #addTeacherModal [style*="border-bottom: 1px solid #e2e8f0"] {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] #addTeacherModal h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addTeacherModal .close,
[data-theme="dark"] #addTeacherModal [style*="color: #64748b"] {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #addTeacherModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addTeacherModal input {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #addTeacherModal small {
    color: #71717a !important;
}

[data-theme="dark"] #cancelAddTeacher {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #submitAddTeacher {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

[data-theme="dark"] #addTeacherMessage {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

/* === BULK UPLOAD TEACHERS MODAL === */
[data-theme="dark"] #bulkUploadTeachersModal > div:first-child {
    background: rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] #bulkUploadTeachersModal .modal-content,
[data-theme="dark"] #bulkUploadTeachersModal > div > div {
    background: linear-gradient(145deg, #1e1a28 0%, #16131e 100%) !important;
    border: 1px solid #2a2535 !important;
}

[data-theme="dark"] #bulkUploadTeachersModal [style*="border-bottom: 1px solid #e2e8f0"] {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] #bulkUploadTeachersModal h2,
[data-theme="dark"] #bulkUploadTeachersModal h4 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #bulkUploadTeachersModal .close {
    color: #a8a0b8 !important;
}

/* Blue info box */
[data-theme="dark"] #bulkUploadTeachersModal [style*="background: #f0f9ff"] {
    background: rgba(59, 130, 246, 0.1) !important;
    border-left-color: #3b82f6 !important;
}

[data-theme="dark"] #bulkUploadTeachersModal [style*="color: #1e40af"] {
    color: #60a5fa !important;
}

[data-theme="dark"] #bulkUploadTeachersModal label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #bulkUploadTeachersModal p,
[data-theme="dark"] #bulkUploadTeachersModal small {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #bulkUploadTeachersModal input[type="file"] {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Preview box */
[data-theme="dark"] #uploadTeacherPreview {
    background: #231f30 !important;
}

[data-theme="dark"] #uploadTeacherPreview h4 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #previewTeacherText {
    color: #a8a0b8 !important;
}

[data-theme="dark"] #cancelBulkUploadTeachers {
    background: #231f30 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] #submitBulkUploadTeachers {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

[data-theme="dark"] #downloadTeacherTemplate {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
}

/* === SCHOOL DASHBOARD - Additional Page Elements === */

/* School profile form */
[data-theme="dark"] #schoolProfileForm h3 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #schoolProfileForm label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] #schoolProfileForm input,
[data-theme="dark"] #schoolProfileForm select,
[data-theme="dark"] #schoolProfileForm textarea {
    background: #16131e !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] #profileUpdateMessage {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #4ade80 !important;
}

/* Subscription details info items */
[data-theme="dark"] .subscription-details .info-item {
    background: #231f30 !important;
}

[data-theme="dark"] .subscription-details .info-label {
    color: #71717a !important;
}

[data-theme="dark"] .subscription-details .info-value {
    color: #e8e2f0 !important;
}

/* Status badges in school dashboard */
[data-theme="dark"] .status-badge.active {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

[data-theme="dark"] .status-badge.inactive {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

[data-theme="dark"] .status-badge.pending {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
}

/* Section headers in school dashboard */
[data-theme="dark"] .section-header h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .section-header h3 {
    color: #e8e2f0 !important;
}

/* Pricing table text */
[data-theme="dark"] #subscription h3 {
    color: #e8e2f0 !important;
}

/* ================================================
   ADDITIONAL INLINE STYLE OVERRIDES
   Covers gaps found in internal page audit
   ================================================ */

/* Success message backgrounds (#d1fae5 light green) */
[data-theme="dark"] [style*="background: #d1fae5"],
[data-theme="dark"] [style*="background:#d1fae5"] {
    background: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

/* Success text color on green backgrounds */
[data-theme="dark"] [style*="color: #059669"],
[data-theme="dark"] [style*="color:#059669"] {
    color: #6ee7b7 !important;
}

/* Error/danger red background as inline */
[data-theme="dark"] [style*="background: #ef4444"],
[data-theme="dark"] [style*="background:#ef4444"] {
    background: #dc2626 !important;
}

/* Blue button background as inline */
[data-theme="dark"] [style*="background: #2563eb"],
[data-theme="dark"] [style*="background:#2563eb"] {
    background: #3b82f6 !important;
}

/* Green gradient buttons (learning-journey, admin) */
[data-theme="dark"] [style*="background: linear-gradient(135deg, #10b981"],
[data-theme="dark"] [style*="background: linear-gradient(135deg, #22c55e"] {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

/* Blue gradient buttons/headers */
[data-theme="dark"] [style*="background: linear-gradient(135deg, #3b82f6, #1d4ed8)"],
[data-theme="dark"] [style*="background: linear-gradient(135deg, #3b82f6 0%, #2563eb"] {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

/* Light green background variants */
[data-theme="dark"] [style*="background: #ecfdf5"],
[data-theme="dark"] [style*="background:#ecfdf5"] {
    background: rgba(16, 185, 129, 0.1) !important;
}

/* Light yellow/amber backgrounds */
[data-theme="dark"] [style*="background: #fefce8"],
[data-theme="dark"] [style*="background:#fefce8"] {
    background: rgba(251, 191, 36, 0.1) !important;
}

/* Light purple/violet backgrounds */
[data-theme="dark"] [style*="background: #faf5ff"],
[data-theme="dark"] [style*="background:#faf5ff"],
[data-theme="dark"] [style*="background: #f5f3ff"],
[data-theme="dark"] [style*="background:#f5f3ff"] {
    background: rgba(139, 92, 246, 0.1) !important;
}

/* Light rose/red backgrounds */
[data-theme="dark"] [style*="background: #fff1f2"],
[data-theme="dark"] [style*="background:#fff1f2"] {
    background: rgba(239, 68, 68, 0.08) !important;
}

/* Generic white backgrounds */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#ffffff"] {
    background: #1e1a28 !important;
}

/* Light border overrides */
[data-theme="dark"] [style*="border-color: #e2e8f0"],
[data-theme="dark"] [style*="border-color:#e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #e5e7eb"],
[data-theme="dark"] [style*="border: 1px solid #d1d5db"],
[data-theme="dark"] [style*="border: 2px solid #e2e8f0"] {
    border-color: #2a2535 !important;
}

/* Dark text that disappears on dark backgrounds */
[data-theme="dark"] [style*="color: #111827"],
[data-theme="dark"] [style*="color:#111827"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] [style*="color: #0f172a"],
[data-theme="dark"] [style*="color:#0f172a"] {
    color: #e8e2f0 !important;
}

[data-theme="dark"] [style*="color: #1e40af"],
[data-theme="dark"] [style*="color:#1e40af"] {
    color: #60a5fa !important;
}

[data-theme="dark"] [style*="color: #6b7280"],
[data-theme="dark"] [style*="color:#6b7280"] {
    color: #a8a0b8 !important;
}

[data-theme="dark"] [style*="color: #9ca3af"],
[data-theme="dark"] [style*="color:#9ca3af"] {
    color: #a8a0b8 !important;
}

/* Box shadow overrides for dark mode */
[data-theme="dark"] [style*="box-shadow: 0"] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* === PROGRESS REPORT DARK MODE === */

[data-theme="dark"] .progress-child-selector label {
    color: #e8e2f0;
}
[data-theme="dark"] #progressChildSelect {
    background: #231f30;
    border-color: #2a2535;
    color: #e8e2f0;
}
[data-theme="dark"] .progress-empty {
    background: #1e1a28;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .progress-empty h3 {
    color: #e8e2f0;
}
[data-theme="dark"] .progress-empty p {
    color: #a8a0b8;
}
[data-theme="dark"] .progress-skeleton-card {
    background: linear-gradient(90deg, #1e1a28 25%, #2a2535 50%, #1e1a28 75%);
    background-size: 200% 100%;
}
[data-theme="dark"] .progress-report-header {
    border-bottom-color: #2a2535;
}
[data-theme="dark"] .progress-report-header h2 {
    color: #e8e2f0;
}
[data-theme="dark"] .progress-year-label {
    color: #a8a0b8;
}
[data-theme="dark"] .progress-pdf-btn {
    background: #f97316;
}
[data-theme="dark"] .active-session-banner {
    background: #2a2210;
    border-color: #b45309;
}
[data-theme="dark"] .active-session-banner .banner-text {
    color: #fbbf24;
}
[data-theme="dark"] .assessment-card {
    background: #1e1a28;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .assessment-card-header {
    border-bottom-color: #2a2535;
}
[data-theme="dark"] .assessment-card-title {
    color: #e8e2f0;
}
[data-theme="dark"] .assessment-card-date {
    color: #a8a0b8;
}
[data-theme="dark"] .assessment-card-stats {
    color: #a8a0b8;
}
[data-theme="dark"] .subject-icon.math {
    background: rgba(59, 130, 246, 0.15);
}
[data-theme="dark"] .subject-icon.english {
    background: rgba(139, 92, 246, 0.15);
}
[data-theme="dark"] .badge-exceeding {
    background: rgba(22, 163, 74, 0.15);
    color: #4ade80;
}
[data-theme="dark"] .badge-meeting {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
[data-theme="dark"] .badge-building {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
[data-theme="dark"] .badge-strengthening {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}
[data-theme="dark"] .strand-row {
    border-bottom-color: #2a2535;
}
[data-theme="dark"] .strand-row:hover {
    background: #231f30;
}
[data-theme="dark"] .strand-name {
    color: #e8e2f0;
}
[data-theme="dark"] .strand-stats {
    color: #a8a0b8;
}
[data-theme="dark"] .strand-expand-icon {
    color: #a8a0b8;
}
[data-theme="dark"] .strand-questions {
    background: #16131e;
}
[data-theme="dark"] .strand-questions-table th {
    background: #1e1a28;
    color: #a8a0b8;
    border-bottom-color: #2a2535;
}
[data-theme="dark"] .strand-questions-table td {
    color: #e8e2f0;
    border-bottom-color: #2a2535;
}
[data-theme="dark"] .strand-questions-table tr:nth-child(even) td {
    background: #1a1625;
}
[data-theme="dark"] .progress-section-title {
    color: #e8e2f0;
    border-top-color: #2a2535;
}
[data-theme="dark"] .recommendations-loading {
    color: #a8a0b8;
}
[data-theme="dark"] .recommendations-spinner {
    border-color: #2a2535;
    border-top-color: #f97316;
}
[data-theme="dark"] .recommendations-error {
    background: rgba(220, 38, 38, 0.1);
    color: #a8a0b8;
}
[data-theme="dark"] .celebration-card {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: #22c55e;
}
[data-theme="dark"] .celebration-card p {
    color: #4ade80;
}
[data-theme="dark"] .celebration-card::before {
    color: #4ade80;
}
[data-theme="dark"] .focus-area-card {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
}
[data-theme="dark"] .focus-area-card h4 {
    color: #fbbf24;
}
[data-theme="dark"] .focus-area-card .focus-why {
    color: #fcd34d;
}
[data-theme="dark"] .focus-area-card ul,
[data-theme="dark"] .focus-area-card li {
    color: #fbbf24;
}
[data-theme="dark"] .home-support-section {
    background: rgba(59, 130, 246, 0.1);
}
[data-theme="dark"] .home-support-section h4 {
    color: #60a5fa;
}
[data-theme="dark"] .home-support-section ul,
[data-theme="dark"] .home-support-section li {
    color: #93c5fd;
}
[data-theme="dark"] .next-steps-section {
    background: rgba(139, 92, 246, 0.1);
}
[data-theme="dark"] .next-steps-section h4 {
    color: #a78bfa;
}
[data-theme="dark"] .next-steps-section p {
    color: #c4b5fd;
}

/* ============================================
   TRIAL REMINDER BANNER - DARK MODE
   ============================================ */

[data-theme="dark"] .trial-reminder-banner {
    background: linear-gradient(135deg,
        rgba(120, 53, 15, 0.45) 0%,
        rgba(146, 64, 14, 0.35) 40%,
        rgba(107, 33, 6, 0.4) 100%) !important;
    border-bottom: 1px solid rgba(251, 191, 36, 0.25) !important;
    box-shadow: inset 0 -1px 0 rgba(251, 191, 36, 0.1);
}

[data-theme="dark"] .trial-reminder-banner::before {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(251, 191, 36, 0.04) 10px,
        rgba(251, 191, 36, 0.04) 20px
    ) !important;
}

[data-theme="dark"] .trial-text {
    color: #fde68a !important;
}

[data-theme="dark"] .trial-text strong {
    color: #fbbf24 !important;
}

[data-theme="dark"] .trial-days-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #1c1917 !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4) !important;
}

[data-theme="dark"] .trial-message {
    color: #fcd34d !important;
}

[data-theme="dark"] .trial-actions {
    color: #fde68a;
}

/* ============================================
   TRIAL UPGRADE NOTICE (Modal) - DARK MODE
   ============================================ */

[data-theme="dark"] .trial-upgrade-notice {
    background: linear-gradient(135deg,
        rgba(120, 53, 15, 0.3) 0%,
        rgba(146, 64, 14, 0.2) 100%) !important;
    border-color: rgba(251, 191, 36, 0.4) !important;
}

[data-theme="dark"] .trial-upgrade-info strong {
    color: #fbbf24 !important;
}

[data-theme="dark"] .trial-upgrade-info p {
    color: #fcd34d !important;
    opacity: 0.85;
}

/* ============================================
   SUBSCRIPTION STATUS CARD (Modal) - DARK MODE
   ============================================ */

[data-theme="dark"] .subscription-status-card {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
}

[data-theme="dark"] .subscription-status-title {
    color: #6ee7b7 !important;
}

[data-theme="dark"] .subscription-status-plan {
    color: #a7f3d0 !important;
}

[data-theme="dark"] .subscription-status-grid {
    border-top-color: rgba(16, 185, 129, 0.2) !important;
}

[data-theme="dark"] .subscription-stat-number {
    color: #6ee7b7 !important;
}

[data-theme="dark"] .subscription-stat-number.stat-danger {
    color: #fca5a5 !important;
}

[data-theme="dark"] .subscription-stat-label {
    color: #a7f3d0 !important;
}


/* ================================================
   ALE ADMIN PAGES
   admin-learning-paths, admin-learning-path-detail,
   admin-content-library, admin-content-generation
   ================================================ */

/* -- Shared layout: stat cards, filters, tables, modals -- */

[data-theme="dark"] .filters-section,
[data-theme="dark"] .table-container,
[data-theme="dark"] .modal-content {
    background: #1e1a28 !important;
    border-color: #2a2535;
    color: #e8e2f0;
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    border-color: #2a2535 !important;
}

[data-theme="dark"] .modal-close {
    color: #a8a0b8;
}

[data-theme="dark"] th {
    background: #16131e !important;
    color: #a8a0b8 !important;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] td {
    border-bottom-color: #2a2535 !important;
    color: #e8e2f0;
}

[data-theme="dark"] tr:hover {
    background: #231f30 !important;
}

[data-theme="dark"] tr.clickable-row:hover {
    background: #231f30 !important;
}

/* Filter controls */
[data-theme="dark"] .filter-group label {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .filter-group select,
[data-theme="dark"] .filter-group input {
    background: #16131e !important;
    color: #e8e2f0 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #16131e !important;
    color: #e8e2f0 !important;
    border-color: #2a2535 !important;
}

/* Stat card label text */
[data-theme="dark"] .stat-label {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .stat-value {
    color: #e8e2f0;
}

/* Pagination */
[data-theme="dark"] .pagination-btn {
    background: #1e1a28;
    color: #a8a0b8;
    border-color: #2a2535;
}

[data-theme="dark"] .pagination-btn.active {
    background: #3b82f6 !important;
    color: white !important;
    border-color: #3b82f6 !important;
}

[data-theme="dark"] .pagination-btn:hover:not(.active) {
    background: #231f30;
}

/* Buttons */
[data-theme="dark"] .btn-secondary {
    background: #231f30 !important;
    color: #e8e2f0 !important;
    border-color: #2a2535;
}

/* Action buttons (soft-coloured) */
[data-theme="dark"] .action-btn-view {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .action-btn-approve {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #86efac !important;
}

[data-theme="dark"] .action-btn-reject {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .action-btn-flag {
    background: rgba(249, 115, 22, 0.15) !important;
    color: #fdba74 !important;
}

[data-theme="dark"] .action-btn-delete {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #fca5a5 !important;
}

/* Badges in dark mode: softer backgrounds */
[data-theme="dark"] .badge-blue {
    background: rgba(59, 130, 246, 0.18) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .badge-green,
[data-theme="dark"] .badge-approved {
    background: rgba(34, 197, 94, 0.18) !important;
    color: #86efac !important;
}

[data-theme="dark"] .badge-yellow,
[data-theme="dark"] .badge-pending,
[data-theme="dark"] .badge-medium {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .badge-red,
[data-theme="dark"] .badge-rejected,
[data-theme="dark"] .badge-hard {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .badge-gray,
[data-theme="dark"] .badge-easy {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .badge-purple {
    background: rgba(167, 139, 250, 0.18) !important;
    color: #c4b5fd !important;
}

[data-theme="dark"] .badge-flagged {
    background: rgba(249, 115, 22, 0.18) !important;
    color: #fdba74 !important;
}

/* Strand badges */
[data-theme="dark"] .strand-badge {
    background: rgba(167, 139, 250, 0.15) !important;
    color: #c4b5fd !important;
}

/* Alerts */
[data-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #86efac !important;
    border-color: rgba(34, 197, 94, 0.25) !important;
}

[data-theme="dark"] .alert-error {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #fca5a5 !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
}

/* Section headings and badges */
[data-theme="dark"] .section-heading h2 {
    color: #e8e2f0;
}

/* Loading states */
[data-theme="dark"] .loading {
    color: #a8a0b8;
}

[data-theme="dark"] .spinner {
    border-color: #2a2535;
    border-top-color: #60a5fa;
}

/* Empty state text */
[data-theme="dark"] .empty-state {
    color: #a8a0b8;
}

/* Bulk actions bar */
[data-theme="dark"] .bulk-actions {
    background: #231f30 !important;
    border-color: #2a2535;
    color: #e8e2f0;
}

/* -- Learning Path Detail page specifics -- */

[data-theme="dark"] .detail-header {
    background: #1e1a28 !important;
    border-color: #2a2535;
}

[data-theme="dark"] .detail-title p {
    color: #a8a0b8 !important;
}

/* Theta bars (CAT baseline) */
[data-theme="dark"] .theta-bar-container {
    background: #2a2535 !important;
}

[data-theme="dark"] .theta-label {
    color: #a8a0b8;
}

[data-theme="dark"] .theta-value {
    color: #e8e2f0;
}

/* Strategy panel */
[data-theme="dark"] .strategy-display {
    background: #16131e !important;
    color: #a8a0b8;
}

[data-theme="dark"] .strategy-textarea {
    background: #16131e !important;
    color: #e8e2f0 !important;
    border-color: #2a2535 !important;
}

/* Week timeline cards */
[data-theme="dark"] .week-card {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .week-card.current {
    border-color: #60a5fa !important;
}

[data-theme="dark"] .week-card-header h3 {
    color: #e8e2f0;
}

/* -- Content Generation page specifics -- */

/* Tabs (horizontal tab bar) */
[data-theme="dark"] .tabs {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .tab-btn {
    color: #a8a0b8;
}

[data-theme="dark"] .tab-btn.active {
    color: #60a5fa !important;
    border-bottom-color: #60a5fa !important;
}

[data-theme="dark"] .tab-btn:hover {
    color: #e8e2f0 !important;
}

/* Heatmap */
[data-theme="dark"] .heatmap-cell.empty {
    background: #2a2535 !important;
    color: #a8a0b8 !important;
}

[data-theme="dark"] .heatmap-header {
    color: #a8a0b8 !important;
}

/* Job status */
[data-theme="dark"] .job-status.idle {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #86efac !important;
}

[data-theme="dark"] .job-status.running {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #fcd34d !important;
}

/* JSON viewer */
[data-theme="dark"] .json-viewer {
    background: #16131e !important;
    color: #a8a0b8 !important;
    border-color: #2a2535;
}

/* Coverage heatmap legend */
[data-theme="dark"] .heatmap-legend {
    color: #a8a0b8;
}

/* -- Admin Dashboard nav bar -- */

[data-theme="dark"] .admin-nav a {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .admin-nav a:hover {
    color: white;
}

/* Progress bars inside tables */
[data-theme="dark"] .progress-bar-track {
    background: #2a2535;
}

/* Checkbox styling in tables */
[data-theme="dark"] .checkbox-cell input[type="checkbox"] {
    accent-color: #60a5fa;
}

/* ============================================
   Admin Security Dashboard - Dark Mode
   ============================================ */

/* Stat cards */
[data-theme="dark"] .stat-card {
    background: #1e1a28 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .stat-card h3 {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .stat-value {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .stat-value.critical { color: #f87171 !important; }
[data-theme="dark"] .stat-value.warning { color: #fbbf24 !important; }
[data-theme="dark"] .stat-value.success { color: #4ade80 !important; }
[data-theme="dark"] .stat-value.info { color: #60a5fa !important; }

/* Cards (Security Incidents, Compliance Status) */
[data-theme="dark"] .card {
    background: #1e1a28 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}

[data-theme="dark"] .card-header {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .card-header h2 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .card-body {
    color: #e8e2f0 !important;
}

/* Compliance items */
[data-theme="dark"] .compliance-item {
    background: #231f30 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .compliance-icon.active {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

[data-theme="dark"] .compliance-icon.inactive {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

/* Log entries */
[data-theme="dark"] .log-entry {
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] .log-time {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .log-action {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .log-details {
    color: #a8a0b8 !important;
}

/* Tabs (security page) */
[data-theme="dark"] .tab {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .tab:hover {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .tab.active {
    color: #60a5fa !important;
    border-bottom-color: #60a5fa !important;
}

/* Tables */
[data-theme="dark"] th {
    color: #a8a0b8 !important;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] td {
    color: #e8e2f0 !important;
    border-bottom-color: #2a2535 !important;
}

[data-theme="dark"] tr:hover td {
    background: #231f30 !important;
}

/* Badges (dark mode) */
[data-theme="dark"] .badge-critical { background: rgba(239, 68, 68, 0.2) !important; color: #f87171 !important; }
[data-theme="dark"] .badge-high { background: rgba(249, 115, 22, 0.2) !important; color: #fb923c !important; }
[data-theme="dark"] .badge-medium { background: rgba(245, 158, 11, 0.2) !important; color: #fbbf24 !important; }
[data-theme="dark"] .badge-low { background: rgba(34, 197, 94, 0.2) !important; color: #4ade80 !important; }
[data-theme="dark"] .badge-new { background: rgba(59, 130, 246, 0.2) !important; color: #60a5fa !important; }
[data-theme="dark"] .badge-investigating { background: rgba(245, 158, 11, 0.2) !important; color: #fbbf24 !important; }
[data-theme="dark"] .badge-contained { background: rgba(236, 72, 153, 0.2) !important; color: #f472b6 !important; }
[data-theme="dark"] .badge-resolved { background: rgba(34, 197, 94, 0.2) !important; color: #4ade80 !important; }
[data-theme="dark"] .badge-pending { background: rgba(245, 158, 11, 0.2) !important; color: #fbbf24 !important; }
[data-theme="dark"] .badge-completed { background: rgba(34, 197, 94, 0.2) !important; color: #4ade80 !important; }

/* Modals (security page) */
[data-theme="dark"] .modal-content {
    background: #1e1a28 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .modal h3 {
    color: #e8e2f0 !important;
}

/* Form elements in modals */
[data-theme="dark"] .form-group label {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: #231f30 !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}

/* Button secondary in dark mode */
[data-theme="dark"] .btn-secondary {
    background: #231f30 !important;
    color: #e8e2f0 !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #2a2535 !important;
}

/* Loading spinner */
[data-theme="dark"] .loading {
    color: #a8a0b8 !important;
}

[data-theme="dark"] .spinner {
    border-color: #2a2535 !important;
    border-top-color: #60a5fa !important;
}

/* Page header and subtitle */
[data-theme="dark"] h1 {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .subtitle {
    color: #a8a0b8 !important;
}

/* Report incident button */
[data-theme="dark"] .btn-danger {
    background: #dc2626 !important;
}

[data-theme="dark"] .btn-danger:hover {
    background: #b91c1c !important;
}

/* Refresh button in card header */
[data-theme="dark"] .card-header .btn {
    color: #e8e2f0 !important;
}

/* ================================================
   GOOGLE SSO BUTTON - Dark Mode
   Per Google Sign-In branding guidelines (dark)
   ================================================ */

[data-theme="dark"] .google-sso-btn {
    background: #131314 !important;
    color: #e3e3e3 !important;
    border-color: #5f6368 !important;
}

[data-theme="dark"] .google-sso-btn:hover {
    background: #1f1f20 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5) !important;
}

/* ================================================
   OAUTH CALLBACK PAGE - Dark Mode
   ================================================ */

[data-theme="dark"] .error-icon {
    background: #2d1f1f !important;
}

[data-theme="dark"] .error-text {
    color: #fca5a5 !important;
}

/* ================================================
   CONNECTED ACCOUNTS - Dark Mode (Parent Dashboard)
   ================================================ */

[data-theme="dark"] .connected-provider {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
}

[data-theme="dark"] .connected-provider .provider-name {
    color: #e8e2f0 !important;
}

[data-theme="dark"] .connected-provider .provider-status {
    color: #a8a0b8 !important;
}

/* ================================================
   ERROR MONITORING PAGE - Dark Mode
   ================================================ */

/* Page title and subtitle */
[data-theme="dark"] .page-title {
    color: #e8e2f0 !important;
}
[data-theme="dark"] .page-subtitle {
    color: #a8a0b8 !important;
}

/* Stat cards */
[data-theme="dark"] .stats-grid .stat-card {
    background: #1e1a28 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] .stats-grid .stat-label {
    color: #a8a0b8 !important;
}
[data-theme="dark"] .stats-grid .stat-value {
    color: #e8e2f0 !important;
}
[data-theme="dark"] .stats-grid .stat-value.danger { color: #f87171 !important; }
[data-theme="dark"] .stats-grid .stat-value.warning { color: #fbbf24 !important; }
[data-theme="dark"] .stats-grid .stat-value.success { color: #4ade80 !important; }

/* Chart section */
[data-theme="dark"] .chart-section {
    background: #1e1a28 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] .chart-title {
    color: #e8e2f0 !important;
}
[data-theme="dark"] .bar-label {
    color: #a8a0b8 !important;
}
[data-theme="dark"] .bar-track {
    background: #2a2535 !important;
}
[data-theme="dark"] .bar-count {
    color: #a8a0b8 !important;
}

/* Tabs */
[data-theme="dark"] .tab-bar {
    border-bottom-color: #2a2535 !important;
}
[data-theme="dark"] .tab-btn {
    color: #a8a0b8 !important;
}
[data-theme="dark"] .tab-btn:hover {
    color: #e8e2f0 !important;
}
[data-theme="dark"] .tab-btn.active {
    color: #818cf8 !important;
    border-bottom-color: #818cf8 !important;
}

/* Filter bar */
[data-theme="dark"] .filter-bar select,
[data-theme="dark"] .filter-bar input {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
    color: #e8e2f0 !important;
}
[data-theme="dark"] .filter-bar select:focus,
[data-theme="dark"] .filter-bar input:focus {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15) !important;
}
[data-theme="dark"] .filter-bar label {
    color: #a8a0b8 !important;
}

/* Table */
[data-theme="dark"] .table-wrapper {
    background: #1e1a28 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] th {
    color: #a8a0b8 !important;
    border-bottom-color: #2a2535 !important;
    background: #161222 !important;
}
[data-theme="dark"] td {
    color: #c8c0d8 !important;
    border-bottom-color: #2a2535 !important;
}
[data-theme="dark"] tr:hover {
    background: #231f30 !important;
}

/* Severity badges - dark mode */
[data-theme="dark"] .badge-fatal { background: #7f1d1d !important; color: #fecaca !important; }
[data-theme="dark"] .badge-error { background: #7f1d1d !important; color: #fca5a5 !important; }
[data-theme="dark"] .badge-warn { background: #78350f !important; color: #fde68a !important; }
[data-theme="dark"] .badge-info { background: #1e3a5f !important; color: #93c5fd !important; }
[data-theme="dark"] .badge-debug { background: #2a2535 !important; color: #a8a0b8 !important; }
[data-theme="dark"] .badge-resolved { background: rgba(34, 197, 94, 0.15) !important; color: #4ade80 !important; }
[data-theme="dark"] .badge-unresolved { background: rgba(239, 68, 68, 0.15) !important; color: #f87171 !important; }

/* Resolve button */
[data-theme="dark"] .btn-resolve {
    background: transparent !important;
    border-color: #4ade80 !important;
    color: #4ade80 !important;
}
[data-theme="dark"] .btn-resolve:hover {
    background: #4ade80 !important;
    color: #161222 !important;
}

/* Pagination */
[data-theme="dark"] .pagination {
    color: #a8a0b8 !important;
}
[data-theme="dark"] .pagination-btns button {
    background: #1e1a28 !important;
    border-color: #2a2535 !important;
    color: #a8a0b8 !important;
}
[data-theme="dark"] .pagination-btns button:hover:not(:disabled) {
    border-color: #818cf8 !important;
    color: #818cf8 !important;
}

/* Empty state */
[data-theme="dark"] .empty-state {
    color: #a8a0b8 !important;
}

/* Stack trace modal */
[data-theme="dark"] .modal-box {
    background: #1e1a28 !important;
}
[data-theme="dark"] .modal-header {
    border-bottom-color: #2a2535 !important;
}
[data-theme="dark"] .modal-header h3 {
    color: #e8e2f0 !important;
}
[data-theme="dark"] .modal-close {
    color: #a8a0b8 !important;
}
[data-theme="dark"] .modal-close:hover {
    color: #e8e2f0 !important;
}
