/* ==========================================================================
   Z_Theme — پوستهٔ تاریک (Dark Theme)
   فعال‌سازی: <html data-theme="dark">
   ========================================================================== */

html[data-theme="dark"] {
    color-scheme: dark;
    background-color: var(--bg-page);

    /* ---------- متغیرهای Bootstrap ---------- */
    --bs-body-bg: var(--bg-page);
    --bs-body-color: var(--text-primary);
    --bs-body-color-rgb: 230, 237, 247;
    --bs-body-bg-rgb: 11, 18, 32;
    --bs-emphasis-color: #f8fafc;
    --bs-emphasis-color-rgb: 248, 250, 252;
    --bs-secondary-color: var(--text-muted);
    --bs-secondary-color-rgb: 154, 169, 192;
    --bs-tertiary-color: #7d8ca6;
    --bs-border-color: var(--border-color);
    --bs-border-color-translucent: rgba(148, 163, 184, .22);
    --bs-secondary-bg: var(--sidebar-bg);
    --bs-tertiary-bg: var(--bg-subtle);
    --bs-heading-color: #f8fafc;
    --bs-link-color: var(--primary-color);
    --bs-link-hover-color: var(--primary-hover);
    --bs-card-bg: var(--bg-card);
    --bs-card-cap-bg: rgba(255, 255, 255, .04);
    --bs-card-border-color: var(--border-color);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-color);
    --bs-table-striped-bg: rgba(255, 255, 255, .035);
    --bs-table-striped-color: var(--text-primary);
    --bs-table-hover-bg: rgba(96, 165, 250, .12);
    --bs-table-hover-color: #ffffff;
    --bs-modal-bg: var(--bg-card);
    --bs-modal-header-border-color: var(--border-color);
    --bs-modal-footer-border-color: var(--border-color);
    --bs-dropdown-bg: var(--bg-subtle);
    --bs-dropdown-border-color: var(--border-color);
    --bs-dropdown-link-color: var(--text-primary);
    --bs-dropdown-link-hover-bg: rgba(96, 165, 250, .16);
    --bs-dropdown-link-hover-color: #ffffff;
    --bs-dropdown-link-active-bg: #2563eb;
    --bs-dropdown-divider-bg: var(--border-color);
    --bs-offcanvas-bg: var(--bg-card);
    --bs-accordion-bg: var(--bg-card);
    --bs-accordion-color: var(--text-primary);
    --bs-accordion-border-color: var(--border-color);
    --bs-accordion-btn-color: var(--text-primary);
    --bs-accordion-active-bg: var(--bg-subtle);
    --bs-accordion-active-color: #ffffff;

    /* ---------- متغیرهای پروژه (Colors.css) ---------- */
    --bg-page: #0b1220;
    --bg-card: #131c2e;
    --bg-card-subtle: #16223a;
    --border-color: #25324a;
    --border-subtle: #1f2b40;
    --primary-color: #fbbf24;
    --primary-hover: #f59e0b;
    --accent-color: #fbbf24;
    --accent-hover: #f59e0b;
    --header-bg: #1b2740;
    --header-text: #fde68a;
    --header-border: #2b3a57;
    --text-primary: #e6edf7;
    --text-secondary: #b9c6da;
    --text-light: #ffffff;
    --shadow-soft: 0 2px 12px rgba(0, 0, 0, .45);
}

/* ==========================================================================
   ۱) پایه
   ========================================================================== */
html[data-theme="dark"] body,
html[data-theme="dark"] #app {
    background-color: var(--bg-page) !important;
    color: var(--text-primary);
}

html[data-theme="dark"] .app-main,
html[data-theme="dark"] .app-content {
    background-color: var(--bg-page) !important;
    color: var(--text-primary);
}

html[data-theme="dark"] ::selection {
    background: rgba(96, 165, 250, .35);
    color: #fff;
}

/* اسکرول‌بار */
html[data-theme="dark"] *::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
html[data-theme="dark"] *::-webkit-scrollbar-track {
    background: #0e1728;
}
html[data-theme="dark"] *::-webkit-scrollbar-thumb {
    background: #2b3a57;
    border-radius: 8px;
}
html[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
    background: #3b4d70;
}

/* ==========================================================================
   ۲) هدر و سایدبار
   ========================================================================== */
