/* ==========================================================================
   Z_Theme — پوستهٔ تاریک (Dark Theme)
   فعال‌سازی: <html data-theme="dark">
   ========================================================================== */

html[data-theme="dark"] {
    color-scheme: dark;
    background-color: #0b1220;

    /* ---------- متغیرهای Bootstrap ---------- */
    --bs-body-bg: #0b1220;
    --bs-body-color: #e6edf7;
    --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: #9aa9c0;
    --bs-secondary-color-rgb: 154, 169, 192;
    --bs-tertiary-color: #7d8ca6;
    --bs-border-color: #25324a;
    --bs-border-color-translucent: rgba(148, 163, 184, .22);
    --bs-secondary-bg: #111a2b;
    --bs-tertiary-bg: #16223a;
    --bs-heading-color: #f8fafc;
    --bs-link-color: #7cc4ff;
    --bs-link-hover-color: #a5d8ff;
    --bs-card-bg: #131c2e;
    --bs-card-cap-bg: rgba(255, 255, 255, .04);
    --bs-card-border-color: #25324a;
    --bs-table-bg: transparent;
    --bs-table-color: #e6edf7;
    --bs-table-border-color: #25324a;
    --bs-table-striped-bg: rgba(255, 255, 255, .035);
    --bs-table-striped-color: #e6edf7;
    --bs-table-hover-bg: rgba(96, 165, 250, .12);
    --bs-table-hover-color: #ffffff;
    --bs-modal-bg: #131c2e;
    --bs-modal-header-border-color: #25324a;
    --bs-modal-footer-border-color: #25324a;
    --bs-dropdown-bg: #16223a;
    --bs-dropdown-border-color: #25324a;
    --bs-dropdown-link-color: #e6edf7;
    --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: #25324a;
    --bs-offcanvas-bg: #131c2e;
    --bs-accordion-bg: #131c2e;
    --bs-accordion-color: #e6edf7;
    --bs-accordion-border-color: #25324a;
    --bs-accordion-btn-color: #e6edf7;
    --bs-accordion-active-bg: #16223a;
    --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: #0b1220 !important;
    color: #e6edf7;
}

html[data-theme="dark"] .app-main,
html[data-theme="dark"] .app-content {
    background-color: #0b1220 !important;
    color: #e6edf7;
}

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: #111a2b !important;
    border-color: #25324a !important;
    color: #e6edf7;
}
html[data-theme="dark"] .app-sidebar {
    background-color: #111a2b !important;
    border-color: #25324a !important;
}
html[data-theme="dark"] #mySidebar,
html[data-theme="dark"] #mySidebar .bg-white {
    background-color: #111a2b !important;
}
html[data-theme="dark"] .app-header .btn-light {
    background-color: #16223a !important;
    border-color: #25324a !important;
    color: #e6edf7 !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: #e6edf7 !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: #16223a !important;
    color: #cfdaeb !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: #1e2c47 !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .menu-link.level-3,
html[data-theme="dark"] .menu-button.level-3 {
    background-color: #131c2e !important;
    color: #b9c6da !important;
    border-right-color: #34d399 !important;
    border-bottom-color: #1f2b40 !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: #131c2e !important;
    border-color: #25324a !important;
    color: #e6edf7;
}
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .Z_Form_Title {
    background-color: #16223a !important;
    border-color: #25324a !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: #16223a !important;
    border-color: #25324a !important;
    color: #e6edf7 !important;
}

/* ==========================================================================
   ۴) جداول
   ========================================================================== */
html[data-theme="dark"] .table {
    color: #e6edf7;
    border-color: #25324a;
}
html[data-theme="dark"] .table > :not(caption) > * > * {
    background-color: transparent;
    border-color: #25324a;
    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: #1b2740 !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: #e6edf7 !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: #25324a !important;
}
html[data-theme="dark"] .sticky-action-col {
    background-color: #131c2e !important;
    border-color: #25324a !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: #1b2740 !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: #e6edf7 !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: #131c2e !important;
    color: #9aa9c0 !important;
}
html[data-theme="dark"] .input-group-text {
    background-color: #16223a !important;
    border-color: #2b3a57 !important;
    color: #b9c6da !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: #cfdaeb;
}
html[data-theme="dark"] .form-switch .form-check-input {
    background-color: #3b4d70;
}

/* سلکت‌های سفارشی */
html[data-theme="dark"] select option {
    background-color: #131c2e;
    color: #e6edf7;
}

/* ==========================================================================
   ۶) دکمه‌ها
   ========================================================================== */
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: #1b2740 !important;
    border-color: #2b3a57 !important;
    color: #e6edf7 !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: #25324a !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .btn-outline-secondary {
    color: #b9c6da;
    border-color: #3b4d70;
}
html[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #25324a;
    color: #fff;
}
html[data-theme="dark"] .btn-outline-dark {
    color: #e6edf7;
    border-color: #4a5c7d;
}
html[data-theme="dark"] .btn-outline-dark:hover {
    background-color: #e6edf7;
    color: #0b1220;
}
html[data-theme="dark"] .btn-primary:disabled,
html[data-theme="dark"] .btn-primary.disabled {
    background-color: #1e2c47 !important;
    border-color: #2b3a57 !important;
    color: #9aa9c0 !important;
}
html[data-theme="dark"] .grid-action-btn {
    background-color: #1b2740 !important;
    border-color: #2b3a57 !important;
    color: #cfdaeb !important;
}
html[data-theme="dark"] .grid-action-btn:hover {
    background-color: #25324a !important;
    color: #fff !important;
}
html[data-theme="dark"] .Z_RoundBTN-BTN {
    background-color: #1b2740 !important;
    color: #e6edf7 !important;
    border-color: #2b3a57 !important;
}

