/* ============================================================
   Medix site theme modes
   - light  : default, intentionally LEFT UNTOUCHED (no overrides)
   - dark   : functional dark palette for the main site
   - brown  : Cream + Brown ("Brown Mode") design system
   Applied via <html data-theme="..."> set by js/theme.js
   ============================================================ */

/* ---- Theme switcher UI (always visible) ---- */
.medix-theme-switcher {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.06);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.medix-theme-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    background: transparent;
    color: #475569;
    font-size: 13px;
    line-height: 1;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.medix-theme-btn:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a;
    transform: translateY(-1px);
}
.medix-theme-btn:focus-visible {
    outline: 2px solid #76583f;
    outline-offset: 2px;
}
.medix-theme-btn.active {
    background: #76583f;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(118, 88, 63, 0.45);
}

html[data-theme="brown"] .medix-theme-btn,
html[data-theme="dark"] .medix-theme-btn { color: #cbd5e1; }
html[data-theme="brown"] .medix-theme-btn:hover,
html[data-theme="dark"] .medix-theme-btn:hover { background: rgba(255, 255, 255, 0.14); color: #ffffff; }

/* ============================================================
   B R O W N   M O D E
   Palette: page #FAF8F2 | section #F5F0E8 | card #FFFDF8
            primary #76583F | dark #5F4632 | hover #8A6A4D
            text #172033 | secondary #667085 | muted #98A2B3
            border #E5D8C7
   ============================================================ */

/* ---- Surfaces ---- */
html[data-theme="brown"] body,
html[data-theme="brown"] .bg-gray-50,
html[data-theme="brown"] .bg-slate-50 { background-color: #faf8f2 !important; }
html[data-theme="brown"] .bg-gray-100,
html[data-theme="brown"] .bg-slate-100 { background-color: #f5f0e8 !important; }
html[data-theme="brown"] .bg-white { background-color: #fffdf8 !important; }
html[data-theme="brown"] .bg-gray-200 { background-color: #efe5d6 !important; }

/* ---- Text ---- */
html[data-theme="brown"] .text-gray-900,
html[data-theme="brown"] .text-gray-800,
html[data-theme="brown"] .text-gray-700,
html[data-theme="brown"] .text-slate-900,
html[data-theme="brown"] .text-slate-800,
html[data-theme="brown"] .text-slate-700 { color: #172033 !important; }
html[data-theme="brown"] .text-gray-600,
html[data-theme="brown"] .text-gray-500,
html[data-theme="brown"] .text-slate-600,
html[data-theme="brown"] .text-slate-500 { color: #667085 !important; }
html[data-theme="brown"] .text-gray-400,
html[data-theme="brown"] .text-gray-300,
html[data-theme="brown"] .text-slate-400,
html[data-theme="brown"] .text-slate-300 { color: #98a2b3 !important; }
html[data-theme="brown"] .text-gray-100,
html[data-theme="brown"] .text-gray-200 { color: #d9c8b0 !important; }

/* ---- Borders / dividers ---- */
html[data-theme="brown"] .border-gray-100,
html[data-theme="brown"] .border-gray-150,
html[data-theme="brown"] .border-gray-155,
html[data-theme="brown"] .border-gray-200,
html[data-theme="brown"] .border-gray-300,
html[data-theme="brown"] .border-slate-100,
html[data-theme="brown"] .border-slate-200 { border-color: #e5d8c7 !important; }
html[data-theme="brown"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
html[data-theme="brown"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #e5d8c7 !important; }

/* ---- Primary brand scale: blue -> brown ---- */
html[data-theme="brown"] .text-primary-900,
html[data-theme="brown"] .text-primary-800,
html[data-theme="brown"] .text-primary-700 { color: #5f4632 !important; }
html[data-theme="brown"] .text-primary-600 { color: #76583f !important; }
html[data-theme="brown"] .text-primary-500,
html[data-theme="brown"] .text-primary-400 { color: #8a6a4d !important; }
html[data-theme="brown"] .text-primary-200,
html[data-theme="brown"] .text-primary-100 { color: #ede2d0 !important; }

html[data-theme="brown"] .bg-primary-900 { background-color: #4a3827 !important; }
html[data-theme="brown"] .bg-primary-800,
html[data-theme="brown"] .bg-primary-700 { background-color: #5f4632 !important; }
html[data-theme="brown"] .bg-primary-600 { background-color: #76583f !important; }
html[data-theme="brown"] .bg-primary-500 { background-color: #8a6a4d !important; }
html[data-theme="brown"] .bg-primary-400 { background-color: #a58a6e !important; }
html[data-theme="brown"] .bg-primary-100 { background-color: #f0e8d9 !important; }
html[data-theme="brown"] .bg-primary-50 { background-color: #f5f0e8 !important; }

html[data-theme="brown"] .border-primary-100 { border-color: #e5d8c7 !important; }
html[data-theme="brown"] .border-primary-200,
html[data-theme="brown"] .border-primary-300 { border-color: #d9c8b0 !important; }
html[data-theme="brown"] .border-primary-400 { border-color: #8a6a4d !important; }
html[data-theme="brown"] .border-primary-500,
html[data-theme="brown"] .border-primary-600,
html[data-theme="brown"] .border-primary-700 { border-color: #76583f !important; }

html[data-theme="brown"] .hover\:text-primary-700:hover { color: #5f4632 !important; }
html[data-theme="brown"] .hover\:text-primary-600:hover { color: #76583f !important; }
html[data-theme="brown"] .hover\:text-primary-500:hover { color: #8a6a4d !important; }
html[data-theme="brown"] .hover\:bg-primary-700:hover { background-color: #76583f !important; }
html[data-theme="brown"] .hover\:bg-primary-600:hover { background-color: #8a6a4d !important; }
html[data-theme="brown"] .hover\:bg-primary-500:hover { background-color: #a58a6e !important; }

html[data-theme="brown"] .from-primary-500 { --tw-gradient-from: #8a6a4d; }
html[data-theme="brown"] .from-primary-600 { --tw-gradient-from: #76583f; }
html[data-theme="brown"] .from-primary-700 { --tw-gradient-from: #5f4632; }
html[data-theme="brown"] .from-primary-50 { --tw-gradient-from: #f5f0e8; }
html[data-theme="brown"] .to-primary-500 { --tw-gradient-to: #8a6a4d; }
html[data-theme="brown"] .to-primary-600 { --tw-gradient-to: #76583f; }
html[data-theme="brown"] .to-primary-700,
html[data-theme="brown"] .to-primary-800 { --tw-gradient-to: #5f4632; }

html[data-theme="brown"] .ring-primary-300 { --tw-ring-color: rgba(138, 106, 77, 0.4); }
html[data-theme="brown"] .ring-primary-50 { --tw-ring-color: rgba(229, 216, 199, 0.6); }

/* ---- Blue / sky / indigo accents -> brown ---- */
html[data-theme="brown"] .text-blue-500,
html[data-theme="brown"] .text-sky-500,
html[data-theme="brown"] .text-indigo-500 { color: #8a6a4d !important; }
html[data-theme="brown"] .text-blue-600,
html[data-theme="brown"] .text-sky-600,
html[data-theme="brown"] .text-indigo-600 { color: #76583f !important; }
html[data-theme="brown"] .text-blue-700,
html[data-theme="brown"] .text-sky-700,
html[data-theme="brown"] .text-indigo-700 { color: #5f4632 !important; }
html[data-theme="brown"] .text-blue-800,
html[data-theme="brown"] .text-indigo-800 { color: #4a3827 !important; }
html[data-theme="brown"] .text-blue-900 { color: #5f4632 !important; }
html[data-theme="brown"] .text-blue-200,
html[data-theme="brown"] .text-blue-100 { color: #f5f0e8 !important; }

html[data-theme="brown"] .bg-blue-50,
html[data-theme="brown"] .bg-indigo-50 { background-color: #f5f0e8 !important; }
html[data-theme="brown"] .bg-blue-100,
html[data-theme="brown"] .bg-indigo-100 { background-color: #f0e8d9 !important; }
html[data-theme="brown"] .bg-blue-500,
html[data-theme="brown"] .bg-sky-500 { background-color: #8a6a4d !important; }
html[data-theme="brown"] .bg-blue-600,
html[data-theme="brown"] .bg-sky-600,
html[data-theme="brown"] .bg-indigo-600 { background-color: #76583f !important; }
html[data-theme="brown"] .bg-blue-700,
html[data-theme="brown"] .bg-sky-700,
html[data-theme="brown"] .bg-indigo-700 { background-color: #5f4632 !important; }
html[data-theme="brown"] .bg-blue-800,
html[data-theme="brown"] .bg-indigo-800 { background-color: #4a3827 !important; }

html[data-theme="brown"] .border-blue-100,
html[data-theme="brown"] .border-blue-200 { border-color: #e5d8c7 !important; }
html[data-theme="brown"] .border-blue-500,
html[data-theme="brown"] .border-blue-600 { border-color: #76583f !important; }

html[data-theme="brown"] .hover\:bg-blue-600:hover,
html[data-theme="brown"] .hover\:bg-sky-600:hover { background-color: #8a6a4d !important; }
html[data-theme="brown"] .hover\:bg-blue-700:hover,
html[data-theme="brown"] .hover\:bg-sky-700:hover { background-color: #76583f !important; }
html[data-theme="brown"] .hover\:text-blue-700:hover,
html[data-theme="brown"] .hover\:text-blue-600:hover,
html[data-theme="brown"] .hover\:text-indigo-600:hover { color: #5f4632 !important; }

html[data-theme="brown"] .from-blue-500 { --tw-gradient-from: #8a6a4d; }
html[data-theme="brown"] .from-blue-600 { --tw-gradient-from: #76583f; }
html[data-theme="brown"] .from-blue-700 { --tw-gradient-from: #5f4632; }
html[data-theme="brown"] .from-blue-50 { --tw-gradient-from: #f5f0e8; }
html[data-theme="brown"] .from-indigo-600 { --tw-gradient-from: #76583f; }
html[data-theme="brown"] .to-blue-50 { --tw-gradient-to: #f5f0e8; }
html[data-theme="brown"] .to-blue-100 { --tw-gradient-to: #f0e8d9; }
html[data-theme="brown"] .to-blue-600 { --tw-gradient-to: #76583f; }
html[data-theme="brown"] .to-blue-700 { --tw-gradient-to: #5f4632; }
html[data-theme="brown"] .to-blue-800 { --tw-gradient-to: #4a3827; }
html[data-theme="brown"] .to-indigo-600 { --tw-gradient-to: #76583f; }
html[data-theme="brown"] .to-indigo-700 { --tw-gradient-to: #5f4632; }
html[data-theme="brown"] .from-slate-50 { --tw-gradient-from: #faf8f2; }

/* ---- Height / widths of text and white gradient flows ---- */
html[data-theme="brown"] .from-white { --tw-gradient-from: #faf8f2; }
html[data-theme="brown"] .to-white { --tw-gradient-to: #faf8f2; }

/* ---- Focus states ---- */
html[data-theme="brown"] .focus\:ring-blue-500:focus,
html[data-theme="brown"] .focus\:ring-primary-500:focus { --tw-ring-color: rgba(118, 88, 63, 0.35) !important; }
html[data-theme="brown"] .focus\:border-blue-500:focus,
html[data-theme="brown"] .focus\:border-primary-500:focus { border-color: #76583f !important; }

/* ---- Forms ---- */
html[data-theme="brown"] input,
html[data-theme="brown"] select,
html[data-theme="brown"] textarea {
    background-color: #fffdf8 !important;
    border-color: #e5d8c7 !important;
    color: #172033 !important;
}
html[data-theme="brown"] input:focus,
html[data-theme="brown"] select:focus,
html[data-theme="brown"] textarea:focus { border-color: #76583f !important; }

/* ---- Tables ---- */
html[data-theme="brown"] table { background-color: #fffdf8 !important; }
html[data-theme="brown"] thead,
html[data-theme="brown"] .thead,
html[data-theme="brown"] th {
    background-color: #f5f0e8 !important;
    color: #5f4632 !important;
}

/* ---- Step tabs / group selector (User Home Index) ---- */
html[data-theme="brown"] .step-button:not(.selected) {
    background-color: #fffdf8 !important;
    color: #76583f !important;
    border-color: #76583f !important;
}
html[data-theme="brown"] .step-button:not(.selected):hover {
    background-color: #8a6a4d !important;
    color: #ffffff !important;
    border-color: #8a6a4d !important;
}
html[data-theme="brown"] .step-button.selected,
html[data-theme="brown"] .step-button.active {
    background-color: #76583f !important;
    color: #ffffff !important;
    border-color: #76583f !important;
}

/* ---- Progress rings (rendered SVG with hard-coded strokes) ---- */
html[data-theme="brown"] circle[stroke="#0066cc"] { stroke: #76583f; }
html[data-theme="brown"] circle[stroke="#2563eb"] { stroke: #76583f; }
html[data-theme="brown"] circle[stroke="#3b82f6"] { stroke: #8a6a4d; }
html[data-theme="brown"] circle[stroke="#1d4ed8"] { stroke: #8a6a4d; }
html[data-theme="brown"] circle[stroke="#e5e7eb"] { stroke: #e5d8c7; }
html[data-theme="brown"] #usageGradient stop:first-child { stop-color: #8a6a4d; }
html[data-theme="brown"] #usageGradient stop:last-child { stop-color: #76583f; }

/* ---- Header (_UserLayout) ---- */
html[data-theme="brown"] header.sticky {
    background: #76583f !important;
    border-bottom: none !important;
    box-shadow: 0 1px 3px rgba(95, 70, 50, 0.2), 0 8px 24px -12px rgba(95, 70, 50, 0.4) !important;
}
html[data-theme="brown"] header.sticky a,
html[data-theme="brown"] header.sticky button { color: #fff8ef !important; }
html[data-theme="brown"] header.sticky a:hover,
html[data-theme="brown"] header.sticky button:hover { color: #ffe7cc !important; }
html[data-theme="brown"] header.sticky a .text-primary-600,
html[data-theme="brown"] header.sticky a .text-primary-700,
html[data-theme="brown"] header.sticky a .text-primary-800,
html[data-theme="brown"] header.sticky a .text-primary-900 { color: #fff8ef !important; }
html[data-theme="brown"] #menu {
    background: #76583f !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}
html[data-theme="brown"] #menu a:hover { background: rgba(255, 255, 255, 0.08) !important; }

/* ---- Footer ---- */
html[data-theme="brown"] footer.bg-primary-800 { background-color: #5f4632 !important; }
html[data-theme="brown"] footer .text-gray-300 { color: #e8dccb !important; }

/* ---- Landing hero ---- */
html[data-theme="brown"] .hero-gradient {
    background: linear-gradient(135deg, #5f4632 0%, #76583f 100%) !important;
}

/* ---- Statics layout components ---- */
html[data-theme="brown"] .main-content {
    background: linear-gradient(135deg, #faf8f2 0%, #f5f0e8 100%) !important;
}
html[data-theme="brown"] .top-nav {
    background: rgba(255, 253, 248, 0.92) !important;
    border-bottom-color: rgba(229, 216, 199, 0.9) !important;
    box-shadow: 0 4px 15px rgba(95, 70, 50, 0.08) !important;
}
html[data-theme="brown"] .sidebar {
    background: linear-gradient(145deg, #76583f 0%, #5f4632 100%) !important;
    box-shadow: 0 25px 50px -12px rgba(95, 70, 50, 0.4) !important;
}
html[data-theme="brown"] .mobile-menu-button,
html[data-theme="brown"] .home-button,
html[data-theme="brown"] .browser-button,
html[data-theme="brown"] .comment-button {
    background: linear-gradient(135deg, #8a6a4d 0%, #76583f 100%) !important;
    box-shadow: 0 4px 15px rgba(118, 88, 63, 0.3) !important;
}
html[data-theme="brown"] .user-welcome {
    background: linear-gradient(135deg, #f5f0e8 0%, #ede2d0 100%) !important;
    color: #5f4632 !important;
    border-color: #e5d8c7 !important;
}
html[data-theme="brown"] .sidebar-header {
    background: rgba(255, 255, 255, 0.12) !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

/* ============================================================
   D A R K   M O D E  (main site)
   A functional dark palette; brand accent stays blue.
   ============================================================ */

html[data-theme="dark"] body,
html[data-theme="dark"] .bg-gray-50,
html[data-theme="dark"] .bg-slate-50 { background-color: #0e1626 !important; }
html[data-theme="dark"] .bg-gray-100,
html[data-theme="dark"] .bg-slate-100 { background-color: #16213a !important; }
html[data-theme="dark"] .bg-white { background-color: #1b2739 !important; }
html[data-theme="dark"] .bg-gray-200 { background-color: #23324a !important; }

html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800,
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-slate-900,
html[data-theme="dark"] .text-slate-800,
html[data-theme="dark"] .text-slate-700 { color: #e2e8f0 !important; }
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-slate-600,
html[data-theme="dark"] .text-slate-500 { color: #94a3b8 !important; }
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-gray-300,
html[data-theme="dark"] .text-slate-400,
html[data-theme="dark"] .text-slate-300 { color: #64748b !important; }
html[data-theme="dark"] .text-gray-100,
html[data-theme="dark"] .text-gray-200 { color: #a5b4cb !important; }

html[data-theme="dark"] .border-gray-100,
html[data-theme="dark"] .border-gray-150,
html[data-theme="dark"] .border-gray-155,
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-300,
html[data-theme="dark"] .border-slate-100,
html[data-theme="dark"] .border-slate-200 { border-color: #2c3a52 !important; }
html[data-theme="dark"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
html[data-theme="dark"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]) { border-color: #2c3a52 !important; }

html[data-theme="dark"] .bg-primary-50,
html[data-theme="dark"] .bg-blue-50,
html[data-theme="dark"] .bg-indigo-50 { background-color: #16213a !important; }
html[data-theme="dark"] .bg-primary-100,
html[data-theme="dark"] .bg-blue-100,
html[data-theme="dark"] .bg-indigo-100 { background-color: #23324a !important; }
html[data-theme="dark"] .bg-primary-600 { background-color: #2563eb !important; }
html[data-theme="dark"] .bg-primary-700,
html[data-theme="dark"] .bg-blue-700,
html[data-theme="dark"] .bg-indigo-700 { background-color: #1d4ed8 !important; }

html[data-theme="dark"] .text-primary-700,
html[data-theme="dark"] .text-blue-700,
html[data-theme="dark"] .text-indigo-700 { color: #93c5fd !important; }
html[data-theme="dark"] .text-primary-600,
html[data-theme="dark"] .text-blue-600,
html[data-theme="dark"] .text-indigo-600 { color: #60a5fa !important; }
html[data-theme="dark"] .text-primary-500,
html[data-theme="dark"] .text-blue-500 { color: #a5b4cb !important; }
html[data-theme="dark"] .text-primary-100,
html[data-theme="dark"] .text-blue-100,
html[data-theme="dark"] .text-blue-200 { color: #93c5fd !important; }

html[data-theme="dark"] .border-primary-100,
html[data-theme="dark"] .border-primary-200,
html[data-theme="dark"] .border-blue-100,
html[data-theme="dark"] .border-blue-200 { border-color: #2c3a52 !important; }
html[data-theme="dark"] .border-primary-300 { border-color: #475569 !important; }

html[data-theme="dark"] .hover\:text-primary-700:hover,
html[data-theme="dark"] .hover\:text-blue-700:hover { color: #93c5fd !important; }
html[data-theme="dark"] .hover\:bg-primary-700:hover,
html[data-theme="dark"] .hover\:bg-blue-700:hover { background-color: #1d4ed8 !important; }

html[data-theme="dark"] .from-primary-600,
html[data-theme="dark"] .from-blue-600 { --tw-gradient-from: #2563eb; }
html[data-theme="dark"] .to-primary-700,
html[data-theme="dark"] .to-blue-700 { --tw-gradient-to: #1d4ed8; }
html[data-theme="dark"] .from-blue-50,
html[data-theme="dark"] .from-primary-50 { --tw-gradient-from: #16213a; }
html[data-theme="dark"] .from-slate-50 { --tw-gradient-from: #0e1626; }
html[data-theme="dark"] .to-blue-50 { --tw-gradient-to: #101a2c; }
html[data-theme="dark"] .from-white { --tw-gradient-from: #0e1626; }
html[data-theme="dark"] .to-white { --tw-gradient-to: #0e1626; }

html[data-theme="dark"] .ring-primary-50 { --tw-ring-color: rgba(51, 65, 85, 0.6); }

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: #0e1626 !important;
    border-color: #2c3a52 !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { border-color: #2563eb !important; }

html[data-theme="dark"] table { background-color: #1b2739 !important; }
html[data-theme="dark"] thead,
html[data-theme="dark"] .thead,
html[data-theme="dark"] th {
    background-color: #16213a !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .step-button:not(.selected) {
    background-color: #1b2739 !important;
    color: #93c5fd !important;
    border-color: #2563eb !important;
}
html[data-theme="dark"] .step-button.selected,
html[data-theme="dark"] .step-button.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}

html[data-theme="dark"] header.sticky {
    background: #101a2c !important;
    box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.5) !important;
}
html[data-theme="dark"] header.sticky a,
html[data-theme="dark"] header.sticky button { color: #e2e8f0 !important; }
html[data-theme="dark"] header.sticky a .text-primary-600,
html[data-theme="dark"] header.sticky a .text-primary-700,
html[data-theme="dark"] header.sticky a .text-primary-800,
html[data-theme="dark"] header.sticky a .text-primary-900 { color: #e2e8f0 !important; }
html[data-theme="dark"] #menu {
    background: #101a2c !important;
    border-color: #2c3a52 !important;
}
html[data-theme="dark"] #menu a:hover { background: #16213a !important; }

html[data-theme="dark"] footer.bg-primary-800 { background-color: #0b1220 !important; }
html[data-theme="dark"] footer .text-gray-300 { color: #a5b4cb !important; }

html[data-theme="dark"] .hero-gradient {
    background: linear-gradient(135deg, #0b1220 0%, #1d4ed8 100%) !important;
}

html[data-theme="dark"] .main-content {
    background: linear-gradient(135deg, #0e1626 0%, #101a2c 100%) !important;
}
html[data-theme="dark"] .top-nav {
    background: rgba(14, 22, 38, 0.92) !important;
    border-bottom-color: #2c3a52 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25) !important;
}
html[data-theme="dark"] .sidebar {
    background: linear-gradient(145deg, #111c33 0%, #16213a 100%) !important;
}
html[data-theme="dark"] .user-welcome {
    background: linear-gradient(135deg, #23324a 0%, #16213a 100%) !important;
    color: #e2e8f0 !important;
    border-color: #2c3a52 !important;
}

/* ============================================================
   E N H A N C E M E N T S
   Layer 2: contrast, native controls, richer surfaces, hero.
   ============================================================ */

/* ---- Native controls & scrollbars follow the theme ---- */
html[data-theme="brown"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

html[data-theme="brown"] ::selection { background: #76583f; color: #fffdf8; }
html[data-theme="dark"] ::selection { background: #2563eb; color: #ffffff; }

html[data-theme="brown"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="brown"] ::-webkit-scrollbar-track { background: #f5f0e8; }
html[data-theme="brown"] ::-webkit-scrollbar-thumb { background: #d9c8b0; border-radius: 6px; border: 2px solid #f5f0e8; }
html[data-theme="brown"] ::-webkit-scrollbar-thumb:hover { background: #8a6a4d; }

html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0e1626; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2c3a52; border-radius: 6px; border: 2px solid #0e1626; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #3b82f6; }

/* ---- Contrast bumps for muted / icon text ---- */
html[data-theme="brown"] .text-gray-400 { color: #8a7757 !important; }
html[data-theme="brown"] .text-gray-300 { color: #9c8a72 !important; }
html[data-theme="brown"] .text-slate-400 { color: #8a7757 !important; }
html[data-theme="brown"] .text-slate-300 { color: #9c8a72 !important; }
html[data-theme="dark"] .text-gray-400,
html[data-theme="dark"] .text-gray-300 { color: #94a3b8 !important; }

/* ---- Focus glow for form fields ---- */
html[data-theme="brown"] input:focus,
html[data-theme="brown"] select:focus,
html[data-theme="brown"] textarea:focus { box-shadow: 0 0 0 3px rgba(118, 88, 63, 0.15) !important; }
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important; }

/* ---- Warmer purple/blue accent coverage (promo banners) ---- */
html[data-theme="brown"] .bg-blue-300 { background-color: #c2ab90 !important; }
html[data-theme="brown"] .bg-blue-400 { background-color: #a58a6e !important; }
html[data-theme="brown"] .bg-purple-500,
html[data-theme="brown"] .bg-purple-600 { background-color: #8a6a4d !important; }
html[data-theme="brown"] .text-purple-500,
html[data-theme="brown"] .text-purple-600 { color: #76583f !important; }
html[data-theme="brown"] .hover\:bg-blue-300:hover { background-color: #c2ab90 !important; }
html[data-theme="brown"] .from-purple-500,
html[data-theme="brown"] .from-purple-600 { --tw-gradient-from: #8a6a4d; }
html[data-theme="brown"] .to-purple-500 { --tw-gradient-to: #8a6a4d; }
html[data-theme="brown"] .to-purple-600 { --tw-gradient-to: #a58a6e; }

/* ---- Richer header gradients ---- */
html[data-theme="brown"] header.sticky {
    background: linear-gradient(135deg, #8a6a4d 0%, #76583f 55%, #5f4632 100%) !important;
}
html[data-theme="dark"] header.sticky {
    background: linear-gradient(135deg, #16213a 0%, #0b1220 100%) !important;
}

/* ---- Primary buttons: gradient + depth ---- */
html[data-theme="brown"] .bg-primary-600 {
    background: linear-gradient(135deg, #8a6a4d 0%, #76583f 100%) !important;
    box-shadow: 0 6px 18px -8px rgba(95, 70, 50, 0.6) !important;
}
html[data-theme="brown"] .bg-primary-600:hover {
    background: linear-gradient(135deg, #76583f 0%, #5f4632 100%) !important;
}
html[data-theme="brown"] .bg-primary-700 {
    background: linear-gradient(135deg, #76583f 0%, #5f4632 100%) !important;
}
html[data-theme="dark"] .bg-primary-600 {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    box-shadow: 0 6px 18px -8px rgba(37, 99, 235, 0.6) !important;
}
html[data-theme="dark"] .bg-primary-600:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
}

/* ---- Table row hover ---- */
html[data-theme="brown"] tbody tr:hover { background-color: #f5f0e8 !important; }
html[data-theme="dark"] tbody tr:hover { background-color: #16213a !important; }

/* ---- QBank card hover depth ---- */
html[data-theme="brown"] .qbank-group-card:hover,
html[data-theme="brown"] .qbank-card:hover {
    box-shadow: 0 22px 45px -18px rgba(95, 70, 50, 0.45) !important;
}
html[data-theme="dark"] .qbank-group-card:hover,
html[data-theme="dark"] .qbank-card:hover {
    box-shadow: 0 22px 45px -18px rgba(0, 0, 0, 0.6) !important;
}

/* ---- Landing hero: Brown = rich brown that bridges into cream ---- */
html[data-theme="brown"] .hero-gradient {
    background: linear-gradient(158deg, #3f2f21 0%, #4a3827 18%, #5f4632 40%, #76583f 60%, #9c7a56 80%, #f5f0e8 100%) !important;
    position: relative;
}
html[data-theme="brown"] .hero-gradient::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(245, 240, 232, 0) 55%, rgba(245, 240, 232, 0.28) 82%, rgba(245, 240, 232, 0.55) 100%);
}
html[data-theme="brown"] .hero-gradient .container { position: relative; z-index: 10; }
html[data-theme="brown"] .hero-gradient .bg-blue-800 { background-color: rgba(255, 244, 208, 0.12) !important; }
html[data-theme="brown"] .hero-gradient .border-blue-700 { border-color: rgba(255, 180, 9, 0.5) !important; }
html[data-theme="brown"] .hero-gradient .text-blue-100 { color: #f7f2e9 !important; }
html[data-theme="brown"] .hero-gradient a.bg-yellow-400 {
    background: linear-gradient(135deg, #ffc219 0%, #ffb609 100%) !important;
    box-shadow: 0 12px 30px -12px rgba(255, 182, 9, 0.75) !important;
}
html[data-theme="brown"] .hero-gradient a.bg-yellow-400:hover {
    background: linear-gradient(135deg, #ffd24d 0%, #ffc219 100%) !important;
}
html[data-theme="brown"] .hero-gradient a.bg-white {
    background-color: #faf8f2 !important;
    box-shadow: 0 12px 30px -14px rgba(63, 47, 33, 0.6) !important;
}
html[data-theme="brown"] .hero-gradient a.bg-white:hover { background-color: #f5f0e8 !important; }
html[data-theme="brown"] .hero-gradient .logo-line {
    background: linear-gradient(90deg, transparent, #ffb609, transparent) !important;
}

/* ---- Landing hero: Dark ---- */
html[data-theme="dark"] .hero-gradient {
    background: linear-gradient(158deg, #060b15 0%, #0b1220 35%, #132347 65%, #1d4ed8 100%) !important;
}
html[data-theme="dark"] .hero-gradient a.bg-white {
    background-color: #e2e8f0 !important;
    color: #0b1220 !important;
    box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.7) !important;
}
html[data-theme="dark"] .hero-gradient a.bg-white:hover { background-color: #f1f5f9 !important; }

/* ---- Landing hero: Brown components on the statics dashboard ---- */
html[data-theme="brown"] .from-gray-50 { --tw-gradient-from: #faf8f2; }
html[data-theme="brown"] .hover\:shadow-2xl:hover { box-shadow: 0 25px 50px -12px rgba(95, 70, 50, 0.45) !important; }

/* ---- Pastel stat tiles & charts: Brown keeps warm info tints ---- */

/* ---- Pastel stat tiles & charts: Dark -> dark tiles so light text stays readable ---- */
html[data-theme="dark"] .from-gray-50 { --tw-gradient-from: #121c2e; }
html[data-theme="dark"] .from-blue-50 { --tw-gradient-from: #141f38; }
html[data-theme="dark"] .from-green-50 { --tw-gradient-from: #12261b; }
html[data-theme="dark"] .to-emerald-50 { --tw-gradient-to: #10241c; }
html[data-theme="dark"] .from-red-50 { --tw-gradient-from: #2a1418; }
html[data-theme="dark"] .to-pink-50 { --tw-gradient-to: #2d141c; }
html[data-theme="dark"] .from-yellow-50 { --tw-gradient-from: #2a2312; }
html[data-theme="dark"] .to-amber-50 { --tw-gradient-to: #2b1f10; }
html[data-theme="dark"] .from-indigo-50 { --tw-gradient-from: #172039; }
html[data-theme="dark"] .to-indigo-50 { --tw-gradient-to: #16213a; }
html[data-theme="dark"] .to-violet-50 { --tw-gradient-to: #1c1433; }
html[data-theme="dark"] .from-orange-50 { --tw-gradient-from: #2b1c10; }
html[data-theme="dark"] .to-yellow-50 { --tw-gradient-to: #2a2312; }
html[data-theme="dark"] .from-purple-50 { --tw-gradient-from: #211531; }
html[data-theme="dark"] .to-slate-50 { --tw-gradient-to: #16213a; }
html[data-theme="dark"] .hover\:shadow-2xl:hover { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important; }

/* ---- Colored card borders: Dark ---- */
html[data-theme="dark"] .border-green-200 { border-color: #1f4d35 !important; }
html[data-theme="dark"] .border-red-200 { border-color: #6e2730 !important; }
html[data-theme="dark"] .border-yellow-200 { border-color: #6b5b1e !important; }
html[data-theme="dark"] .border-orange-200 { border-color: #6b4a1e !important; }
html[data-theme="dark"] .border-purple-200 { border-color: #4c2f63 !important; }
html[data-theme="dark"] .border-pink-200 { border-color: #5c2a45 !important; }
html[data-theme="dark"] .border-indigo-200 { border-color: #33446e !important; }

/* ---- Progress ring background track: Dark ---- */
html[data-theme="dark"] circle[stroke="#e5e7eb"] { stroke: #2c3a52; }

/* ---- Brown mode also needs chart/stat text accents readable ---- */
html[data-theme="brown"] .border-green-200 { border-color: #cfe3c9 !important; }

/* ============================================================
   AI EXPLANATION SECTION (inline, Test Interface)
   ============================================================ */
html[data-theme="dark"] .ai-explanation-section {
    background: #1e1f22 !important;
    border-color: #2c3a52 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25) !important;
}
html[data-theme="brown"] .ai-explanation-section {
    background: #fdf9f0 !important;
    border-color: #e5d8c7 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
html[data-theme="dark"] .ai-explanation-body blockquote {
    border-left-color: #3b82f6 !important;
    color: #94a3b8 !important;
}
html[data-theme="brown"] .ai-explanation-body blockquote {
    border-left-color: #76583f !important;
    color: #667085 !important;
}
html[data-theme="dark"] .ai-explanation-loading {
    color: #94a3b8 !important;
}
html[data-theme="dark"] .ai-explanation-loading .spinner {
    border-color: #2c3a52 !important;
    border-top-color: #3b82f6 !important;
}
html[data-theme="brown"] .ai-explanation-loading .spinner {
    border-color: #e5d8c7 !important;
    border-top-color: #76583f !important;
}
html[data-theme="dark"] .ai-tutor-btn {
    background: #2563eb !important;
}
html[data-theme="brown"] .ai-tutor-btn {
    background: #76583f !important;
}

/* ============================================================
   PREVIOUS TESTS PAGE  (Test/Index.cshtml)
   ============================================================ */

/* ---- Dark mode ---- */
html[data-theme="dark"] .test-results-container { color: #e0e0e0 !important; }
html[data-theme="dark"] .page-title            { color: #e0e0e0 !important; }
html[data-theme="dark"] .pagination-info       { color: #999 !important; }
html[data-theme="dark"] .mobile-card           { background: #2d2d30 !important; border-color: #3d3d40 !important; }
html[data-theme="dark"] .card-title            { color: #e0e0e0 !important; }
html[data-theme="dark"] .detail-label          { color: #999 !important; }
html[data-theme="dark"] .detail-value          { color: #e0e0e0 !important; }
html[data-theme="dark"] .empty-card            { color: #777 !important; }
html[data-theme="dark"] .table-responsive      { background: #2d2d30 !important; }
html[data-theme="dark"] .results-table tbody tr         { border-bottom-color: #3d3d40 !important; }
html[data-theme="dark"] .results-table tbody tr:hover   { background: #3a3a3d !important; }
html[data-theme="dark"] .results-table td               { color: #e0e0e0 !important; }
html[data-theme="dark"] .page-link              { color: #ddd !important; background: #2d2d30 !important; border-color: #3d3d40 !important; }
html[data-theme="dark"] .page-link:hover:not(.active)   { background: #3a3a3d !important; }
html[data-theme="dark"] .page-item.active .page-link    { color: #fff !important; background: #3b82f6 !important; border-color: #3b82f6 !important; }
html[data-theme="dark"] .page-item.disabled .page-link  { background: #252528 !important; color: #666 !important; }
html[data-theme="dark"] .search-form .input-group        { background: #2d2d30 !important; }
html[data-theme="dark"] .search-form input[type="text"]  { color: #e0e0e0 !important; }
html[data-theme="dark"] .modal-content     { background: #2d2d30 !important; }
html[data-theme="dark"] .modal-header      { background: #3a3a3d !important; }
html[data-theme="dark"] .modal-title       { color: #e0e0e0 !important; }
html[data-theme="dark"] .modal-message     { color: #bbb !important; }
html[data-theme="dark"] .cancel-button     { background: #3a3a3d !important; color: #ddd !important; border-color: #4a4a4d !important; }
html[data-theme="dark"] .cancel-button:hover { background: #4a4a4d !important; }
html[data-theme="dark"] .toast-notification { background: #3a3a3d !important; }

/* ---- Brown mode ---- */
html[data-theme="brown"] .test-results-container { color: #172033 !important; }
html[data-theme="brown"] .page-title             { color: #172033 !important; }
html[data-theme="brown"] .pagination-info        { color: #98a2b3 !important; }
html[data-theme="brown"] .mobile-card            { background: #fffdf8 !important; border-color: #e5d8c7 !important; }
html[data-theme="brown"] .card-title             { color: #172033 !important; }
html[data-theme="brown"] .detail-label           { color: #667085 !important; }
html[data-theme="brown"] .detail-value           { color: #172033 !important; }
html[data-theme="brown"] .empty-card             { color: #98a2b3 !important; }
html[data-theme="brown"] .table-responsive       { background: #fffdf8 !important; }
html[data-theme="brown"] .results-table tbody tr          { border-bottom-color: #e5d8c7 !important; }
html[data-theme="brown"] .results-table tbody tr:hover    { background: #f5f0e8 !important; }
html[data-theme="brown"] .results-table td                { color: #172033 !important; }
html[data-theme="brown"] .page-link              { color: #667085 !important; background: #fffdf8 !important; border-color: #e5d8c7 !important; }
html[data-theme="brown"] .page-link:hover:not(.active)    { background: #f5f0e8 !important; }
html[data-theme="brown"] .page-item.active .page-link     { color: #fff !important; background: #76583f !important; border-color: #76583f !important; }
html[data-theme="brown"] .page-item.disabled .page-link   { background: #f5f0e8 !important; color: #98a2b3 !important; }
html[data-theme="brown"] .search-form .input-group         { background: #fffdf8 !important; }
html[data-theme="brown"] .search-form input[type="text"]   { color: #172033 !important; }
html[data-theme="brown"] .modal-content      { background: #fffdf8 !important; }
html[data-theme="brown"] .modal-header       { background: #f5f0e8 !important; }
html[data-theme="brown"] .modal-title        { color: #172033 !important; }
html[data-theme="brown"] .modal-message      { color: #667085 !important; }
html[data-theme="brown"] .cancel-button      { background: #fffdf8 !important; color: #667085 !important; border-color: #e5d8c7 !important; }
html[data-theme="brown"] .cancel-button:hover { background: #f5f0e8 !important; }
html[data-theme="brown"] .toast-notification { background: #5f4632 !important; }

/* ============================================================
   NOTEBOOK MODAL  (_NoteBookPartialView.cshtml)
   Follows the site theme via html[data-theme]
   ============================================================ */

/* ---- Dark mode (enhanced) ---- */
html[data-theme="dark"] #notebookModal {
  --nb-light: #1e1f22;
  --nb-dark: #e0e0e0;
  --nb-gray-50: #26262a;
  --nb-gray-100: #2d2d32;
  --nb-gray-200: #38383e;
  --nb-gray-300: #48484f;
  --nb-gray-400: #8b8b94;
  --nb-gray-500: #9e9ea8;
  --nb-gray-600: #b2b2bc;
  --nb-gray-700: #c8c8d0;
  --nb-gray-800: #e0e0e0;
  --nb-gray-900: #f0f0f4;
  --nb-primary: #3b82f6;
  --nb-primary-dark: #2563eb;
  --nb-primary-light: #60a5fa;
  --nb-primary-bg: rgba(59, 130, 246, 0.14);
  --gray-500: #9e9ea8;
  --gray-700: #c8c8d0;
  --gray-800: #e0e0e0;
}

/* Surfaces — main */
html[data-theme="dark"] #notebookModal .modal-container,
html[data-theme="dark"] #notebookModal .notebook-editor,
html[data-theme="dark"] #notebookModal #quill-editor,
html[data-theme="dark"] #notebookModal #mobile-quill-editor,
html[data-theme="dark"] #notebookModal .mobile-view {
  background: #1e1f22 !important;
  color: #d4d4d8 !important;
}

/* Surfaces — panels & toolbar */
html[data-theme="dark"] #notebookModal .ql-toolbar,
html[data-theme="dark"] #notebookModal .notebook-list,
html[data-theme="dark"] #notebookModal #listView,
html[data-theme="dark"] #notebookModal .mobile-view-toggle,
html[data-theme="dark"] #notebookModal .notebook-actions {
  background: #252528 !important;
  border-color: #38383e !important;
}

/* Quill Snow CDN overrides */
html[data-theme="dark"] .ql-snow .ql-toolbar,
html[data-theme="dark"] .ql-snow.ql-toolbar {
  background: #252528 !important;
  border-color: #38383e !important;
}
html[data-theme="dark"] .ql-snow .ql-container {
  border-color: #38383e !important;
}
html[data-theme="dark"] .ql-snow .ql-picker-label {
  color: #b2b2bc !important;
}
html[data-theme="dark"] .ql-snow .ql-picker-options {
  background: #2d2d32 !important;
  border-color: #48484f !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
}
html[data-theme="dark"] .ql-snow .ql-picker-item:hover {
  color: #60a5fa !important;
}
html[data-theme="dark"] .ql-snow .ql-stroke {
  stroke: #9e9ea8 !important;
}
html[data-theme="dark"] .ql-snow .ql-fill {
  fill: #9e9ea8 !important;
}
html[data-theme="dark"] .ql-snow button:hover .ql-stroke,
html[data-theme="dark"] .ql-snow .ql-picker-label:hover .ql-stroke,
html[data-theme="dark"] .ql-snow button.ql-active .ql-stroke {
  stroke: #60a5fa !important;
}
html[data-theme="dark"] .ql-snow button:hover .ql-fill,
html[data-theme="dark"] .ql-snow button.ql-active .ql-fill {
  fill: #60a5fa !important;
}
html[data-theme="dark"] .ql-snow .ql-tooltip {
  background: #2d2d32 !important;
  border-color: #48484f !important;
  color: #d4d4d8 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
html[data-theme="dark"] .ql-snow .ql-tooltip input[type="text"] {
  background: #1e1f22 !important;
  border-color: #48484f !important;
  color: #e0e0e0 !important;
}
html[data-theme="dark"] .ql-snow a {
  color: #60a5fa !important;
}
html[data-theme="dark"] .ql-toolbar.ql-snow .ql-formats {
  margin-right: 10px !important;
}
html[data-theme="dark"] .ql-snow .ql-tooltip-arrow {
  border-top-color: #48484f !important;
}

/* Quill editor content areas */
html[data-theme="dark"] #notebookModal .ql-container {
  background: #1e1f22 !important;
  color: #d4d4d8 !important;
}
html[data-theme="dark"] #notebookModal .ql-editor {
  color: #d4d4d8 !important;
}
html[data-theme="dark"] #notebookModal .ql-editor.ql-blank::before {
  color: #6b6b74 !important;
  font-style: italic;
}
html[data-theme="dark"] #notebookModal .ql-editor h1 {
  color: #f0f0f4 !important;
}
html[data-theme="dark"] #notebookModal .ql-editor h2 {
  color: #e0e0e0 !important;
}
html[data-theme="dark"] #notebookModal .ql-editor pre {
  background: #16171a !important;
  color: #e5e7eb !important;
  border: 1px solid #38383e !important;
}
html[data-theme="dark"] #notebookModal .ql-editor code {
  background: #333338 !important;
  color: #60a5fa !important;
}
html[data-theme="dark"] #notebookModal .ql-editor blockquote {
  background: rgba(59, 130, 246, 0.08) !important;
  border-left-color: #3b82f6 !important;
  color: #9e9ea8 !important;
}

/* Form inputs */
html[data-theme="dark"] #notebookModal .form-input {
  background: #252528 !important;
  border-color: #48484f !important;
  color: #e0e0e0 !important;
}
html[data-theme="dark"] #notebookModal .form-input:focus {
  background: #2a2a2e !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}
html[data-theme="dark"] #notebookModal .form-input::placeholder {
  color: #6b6b74 !important;
}

/* Buttons */
html[data-theme="dark"] #notebookModal .btn-secondary {
  background: #2d2d32 !important;
  color: #b2b2bc !important;
  border-color: #48484f !important;
}
html[data-theme="dark"] #notebookModal .btn-secondary:hover {
  background: #38383e !important;
  border-color: #5a5a62 !important;
  color: #e0e0e0 !important;
}
html[data-theme="dark"] #notebookModal .btn-primary {
  background: #2563eb !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
}
html[data-theme="dark"] #notebookModal .btn-primary:hover {
  background: #1d4ed8 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45) !important;
}

/* Cards */
html[data-theme="dark"] #notebookModal .notebook-card {
  background: #252528 !important;
  border-color: #38383e !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}
html[data-theme="dark"] #notebookModal .notebook-card:hover {
  background: #2d2d32 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.18) !important;
}
html[data-theme="dark"] #notebookModal .notebook-list > div:first-child {
  background: #252528 !important;
}

/* View toggle */
html[data-theme="dark"] #notebookModal .view-toggle-btn {
  color: #9e9ea8 !important;
}
html[data-theme="dark"] #notebookModal .view-toggle-btn:hover {
  background: #333338 !important;
  color: #e0e0e0 !important;
}
html[data-theme="dark"] #notebookModal .view-toggle-btn.active {
  background: #2563eb !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35) !important;
}

/* Stats chips */
html[data-theme="dark"] #notebookModal .bg-gray-100 {
  background-color: #2d2d32 !important;
  color: #9e9ea8 !important;
}

/* Tags — less garish in dark */
html[data-theme="dark"] #notebookModal .tag-new {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
}
html[data-theme="dark"] #notebookModal .tag-updated {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #60a5fa !important;
}

/* Content preview */
html[data-theme="dark"] #notebookModal .notebook-content-preview {
  color: #9e9ea8 !important;
}

/* Action buttons */
html[data-theme="dark"] #notebookModal .edit-btn {
  color: #60a5fa !important;
}
html[data-theme="dark"] #notebookModal .edit-btn:hover {
  background: rgba(59, 130, 246, 0.12) !important;
}
html[data-theme="dark"] #notebookModal .delete-btn {
  color: #f87171 !important;
}
html[data-theme="dark"] #notebookModal .delete-btn:hover {
  background: rgba(239, 68, 68, 0.12) !important;
}
html[data-theme="dark"] #notebookModal .hover\:bg-red-50:hover {
  background: rgba(239, 68, 68, 0.12) !important;
}
html[data-theme="dark"] #notebookModal .hover\:bg-gray-100:hover {
  background: #333338 !important;
}
html[data-theme="dark"] #notebookModal .hover\:text-gray-200:hover {
  color: #e0e0e0 !important;
}

/* Text color utilities */
html[data-theme="dark"] #notebookModal .text-primary {
  color: #3b82f6 !important;
}
html[data-theme="dark"] #notebookModal .text-red-600 {
  color: #f87171 !important;
}
html[data-theme="dark"] #notebookModal .text-red-500 {
  color: #f87171 !important;
}
html[data-theme="dark"] #notebookModal .bg-red-100 {
  background-color: rgba(239, 68, 68, 0.14) !important;
}
html[data-theme="dark"] #notebookModal .bg-primary-bg {
  background-color: rgba(59, 130, 246, 0.12) !important;
}
html[data-theme="dark"] #notebookModal .text-primary-light {
  color: #60a5fa !important;
}

/* Empty state */
html[data-theme="dark"] #notebookModal .w-20.h-20.bg-primary-bg,
html[data-theme="dark"] #notebookModal .w-20.h-20 {
  background-color: rgba(59, 130, 246, 0.12) !important;
}

/* Scrollbar styling */
html[data-theme="dark"] #notebookModal .custom-scrollbar::-webkit-scrollbar-track {
  background: #1e1f22 !important;
}
html[data-theme="dark"] #notebookModal .custom-scrollbar::-webkit-scrollbar-thumb {
  background: #48484f !important;
  border-color: #1e1f22 !important;
}
html[data-theme="dark"] #notebookModal .custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #5a5a62 !important;
}
html[data-theme="dark"] #notebookModal .custom-scrollbar {
  scrollbar-color: #48484f #1e1f22 !important;
}
html[data-theme="dark"] #notebookModal #notebookList::-webkit-scrollbar-track,
html[data-theme="dark"] #notebookModal #mobileNotebookList::-webkit-scrollbar-track {
  background: #1e1f22 !important;
}
html[data-theme="dark"] #notebookModal #notebookList::-webkit-scrollbar-thumb,
html[data-theme="dark"] #notebookModal #mobileNotebookList::-webkit-scrollbar-thumb {
  background: #48484f !important;
  border-color: #1e1f22 !important;
}

/* Box shadows — deeper on dark */
html[data-theme="dark"] #notebookModal .modal-container {
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px #38383e !important;
}

/* Header gradient */
html[data-theme="dark"] #notebookModal .flex.justify-between.items-center.px-4.py-3 {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
}

/* Confirm dialog (JS-rendered) */
html[data-theme="dark"] #confirmModal,
html[data-theme="dark"] .confirm-overlay {
  background-color: rgba(0, 0, 0, 0.65) !important;
}
html[data-theme="dark"] #confirmModal .modal-content,
html[data-theme="dark"] .confirm-content,
html[data-theme="dark"] .fixed .rounded-lg .shadow-xl {
  background: #252528 !important;
  border-color: #38383e !important;
  color: #d4d4d8 !important;
}

/* Alert / toast */
html[data-theme="dark"] #notebookAlert,
html[data-theme="dark"] .fixed.top-4.right-4 {
  background: #2d2d32 !important;
  border-color: #48484f !important;
  color: #d4d4d8 !important;
}

/* Loading spinner */
html[data-theme="dark"] #notebookModal .border-primary-light {
  border-color: rgba(59, 130, 246, 0.25) !important;
}
html[data-theme="dark"] #notebookModal .border-t-primary {
  border-top-color: #3b82f6 !important;
}

/* Focus ring */
html[data-theme="dark"] #notebookModal input:focus-visible,
html[data-theme="dark"] #notebookModal .form-input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

/* Label colors (inline style: var(--gray-700)) */
html[data-theme="dark"] #notebookModal label {
  color: #b2b2bc !important;
}

/* ---- Brown mode ---- */
html[data-theme="brown"] #notebookModal {
  --nb-light: #fffdf8;
  --nb-dark: #172033;
  --nb-gray-50: #fffdf8;
  --nb-gray-100: #f5f0e8;
  --nb-gray-200: #e5d8c7;
  --nb-gray-300: #dccbbb;
  --nb-gray-400: #98a2b3;
  --nb-gray-500: #667085;
  --nb-gray-600: #667085;
  --nb-gray-700: #4f5a6d;
  --nb-gray-800: #172033;
  --nb-gray-900: #172033;
  --nb-primary: #76583f;
  --nb-primary-dark: #5f4632;
  --nb-primary-light: #8a6a4d;
  --nb-primary-bg: rgba(118, 88, 63, 0.12);
  --gray-500: #667085;
  --gray-700: #4f5a6d;
  --gray-800: #172033;
}
html[data-theme="brown"] #notebookModal .modal-container,
html[data-theme="brown"] #notebookModal .notebook-editor,
html[data-theme="brown"] #notebookModal .ql-container,
html[data-theme="brown"] #notebookModal .ql-editor,
html[data-theme="brown"] #notebookModal #quill-editor,
html[data-theme="brown"] #notebookModal #mobile-quill-editor,
html[data-theme="brown"] #notebookModal .form-input,
html[data-theme="brown"] #notebookModal .form-input:focus,
html[data-theme="brown"] #notebookModal .mobile-view,
html[data-theme="brown"] #notebookModal .notebook-card {
  background: #fffdf8 !important;
}
html[data-theme="brown"] #notebookModal .ql-toolbar,
html[data-theme="brown"] #notebookModal .notebook-list,
html[data-theme="brown"] #notebookModal .notebook-list > div:first-child,
html[data-theme="brown"] #notebookModal #listView,
html[data-theme="brown"] #notebookModal .mobile-view-toggle {
  background: #f5f0e8 !important;
}
html[data-theme="brown"] #notebookModal .view-toggle-btn:hover {
  background: #efe5d6 !important;
  color: var(--nb-gray-800);
}
html[data-theme="brown"] #notebookModal .notebook-card:hover {
  background: #f5f0e8 !important;
  border-color: var(--nb-primary-light) !important;
}
html[data-theme="brown"] #notebookModal .delete-btn:hover,
html[data-theme="brown"] #notebookModal .edit-btn:hover,
html[data-theme="brown"] #notebookModal .hover\:bg-red-50:hover,
html[data-theme="brown"] #notebookModal .hover\:bg-gray-100:hover {
  background: #efe5d6 !important;
}
html[data-theme="brown"] #notebookModal .ql-editor pre {
  background: #efe5d6 !important;
  color: #5f4632 !important;
}
html[data-theme="brown"] #notebookModal .ql-editor code {
  background: #f5f0e8 !important;
  color: #76583f !important;
}
html[data-theme="brown"] #notebookModal .custom-scrollbar::-webkit-scrollbar-thumb {
  border-color: #fffdf8 !important;
}
html[data-theme="brown"] #notebookModal #notebookList::-webkit-scrollbar-thumb,
html[data-theme="brown"] #notebookModal #mobileNotebookList::-webkit-scrollbar-thumb {
  border-color: #fffdf8 !important;
}
html[data-theme="brown"] #notebookModal .flex.justify-between.items-center.px-4.py-3 {
  background: linear-gradient(135deg, var(--nb-primary), var(--nb-primary-dark)) !important;
}