html[data-theme="dark"] .app-header {
    background-color: var(--sidebar-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}
html[data-theme="dark"] .app-sidebar {
    background-color: var(--sidebar-bg) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] #mySidebar,
html[data-theme="dark"] #mySidebar .bg-white {
    background-color: var(--sidebar-bg) !important;
}
html[data-theme="dark"] .app-header .btn-light {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .app-header .btn-light i {
    color: #c9d6ea !important;
}

/* منوی سایدبار */
html[data-theme="dark"] .menu-link.level-1,
html[data-theme="dark"] .menu-button.level-1 {
    background-color: #1a2740 !important;
    color: var(--text-primary) !important;
    border-right-color: #60a5fa !important;
    box-shadow: none;
}
html[data-theme="dark"] .menu-link.level-1:hover,
html[data-theme="dark"] .menu-button.level-1:hover {
    background-color: #223354 !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .menu-link.level-2,
html[data-theme="dark"] .menu-button.level-2 {
    background-color: var(--bg-subtle) !important;
    color: var(--text-secondary) !important;
    border-right-color: #64748b !important;
    border-bottom-color: #223049 !important;
}
html[data-theme="dark"] .menu-link.level-2:hover,
html[data-theme="dark"] .menu-button.level-2:hover {
    background-color: var(--bg-hover) !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .menu-link.level-3,
html[data-theme="dark"] .menu-button.level-3 {
    background-color: var(--bg-card) !important;
    color: var(--text-secondary) !important;
    border-right-color: #34d399 !important;
    border-bottom-color: var(--border-subtle) !important;
}
html[data-theme="dark"] .menu-link.level-3:hover,
html[data-theme="dark"] .menu-button.level-3:hover {
    background-color: #1b2b42 !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .menu-link.level-4,
html[data-theme="dark"] .menu-link.level-5 {
    background-color: #101a2c !important;
    color: #aab9cf !important;
}
html[data-theme="dark"] .menu-link.level-4:hover,
html[data-theme="dark"] .menu-link.level-5:hover {
    background-color: #1a2740 !important;
    color: #ffffff !important;
}

/* ==========================================================================
   ۲-ب) لایهٔ محتوا (سام: style.css)
   ========================================================================== */
html[data-theme="dark"] .content {
    background-color: transparent !important;
}
html[data-theme="dark"] .fill-main-content,
html[data-theme="dark"] .content-wrapper {
    background-color: transparent !important;
}

/* ==========================================================================
   ۳) کارت‌ها و باکس‌ها
   ========================================================================== */
html[data-theme="dark"] .card,
html[data-theme="dark"] .Z_Component,
html[data-theme="dark"] .content-box,
html[data-theme="dark"] .table-container {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .Z_Form_Title {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: #f8fafc;
}
html[data-theme="dark"] .Z_Component_Open,
html[data-theme="dark"] .Z_Component_Save,
html[data-theme="dark"] .Z_Component_Reload {
    filter: brightness(.92) saturate(.9);
}
html[data-theme="dark"] .Z_Setting,
html[data-theme="dark"] .settings-btn {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* ==========================================================================
   ۴) جداول
   ========================================================================== */
html[data-theme="dark"] .table {
    color: var(--text-primary);
    border-color: var(--border-color);
}
html[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    border-color: var(--border-color);
    color: inherit;
    box-shadow: none;
}
html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table > thead {
    background-color: var(--header-bg) !important;
    color: #f8fafc !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .table thead th {
    font-weight: 700;
}
html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, .03) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(96, 165, 250, .14) !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .compact-table td,
html[data-theme="dark"] .compact-table th {
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .sticky-action-col {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) .sticky-action-col {
    background-color: #172135 !important;
}
html[data-theme="dark"] .Z_TableListHead {
    background-color: var(--header-bg) !important;
    color: #f8fafc !important;
}

/* ==========================================================================
   ۵) فرم‌ها
   ========================================================================== */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not(.btn) {
    background-color: #0f1929 !important;
    border-color: #2b3a57 !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    background-color: #101c30 !important;
    border-color: #60a5fa !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 .2rem rgba(96, 165, 250, .18);
}
html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #7284a0 !important;
}
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-control[readonly],
html[data-theme="dark"] .form-select:disabled {
    background-color: var(--bg-card) !important;
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .input-group-text {
    background-color: var(--bg-subtle) !important;
    border-color: #2b3a57 !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .form-check-input {
    background-color: #0f1929;
    border-color: #3b4d70;
}
html[data-theme="dark"] .form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}
html[data-theme="dark"] .form-label,
html[data-theme="dark"] label {
    color: var(--text-secondary);
}
html[data-theme="dark"] .form-switch .form-check-input {
    background-color: #3b4d70;
}

/* سلکت‌های سفارشی */
html[data-theme="dark"] select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* ==========================================================================
   ۶) دکمه‌ها
   ========================================================================== */
html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .btn-white,
html[data-theme="dark"] .btn-default,
html[data-theme="dark"] .btn-secondary {
    background-color: var(--header-bg) !important;
    border-color: #2b3a57 !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .btn-white:hover,
html[data-theme="dark"] .btn-default:hover,
html[data-theme="dark"] .btn-secondary:hover {
    background-color: var(--border-color) !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: #3b4d70;
}
html[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--border-color);
    color: #fff;
}
html[data-theme="dark"] .btn-outline-dark {
    color: var(--text-primary);
    border-color: #4a5c7d;
}
html[data-theme="dark"] .btn-outline-dark:hover {
    background-color: var(--text-primary);
    color: var(--bg-page);
}
html[data-theme="dark"] .btn-primary:disabled,
html[data-theme="dark"] .btn-primary.disabled {
    background-color: var(--bg-hover) !important;
    border-color: #2b3a57 !important;
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .grid-action-btn {
    background-color: var(--header-bg) !important;
    border-color: #2b3a57 !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .grid-action-btn:hover {
    background-color: var(--border-color) !important;
    color: #fff !important;
}
html[data-theme="dark"] .Z_RoundBTN-BTN {
    background-color: var(--header-bg) !important;
    color: var(--text-primary) !important;
    border-color: #2b3a57 !important;
}

/* ==========================================================================
   ۷) منوها، تب‌ها، مودال‌ها
   ========================================================================== */
html[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-subtle);
    border-color: var(--border-color);
    color: var(--text-primary);
}
html[data-theme="dark"] .dropdown-item {
    color: var(--text-primary);
}
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
    background-color: rgba(96, 165, 250, .16);
    color: #fff;
}
html[data-theme="dark"] .dropdown-divider {
    border-color: var(--border-color);
}

html[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--border-color);
}
html[data-theme="dark"] .nav-tabs .nav-link {
    color: var(--text-secondary);
    border-color: transparent;
}
html[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #ffffff;
    background-color: rgba(96, 165, 250, .10);
}
html[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--bg-subtle);
    border-color: var(--border-color) var(--border-color) var(--bg-subtle);
    color: #ffffff;
}
html[data-theme="dark"] .nav-pills .nav-link.active {
    background-color: #2563eb;
    color: #fff;
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .Z_CustomModal {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: #f8fafc;
}
html[data-theme="dark"] .modal-body {
    background-color: var(--bg-card) !important;
    color: var(--text-primary);
}
html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ==========================================================================
   ۸) هشدارها، بج‌ها، لیست‌ها
   ========================================================================== */
html[data-theme="dark"] .alert {
    border-color: #2b3a57;
    color: var(--text-primary);
}
html[data-theme="dark"] .alert-light {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
}
html[data-theme="dark"] .alert-warning {
    background-color: #3a2d0d;
    color: var(--header-text);
}
html[data-theme="dark"] .alert-danger {
    background-color: #3a1418;
    color: #fecaca;
}
html[data-theme="dark"] .alert-success {
    background-color: #0f2f24;
    color: #a7f3d0;
}
html[data-theme="dark"] .list-group-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}
html[data-theme="dark"] .accordion-item {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}
html[data-theme="dark"] .accordion-button {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
}
html[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: var(--header-bg);
    color: #fff;
}
html[data-theme="dark"] .accordion-button::after {
    filter: invert(1) brightness(1.6);
}

/* ==========================================================================
   ۹) ابزارهای Bootstrap (کلاس‌های کمکی)
   ========================================================================== */