/* ==========================================================================
   ۷) منوها، تب‌ها، مودال‌ها
   ========================================================================== */
html[data-theme="dark"] .dropdown-menu {
    background-color: #16223a;
    border-color: #25324a;
    color: #e6edf7;
}
html[data-theme="dark"] .dropdown-item {
    color: #e6edf7;
}
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: #25324a;
}

html[data-theme="dark"] .nav-tabs {
    border-bottom-color: #25324a;
}
html[data-theme="dark"] .nav-tabs .nav-link {
    color: #b9c6da;
    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: #16223a;
    border-color: #25324a #25324a #16223a;
    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: #131c2e !important;
    border-color: #25324a !important;
    color: #e6edf7;
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    background-color: #16223a !important;
    border-color: #25324a !important;
    color: #f8fafc;
}
html[data-theme="dark"] .modal-body {
    background-color: #131c2e !important;
    color: #e6edf7;
}
html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* ==========================================================================
   ۸) هشدارها، بج‌ها، لیست‌ها
   ========================================================================== */
html[data-theme="dark"] .alert {
    border-color: #2b3a57;
    color: #e6edf7;
}
html[data-theme="dark"] .alert-light {
    background-color: #16223a;
    color: #e6edf7;
}
html[data-theme="dark"] .alert-warning {
    background-color: #3a2d0d;
    color: #fde68a;
}
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: #131c2e;
    border-color: #25324a;
    color: #e6edf7;
}
html[data-theme="dark"] .accordion-item {
    background-color: #131c2e;
    border-color: #25324a;
}
html[data-theme="dark"] .accordion-button {
    background-color: #16223a;
    color: #e6edf7;
}
html[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #1b2740;
    color: #fff;
}
html[data-theme="dark"] .accordion-button::after {
    filter: invert(1) brightness(1.6);
}

/* ==========================================================================
   ۹) ابزارهای Bootstrap (کلاس‌های کمکی)
   ========================================================================== */
