html[data-theme="dark"] body {
    color: #e5e7eb;
    background-color: #0b1120 !important;
}

.student-theme-toggle {
    display: grid;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    color: #334155;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.student-theme-toggle:hover {
    transform: translateY(-1px) scale(1.04);
}

.student-theme-toggle svg {
    width: 1.1rem;
    height: 1.1rem;
}

.student-theme-toggle .theme-icon-sun,
html[data-theme="dark"] .student-theme-toggle .theme-icon-moon {
    display: none;
}

html[data-theme="dark"] .student-theme-toggle .theme-icon-sun {
    display: block;
}

html[data-theme="dark"] .student-theme-toggle {
    border-color: #475569;
    color: #fbbf24;
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-white\/70,
html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-gray-100,
html[data-theme="dark"] .bg-gray-200,
html[data-theme="dark"] .bg-slate-50,
html[data-theme="dark"] .bg-slate-100,
html[data-theme="dark"] .bg-slate-200 {
    background-color: #111827 !important;
}

html[data-theme="dark"] .from-blue-50,
html[data-theme="dark"] .from-indigo-50,
html[data-theme="dark"] .via-white,
html[data-theme="dark"] .to-gray-50,
html[data-theme="dark"] .to-slate-50 {
    background-color: #111827 !important;
    background-image: none !important;
}

html[data-theme="dark"] .bg-blue-50,
html[data-theme="dark"] .bg-blue-100,
html[data-theme="dark"] .bg-sky-50,
html[data-theme="dark"] .bg-sky-100,
html[data-theme="dark"] .bg-indigo-50 {
    background-color: #10233f !important;
}

html[data-theme="dark"] .bg-green-50,
html[data-theme="dark"] .bg-green-100,
html[data-theme="dark"] .bg-emerald-50,
html[data-theme="dark"] .bg-emerald-100 {
    background-color: #0d2d2b !important;
}

html[data-theme="dark"] .bg-amber-50,
html[data-theme="dark"] .bg-amber-100,
html[data-theme="dark"] .bg-yellow-50 {
    background-color: #33260f !important;
}

html[data-theme="dark"] .bg-red-50,
html[data-theme="dark"] .bg-red-100 {
    background-color: #35171d !important;
}

html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-slate-900 {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-slate-700,
html[data-theme="dark"] .text-slate-600 {
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-slate-500,
html[data-theme="dark"] .text-slate-300 {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .text-blue-900,
html[data-theme="dark"] .text-blue-800,
html[data-theme="dark"] .text-blue-700,
html[data-theme="dark"] .text-sky-900,
html[data-theme="dark"] .text-sky-700,
html[data-theme="dark"] .text-indigo-700 {
    color: #93c5fd !important;
}

html[data-theme="dark"] .text-green-800,
html[data-theme="dark"] .text-green-700,
html[data-theme="dark"] .text-emerald-900,
html[data-theme="dark"] .text-emerald-700 {
    color: #6ee7b7 !important;
}

html[data-theme="dark"] .text-red-800,
html[data-theme="dark"] .text-red-700,
html[data-theme="dark"] .text-red-600 {
    color: #fca5a5 !important;
}

html[data-theme="dark"] .text-amber-900,
html[data-theme="dark"] .text-amber-800,
html[data-theme="dark"] .text-amber-700,
html[data-theme="dark"] .text-yellow-800 {
    color: #fcd34d !important;
}

html[data-theme="dark"] [class*="border-gray-"],
html[data-theme="dark"] [class*="border-slate-"],
html[data-theme="dark"] [class*="border-blue-"],
html[data-theme="dark"] [class*="border-sky-"],
html[data-theme="dark"] [class*="border-indigo-"],
html[data-theme="dark"] [class*="border-green-"],
html[data-theme="dark"] [class*="border-emerald-"] {
    border-color: #334155 !important;
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    border-color: #475569 !important;
    color: #e5e7eb !important;
    background-color: #0f172a !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #64748b;
}

html[data-theme="dark"] [class*="hover:bg-gray-50"]:hover,
html[data-theme="dark"] [class*="hover:bg-gray-100"]:hover,
html[data-theme="dark"] [class*="hover:bg-white"]:hover {
    background-color: #1e293b !important;
}

html[data-theme="dark"] iframe {
    background-color: #0b1120 !important;
}

@media screen {
    html[data-theme="dark"] .title h1,
    html[data-theme="dark"] .title p,
    html[data-theme="dark"] .section-title {
        color: #f1f5f9;
    }

    html[data-theme="dark"] .center-contact-line,
    html[data-theme="dark"] .sub {
        color: #cbd5e1;
    }

    html[data-theme="dark"] .header,
    html[data-theme="dark"] .section-title,
    html[data-theme="dark"] .details-table td,
    html[data-theme="dark"] .data-table th,
    html[data-theme="dark"] .data-table td {
        border-color: #475569;
    }

    html[data-theme="dark"] .details-table .label,
    html[data-theme="dark"] .data-table th,
    html[data-theme="dark"] .ledger-row {
        color: #e5e7eb;
        background: #1e293b !important;
    }

    html[data-theme="dark"] .ledger-row-due {
        background: #35171d;
    }

    html[data-theme="dark"] .ledger-row-due td {
        color: #fca5a5;
    }

    html[data-theme="dark"] .email-status {
        border-color: #475569;
        color: #e5e7eb;
        background: #1e293b;
    }

    html[data-theme="dark"] .email-status.success {
        color: #6ee7b7;
        background: #0d2d2b;
    }

    html[data-theme="dark"] .email-status.error {
        color: #fca5a5;
        background: #35171d;
    }
}

@media print {
    html[data-theme="dark"] body {
        color: #111 !important;
        background: #fff !important;
    }
}