html[data-theme="dark"] .bg-white { background-color: var(--bg-card) !important; }
html[data-theme="dark"] .bg-light { background-color: #0f1929 !important; }
html[data-theme="dark"] .bg-body { background-color: var(--bg-page) !important; }
html[data-theme="dark"] .bg-body-tertiary { background-color: var(--sidebar-bg) !important; }
html[data-theme="dark"] .text-dark { color: var(--text-primary) !important; }
html[data-theme="dark"] .text-secondary { color: var(--text-muted) !important; }
html[data-theme="dark"] .text-muted { color: #8494ad !important; }
html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end {
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .border-light { border-color: #2b3a57 !important; }
html[data-theme="dark"] .shadow-sm { box-shadow: 0 1px 4px rgba(0, 0, 0, .45) !important; }
html[data-theme="dark"] .shadow { box-shadow: 0 6px 20px rgba(0, 0, 0, .55) !important; }

/* ==========================================================================
   ۱۰) کامپوننت‌های اختصاصی نرم‌افزار
   ========================================================================== */
/* کاشی‌های داشبورد */
html[data-theme="dark"] .Z_Component_Kartex_Label {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .Z_Component_Kartex_Label input,
html[data-theme="dark"] .Z_Component_Kartex_Label .form-control {
    background-color: transparent !important;
    color: #fbbf24 !important;
}
html[data-theme="dark"] .Z_Component_Dashboard_Title {
    filter: brightness(.95) saturate(.95);
}
html[data-theme="dark"] .Z_Hamiyab,
html[data-theme="dark"] .Z_Component_Kartex_Title {
    color: var(--text-primary) !important;
}

/* جستجوی منو */
html[data-theme="dark"] .modern-search .input-group-text,
html[data-theme="dark"] .modern-search .form-control {
    background-color: #0f1929 !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #3b4d70;
}

/* تقویم (Z_DateBox) */
html[data-theme="dark"] .Z_Calender {
    background-color: rgba(0, 0, 0, .55) !important;
}
html[data-theme="dark"] .Z_Calender-Body {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .6) !important;
}
html[data-theme="dark"] .Z_Calender-Month {
    background-color: #1e3a5f !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .Z_Calender-Month button {
    color: var(--text-primary) !important;
    border-color: #3b4d70 !important;
}
html[data-theme="dark"] .Z_Calender-Month svg path {
    fill: var(--text-primary) !important;
}
html[data-theme="dark"] .Z_Calender-Weeks {
    background-color: var(--bg-subtle) !important;
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .Z_Calender-Grid {
    background-color: transparent !important;
}
html[data-theme="dark"] .Z_Calender-Day {
    background-color: var(--header-bg) !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .Z_Calender-Day:hover {
    background-color: var(--border-color) !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .Z_Calender-Day:active,
html[data-theme="dark"] .Z_Calender-Day.is-selected {
    background-color: #2563eb !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .Z_Calender-Day[style*="red"] {
    background-color: #7f1d1d !important;
    color: #fecaca !important;
}
html[data-theme="dark"] .Z_Calender-Day[style*="#ffc107"] {
    background-color: #b45309 !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .Z_Calender-Day[style*="#0dcaf0"] {
    background-color: #0891b2 !important;
    color: #ffffff !important;
}
/* تقویم با کلاس‌های زیرخط (نمای تقویم دیگر) */
html[data-theme="dark"] .Z_Calender_Header,
html[data-theme="dark"] .Z_Calender_Body {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .Z_Calender_Body .today {
    background-color: #2563eb !important;
    color: #fff !important;
}
html[data-theme="dark"] .day-card-container {
    background: rgba(22, 34, 58, .65) !important;
}

/* فیلدهای خاص */
html[data-theme="dark"] .component-label {
    background-color: var(--bg-card) !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .Z_Slider-Title {
    background-color: var(--bg-subtle) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .Z_Input {
    background-color: #0f1929 !important;
    border-color: #2b3a57 !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .Z_List_Options_BTN,
html[data-theme="dark"] .Z_X_RadioBox_Value {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .Z_List_Options_BTN:hover,
html[data-theme="dark"] .Z_X_RadioBox_Value:hover {
    background-color: var(--bg-hover) !important;
    color: #fff !important;
}
html[data-theme="dark"] .Z_Input:focus + .Z_Input-label,
html[data-theme="dark"] .Z_Input:valid + .Z_Input-label {
    color: #93c5fd !important;
}

/* گزارش پویا */
html[data-theme="dark"] .Z_Report_Dynamic {
    background-color: rgba(255, 255, 255, .03) !important;
    border-color: #334155 !important;
}

/* باکس‌های رنگی صفحهٔ اصلی */
html[data-theme="dark"] .Q1X { background-color: rgba(129, 140, 248, .12) !important; }
html[data-theme="dark"] .Q2X { background-color: rgba(251, 146, 60, .12) !important; }

/* ==========================================================================
   ۱۰-ب) گزارش‌ها (Reports)
   ========================================================================== */
html[data-theme="dark"] .reports-toolbar,
html[data-theme="dark"] .report-table-container {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .reports-toolbar-label,
html[data-theme="dark"] .reports-toolbar-item {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .alert-secondary {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .report-table-container thead th {
    background-color: var(--header-bg) !important;
    color: #f8fafc !important;
}
html[data-theme="dark"] .report-table-container::-webkit-scrollbar-track {
    background: #0e1728 !important;
}
html[data-theme="dark"] .report-table-container::-webkit-scrollbar-thumb {
    background: #2b3a57 !important;
}

/* ==========================================================================
   ۱۰-ج) لودینگ فرم‌ها
   ========================================================================== */
html[data-theme="dark"] .page-loading-overlay {
    background: rgba(11, 18, 32, .82) !important;
}
html[data-theme="dark"] .page-loading-overlay .text-secondary {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .page-loading-overlay .spinner-border {
    border-color: rgba(96, 165, 250, .25) !important;
    border-top-color: #60a5fa !important;
}
.loading_Content::after {
    content: "";
    width: 46px;
    height: 46px;
    border: 4px solid rgba(120, 53, 15, .18);
    border-top-color: #d97706;
    border-radius: 50%;
    animation: z-loading-spin .8s linear infinite;
}
@keyframes z-loading-spin {
    to { transform: rotate(360deg); }
}
html[data-theme="dark"] .loading_Content {
    background-color: rgba(11, 18, 32, .72) !important;
}
html[data-theme="dark"] .loading_Content::after {
    border-color: rgba(251, 191, 36, .16);
    border-top-color: #fbbf24;
}

/* ==========================================================================
   ۱۰-د) کامپوننت‌های Z_* (چک‌باکس، دراپ‌داون، کارت، درخت، رنگ)
   ========================================================================== */
html[data-theme="dark"] .Z_Component .form-check.form-switch {
    background-color: var(--bg-card) !important;
}
html[data-theme="dark"] .z-dropdown-control,
html[data-theme="dark"] .z-dropdown-menu {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .z-dropdown-control:hover {
    background-color: var(--bg-hover) !important;
}
html[data-theme="dark"] .z-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .z-color-picker {
    background: #0f1929 !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .z-tree-check {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* ==========================================================================
   ۱۰-ه) سایر کامپوننت‌های Z_Components
   ========================================================================== */
html[data-theme="dark"] .modern-chip {
    background-color: #142c27 !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .card-thumb-wrapper {
    background-color: #0f1929 !important;
}
html[data-theme="dark"] .z-card-skeleton {
    background: var(--bg-subtle) !important;
}
html[data-theme="dark"] .btn-close-custom {
    background: var(--header-bg) !important;
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .btn-close-custom:hover {
    background: var(--border-color) !important;
    color: #ef4444 !important;
}
html[data-theme="dark"] .z-dropdown-item:hover {
    background-color: var(--bg-hover) !important;
}
html[data-theme="dark"] [style*="background:#f8f9fa"] {
    background-color: var(--bg-subtle) !important;
}
html[data-theme="dark"] .table-hover tbody tr:hover .sticky-action-col {
    background-color: var(--bg-subtle) !important;
}
html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) .sticky-action-col {
    background-color: #172135 !important;
}
html[data-theme="dark"] thead .sticky-action-col {
    background-color: var(--header-bg) !important;
}
html[data-theme="dark"] .sticky-action-col .btn {
    background-color: transparent !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] tr:hover .sticky-action-col {
    background-color: var(--bg-subtle) !important;
}
html[data-theme="dark"] tr:hover .sticky-action-col .btn {
    background-color: var(--bg-subtle) !important;
}
html[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) .sticky-action-col .btn {
    background-color: #172135 !important;
}
html[data-theme="dark"] .custom-scrollbar::-webkit-scrollbar-track {
    background: #0e1728 !important;
}
html[data-theme="dark"] .slider-title,
html[data-theme="dark"] .z-card-title {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .switch-caption {
    color: var(--text-secondary) !important;
}

/* ==========================================================================
   ۱۱) کلید تغییر پوسته
   ========================================================================== */
.z-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color, #e2e8f0);
    background-color: var(--bg-card, #fff);
    color: #334155;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease;
    flex: 0 0 auto;
}
.z-theme-toggle:hover {
    transform: rotate(-12deg) scale(1.06);
    border-color: #f59e0b;
    color: #d97706;
}
.z-theme-toggle i { font-size: 1.15rem; line-height: 1; }

html[data-theme="dark"] .z-theme-toggle {
    background-color: var(--bg-subtle);
    border-color: #2b3a57;
    color: #fbbf24;
}
html[data-theme="dark"] .z-theme-toggle:hover {
    background-color: var(--bg-hover);
    color: #fcd34d;
    border-color: #f59e0b;
}

/* ==========================================================================
   ۱۱-ب) پنل فیلتر (FiltersForm)
   ========================================================================== */
html[data-theme="dark"] .filter-panel-clean {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .filter-panel-clean .form-input,
html[data-theme="dark"] .filter-panel-clean .form-select {
    background-color: #0f1929 !important;
    border-color: #2b3a57 !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .filter-panel-clean .label-txt {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .filter-panel-clean .action-buttons {
    border-right-color: var(--border-color) !important;
}
html[data-theme="dark"] .filter-panel-clean .btn-action.reset {
    background: var(--header-bg) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .filter-panel-clean .filter-item-row {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
}

/* ==========================================================================
   ۱۲) پنل‌های کاربری (تحصیلدار / خیرین / مددجویان)
   ========================================================================== */html[data-theme="dark"] .eshareh-client-layout,
html[data-theme="dark"] .client-body-height {
    background-color: var(--bg-page) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .client-shell {
    background: var(--bg-card) !important;
    border-left-color: var(--border-color) !important;
    border-right-color: var(--border-color) !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, .55) !important;
}
html[data-theme="dark"] .client-top-header {
    background: rgba(17, 26, 43, .95) !important;
    border-bottom-color: var(--border-color) !important;
}
html[data-theme="dark"] .user-sub { color: var(--text-muted) !important; }
html[data-theme="dark"] .user-name,
html[data-theme="dark"] .user-fullname { color: #f8fafc !important; }
html[data-theme="dark"] .user-header-avatar { background-color: var(--header-bg) !important; }

html[data-theme="dark"] .btn-return-home {
    background: var(--header-bg) !important;
    color: #fbbf24 !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .btn-return-home:hover {
    background: #c2410c !important;
    color: #fff !important;
}
html[data-theme="dark"] .notif-btn,
html[data-theme="dark"] .menu-toggler {
    background: var(--header-bg) !important;
    border-color: #2b3a57 !important;
    color: #fbbf24 !important;
}
html[data-theme="dark"] .notif-btn:hover,
html[data-theme="dark"] .menu-toggler:hover { background: var(--border-color) !important; }
html[data-theme="dark"] .badge-pulse-counter { border-color: var(--sidebar-bg) !important; }

html[data-theme="dark"] .sidebar-drawer {
    background: var(--bg-card) !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, .55) !important;
}
html[data-theme="dark"] .sidebar-nav-item {
    background: var(--bg-subtle) !important;
    color: var(--text-secondary) !important;
    border-color: transparent !important;
}
html[data-theme="dark"] .sidebar-nav-item:hover {
    background: var(--bg-hover) !important;
    color: #ffffff !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .sidebar-nav-item i { color: #fbbf24 !important; }
html[data-theme="dark"] .sidebar-divider { border-color: var(--border-color) !important; }
html[data-theme="dark"] .user-badge { background: #3a2d0d !important; color: var(--header-text) !important; }
html[data-theme="dark"] .btn-close-menu { background: #1f2937 !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .btn-logout { background: #3a1418 !important; color: #fecaca !important; border-color: #7f1d1d !important; }
html[data-theme="dark"] .btn-logout i { color: #fecaca !important; }

html[data-theme="dark"] .client-content-area { background: transparent !important; }
html[data-theme="dark"] .client-bottom-nav {
    background: rgba(17, 26, 43, .96) !important;
    border-top-color: var(--border-color) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .45) !important;
}
html[data-theme="dark"] .nav-item-btn { color: var(--text-muted) !important; }
html[data-theme="dark"] .nav-item-btn:hover { color: #fbbf24 !important; }
html[data-theme="dark"] .icon-center-bubble { border-color: var(--sidebar-bg) !important; }

/* --- صفحات داخلی پورتال‌ها --- */
html[data-theme="dark"] .dashboard-wrapper,
html[data-theme="dark"] .cash-request-wrapper,
html[data-theme="dark"] .wares-request-wrapper,
html[data-theme="dark"] .box-request-wrapper,
html[data-theme="dark"] .box-collect-wrapper,
html[data-theme="dark"] .wreath-request-wrapper,
html[data-theme="dark"] .slaughter-request-wrapper,
html[data-theme="dark"] .fasting-request-wrapper,
html[data-theme="dark"] .prayer-request-wrapper,
html[data-theme="dark"] .service-quran-wrapper,
html[data-theme="dark"] .obligation-request-wrapper,
html[data-theme="dark"] .visit-req-wrapper,
html[data-theme="dark"] .payment-wrapper,
html[data-theme="dark"] .reports-page-wrapper,
html[data-theme="dark"] .upload-container-wrapper {
    background-color: transparent !important;
    color: var(--text-primary) !important;
}

html[data-theme="dark"] .form-card,
html[data-theme="dark"] .form-section-card,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .register-card,
html[data-theme="dark"] .signup-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .empty-state-card,
html[data-theme="dark"] .loading-state-card,
html[data-theme="dark"] .client-info-banner,
html[data-theme="dark"] .item-row,
html[data-theme="dark"] .dynamic-section,
html[data-theme="dark"] .wreath-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35) !important;
}
/* کارت‌های پنل کاربری (فقط داخل لایهٔ پورتال، نه صفحهٔ اول) */
html[data-theme="dark"] .eshareh-client-layout .portal-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .stat-card:hover,
html[data-theme="dark"] .eshareh-client-layout .portal-card:hover {
    border-color: #3b4d70 !important;
    background: var(--bg-subtle) !important;
}
html[data-theme="dark"] .form-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .wreath-title,
html[data-theme="dark"] .profile-name,
html[data-theme="dark"] .register-title,
html[data-theme="dark"] .empty-title,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .section-badge,
html[data-theme="dark"] .welcome-tag,
html[data-theme="dark"] .brand-badge-info {
    color: #f8fafc !important;
}
html[data-theme="dark"] .card-desc,
html[data-theme="dark"] .empty-desc,
html[data-theme="dark"] .no-data-msg,
html[data-theme="dark"] .info-item,
html[data-theme="dark"] .ios-label {
    color: #a9b8cf !important;
}
html[data-theme="dark"] .card-arrow,
html[data-theme="dark"] .header-icon-box,
html[data-theme="dark"] .empty-icon-wrap,
html[data-theme="dark"] .upload-label {
    color: #fbbf24 !important;
}
html[data-theme="dark"] .card-icon-wrapper {
    background: #2a2118 !important;
    border-color: #4a3a22 !important;
}
html[data-theme="dark"] .card-icon-wrapper .fallback-icon i {
    color: #fbbf24 !important;
}
html[data-theme="dark"] .client_btn {
    background: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .client_btn span { color: inherit !important; }
html[data-theme="dark"] .client_btn:hover { background: var(--bg-hover) !important; }

html[data-theme="dark"] .custom-select,
html[data-theme="dark"] .custom-check-box,
html[data-theme="dark"] .custom-check-container {
    background-color: #0f1929 !important;
    border-color: #2b3a57 !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .custom-alert {
    background-color: #3a2d0d !important;
    color: var(--header-text) !important;
    border-color: #7c5a10 !important;
}
html[data-theme="dark"] .z-table thead,
html[data-theme="dark"] .classic-admin-table thead {
    background-color: var(--header-bg) !important;
    color: #f8fafc !important;
}
html[data-theme="dark"] .z-table td,
html[data-theme="dark"] .classic-admin-table td {
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .classic-admin-table tr:hover { background-color: var(--bg-subtle) !important; }

/* ==========================================================================
   ۱۲-ب) پنل کاربری سام (Layout_Client_Home سام)
   ========================================================================== */
html[data-theme="dark"] .page,
html[data-theme="dark"] .main,
html[data-theme="dark"] .Client-Body-width,
html[data-theme="dark"] .Clinet-Body-width,
html[data-theme="dark"] .Client-Body-height {
    background-color: var(--bg-page) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .Client-Header {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .header-icon-btn {
    background-color: var(--header-bg) !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .header-icon-btn:hover {
    background-color: var(--border-color) !important;
}
html[data-theme="dark"] .university-brand-header {
    background: var(--bg-card) !important;
}
html[data-theme="dark"] .university-name-text {
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .university-logo-header {
    background-color: var(--bg-card) !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .sidebar-menu-item {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .sidebar-menu-item:hover {
    background-color: var(--bg-hover) !important;
    color: var(--primary-color) !important;
}
html[data-theme="dark"] .notification-icon-wrapper {
    background-color: #2a2118 !important;
    border-color: #4a3a22 !important;
}
html[data-theme="dark"] .notification-icon-wrapper:hover {
    background-color: #3a2d0d !important;
}
html[data-theme="dark"] .notification-badge {
    border-color: var(--sidebar-bg) !important;
}
html[data-theme="dark"] .home-icon-circle {
    border-color: var(--sidebar-bg) !important;
}
html[data-theme="dark"] .footer-nav-btn {
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .footer-nav-btn:hover {
    color: #fbbf24 !important;
}

/* ==========================================================================
   ۱۲-ج) فرم‌های Forms/Publics (مخاطبین و …)
   ========================================================================== */
html[data-theme="dark"] .contact-page-wrapper {
    background-color: var(--bg-page) !important;
}
html[data-theme="dark"] .contact-page-wrapper .form-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .45) !important;
}
html[data-theme="dark"] .contact-page-wrapper .search-box {
    background: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-cancel {
    background: var(--header-bg) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .contact-page-wrapper .sort-wrapper {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .contact-page-wrapper .custom-select {
    background: #0f1929 !important;
    color: var(--text-primary) !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .contact-page-wrapper .count-badge {
    background: #2a2118 !important;
    color: #fbbf24 !important;
}
html[data-theme="dark"] .contact-page-wrapper .table-container {
    border-color: var(--border-color) !important;
    background-color: transparent !important;
}
html[data-theme="dark"] .classic-admin-table thead {
    background-color: var(--header-bg) !important;
}
html[data-theme="dark"] .classic-admin-table th {
    color: #f8fafc !important;
    border-bottom-color: #2b3a57 !important;
}
html[data-theme="dark"] .classic-admin-table td {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}
html[data-theme="dark"] .classic-admin-table tr:hover {
    background-color: var(--bg-subtle) !important;
}
html[data-theme="dark"] .classic-admin-table tr.selected-row {
    background-color: var(--bg-hover) !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-primary {
    background: #92400e !important;
    color: #fff !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-primary:hover:not(:disabled) {
    background: #b45309 !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-primary:disabled {
    background: var(--bg-hover) !important;
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-outline {
    background: #2a2118 !important;
    color: #fbbf24 !important;
    border-color: #4a3a22 !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-outline:hover {
    background: #3a2d0d !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-icon {
    color: #fbbf24 !important;
    border-color: #f59e0b !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-icon:hover {
    background: #f59e0b !important;
    color: var(--bg-page) !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-page {
    background: var(--bg-subtle) !important;
    border-color: #2b3a57 !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .contact-page-wrapper .page-indicator,
html[data-theme="dark"] .contact-page-wrapper .loading-msg {
    color: var(--text-secondary) !important;
}

/* کارت‌های رنگی بخش آدرس/تلفن/کارت مخاطب */
html[data-theme="dark"] .card-body {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .card-body[style*="98C1D9"] { background-color: #16243a !important; }
html[data-theme="dark"] .card-body[style*="BEE3DB"] { background-color: #142c27 !important; }
html[data-theme="dark"] .card-body[style*="89B0AE"] { background-color: #1a2f2d !important; }

/* فرم یادآوری */
html[data-theme="dark"] [style*="background-color: #e1e1e1"] {
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .no-data-msg {
    background: #2a2118 !important;
    border-color: #4a3a22 !important;
    color: #fbbf24 !important;
}

/* ==========================================================================
   ۱۲-د) سام: خط بحران و لایهٔ Layout_Clients
   ========================================================================== */
html[data-theme="dark"] .layout-client-wrapper {
    background-color: var(--bg-page) !important;
}
/* سام: پنل مراجع – پروفایل */
html[data-theme="dark"] .profile-header {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-page) 100%) !important;
    border-bottom-color: var(--border-color) !important;
}
html[data-theme="dark"] .avatar-img,
html[data-theme="dark"] .client-avatar {
    background-color: var(--header-bg) !important;
    border-color: var(--bg-page) !important;
}
html[data-theme="dark"] .btn-verify-badge {
    background: var(--header-bg) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .profile-completion-box,
html[data-theme="dark"] .detail-item,
html[data-theme="dark"] .empty-state-box.bg-white,
html[data-theme="dark"] .section-card.bg-white {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .section-card.bg-white {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .custom-progress-bar {
    background-color: var(--border-color) !important;
}
html[data-theme="dark"] .section-card .z-card {
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .card-thumb-wrapper {
    background: var(--bg-card) !important;
}
html[data-theme="dark"] nav.Client-Footer-Bar,
html[data-theme="dark"] nav.Client-Footer-Bar.bg-white {
    background: var(--bg-card) !important;
    border-top-color: var(--border-color) !important;
}
/* سام: صفحهٔ انتخاب پنل (Index/home-page)
   توجه: لوگوها PNG با پس‌زمینهٔ شفاف‌اند؛ پلاکِ پشت لوگو روشن می‌ماند
   تا رنگ اصلی لوگو حفظ شود (تیره‌کردن پلاک، لوگو را تیره نشان می‌داد). */
html[data-theme="dark"] .main-logo-frame {
    background: rgba(248, 250, 252, .95) !important;
    border-color: rgba(226, 232, 240, .9) !important;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .45) !important;
}
html[data-theme="dark"] .university-logo-frame {
    background: rgba(241, 245, 249, .92) !important;
    border-color: rgba(203, 213, 225, .8) !important;
}
html[data-theme="dark"] .university-logo-header {
    background-color: rgba(248, 250, 252, .95) !important;
    border-color: rgba(203, 213, 225, .8) !important;
}/* صفحهٔ اول (انتخاب پنل) پس‌زمینهٔ عکس روشن دارد؛ متن‌ها با همان
   رنگ‌بندی حالت روشن می‌مانند تا خوانا باشند. */
html[data-theme="dark"] .consultant-welcome-banner {
    background: linear-gradient(135deg, #122e23, #0f241c) !important;
    border-color: #2a4a38 !important;
}
html[data-theme="dark"] .banner-icon-box {
    background: var(--header-bg) !important;
}
html[data-theme="dark"] .banner-decoration-circle {
    background: rgba(255, 255, 255, .05) !important;
}
html[data-theme="dark"] span.badge.bg-primary-subtle {
    background: #132a45 !important;
    color: var(--primary-color) !important;
}
/* سام: آیکون‌های سرصفحه/فیلتر/حالت خالی فرم نوبت‌های مشاور */
html[data-theme="dark"] .header-icon-box {
    background: var(--header-bg) !important;
}
html[data-theme="dark"] .filter-icon {
    background: var(--header-bg) !important;
}
html[data-theme="dark"] .empty-icon-wrap,
html[data-theme="dark"] .empty-state-box.bg-white {
    background-color: var(--bg-card) !important;
}
html[data-theme="dark"] .client-avatar {
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .skeleton-avatar,
html[data-theme="dark"] .skeleton-line {
    background: var(--border-color) !important;
    animation: none !important;
}
html[data-theme="dark"] .crisis-stat,
html[data-theme="dark"] .crisis-grid-wrap,
html[data-theme="dark"] .crisis-loading,
html[data-theme="dark"] .crisis-empty-state {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .crisis-stat__value {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .crisis-stat__of,
html[data-theme="dark"] .crisis-stat__label {
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .crisis-stat__icon--blue { background: #132a45 !important; color: var(--primary-color) !important; }
html[data-theme="dark"] .crisis-stat__icon--green { background: #122e23 !important; color: #6ee7b7 !important; }
html[data-theme="dark"] .crisis-stat__icon--red { background: #3a1418 !important; color: #fca5a5 !important; }
html[data-theme="dark"] .crisis-stat__icon--purple { background: #241a3d !important; color: #c4b5fd !important; }
html[data-theme="dark"] .crisis-grid__corner {
    background: var(--bg-subtle) !important;
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .crisis-person {
    background: rgba(255, 255, 255, .05) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .crisis-person.is-clickable:hover {
    background: var(--bg-hover) !important;
    border-color: #3b4d70 !important;
}
html[data-theme="dark"] .crisis-btn--light {
    background: var(--header-bg) !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .crisis-btn--light:hover {
    background: var(--border-color) !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .crisis-leave-note {
    background: #2a2118 !important;
    border-color: #4a3a22 !important;
    color: #fbbf24 !important;
}
html[data-theme="dark"] .crisis-grid__day {
    background: linear-gradient(180deg, var(--bg-subtle), var(--bg-card)) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .crisis-grid__day.is-today {
    background: linear-gradient(180deg, #2a2118, #241d10) !important;
    border-color: #f4c66a !important;
}
html[data-theme="dark"] .crisis-grid__day-name {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .crisis-grid__day-date {
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .crisis-grid__cell.is-filled {
    background: linear-gradient(180deg, #122e23, #0f241c) !important;
    border-color: #2a4a38 !important;
}
html[data-theme="dark"] .crisis-grid__cell.is-empty {
    background: repeating-linear-gradient(135deg, #101726, #101726 6px, #181022 6px, #181022 12px) !important;
    border-color: #3a2a2e !important;
}
html[data-theme="dark"] .crisis-empty-cell {
    color: #d99595 !important;
}
html[data-theme="dark"] .crisis-empty-cell i {
    color: #b57a7a !important;
}
html[data-theme="dark"] .leaves-icon {
    background: #2a2118 !important;
    color: #fb923c !important;
}
html[data-theme="dark"] .crisis-grid__shift--10 {
    background: #2a2118 !important;
    border-color: #4a3a22 !important;
}
html[data-theme="dark"] .crisis-grid__shift--11 {
    background: #132a45 !important;
    border-color: #24425f !important;
}
html[data-theme="dark"] .crisis-grid__shift--12 {
    background: #1e2438 !important;
    border-color: #33405c !important;
}
html[data-theme="dark"] .crisis-grid__shift-name {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .crisis-grid__shift-time {
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .crisis-legend {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}
html[data-theme="dark"] table tfoot th,
html[data-theme="dark"] table tfoot td {
    color: var(--text-primary) !important;
    background-color: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
}

/* ==========================================================================
   ۱۳) صفحهٔ ورود
   ========================================================================== */
.login-theme-toggle {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 100000;
}

html[data-theme="dark"] .consultant-login-page.intro-container {
    background: linear-gradient(rgba(11, 18, 32, .88), rgba(11, 18, 32, .95)),
                url('../images/loginright.webp') center center / cover no-repeat !important;
}
html[data-theme="dark"] .consultant-login-shell {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .55) !important;
}
html[data-theme="dark"] .login-brand-panel {
    background-color: #0e2a43 !important;
}
html[data-theme="dark"] .login-heading h1 {
    color: #f8fafc !important;
}
html[data-theme="dark"] .login-field label,
html[data-theme="dark"] .remember-me label,
html[data-theme="dark"] .form-check-label {
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .consultant-login-shell .form-control {
    background-color: #0f1929 !important;
    border-color: #2b3a57 !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .consultant-login-shell .form-control:focus {
    border-color: #60a5fa !important;
}

/* ==========================================================================
   ۱۴) چاپ — همیشه روشن
   ========================================================================== */@media print {
    html[data-theme="dark"] body,
    html[data-theme="dark"] #app,
    html[data-theme="dark"] .app-main,
    html[data-theme="dark"] .app-content {
        background: #fff !important;
        color: #000 !important;
    }
}

/* ==========================================================================
   ۱۲-هـ) سام: نوبت‌های من و کارت‌های سفید عمومی پنلها
   ========================================================================== */
html[data-theme="dark"] .session-card,
html[data-theme="dark"] html[data-theme="dark"] .empty-box,
html[data-theme="dark"] .empty-box,
html[data-theme="dark"] div.bg-white.rounded-3,
html[data-theme="dark"] .reservation-card.bg-white {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .empty-box {
    border-style: dashed !important;
}
html[data-theme="dark"] .session-img {
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .session-card:hover {
    border-color: #3b4d70 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4) !important;
}

/* ==========================================================================
   ۱۲-و) سام: پنل مراجع - کارت دسته‌بندی مشاوران و پروفایل مشاور
   ========================================================================== */
html[data-theme="dark"] .category-img-wrapper {
    background-color: var(--header-bg) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .doctor-detail-my-btn {
    background: #2b3550 !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .doctor-detail-image-container,
html[data-theme="dark"] .doctor-detail-image-container-2 {
    background-color: var(--bg-card) !important;
}

/* ==========================================================================
   ۱۲-ز) سام: کارت‌های اقدام پروفایل و دکمه‌های گرد (Z_RoundBTN)
   ========================================================================== */
html[data-theme="dark"] .action-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .Z_RoundBTN-alarm,
html[data-theme="dark"] .Z_RoundBTN-alarm-OK,
html[data-theme="dark"] .Z_RoundBTN-alarm-No {
    background: var(--header-bg) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .Z_RoundBTN-alarm-OK {
    color: #6ee7b7 !important;
}
html[data-theme="dark"] .Z_RoundBTN-alarm-No {
    color: #fca5a5 !important;
}
html[data-theme="dark"] .Z_RoundBTN-alarm-OK i,
html[data-theme="dark"] .Z_RoundBTN-alarm-No i {
    color: inherit !important;
}
html[data-theme="dark"] .Z_RoundBTN-Caption {
    color: var(--text-muted) !important;
}

/* ==========================================================================
   ۱۲-ح) سام: پنل مشاور - برنامه کار، پروفایل، تغییر رمز، خط بحران مشاور
   ========================================================================== */
html[data-theme="dark"] .schedule-hero.card,
html[data-theme="dark"] .crisis-hero.card,
html[data-theme="dark"] .password-hero {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-page) 100%) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .profile-status-bar,
html[data-theme="dark"] .identity-notice,
html[data-theme="dark"] .card-header.border-0 {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .status-chip.inactive,
html[data-theme="dark"] .badge.count-badge {
    background: var(--header-bg) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .session-metric-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .header-icon {
    background: var(--header-bg) !important;
}
html[data-theme="dark"] .password-input-group,
html[data-theme="dark"] .input-group.password-input-group {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .btn.toggle-eye {
    background: transparent !important;
    color: var(--text-muted) !important;
}

/* سام: فوتر مشترک داخل صفحات پنل (بدون تغییر بج نسخه) */
html[data-theme="dark"] footer.home-footer,
html[data-theme="dark"] .home-footer {
    background: transparent !important;
}

/* سام: صفحهٔ مهمان (Guests) */
html[data-theme="dark"] .guest-welcome-banner {
    background: linear-gradient(135deg, #132a45 0%, #0f2236 100%) !important;
    border-color: #24425f !important;
}
html[data-theme="dark"] .guest-welcome-banner .banner-decoration-circle {
    background: rgba(255, 255, 255, .05) !important;
}
html[data-theme="dark"] .section-card.bg-white {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .section-card.bg-white:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .4) !important;
}

/* سام: لیست مشاوران (ConsultantsCards) */
html[data-theme="dark"] .consultant-card,
html[data-theme="dark"] .consultant-card-skeleton {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .consultant-card:hover {
    border-color: #3b4d70 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .45) !important;
}
html[data-theme="dark"] .consultant-avatar {
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .online-dot {
    border-color: var(--bg-card) !important;
}
html[data-theme="dark"] .consultant-name {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .consultant-desc,
html[data-theme="dark"] .consultant-meta {
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .badge-ma {
    background: #132a45 !important;
    color: var(--primary-color) !important;
}
html[data-theme="dark"] .badge-phd {
    background: #241a3d !important;
    color: #c4b5fd !important;
}
html[data-theme="dark"] .badge-bachelor {
    background: #122e23 !important;
    color: #6ee7b7 !important;
}
html[data-theme="dark"] .badge-none {
    background: var(--header-bg) !important;
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .badge-field {
    background: #2a2118 !important;
    color: #fbbf24 !important;
}
html[data-theme="dark"] .empty-state {
    border-color: #3b4d70 !important;
}

/* تم تیره: پس‌زمینهٔ سفیدِ داخل سوییچ چک‌باکس‌ها */
html[data-theme="dark"] .form-check.form-switch {
    background-color: transparent !important;
}
html[data-theme="dark"] .Z_Component .form-check.form-switch {
    background-color: var(--header-bg) !important;
    border-radius: 8px;
    padding-left: 2.2em;
}

/* تم تیره: چیپ‌های Z_ContactBox */
html[data-theme="dark"] .contact-chip {
    background: var(--header-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .contact-chip i { color: var(--primary-color) !important; }
html[data-theme="dark"] .contact-chip .k { color: var(--text-muted) !important; }
html[data-theme="dark"] .contact-chip.contact-status.is-active {
    background: #122e23 !important; border-color: #2a4a38 !important; color: #6ee7b7 !important;
}
html[data-theme="dark"] .contact-chip.contact-status.is-active i { color: #34d399 !important; }
html[data-theme="dark"] .contact-chip.contact-status.is-inactive {
    background: #3a1418 !important; border-color: #7f1d1d !important; color: #fca5a5 !important;
}
html[data-theme="dark"] .contact-chip.contact-status.is-inactive i { color: #f87171 !important; }
html[data-theme="dark"] .contact-phone-row {
    background: #132a45 !important;
    border-color: #24425f !important;
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .contact-phone-row .bi-sim { color: var(--primary-color) !important; }

/* ==========================================================================
   تم تیره: پنل تحصیلداران
   ========================================================================== */
html[data-theme="dark"] .collector-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .collector-title {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}
html[data-theme="dark"] .collector-search {
    background: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .collector-btn.ghost,
html[data-theme="dark"] .collector-btn.soft {
    background: var(--header-bg) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .collector-table-wrap {
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .collector-table thead th {
    background: var(--header-bg) !important;
    color: var(--text-primary) !important;
    border-bottom-color: #2b3a57 !important;
}
html[data-theme="dark"] .collector-table tbody td {
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border-color) !important;
}
html[data-theme="dark"] .collector-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, .02) !important;
}
html[data-theme="dark"] .collector-table tbody tr:hover {
    background: rgba(96, 165, 250, .12) !important;
}
html[data-theme="dark"] .collector-table .muted { color: var(--text-muted) !important; }
html[data-theme="dark"] .collector-table .money { color: #6ee7b7 !important; }
html[data-theme="dark"] .collector-icon-btn {
    background: var(--header-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .collector-empty {
    background: #2a2118 !important;
    border-color: #4a3a22 !important;
    color: #fbbf24 !important;
}
html[data-theme="dark"] .collector-loading { color: var(--text-muted) !important; }
html[data-theme="dark"] .collector-skeleton-row {
    background: linear-gradient(90deg, var(--header-bg) 25%, #223049 37%, var(--header-bg) 63%) !important;
    background-size: 400% 100% !important;
}
html[data-theme="dark"] .collector-toast {
    background: #e2e8f0 !important;
    color: var(--bg-page) !important;
}
@media (max-width: 720px) {
    html[data-theme="dark"] .collector-table.responsive tbody tr {
        background: var(--bg-subtle) !important;
        border-color: var(--border-color) !important;
    }
    html[data-theme="dark"] .collector-table.responsive tbody td::before { color: var(--text-muted) !important; }
}

html[data-theme="dark"] .collector-search .field .component-label {
    color: var(--text-muted) !important;
}

/* تم تیره: سوییچ و آپلود سفارشی */
html[data-theme="dark"] .z-switch-control {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}
html[data-theme="dark"] .z-switch-text { color: var(--text-secondary) !important; }
html[data-theme="dark"] .z-switch-track { background: #3b4d70 !important; }
html[data-theme="dark"] .z-switch input:checked + .z-switch-track { background: #f59e0b !important; }
html[data-theme="dark"] .z-switch-knob { background: var(--text-primary) !important; }
html[data-theme="dark"] .z-switch-help { color: var(--text-muted) !important; }
html[data-theme="dark"] .z-switch-action { background: var(--header-bg) !important; color: var(--text-secondary) !important; }
html[data-theme="dark"] .z-upload-hint { color: var(--text-muted) !important; }
html[data-theme="dark"] .z-upload-filename {
    background: #122e23 !important;
    border-color: #2a4a38 !important;
    color: #6ee7b7 !important;
}

/* ==========================================================================
   تم تیره: هدر پنل مراجع/تحصیلدار (Layout_Client_Home)
   ========================================================================== */
html[data-theme="dark"] .client-top-header {
    background: rgba(11, 18, 32, .92) !important;
    border-bottom-color: var(--border-subtle) !important;
}
html[data-theme="dark"] .client-top-header .user-name {
    color: var(--text-primary) !important;
}
html[data-theme="dark"] .client-top-header .user-sub {
    color: var(--text-muted) !important;
}
html[data-theme="dark"] .client-top-header .z-theme-toggle,
html[data-theme="dark"] .client-top-header .notif-btn,
html[data-theme="dark"] .client-top-header .menu-toggler {
    background: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .client-top-header .z-theme-toggle:hover,
html[data-theme="dark"] .client-top-header .notif-btn:hover,
html[data-theme="dark"] .client-top-header .menu-toggler:hover {
    background: var(--bg-hover) !important;
    border-color: #3b4d70 !important;
    color: #fbbf24 !important;
}
html[data-theme="dark"] .client-top-header .btn-return-home {
    background: var(--bg-subtle) !important;
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
}
html[data-theme="dark"] .client-top-header .btn-return-home:hover {
    background: var(--bg-hover) !important;
    border-color: #3b4d70 !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .client-top-header .badge-pulse-counter {
    border-color: var(--bg-page) !important;
}

/* ==========================================================================
   اتصال سطح‌های منو/هدر به توکن‌های قابل ویرایش
   ========================================================================== */
html[data-theme="dark"] .app-sidebar.bg-white,
html[data-theme="dark"] #mySidebar.bg-white,
html[data-theme="dark"] #mySidebar .bg-white {
    background-color: var(--sidebar-bg) !important;
}
html[data-theme="dark"] .app-header.bg-white {
    background-color: var(--bg-card) !important;
}
html[data-theme="dark"] .menu-link.level-1,
html[data-theme="dark"] .menu-button.level-1 {
    background-color: var(--sidebar-bg) !important;
    color: var(--sidebar-text) !important;
}
html[data-theme="dark"] .menu-link.level-1:hover,
html[data-theme="dark"] .menu-button.level-1:hover {
    background-color: var(--bg-hover) !important;
    color: var(--sidebar-text) !important;
}
html[data-theme="dark"] .menu-link,
html[data-theme="dark"] .menu-button,
html[data-theme="dark"] #mySidebar .menu-item span {
    color: var(--sidebar-text) !important;
}