html[data-theme="dark"] .bg-white { background-color: #131c2e !important; }
html[data-theme="dark"] .bg-light { background-color: #0f1929 !important; }
html[data-theme="dark"] .bg-body { background-color: #0b1220 !important; }
html[data-theme="dark"] .bg-body-tertiary { background-color: #111a2b !important; }
html[data-theme="dark"] .text-dark { color: #e6edf7 !important; }
html[data-theme="dark"] .text-secondary { color: #9aa9c0 !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: #25324a !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: #16223a !important;
    border-color: #25324a !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: #e6edf7 !important;
}

/* جستجوی منو */
html[data-theme="dark"] .modern-search .input-group-text,
html[data-theme="dark"] .modern-search .form-control {
    background-color: #0f1929 !important;
    border-color: #25324a !important;
    color: #e6edf7 !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: #131c2e !important;
    border: 1px solid #25324a !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .6) !important;
}
html[data-theme="dark"] .Z_Calender-Month {
    background-color: #1e3a5f !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .Z_Calender-Month button {
    color: #e6edf7 !important;
    border-color: #3b4d70 !important;
}
html[data-theme="dark"] .Z_Calender-Month svg path {
    fill: #e6edf7 !important;
}
html[data-theme="dark"] .Z_Calender-Weeks {
    background-color: #16223a !important;
    color: #9aa9c0 !important;
}
html[data-theme="dark"] .Z_Calender-Grid {
    background-color: transparent !important;
}
html[data-theme="dark"] .Z_Calender-Day {
    background-color: #1b2740 !important;
    color: #cfdaeb !important;
}
html[data-theme="dark"] .Z_Calender-Day:hover {
    background-color: #25324a !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: #131c2e !important;
    border-color: #25324a !important;
    color: #e6edf7 !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: #131c2e !important;
    color: #cfdaeb !important;
}
html[data-theme="dark"] .Z_Slider-Title {
    background-color: #16223a !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .Z_Input {
    background-color: #0f1929 !important;
    border-color: #2b3a57 !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .Z_List_Options_BTN,
html[data-theme="dark"] .Z_X_RadioBox_Value {
    background-color: #16223a !important;
    border-color: #25324a !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .Z_List_Options_BTN:hover,
html[data-theme="dark"] .Z_X_RadioBox_Value:hover {
    background-color: #1e2c47 !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: #131c2e !important;
    border-color: #25324a !important;
    color: #e6edf7 !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: #cfdaeb !important;
}
html[data-theme="dark"] .alert-secondary {
    background-color: #16223a !important;
    border-color: #25324a !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .report-table-container thead th {
    background-color: #1b2740 !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: #b9c6da !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: #131c2e !important;
}
html[data-theme="dark"] .z-dropdown-control,
html[data-theme="dark"] .z-dropdown-menu {
    background-color: #16223a !important;
    border-color: #25324a !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .z-dropdown-control:hover {
    background-color: #1e2c47 !important;
}
html[data-theme="dark"] .z-card {
    background: #131c2e !important;
    border-color: #25324a !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .z-color-picker {
    background: #0f1929 !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .z-tree-check {
    background: #131c2e !important;
    border-color: #25324a !important;
    color: #e6edf7 !important;
}

/* ==========================================================================
   ۱۰-ه) سایر کامپوننت‌های Z_Components
   ========================================================================== */
html[data-theme="dark"] .modern-chip {
    background-color: #142c27 !important;
    color: #cfdaeb !important;
    border-color: #25324a !important;
}
html[data-theme="dark"] .card-thumb-wrapper {
    background-color: #0f1929 !important;
}
html[data-theme="dark"] .z-card-skeleton {
    background: #16223a !important;
}
html[data-theme="dark"] .btn-close-custom {
    background: #1b2740 !important;
    color: #cbd5e1 !important;
}
html[data-theme="dark"] .btn-close-custom:hover {
    background: #25324a !important;
    color: #ef4444 !important;
}
html[data-theme="dark"] .z-dropdown-item:hover {
    background-color: #1e2c47 !important;
}
html[data-theme="dark"] [style*="background:#f8f9fa"] {
    background-color: #16223a !important;
}
html[data-theme="dark"] .table-hover tbody tr:hover .sticky-action-col {
    background-color: #16223a !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: #1b2740 !important;
}
html[data-theme="dark"] .sticky-action-col .btn {
    background-color: transparent !important;
    color: #cfdaeb !important;
}
html[data-theme="dark"] tr:hover .sticky-action-col {
    background-color: #16223a !important;
}
html[data-theme="dark"] tr:hover .sticky-action-col .btn {
    background-color: #16223a !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: #e6edf7 !important;
}
html[data-theme="dark"] .switch-caption {
    color: #cfdaeb !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: #16223a;
    border-color: #2b3a57;
    color: #fbbf24;
}
html[data-theme="dark"] .z-theme-toggle:hover {
    background-color: #1e2c47;
    color: #fcd34d;
    border-color: #f59e0b;
}

/* ==========================================================================
   ۱۱-ب) پنل فیلتر (FiltersForm)
   ========================================================================== */
html[data-theme="dark"] .filter-panel-clean {
    background: #131c2e !important;
    border-color: #25324a !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: #e6edf7 !important;
}
html[data-theme="dark"] .filter-panel-clean .label-txt {
    color: #cfdaeb !important;
}
html[data-theme="dark"] .filter-panel-clean .action-buttons {
    border-right-color: #25324a !important;
}
html[data-theme="dark"] .filter-panel-clean .btn-action.reset {
    background: #1b2740 !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .filter-panel-clean .filter-item-row {
    background-color: #16223a !important;
    border-color: #25324a !important;
}

/* ==========================================================================
   ۱۲) پنل‌های کاربری (تحصیلدار / خیرین / مددجویان)
   ========================================================================== */html[data-theme="dark"] .eshareh-client-layout,
html[data-theme="dark"] .client-body-height {
    background-color: #0b1220 !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .client-shell {
    background: #131c2e !important;
    border-left-color: #25324a !important;
    border-right-color: #25324a !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: #25324a !important;
}
html[data-theme="dark"] .user-sub { color: #9aa9c0 !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: #1b2740 !important; }

html[data-theme="dark"] .btn-return-home {
    background: #1b2740 !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: #1b2740 !important;
    border-color: #2b3a57 !important;
    color: #fbbf24 !important;
}
html[data-theme="dark"] .notif-btn:hover,
html[data-theme="dark"] .menu-toggler:hover { background: #25324a !important; }
html[data-theme="dark"] .badge-pulse-counter { border-color: #111a2b !important; }

html[data-theme="dark"] .sidebar-drawer {
    background: #131c2e !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, .55) !important;
}
html[data-theme="dark"] .sidebar-nav-item {
    background: #16223a !important;
    color: #cfdaeb !important;
    border-color: transparent !important;
}
html[data-theme="dark"] .sidebar-nav-item:hover {
    background: #1e2c47 !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: #25324a !important; }
html[data-theme="dark"] .user-badge { background: #3a2d0d !important; color: #fde68a !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: #25324a !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .45) !important;
}
html[data-theme="dark"] .nav-item-btn { color: #9aa9c0 !important; }
html[data-theme="dark"] .nav-item-btn:hover { color: #fbbf24 !important; }
html[data-theme="dark"] .icon-center-bubble { border-color: #111a2b !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: #e6edf7 !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: #131c2e !important;
    border-color: #25324a !important;
    color: #e6edf7 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35) !important;
}
/* کارت‌های پنل کاربری (فقط داخل لایهٔ پورتال، نه صفحهٔ اول) */
html[data-theme="dark"] .eshareh-client-layout .portal-card {
    background: #131c2e !important;
    border-color: #25324a !important;
    color: #e6edf7 !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: #16223a !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: #16223a !important;
    border-color: #25324a !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .client_btn span { color: inherit !important; }
html[data-theme="dark"] .client_btn:hover { background: #1e2c47 !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: #e6edf7 !important;
}
html[data-theme="dark"] .custom-alert {
    background-color: #3a2d0d !important;
    color: #fde68a !important;
    border-color: #7c5a10 !important;
}
html[data-theme="dark"] .z-table thead,
html[data-theme="dark"] .classic-admin-table thead {
    background-color: #1b2740 !important;
    color: #f8fafc !important;
}
html[data-theme="dark"] .z-table td,
html[data-theme="dark"] .classic-admin-table td {
    border-color: #25324a !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .classic-admin-table tr:hover { background-color: #16223a !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: #0b1220 !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .Client-Header {
    background-color: #131c2e !important;
    border-color: #25324a !important;
}
html[data-theme="dark"] .header-icon-btn {
    background-color: #1b2740 !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .header-icon-btn:hover {
    background-color: #25324a !important;
}
html[data-theme="dark"] .university-brand-header {
    background: #131c2e !important;
}
html[data-theme="dark"] .university-name-text {
    color: #9aa9c0 !important;
}
html[data-theme="dark"] .university-logo-header {
    background-color: #131c2e !important;
    border-color: #2b3a57 !important;
}
html[data-theme="dark"] .sidebar-menu-item {
    color: #cfdaeb !important;
}
html[data-theme="dark"] .sidebar-menu-item:hover {
    background-color: #1e2c47 !important;
    color: #7cc4ff !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: #111a2b !important;
}
html[data-theme="dark"] .home-icon-circle {
    border-color: #111a2b !important;
}
html[data-theme="dark"] .footer-nav-btn {
    color: #9aa9c0 !important;
}
html[data-theme="dark"] .footer-nav-btn:hover {
    color: #fbbf24 !important;
}

/* ==========================================================================
   ۱۲-ج) فرم‌های Forms/Publics (مخاطبین و …)
   ========================================================================== */
html[data-theme="dark"] .contact-page-wrapper {
    background-color: #0b1220 !important;
}
html[data-theme="dark"] .contact-page-wrapper .form-card {
    background: #131c2e !important;
    border-color: #25324a !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .45) !important;
}
html[data-theme="dark"] .contact-page-wrapper .search-box {
    background: #16223a !important;
    border-color: #25324a !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-cancel {
    background: #1b2740 !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .contact-page-wrapper .sort-wrapper {
    color: #cfdaeb !important;
}
html[data-theme="dark"] .contact-page-wrapper .custom-select {
    background: #0f1929 !important;
    color: #e6edf7 !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: #25324a !important;
    background-color: transparent !important;
}
html[data-theme="dark"] .classic-admin-table thead {
    background-color: #1b2740 !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: #e6edf7 !important;
    border-bottom-color: #25324a !important;
}
html[data-theme="dark"] .classic-admin-table tr:hover {
    background-color: #16223a !important;
}
html[data-theme="dark"] .classic-admin-table tr.selected-row {
    background-color: #1e2c47 !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: #1e2c47 !important;
    color: #9aa9c0 !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: #0b1220 !important;
}
html[data-theme="dark"] .contact-page-wrapper .btn-page {
    background: #16223a !important;
    border-color: #2b3a57 !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .contact-page-wrapper .page-indicator,
html[data-theme="dark"] .contact-page-wrapper .loading-msg {
    color: #cfdaeb !important;
}

/* کارت‌های رنگی بخش آدرس/تلفن/کارت مخاطب */
html[data-theme="dark"] .card-body {
    background-color: #131c2e !important;
    color: #e6edf7 !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: #16223a !important;
    border-color: #25324a !important;
    color: #e6edf7 !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: #0b1220 !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: #131c2e !important;
    border-color: #25324a !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .35) !important;
}
html[data-theme="dark"] .crisis-stat__value {
    color: #e6edf7 !important;
}
html[data-theme="dark"] .crisis-stat__of,
html[data-theme="dark"] .crisis-stat__label {
    color: #9aa9c0 !important;
}
html[data-theme="dark"] .crisis-stat__icon--blue { background: #132a45 !important; color: #7cc4ff !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: #16223a !important;
    color: #9aa9c0 !important;
}
html[data-theme="dark"] .crisis-person {
    background: rgba(255, 255, 255, .05) !important;
    border-color: #25324a !important;
}
html[data-theme="dark"] .crisis-person.is-clickable:hover {
    background: #1e2c47 !important;
    border-color: #3b4d70 !important;
}
html[data-theme="dark"] .crisis-btn--light {
    background: #1b2740 !important;
    color: #e6edf7 !important;
}
html[data-theme="dark"] .crisis-btn--light:hover {
    background: #25324a !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__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: #e6edf7 !important;
}
html[data-theme="dark"] .crisis-grid__shift-time {
    color: #9aa9c0 !important;
}
html[data-theme="dark"] .crisis-legend {
    background: #131c2e !important;
    border-color: #25324a !important;
    color: #9aa9c0 !important;
}
html[data-theme="dark"] table tfoot th,
html[data-theme="dark"] table tfoot td {
    color: #e6edf7 !important;
    background-color: #16223a !important;
    border-color: #25324a !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: #131c2e !important;
    border-color: #25324a !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: #b9c6da !important;
}
html[data-theme="dark"] .consultant-login-shell .form-control {
    background-color: #0f1929 !important;
    border-color: #2b3a57 !important;
    color: #e6edf7 !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;
    }
}
