/* ============================================================
   dark-mode.css — حالت تاریک سراسری سایت مدرسه ریاضی
   فعال‌سازی: <html data-theme="dark">
   این فایل باید بعد از استایل‌های داخلی هر صفحه لود شود.
   ============================================================ */

html[data-theme="dark"] {
    color-scheme: dark;

    /* ── طرح رنگ پنل‌ها (دانش‌آموز / معلم / ادمین) ── */
    --primary:    #3b82f6;
    --primary-l:  #60a5fa;
    --bg:         #0f172a;
    --topbar-bg:  #1e293b;
    --sidebar-bg: #1e293b;
    --card-bg:    #1e293b;
    --text:       #e2e8f0;
    --muted:      #94a3b8;
    --border:     #334155;

    /* ── طرح رنگ صفحات ورود / ثبت‌نام / راهنما / لندینگ ── */
    --p:  #60a5fa;
    --pd: #3b82f6;
    --t:  #e2e8f0;
    --tl: #94a3b8;
    --sh: 0 6px 16px rgba(0,0,0,.45);

    /* ── طرح رنگ صفحات آزمون (exam_play / exam_result) ── */
    --l:  #263449;
    --da: #e2e8f0;
    --bd: 1px solid #334155;

    /* ── رنگ‌های نمودار هندسی سوالات (do_exercise121.php و مشابه) ──
       این تمرین‌ها نمودار SVG را با رنگ‌های ثابت (فرض‌شده روی پس‌زمینه
       روشن) تولید می‌کنند. چون در حالت تاریک پس‌زمینه‌ی جعبه‌ی سوال
       (--l بالا) تیره می‌شود، آن رنگ‌های ثابت—به‌خصوص رنگ‌های تیره مثل
       آبی‌سرمه‌ای برچسب رأس‌ها یا علامت زاویه‌ی قائمه—تقریباً نامرئی
       می‌شدند. کد PHP این مقادیر را با var(--geo-xxx, رنگ‌روشن) صدا
       می‌زند؛ این‌جا فقط برای حالت تاریک، نسخه‌ی روشن‌تر هرکدام را
       تعریف می‌کنیم (در حالت روشن این متغیرها اصلاً تعریف نشده‌اند و
       کد از همان رنگ اصلی/فال‌بک استفاده می‌کند). */
    --geo-vertex:  #93c5fd; /* رأس‌ها/برچسب نقاط — بود: #1e40af */
    --geo-dark:    #e2e8f0; /* علامت زاویه قائمه و متن سوال — بود: #1e293b */
    --geo-muted:   #94a3b8; /* برچسب‌های فرعی/اندازه — بود: #64748b */
    --geo-red:     #f87171; /* بود: #dc2626 */
    --geo-blue:    #60a5fa; /* خط دور شکل‌ها — بود: #2563eb */
    --geo-green:   #34d399; /* بود: #059669 */
    --geo-purple:  #a78bfa; /* بود: #7c3aed */
    --geo-cyan:    #22d3ee; /* بود: #0891b2 */
    --geo-pink:    #f472b6; /* بود: #db2777 */
    --geo-gray:    #cbd5e1; /* دور شکل‌های همنهشتی — بود: #94a3b8 */
    --geo-text:    #dbeafe; /* پیش‌فرض مقادیر ریاضی (mlShow/mlBlock/mlInline) — بود: #1e3a5f */
    --geo-given:   #cbd5e1; /* متن «داده‌شده» بالای سوال — بود: #374151 */
    --geo-orange:  #fbbf24; /* بود: #d97706 */
    --geo-teal:    #2dd4bf; /* بود: #059689 */
    --geo-emerald: #4ade80; /* بود: #16a34a */
    --geo-violet:  #c084fc; /* بود: #9333ea */
    --geo-olive:   #a3e635; /* بود: #65a30d */
    --geo-box-bg:     #16223a; /* پس‌زمینه‌ی جعبه‌های عدد فارسی/نمایش — بود: #f8fafc */
    --geo-box-border: #334155; /* بود: #e2e8f0 */

    /* ── طرح رنگ exercise.php ── */
    --light: #263449;
    --dark: #e2e8f0;
    --card-gradient: linear-gradient(120deg, #1e293b 0%, #24334a 100%);
    --bg-gradient: linear-gradient(135deg, #1e2a4a 0%, #33254a 100%);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;

    /* ── طرح رنگ student_register / start_online_exam ── */
    --card: #1e293b;
    --shadow: rgba(0,0,0,.5);
    --error-bg: rgba(239,68,68,.14);
    --error-text: #fca5a5;
    --error-border: rgba(239,68,68,.35);
    --success-bg: rgba(16,185,129,.14);
    --success-text: #6ee7b7;
    --success-border: rgba(16,185,129,.35);
}

/* ── پس‌زمینه کلی ── */
html[data-theme="dark"] body {
    background: #0f172a !important;
    color: var(--text, #e2e8f0);
}
html[data-theme="dark"] body::before,
html[data-theme="dark"] body::after {
    opacity: .12 !important;
}

/* ============================================================
   پنل‌ها (سایدبار / تاپ‌بار / کارت / جدول / فرم)
   ============================================================ */
html[data-theme="dark"] .topbar { box-shadow: 0 1px 6px rgba(0,0,0,.4); }
html[data-theme="dark"] .nav-item:hover { background: rgba(96,165,250,.10); color: var(--primary-l); }
html[data-theme="dark"] .nav-item.active { background: rgba(96,165,250,.14); color: var(--primary-l); }
html[data-theme="dark"] .nav-subitem.active { background: rgba(96,165,250,.14); color: var(--primary-l); }
html[data-theme="dark"] .nav-item.danger:hover { background: rgba(239,68,68,.12); }
html[data-theme="dark"] .nav-sub { background: rgba(15,23,42,.55); }
html[data-theme="dark"] .card { box-shadow: 0 2px 8px rgba(0,0,0,.35); }
html[data-theme="dark"] .card-title { color: var(--primary-l); }

/* جدول‌ها */
html[data-theme="dark"] thead th { background: #1d4ed8; color: #f1f5f9; }
html[data-theme="dark"] tbody tr:hover { background: rgba(96,165,250,.07); }

/* فرم‌ها */
html[data-theme="dark"] .form-group input,
html[data-theme="dark"] .form-group select,
html[data-theme="dark"] .form-group textarea,
html[data-theme="dark"] .filter-box select,
html[data-theme="dark"] .input-group input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #64748b !important; }
html[data-theme="dark"] .form-group input:focus,
html[data-theme="dark"] .form-group select:focus,
html[data-theme="dark"] .form-group textarea:focus,
html[data-theme="dark"] .input-group input:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96,165,250,.18) !important;
}

/* پیام‌های flash */
html[data-theme="dark"] .flash-success,
html[data-theme="dark"] .flash.success { background: rgba(16,185,129,.13); color: #6ee7b7; border-color: rgba(16,185,129,.35); }
html[data-theme="dark"] .flash-error,
html[data-theme="dark"] .flash.error { background: rgba(239,68,68,.13); color: #fca5a5; border-color: rgba(239,68,68,.35); }
html[data-theme="dark"] .error {
    background: rgba(239,68,68,.13) !important;
    color: #fca5a5 !important;
    border-color: rgba(239,68,68,.35) !important;
}

/* بج‌ها */
html[data-theme="dark"] .badge-success { background: rgba(16,185,129,.16); color: #6ee7b7; }
html[data-theme="dark"] .badge-warning { background: rgba(245,158,11,.16); color: #fcd34d; }
html[data-theme="dark"] .badge-danger  { background: rgba(239,68,68,.16); color: #fca5a5; }
html[data-theme="dark"] .badge-muted   { background: rgba(148,163,184,.14); color: #cbd5e1; }
html[data-theme="dark"] .badge-primary { background: rgba(96,165,250,.16); color: #93c5fd; }

/* جعبه‌های اطلاعات و فیلتر */
html[data-theme="dark"] .info-box { background: #24334a; border-color: #38507a; }
html[data-theme="dark"] .info-box strong { color: #93c5fd; }
html[data-theme="dark"] .filter-box { background: #16223a; }
html[data-theme="dark"] .filter-box label { color: #93c5fd; }

/* دکمه‌های روشن */
html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .link-btn.copy { background: rgba(96,165,250,.16); color: #93c5fd; }

/* مودال اطلاعیه */
html[data-theme="dark"] .ann-modal { background: #1e293b; }
html[data-theme="dark"] .ann-modal h3 { color: #93c5fd; }
html[data-theme="dark"] .ann-badge { border-color: #1e293b; }

/* ============================================================
   صفحات ورود / ثبت‌نام / بازیابی رمز (کارت‌های شیشه‌ای)
   ============================================================ */
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .register-box,
html[data-theme="dark"] .reset-card,
html[data-theme="dark"] .otp-card,
html[data-theme="dark"] .container[class="container"] {
    background: rgba(30,41,59,.90) !important;
    border-color: rgba(148,163,184,.18) !important;
}
html[data-theme="dark"] body > .container {
    background: rgba(30,41,59,.92) !important;
}

/* ============================================================
   لندینگ (index.php) و صفحات راهنما
   ============================================================ */
html[data-theme="dark"] header,
html[data-theme="dark"] header.scrolled,
html[data-theme="dark"] header.help-header {
    background: rgba(15,23,42,.92) !important;
    border-bottom-color: rgba(148,163,184,.15) !important;
}
html[data-theme="dark"] header.help-header nav a:hover { background: rgba(96,165,250,.12); }
html[data-theme="dark"] header.help-header nav a.active { background: rgba(96,165,250,.18); }
html[data-theme="dark"] .help-toc,
html[data-theme="dark"] .h-section {
    background: rgba(30,41,59,.85) !important;
    border-color: rgba(148,163,184,.15) !important;
}
html[data-theme="dark"] .help-toc a:hover { background: rgba(96,165,250,.12); }
html[data-theme="dark"] .help-toc a::before { color: #0f172a; }

/* ============================================================
   صفحات آزمون (exam_play / exam_result / exercise)
   ============================================================ */
html[data-theme="dark"] .exam-box {
    background: rgba(30,41,59,.96) !important;
    color: #e2e8f0;
}

/* MathLive و MathJax */
html[data-theme="dark"] math-field {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}
html[data-theme="dark"] mjx-container { color: inherit; }

/* ============================================================
   تقویم شمسی (persian-datepicker) در حالت تاریک
   کتابخانه اصلاً حالت تاریک ندارد و همیشه پس‌زمینه سفید دارد؛
   روی صفحهٔ تاریک این باعث می‌شد مرورگر/سیستم‌عامل (روی ویندوز)
   رنگ‌های ویجت را خودکار و ناقص معکوس کند و شمارهٔ خیلی از روزها
   ناخوانا/نامرئی شود. این‌جا خودمان تم تاریک واقعی به آن می‌دهیم.
   ============================================================ */
html[data-theme="dark"] .datepicker-plot-area {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .datepicker-plot-area * { color: #e2e8f0; }
html[data-theme="dark"] .datepicker-plot-area .table-days td span {
    background-color: transparent !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .datepicker-plot-area .table-days td.disabled span {
    background-color: rgba(148,163,184,.12) !important;
    color: #64748b !important;
}
html[data-theme="dark"] .datepicker-plot-area .table-days td span.other-month {
    color: #475569 !important;
}
html[data-theme="dark"] .datepicker-plot-area .table-days td.today span {
    background-color: #10b981 !important;
    color: #fff !important;
}
html[data-theme="dark"] .datepicker-plot-area .table-days td.selected span {
    background-color: #3b82f6 !important;
    color: #fff !important;
}
html[data-theme="dark"] .datepicker-plot-area .table-days td span:hover {
    background-color: rgba(96,165,250,.28) !important;
    color: #fff !important;
}
html[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .month-grid-box .header .header-row-cell {
    color: #93c5fd !important;
}
html[data-theme="dark"] .datepicker-plot-area .datepicker-navigator .pwt-btn-next,
html[data-theme="dark"] .datepicker-plot-area .datepicker-navigator .pwt-btn-switch,
html[data-theme="dark"] .datepicker-plot-area .datepicker-navigator .pwt-btn-prev {
    background-color: rgba(96,165,250,.14) !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .datepicker-plot-area .toolbox .pwt-btn-submit,
html[data-theme="dark"] .datepicker-plot-area .toolbox .pwt-btn-calendar,
html[data-theme="dark"] .datepicker-plot-area .toolbox .pwt-btn-today {
    background-color: rgba(96,165,250,.16) !important;
    color: #93c5fd !important;
}
html[data-theme="dark"] .datepicker-plot-area .datepicker-time-view {
    background-color: #16223a !important;
    border-top-color: #334155 !important;
}
html[data-theme="dark"] .datepicker-plot-area .datepicker-time-view input {
    color: #e2e8f0 !important;
    background: transparent !important;
}
html[data-theme="dark"] .datepicker-plot-area .datepicker-year-view .year-item,
html[data-theme="dark"] .datepicker-plot-area .datepicker-month-view .month-item {
    color: #e2e8f0 !important;
}
/* روی صفحه، حتی اگر تم سایت روشن باشد ولی مرورگر/ویندوز کاربر
   حالت تاریک اجباری برای وب داشته باشد، ویجت را از آن معاف می‌کنیم
   تا خودش را ناقص معکوس نکند */
.datepicker-container, .datepicker-plot-area { color-scheme: light; }
html[data-theme="dark"] .datepicker-container,
html[data-theme="dark"] .datepicker-plot-area { color-scheme: dark; }

/* ============================================================
   صفحات مبتنی بر Tailwind (مثل verify_change_phone)
   ============================================================ */
html[data-theme="dark"] .bg-white\/80,
html[data-theme="dark"] .bg-white {
    background-color: rgba(30,41,59,.92) !important;
}
html[data-theme="dark"] .border-white\/50 { border-color: rgba(148,163,184,.18) !important; }
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-800 { color: #cbd5e1 !important; }
html[data-theme="dark"] .bg-red-50 {
    background-color: rgba(239,68,68,.13) !important;
    border-color: rgba(239,68,68,.35) !important;
    color: #fca5a5 !important;
}

/* ============================================================
   ویجت پشتیبانی (چت تیکت — کاربر و مهمان)
   ============================================================ */
html[data-theme="dark"] #ticketModal,
html[data-theme="dark"] #gtkModal { background: #1e293b; }
html[data-theme="dark"] .tkt-body,
html[data-theme="dark"] .gtk-body { background: #0f172a; }
html[data-theme="dark"] .tkt-msg.admin,
html[data-theme="dark"] .gtk-msg.admin { background: #263449; color: #e2e8f0; }
html[data-theme="dark"] .tkt-typing-bubble,
html[data-theme="dark"] .gtk-typing-bubble { background: #263449; }
html[data-theme="dark"] .tkt-footer,
html[data-theme="dark"] .gtk-footer { background: #1e293b; border-top-color: #334155; }
html[data-theme="dark"] #tktInput,
html[data-theme="dark"] #gtkInput { background: #0f172a; color: #e2e8f0; border-color: #334155; }
html[data-theme="dark"] #tktInput:disabled,
html[data-theme="dark"] #gtkInput:disabled { background: #16223a; color: #64748b; }
html[data-theme="dark"] .tkt-closed-banner strong,
html[data-theme="dark"] .gtk-closed-banner strong { color: #cbd5e1; }
html[data-theme="dark"] .tkt-closed-banner p,
html[data-theme="dark"] .gtk-closed-banner p { color: #94a3b8; }

/* انتخاب بخش پشتیبانی باید در دارک‌مود هم کاملاً مشخص بماند. */
html[data-theme="dark"] #tktDeptChips {
    background: #16223a;
    border-color: #334155;
}
html[data-theme="dark"] .tkt-chips-label,
html[data-theme="dark"] .gtk-gate-dept-label { color: #94a3b8; }
html[data-theme="dark"] .tkt-dept-chip,
html[data-theme="dark"] .gtk-gate-dept-opt {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}
html[data-theme="dark"] .tkt-dept-chip:hover,
html[data-theme="dark"] .gtk-gate-dept-opt:hover {
    background: rgba(124,58,237,.16);
    border-color: #8b5cf6;
}
html[data-theme="dark"] .tkt-dept-chip.on,
html[data-theme="dark"] .gtk-gate-dept-opt.selected {
    background: #6d28d9;
    border-color: #a78bfa;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(167,139,250,.18);
}
html[data-theme="dark"] .tkt-dept-chip.on i,
html[data-theme="dark"] .gtk-gate-dept-opt.selected i { color: #fff; }

/* راهنما و وضعیت ظرفیت در فرم طراحی سؤال */
html[data-theme="dark"] .cq-academic-guide,
html[data-theme="dark"] #capacity_notice {
    background: #16223a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
html[data-theme="dark"] #capacity_notice.is-open {
    background: rgba(16,185,129,.13) !important;
    border-color: rgba(16,185,129,.35) !important;
    color: #6ee7b7 !important;
}
html[data-theme="dark"] #capacity_notice.is-full {
    background: rgba(239,68,68,.13) !important;
    border-color: rgba(239,68,68,.35) !important;
    color: #fca5a5 !important;
}

/* اسکرول‌بار */
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f172a; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; border-radius: 6px; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #475569; }

/* تصاویر: کمی کاهش درخشندگی برای راحتی چشم */
html[data-theme="dark"] img { filter: brightness(.92); }

/* ============================================================
   دکمه تغییر حالت (کلید تاریک/روشن)
   ============================================================ */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 50%;
    background: var(--card-bg, #fff);
    color: var(--muted, #64748b);
    cursor: pointer;
    transition: .2s;
    flex-shrink: 0;
    padding: 0;
}
.theme-toggle:hover {
    color: var(--primary-l, #3b82f6);
    border-color: var(--primary-l, #3b82f6);
    transform: rotate(15deg);
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .tt-sun { display: none; }
html[data-theme="dark"] .theme-toggle .tt-sun { display: block; }
html[data-theme="dark"] .theme-toggle .tt-moon { display: none; }
html[data-theme="dark"] .theme-toggle {
    background: #1e293b;
    border-color: #334155;
    color: #fbbf24;
}

/* حالت شناور برای صفحاتی که تاپ‌بار ندارند —
   بالای صفحه تا با کیبورد مجازی (MathLive) پایین صفحه تداخل نکند */
.theme-toggle--float {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top, 0px));
    left: 14px; /* بالا-چپ؛ عنوان صفحات RTL سمت راست است */
    z-index: 9500;
    width: 46px;
    height: 46px;
    box-shadow: 0 4px 14px rgba(0,0,0,.22);
    background: #fff;
}
html[data-theme="dark"] .theme-toggle--float {
    background: #1e293b;
    box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
.theme-toggle--float svg { width: 21px; height: 21px; }

/* موبایل: کوچک‌تر + رعایت ناحیه امن آیفون */
@media (max-width: 860px) {
    .theme-toggle--float {
        width: 40px;
        height: 40px;
        top: calc(10px + env(safe-area-inset-top, 0px));
        left: 10px;
    }
    .theme-toggle--float svg { width: 19px; height: 19px; }
}

/* جابه‌جایی نرم رنگ‌ها */
html.theme-transition,
html.theme-transition body,
html.theme-transition .card,
html.theme-transition .topbar,
html.theme-transition .sidebar {
    transition: background .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* ============================================================
   submit_homework.php — ارسال تکلیف
   ============================================================ */
html[data-theme="dark"] .container .card {
    background: #1e293b !important;
    border-color: #334155 !important;
}
html[data-theme="dark"] .message.success { background: rgba(16,185,129,.14); color: #6ee7b7; }
html[data-theme="dark"] .message.error   { background: rgba(239,68,68,.14) !important; color: #fca5a5 !important; }
html[data-theme="dark"] input[type="file"] {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}
html[data-theme="dark"] .image-box { background: #16223a; border-color: #334155; }
html[data-theme="dark"] .image-box img { border-color: #334155; }
html[data-theme="dark"] .upload-box { background: #16223a; border-color: #2c3e5f; }
html[data-theme="dark"] .upload-info { color: #93c5fd; }
html[data-theme="dark"] .upload-track { background: #334155; }
html[data-theme="dark"] .upload-guide { background: rgba(96,165,250,.10); border-color: rgba(96,165,250,.30); color: #bfdbfe; }

/* ============================================================
   start_online_exam.php — صفحه پاسخ‌دهی آزمون آنلاین
   ============================================================ */
html[data-theme="dark"] .question-card { background: #1e293b !important; }
html[data-theme="dark"] .question-type { background: rgba(96,165,250,.16); color: #93c5fd; }
html[data-theme="dark"] .question-score { background: rgba(245,158,11,.16); color: #fcd34d; }
html[data-theme="dark"] .readonly-mathlive-wrap { background: #16223a; border-color: #334155; }
html[data-theme="dark"] .option-item { background: #16223a; }
html[data-theme="dark"] .btn-secondary { background: rgba(96,165,250,.16) !important; color: #93c5fd !important; border-color: rgba(96,165,250,.25) !important; }
html[data-theme="dark"] .image-preview-box,
html[data-theme="dark"] .question-image-box,
html[data-theme="dark"] .meta-box { background: #16223a; border-color: #334155; }
html[data-theme="dark"] .question-nav { background: rgba(15,23,42,.97) !important; border-top-color: #334155 !important; }
html[data-theme="dark"] .exam-toast.error   { background: rgba(239,68,68,.16);  color: #fca5a5; border-color: rgba(239,68,68,.4); }
html[data-theme="dark"] .exam-toast.warning { background: rgba(245,158,11,.16); color: #fcd34d; border-color: rgba(245,158,11,.4); }
html[data-theme="dark"] .exam-toast.info    { background: rgba(96,165,250,.16); color: #93c5fd; border-color: rgba(96,165,250,.4); }
html[data-theme="dark"] .exam-toast.success { background: rgba(16,185,129,.16); color: #6ee7b7; border-color: rgba(16,185,129,.4); }

/* ============================================================
   exam_play.php / exam_result.php — قالب‌های آزمون تمرینی
   ============================================================ */
html[data-theme="dark"] .answer-mathfield { background: #0f172a !important; border-color: #334155 !important; color: #e2e8f0; }
html[data-theme="dark"] .box { background: rgba(30,41,59,.96) !important; color: #e2e8f0; }
html[data-theme="dark"] .math-result { background: #0f172a !important; }
html[data-theme="dark"] .prog { background: #334155 !important; }
html[data-theme="dark"] .msg { background: rgba(96,165,250,.14) !important; color: #93c5fd !important; }
html[data-theme="dark"] .time { color: #94a3b8 !important; }

/* پاسخ کاربر / پاسخ صحیح */
html[data-theme="dark"] .ua { background: #334155 !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .ca { background: rgba(16,185,129,.16) !important; color: #6ee7b7 !important; }

/* ── پاسخ تشریحی ── */
html[data-theme="dark"] .solution-wrap {
    background: #1e293b !important;
    border-color: rgba(245,158,11,.35) !important;
}
html[data-theme="dark"] .solution-head {
    background: linear-gradient(45deg, rgba(245,158,11,.20), rgba(249,115,22,.14)) !important;
    color: #fcd34d !important;
}
html[data-theme="dark"] .solution-content {
    background: #1a2438 !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .solution-content .sol-final { color: #6ee7b7 !important; }
html[data-theme="dark"] .solution-content mjx-container,
html[data-theme="dark"] .solution-content math-field { color: #e2e8f0 !important; }

/* دکمه کپی سوال */
html[data-theme="dark"] .copy-question-btn { background: rgba(96,165,250,.16) !important; color: #93c5fd !important; }
html[data-theme="dark"] .copy-question-btn.copied { background: rgba(16,185,129,.16) !important; color: #6ee7b7 !important; }

/* ============================================================
   exercise.php — تمرین تعاملی
   ============================================================ */
html[data-theme="dark"] .glass-card { background: rgba(30,41,59,.92) !important; }
html[data-theme="dark"] .stats-card,
html[data-theme="dark"] .achievement-badge,
html[data-theme="dark"] .history-item { background: #1e293b !important; }
html[data-theme="dark"] .operation-btn { background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0; }
html[data-theme="dark"] .operation-btn.active { background: var(--primary) !important; color: #fff; }
html[data-theme="dark"] .timer { background: rgba(30,41,59,.85) !important; color: #93c5fd; }
html[data-theme="dark"] .result-excellent { background: linear-gradient(135deg, rgba(16,185,129,.22), rgba(52,211,153,.14)) !important; }
html[data-theme="dark"] .result-good      { background: linear-gradient(135deg, rgba(96,165,250,.22), rgba(147,197,253,.14)) !important; }
html[data-theme="dark"] .result-average   { background: linear-gradient(135deg, rgba(245,158,11,.20), rgba(252,211,77,.12)) !important; }
html[data-theme="dark"] .result-poor      { background: linear-gradient(135deg, rgba(239,68,68,.22), rgba(252,165,165,.14)) !important; }

/* ============================================================
   student_register.php — ثبت‌نام دانش‌آموز
   ============================================================ */
html[data-theme="dark"] .class-info-box { background: #16223a !important; border-color: #334155 !important; }
html[data-theme="dark"] .class-description { background: #1e293b !important; border-color: #334155 !important; }

/* ============================================================
   لندینگ (index.php) — کارت‌های شیشه‌ای
   ============================================================ */
html[data-theme="dark"] .hero-summary,
html[data-theme="dark"] .feature,
html[data-theme="dark"] .how-step,
html[data-theme="dark"] .audience-card,
html[data-theme="dark"] .faq-item {
    background: rgba(30,41,59,.82) !important;
    border-color: rgba(148,163,184,.16) !important;
}
html[data-theme="dark"] .cta-btn-outline {
    background: rgba(30,41,59,.75) !important;
    border-color: rgba(96,165,250,.35) !important;
    color: #93c5fd !important;
}
html[data-theme="dark"] .cta-btn-outline:hover { background: #1e293b !important; }

/* ============================================================
   صفحات راهنما — متن‌ها و جعبه‌های نکته
   ============================================================ */
html[data-theme="dark"] .h-section p,
html[data-theme="dark"] .h-steps li { color: #cbd5e1; }
html[data-theme="dark"] .h-section-title { border-bottom-color: #334155; }
html[data-theme="dark"] .h-steps li::before { background: rgba(96,165,250,.16); color: #93c5fd; }
html[data-theme="dark"] .h-note { background: rgba(96,165,250,.10); border-color: rgba(96,165,250,.30); color: #bfdbfe; }
html[data-theme="dark"] .h-warn { background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.30); color: #fcd34d; }
html[data-theme="dark"] .h-path { background: #16223a; color: #cbd5e1; }
html[data-theme="dark"] .h-path i { color: #93c5fd; }

/* ============================================================
   صفحات ورود / ثبت‌نام / OTP — جعبه‌های خطا و کمکی
   ============================================================ */
html[data-theme="dark"] .global-error,
html[data-theme="dark"] .alert-error,
html[data-theme="dark"] .error-message {
    background: rgba(239,68,68,.14) !important;
    color: #fca5a5 !important;
    border-color: rgba(239,68,68,.35) !important;
}
html[data-theme="dark"] .alert-warning {
    background: rgba(245,158,11,.14) !important;
    color: #fcd34d !important;
    border-color: rgba(245,158,11,.35) !important;
}
html[data-theme="dark"] .alert-expired {
    background: rgba(239,68,68,.14) !important;
    color: #fca5a5 !important;
    border-color: rgba(239,68,68,.35) !important;
}
html[data-theme="dark"] .success-message {
    background: rgba(16,185,129,.14) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16,185,129,.35) !important;
}
html[data-theme="dark"] .btn-secondary:hover { background: rgba(96,165,250,.24) !important; }
html[data-theme="dark"] .back-link a {
    background: rgba(30,41,59,.85) !important;
    border-color: rgba(96,165,250,.25) !important;
}
html[data-theme="dark"] .support-box { background: #16223a; color: #cbd5e1; }
html[data-theme="dark"] .support-box a { color: #60a5fa; }
html[data-theme="dark"] .otp-boxes input {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: rgba(96,165,250,.35) !important;
}

/* ============================================================
   ═══ تور ایمنی سراسری ═══
   هیچ پس‌زمینه سفید و هیچ متن تیره‌ای در حالت تاریک نماند
   ============================================================ */

/* ── همه فیلدهای ورودی (حتی بدون type مشخص) ── */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="range"]):not([type="color"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] math-field {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}

/* ── کارت‌ها و جعبه‌های سفید/روشن در همه پنل‌ها ── */
html[data-theme="dark"] .card,
html[data-theme="dark"] .question-card,
html[data-theme="dark"] .objection-item,
html[data-theme="dark"] .compact-options,
html[data-theme="dark"] .ann-modal {
    background: #1e293b !important;
    border-color: #334155 !important;
}
html[data-theme="dark"] .info-box,
html[data-theme="dark"] .check-item,
html[data-theme="dark"] .hint-box,
html[data-theme="dark"] .question-main-box,
html[data-theme="dark"] .type-box,
html[data-theme="dark"] .question-text-book,
html[data-theme="dark"] .answer-box,
html[data-theme="dark"] .correct-box,
html[data-theme="dark"] .math-display,
html[data-theme="dark"] .question-math,
html[data-theme="dark"] .readonly-mathlive,
html[data-theme="dark"] .readonly-mathlive-wrap,
html[data-theme="dark"] .question-image-box,
html[data-theme="dark"] .compact-meta span {
    background: #16223a !important;
    border-color: #334155 !important;
    color: #e2e8f0;
}
html[data-theme="dark"] .hint-box { color: #cbd5e1 !important; }
html[data-theme="dark"] .cq-meta,
html[data-theme="dark"] .cq-small,
html[data-theme="dark"] .meta-line,
html[data-theme="dark"] .objection-text { color: #94a3b8 !important; }

/* ── جدول‌ها: سرستون و ردیف‌های روشن ── */
html[data-theme="dark"] th,
html[data-theme="dark"] thead th {
    background: #1d3055 !important;
    color: #dbeafe !important;
    border-color: #334155 !important;
}
html[data-theme="dark"] td { border-color: #2c3e5f !important; }
html[data-theme="dark"] tbody tr { background: transparent !important; }
html[data-theme="dark"] tbody tr:hover { background: rgba(96,165,250,.07) !important; }

/* ── دکمه‌ها و بج‌های روشن ── */
html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .show-options-btn,
html[data-theme="dark"] .chart-tool-btn,
html[data-theme="dark"] .quick-score-btn,
html[data-theme="dark"] .link-btn.copy {
    background: rgba(96,165,250,.16) !important;
    color: #93c5fd !important;
    border-color: rgba(96,165,250,.30) !important;
}
html[data-theme="dark"] .link-btn.open { background: rgba(96,165,250,.22) !important; color: #93c5fd !important; }
html[data-theme="dark"] .btn-warning {
    background: rgba(245,158,11,.16) !important;
    color: #fcd34d !important;
    border-color: rgba(245,158,11,.35) !important;
}
html[data-theme="dark"] .badge-class { background: rgba(96,165,250,.16) !important; color: #93c5fd !important; }
html[data-theme="dark"] .badge-public { background: rgba(247,37,133,.18) !important; color: #f9a8d4 !important; }
html[data-theme="dark"] .badge-info { background: rgba(96,165,250,.16) !important; color: #93c5fd !important; }
html[data-theme="dark"] .cq-success { background: rgba(16,185,129,.14) !important; color: #6ee7b7 !important; border-color: rgba(16,185,129,.35) !important; }
html[data-theme="dark"] .cq-error { background: rgba(239,68,68,.14) !important; color: #fca5a5 !important; border-color: rgba(239,68,68,.35) !important; }
html[data-theme="dark"] .teacher-answer-box {
    background: rgba(245,158,11,.10) !important;
    border-color: rgba(245,158,11,.30) !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .objection-alert-btn,
html[data-theme="dark"] .objection-list-box {
    background: rgba(249,115,22,.12) !important;
    border-color: rgba(249,115,22,.35) !important;
    color: #fdba74 !important;
}

/* ── مودال اطلاعیه و دکمه بستن ── */
html[data-theme="dark"] .ann-modal h3 { color: #93c5fd !important; }
html[data-theme="dark"] .ann-modal p { color: #cbd5e1 !important; }
html[data-theme="dark"] .ann-close-btn {
    background: #334155 !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
}
html[data-theme="dark"] .ann-close-btn:hover { background: #3e4f6b !important; }

/* ── فیلترباکس زرد داشبورد معلم ── */
html[data-theme="dark"] .filter-box {
    background: rgba(245,158,11,.10) !important;
    border-color: rgba(245,158,11,.30) !important;
}

/* ── پس‌زمینه‌های سفیدِ اینلاین (style="...") ── */
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#FFF"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color:white"],
html[data-theme="dark"] [style*="background-color: white"] {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] [style*="background:#f0f4ff"],
html[data-theme="dark"] [style*="background:#f8faff"],
html[data-theme="dark"] [style*="background:#f8fbff"],
html[data-theme="dark"] [style*="background:#eef2ff"],
html[data-theme="dark"] [style*="background:#edf2ff"],
html[data-theme="dark"] [style*="background:#f6f8ff"],
html[data-theme="dark"] [style*="background:#f1f5f9"],
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f0f4ff"],
html[data-theme="dark"] [style*="background: #f8faff"],
html[data-theme="dark"] [style*="background: #eef2ff"],
html[data-theme="dark"] [style*="background: #f1f5f9"] {
    background: #16223a !important;
    color: #cbd5e1 !important;
}

/* ════════════════════════════════════════════════════════════
   سراسری: پس‌زمینه‌های اینلاینِ روشن که در کل سایت (ادمین/معلم/
   دانش‌آموز/مصحح/گروه/طراح‌سوال/کارشناس/auth) به‌عنوان کارت/باکس
   وضعیت استفاده می‌شوند، اینجا یک‌جا خنثی می‌شوند — چون تطبیق روی
   خودِ کد رنگ (بدون پیشوند background:) هر جای سایت که این رنگ
   inline استفاده شده را می‌گیرد، مستقل از فایل/صفحه.
   («امتیاز شما به توضیح معلم» در view_exam_correction.php هم از
   همین دسته بود — background:#fffbeb زیرمجموعهٔ AMBER پایین.)
   نکته: رنگ‌های تم مطالعه‌ی کرمی (teacher_exam_correction.php،
   حدود خط ۱۰۰۰-۱۰۹۰) اینجا دست‌نخورده‌اند چون آن حالت خودش در
   دارک‌مود مخفی می‌شود (چند خط پایین‌تر، «حالت مطالعه»).
   ════════════════════════════════════════════════════════════ */

/* ── خاکستری/خنثی: مثل کارت‌های بالا، پس‌زمینه تخت تیره ── */
html[data-theme="dark"] [style*="#f9fbff"],
html[data-theme="dark"] [style*="#fafbff"],
html[data-theme="dark"] [style*="#f7fbff"],
html[data-theme="dark"] [style*="#f7faff"],
html[data-theme="dark"] [style*="#fbfcff"],
html[data-theme="dark"] [style*="#f8f9fa"],
html[data-theme="dark"] [style*="#f1f3f5"],
html[data-theme="dark"] [style*="#f3f5ff"],
html[data-theme="dark"] [style*="#f8f9ff"],
html[data-theme="dark"] [style*="#f5f3fa"],
html[data-theme="dark"] [style*="#eef4fb"],
html[data-theme="dark"] [style*="#e9ecef"],
html[data-theme="dark"] [style*="#f2f7ff"],
html[data-theme="dark"] [style*="#f4f7ff"],
html[data-theme="dark"] [style*="#eef4ff"],
html[data-theme="dark"] [style*="#f0f9ff"],
html[data-theme="dark"] [style*="#f0f7ff"],
html[data-theme="dark"] [style*="#f5faff"],
html[data-theme="dark"] [style*="#f0f5ff"],
html[data-theme="dark"] [style*="#e5e7eb"],
html[data-theme="dark"] [style*="#e2e8f0"],
html[data-theme="dark"] [style*="#cbd5e1"],
html[data-theme="dark"] [style*="#f3f4f6"],
html[data-theme="dark"] [style*="#f1f1f1"],
html[data-theme="dark"] [style*="#f5f5f5"],
html[data-theme="dark"] [style*="#fafafa"],
html[data-theme="dark"] [style*="#f8f8f8"],
html[data-theme="dark"] [style*="#eef1f7"],
html[data-theme="dark"] [style*="#edf1f7"],
html[data-theme="dark"] [style*="#eef2f7"],
html[data-theme="dark"] [style*="#f0f4f8"] {
    background: #16223a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

/* ── آبی/اطلاعاتی ── */
html[data-theme="dark"] [style*="#eff6ff"],
html[data-theme="dark"] [style*="#dbeafe"],
html[data-theme="dark"] [style*="#e0e7ff"],
html[data-theme="dark"] [style*="#dbe4ff"],
html[data-theme="dark"] [style*="#dde5ff"],
html[data-theme="dark"] [style*="#e0ecff"],
html[data-theme="dark"] [style*="#e8eeff"],
html[data-theme="dark"] [style*="#eaf1ff"],
html[data-theme="dark"] [style*="#e0f2fe"] {
    background: rgba(96,165,250,.12) !important;
    border-color: rgba(96,165,250,.30) !important;
    color: #93c5fd !important;
}

/* ── سبز/موفقیت ── */
html[data-theme="dark"] [style*="#dcfce7"],
html[data-theme="dark"] [style*="#d1fae5"],
html[data-theme="dark"] [style*="#e8f5e9"],
html[data-theme="dark"] [style*="#e9f7ef"],
html[data-theme="dark"] [style*="#f0fdf4"],
html[data-theme="dark"] [style*="#ecfdf5"],
html[data-theme="dark"] [style*="#dffaf1"],
html[data-theme="dark"] [style*="#f0fff4"],
html[data-theme="dark"] [style*="#ecfccb"] {
    background: rgba(16,185,129,.12) !important;
    border-color: rgba(16,185,129,.30) !important;
    color: #6ee7b7 !important;
}

/* ── کهربایی/هشدار (شامل رِیت‌باکس امتیاز دانش‌آموز به معلم) ── */
html[data-theme="dark"] [style*="#fffbeb"],
html[data-theme="dark"] [style*="#fef3c7"],
html[data-theme="dark"] [style*="#fff4d6"],
html[data-theme="dark"] [style*="#fff8e1"],
html[data-theme="dark"] [style*="#fff3e0"],
html[data-theme="dark"] [style*="#fef9c3"],
html[data-theme="dark"] [style*="#fff4db"],
html[data-theme="dark"] [style*="#fff3cd"],
html[data-theme="dark"] [style*="#fffef5"],
html[data-theme="dark"] [style*="#fffbf5"],
html[data-theme="dark"] [style*="#ffedd5"],
html[data-theme="dark"] [style*="#fefce8"],
html[data-theme="dark"] [style*="#fff7ed"],
html[data-theme="dark"] [style*="#fde68a"] {
    background: rgba(245,158,11,.12) !important;
    border-color: rgba(245,158,11,.35) !important;
    color: #fcd34d !important;
}
html[data-theme="dark"] [style*="#fffbeb"] strong,
html[data-theme="dark"] [style*="#fffbeb"] b { color: #fcd34d !important; }

/* ── قرمز/خطر ── */
html[data-theme="dark"] [style*="#fee2e2"],
html[data-theme="dark"] [style*="#fef2f2"],
html[data-theme="dark"] [style*="#ffe0e0"],
html[data-theme="dark"] [style*="#ffebee"],
html[data-theme="dark"] [style*="#ffcdd2"],
html[data-theme="dark"] [style*="#fff5f5"] {
    background: rgba(239,68,68,.12) !important;
    border-color: rgba(239,68,68,.35) !important;
    color: #fca5a5 !important;
}

/* ── صورتی ── */
html[data-theme="dark"] [style*="#ffe4e6"],
html[data-theme="dark"] [style*="#ffe6eb"],
html[data-theme="dark"] [style*="#fce7f3"],
html[data-theme="dark"] [style*="#fdf2f8"] {
    background: rgba(244,114,182,.14) !important;
    border-color: rgba(244,114,182,.30) !important;
    color: #f9a8d4 !important;
}

/* ── بنفش ── */
html[data-theme="dark"] [style*="#f5f3ff"],
html[data-theme="dark"] [style*="#ede9fe"],
html[data-theme="dark"] [style*="#f3e8ff"],
html[data-theme="dark"] [style*="#faf5ff"],
html[data-theme="dark"] [style*="#f5f0ff"],
html[data-theme="dark"] [style*="#f3eaff"],
html[data-theme="dark"] [style*="#fdf4ff"] {
    background: rgba(167,139,250,.14) !important;
    border-color: rgba(167,139,250,.30) !important;
    color: #c4b5fd !important;
}

/* ── فیروزه‌ای ── */
html[data-theme="dark"] [style*="#f0fdfa"],
html[data-theme="dark"] [style*="#ccfbf1"],
html[data-theme="dark"] [style*="#f0faf8"],
html[data-theme="dark"] [style*="#f2fbfa"],
html[data-theme="dark"] [style*="#e8fbf8"] {
    background: rgba(45,212,191,.14) !important;
    border-color: rgba(45,212,191,.30) !important;
    color: #5eead4 !important;
}

/* ── صفحه مشاهده تصحیح (دانش‌آموز) ── */
html[data-theme="dark"] .summary-item,
html[data-theme="dark"] .empty-mini {
    background: #16223a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .small,
html[data-theme="dark"] .desc { color: #94a3b8 !important; }
html[data-theme="dark"] .teacher-comment-box {
    background: rgba(96,165,250,.10) !important;
    border-color: rgba(96,165,250,.30) !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .correct-box {
    background: rgba(16,185,129,.10) !important;
    border-color: rgba(16,185,129,.30) !important;
    color: #e2e8f0 !important;
}
html[data-theme="dark"] .score-pill { background: rgba(16,185,129,.16) !important; color: #6ee7b7 !important; }
html[data-theme="dark"] .objection-box {
    background: rgba(249,115,22,.12) !important;
    border-color: rgba(249,115,22,.35) !important;
    color: #fdba74 !important;
}
html[data-theme="dark"] .objection-response {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

/* ── هاورهای روشن: هیچ فلش سفیدی هنگام حرکت موس ── */
html[data-theme="dark"] tr:hover td { background: rgba(96,165,250,.07) !important; }
html[data-theme="dark"] .search-results div:hover { background: rgba(96,165,250,.14) !important; }
html[data-theme="dark"] .ticket-card.clickable:hover { background: rgba(96,165,250,.10) !important; }
html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .btn-muted:hover,
html[data-theme="dark"] .chart-tool-btn:hover { background: rgba(96,165,250,.24) !important; }
html[data-theme="dark"] .action-dropdown a:hover,
html[data-theme="dark"] .action-dropdown button:hover { background: rgba(96,165,250,.14) !important; color: #93c5fd !important; }
html[data-theme="dark"] .rank-item:hover { background: rgba(96,165,250,.07) !important; }
html[data-theme="dark"] .search-results { background: #1e293b !important; border-color: #334155 !important; }
html[data-theme="dark"] .action-dropdown { background: #1e293b !important; border-color: #334155 !important; }

/* ── حالت مطالعه (تم کرمی) در حالت تاریک بی‌معناست: گزینه‌اش مخفی شود ── */
html[data-theme="dark"] label:has(#studyModeToggle) { display: none !important; }

/* ════════════════════════════════════════════════════════════
   یکسان‌سازی آیکون‌های تاپ‌بار در کل سایت (مطابق طرح مرجع)
   آیکون اعلان، دکمه دارک‌مود و پیل کیف پول — همه یک استایل:
   مربع گوشه‌گرد، حاشیه ظریف، در دارک: پس‌زمینه تیره
   ════════════════════════════════════════════════════════════ */
/* آیکون اعلان — دایره‌ای مثل دکمه دارک‌مود (دکمه دارک‌مود استایل اصلی خودش را دارد) */
.ann-bell-wrap {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    background: var(--card-bg, #fff) !important;
    color: var(--muted, #64748b) !important;
    cursor: pointer;
    transition: .2s;
    flex-shrink: 0;
    position: relative;
    padding: 0 !important;
}
.ann-bell-wrap:hover {
    color: var(--primary-l, #3b82f6) !important;
    border-color: var(--primary-l, #3b82f6) !important;
}
.ann-bell-wrap i { font-size: 16px !important; color: inherit !important; }
.ann-bell-wrap .ann-badge {
    position: absolute; top: -5px; right: -5px;
}
html[data-theme="dark"] .ann-bell-wrap {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* ── آیکون‌های تاپ‌بار در موبایل: اندازه قطعی و یکسان در همه صفحات ── */
@media (max-width: 640px) {
    .topbar { gap: 8px !important; padding: 0 10px !important; }
    .topbar-end { gap: 8px !important; }
    .theme-toggle {
        width: 32px !important; height: 32px !important;
        min-width: 32px !important; max-width: 32px !important;
        flex-shrink: 0 !important; border-radius: 50% !important;
        padding: 0 !important;
    }
    .theme-toggle svg { width: 16px !important; height: 16px !important; }
    .ann-bell-wrap {
        width: 32px !important; height: 32px !important;
        min-width: 32px !important; max-width: 32px !important;
        flex-shrink: 0 !important;
    }
    .ann-bell-wrap i { font-size: 14px !important; }
    .t-avatar { width: 32px !important; height: 32px !important; font-size: 12px !important; flex-shrink: 0 !important; }
    .topbar .hamburger { font-size: 20px !important; max-width: 30px !important; flex-shrink: 0 !important; }
    .mw-badge { padding: 4px 8px !important; font-size: 10.5px !important; flex-shrink: 0 !important; }
    .topbar-user { gap: 6px !important; }
}
/* پیل کیف پول در دارک — مطابق طرح (پس‌زمینه تیره + عدد سبز) */
html[data-theme="dark"] .mw-pill {
    background: #111827 !important;
    border-color: #263042 !important;
    color: #e5e7eb !important;
    box-shadow: none;
}
html[data-theme="dark"] .mw-amount { color: #34d399 !important; }
html[data-theme="dark"] .mw-badge-active { background: #052e22 !important; color: #6ee7b7 !important; border-color: #134e3a !important; }
html[data-theme="dark"] .mw-badge-trial  { background: #2a2005 !important; color: #fcd34d !important; border-color: #57430a !important; }
html[data-theme="dark"] .mw-badge-none   { background: #2d0f0f !important; color: #fca5a5 !important; border-color: #5c1d1d !important; }

/* اجزای کتابخانهٔ تقویم نیز نباید با پس‌زمینهٔ روشن باز شوند. */
html[data-theme="dark"] .datepicker-plot-area,
html[data-theme="dark"] .datepicker-plot-area .datepicker-time-view {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: #334155 !important;
}
html[data-theme="dark"] .datepicker-plot-area *,
html[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td span,
html[data-theme="dark"] .datepicker-plot-area .datepicker-year-view .year-item,
html[data-theme="dark"] .datepicker-plot-area .datepicker-month-view .month-item {
    color: #cbd5e1 !important;
    background-color: transparent !important;
}
html[data-theme="dark"] .datepicker-plot-area .datepicker-day-view .table-days td.selected span,
html[data-theme="dark"] .datepicker-plot-area .datepicker-year-view .year-item.selected,
html[data-theme="dark"] .datepicker-plot-area .datepicker-month-view .month-item.selected {
    background: #2563eb !important;
    color: #fff !important;
}

/* ── متن‌های تیره‌ی اینلاین ── */
html[data-theme="dark"] [style*="color:#000"],
html[data-theme="dark"] [style*="color: #000"],
html[data-theme="dark"] [style*="color:#111"],
html[data-theme="dark"] [style*="color:#1e293b"],
html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color:#374151"],
html[data-theme="dark"] [style*="color:#475569"],
html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color: #334155"],
html[data-theme="dark"] [style*="color: #374151"],
html[data-theme="dark"] [style*="color: #475569"] {
    color: #cbd5e1 !important;
}
