/* ===== DARK MODE OVERRIDE - قوانین قوی‌تر ===== */

/* Override تمام کلاس‌های background با specificity خیلی بالا */
html body.dark-mode *[class*="bg-white"],
html body.dark-mode *[class*="bg-light"] {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
}

/* Override برای عناصر خاص */
html body.dark-mode .card-header[class*="bg-"],
html body.dark-mode .nav-tabs[class*="bg-"],
html body.dark-mode .nav-link[class*="bg-"],
html body.dark-mode .btn[class*="bg-"],
html body.dark-mode .badge[class*="bg-"],
html body.dark-mode .input-group-text[class*="bg-"] {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
}

/* Override برای inline styles */
html body.dark-mode [style*="background-color: white"],
html body.dark-mode [style*="background-color: #fff"],
html body.dark-mode [style*="background-color: #ffffff"],
html body.dark-mode [style*="background-color: #f8f9fa"],
html body.dark-mode [style*="background-color: #f5f7fb"],
html body.dark-mode [style*="background-color: #e9ecef"] {
  background-color: #1a1d1e !important;
}

/* Override برای تمام عناصر با کلاس bg-light یا bg-white */
html body.dark-mode .bg-light,
html body.dark-mode .bg-white {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
}

/* Override برای سرتیترها */
html body.dark-mode .card-header {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
}

/* Override برای تب‌ها */
html body.dark-mode .nav-tabs {
  background-color: #1a1d1e !important;
}

html body.dark-mode .nav-tabs .nav-link {
  background-color: #2c3136 !important;
  color: #000000 !important; /* رنگ متن مشکی */
}

html body.dark-mode .nav-tabs .nav-link:hover {
  background-color: #3a3f44 !important;
  color: #000000 !important; /* رنگ متن مشکی در hover */
}

html body.dark-mode .nav-tabs .nav-link.active {
  background-color: #4361ee !important;
  color: #ffffff !important; /* رنگ متن سفید برای تب فعال */
}

/* قوانین اضافی با specificity خیلی بالا */
html body.dark-mode div.card-header.bg-white,
html body.dark-mode div.card-header.bg-light,
html body.dark-mode ul.nav-tabs.bg-light,
html body.dark-mode ul.nav-tabs.bg-white {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
}

/* Override برای تمام عناصر با کلاس‌های ترکیبی */
html body.dark-mode [class*="card-header"][class*="bg-white"],
html body.dark-mode [class*="card-header"][class*="bg-light"],
html body.dark-mode [class*="nav-tabs"][class*="bg-light"],
html body.dark-mode [class*="nav-tabs"][class*="bg-white"] {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
}

/* Override برای تمام عناصر با هر کلاس background */
html body.dark-mode [class*="bg-"] {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
}

/* استثنا برای کلاس‌های خاص */
html body.dark-mode .bg-primary {
  background-color: #4361ee !important;
  color: #fff !important;
}

html body.dark-mode .bg-success {
  background-color: #28a745 !important;
  color: #fff !important;
}

html body.dark-mode .bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
}

html body.dark-mode .bg-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

html body.dark-mode .bg-info {
  background-color: #17a2b8 !important;
  color: #fff !important;
}

html body.dark-mode .bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

/* قوانین اضافی برای Bootstrap RTL */
html body.dark-mode .bg-light.border,
html body.dark-mode .bg-white.border {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
  border-color: #444 !important;
}

/* Override برای تمام عناصر با کلاس‌های Bootstrap */
html body.dark-mode .card-header.bg-white.border-0,
html body.dark-mode .card-header.bg-light.border-0,
html body.dark-mode .nav-tabs.bg-light.border-bottom {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
}

/* قوانین با بالاترین specificity */
html body.dark-mode div.card-header.bg-white.border-0.py-3,
html body.dark-mode div.card-header.bg-light.border-0.py-3,
html body.dark-mode ul.nav.nav-tabs.bg-light.border-bottom {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
}

/* Buttons - رنگ‌های بهتر برای دارک مود */
html body.dark-mode .btn {
  color: #e0e0e0 !important;
  background-color: #2c3136 !important;
  border-color: #555 !important;
  transition: all 0.3s ease !important;
}

html body.dark-mode .btn:hover {
  background-color: #3a3f44 !important;
  border-color: #666 !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

html body.dark-mode .btn:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

html body.dark-mode .btn-primary {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  border-color: #4361ee !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(67, 97, 238, 0.3) !important;
}

html body.dark-mode .btn-primary:hover {
  background: linear-gradient(135deg, #3a56d4, #2d4bcc) !important;
  border-color: #3a56d4 !important;
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.4) !important;
}

html body.dark-mode .btn-outline-primary {
  color: #4361ee !important;
  border-color: #4361ee !important;
  background: transparent !important;
  transition: all 0.3s ease !important;
}

html body.dark-mode .btn-outline-primary:hover {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.3) !important;
}

html body.dark-mode .btn-outline-success {
  color: #28a745 !important;
  border-color: #28a745 !important;
  background: transparent !important;
}

html body.dark-mode .btn-outline-success:hover {
  background: linear-gradient(135deg, #28a745, #218838) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3) !important;
}

html body.dark-mode .btn-outline-info {
  color: #17a2b8 !important;
  border-color: #17a2b8 !important;
  background: transparent !important;
}

html body.dark-mode .btn-outline-info:hover {
  background: linear-gradient(135deg, #17a2b8, #138496) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3) !important;
}

html body.dark-mode .btn-success {
  background: linear-gradient(135deg, #28a745, #218838) !important;
  border-color: #28a745 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3) !important;
}

html body.dark-mode .btn-success:hover {
  background: linear-gradient(135deg, #218838, #1e7e34) !important;
  border-color: #218838 !important;
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4) !important;
}

html body.dark-mode .btn-info {
  background: linear-gradient(135deg, #17a2b8, #138496) !important;
  border-color: #17a2b8 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3) !important;
}

html body.dark-mode .btn-info:hover {
  background: linear-gradient(135deg, #138496, #117a8b) !important;
  border-color: #138496 !important;
  box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4) !important;
}

html body.dark-mode .btn-warning {
  background: linear-gradient(135deg, #ffc107, #e0a800) !important;
  border-color: #ffc107 !important;
  color: #212529 !important;
  box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3) !important;
}

html body.dark-mode .btn-warning:hover {
  background: linear-gradient(135deg, #e0a800, #d39e00) !important;
  border-color: #e0a800 !important;
  box-shadow: 0 4px 8px rgba(255, 193, 7, 0.4) !important;
}

html body.dark-mode .btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
  border-color: #dc3545 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important;
}

html body.dark-mode .btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #bd2130) !important;
  border-color: #c82333 !important;
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4) !important;
}

html body.dark-mode .btn-secondary {
  background: linear-gradient(135deg, #6c757d, #5a6268) !important;
  border-color: #6c757d !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3) !important;
}

html body.dark-mode .btn-secondary:hover {
  background: linear-gradient(135deg, #5a6268, #545b62) !important;
  border-color: #5a6268 !important;
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.4) !important;
}

/* دکمه‌های کوچک */
html body.dark-mode .btn-sm {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.875rem !important;
  border-radius: 0.2rem !important;
}

/* دکمه‌های بزرگ */
html body.dark-mode .btn-lg {
  padding: 0.75rem 1.5rem !important;
  font-size: 1.25rem !important;
  border-radius: 0.3rem !important;
}

/* دکمه btn-light - بهبود برای دارک مود */
html body.dark-mode .btn-light {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
  border-color: #dee2e6 !important;
  color: #495057 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s ease !important;
}

html body.dark-mode .btn-light:hover {
  background: linear-gradient(135deg, #e9ecef, #dee2e6) !important;
  border-color: #ced4da !important;
  color: #212529 !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

html body.dark-mode .btn-light:active {
  background: linear-gradient(135deg, #dee2e6, #ced4da) !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* دکمه‌های outline-light */
html body.dark-mode .btn-outline-light {
  color: #f8f9fa !important;
  border-color: #f8f9fa !important;
  background: transparent !important;
  transition: all 0.3s ease !important;
}

html body.dark-mode .btn-outline-light:hover {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
  color: #495057 !important;
  box-shadow: 0 4px 8px rgba(248, 249, 250, 0.3) !important;
}

/* فرم‌ها و فیلترها - بهبود برای دارک مود */
html body.dark-mode .form-select {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
  transition: all 0.3s ease !important;
}

html body.dark-mode .form-select:focus {
  background-color: #2c3136 !important;
  color: #ffffff !important;
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

html body.dark-mode .form-select:hover {
  background-color: #3a3f44 !important;
  border-color: #666 !important;
}

html body.dark-mode .form-select option {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .form-select option:hover {
  background-color: #3a3f44 !important;
}

html body.dark-mode .form-control {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
  transition: all 0.3s ease !important;
}

html body.dark-mode .form-control:focus {
  background-color: #2c3136 !important;
  color: #ffffff !important;
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

html body.dark-mode .form-control:hover {
  background-color: #3a3f44 !important;
  border-color: #666 !important;
}

/* Breadcrumb - بهبود برای دارک مود */
html body.dark-mode .breadcrumb {
  background-color: #2c3136 !important;
  border-color: #555 !important;
}

html body.dark-mode .breadcrumb-item {
  color: #b0b0b0 !important;
}

html body.dark-mode .breadcrumb-item a {
  color: #4361ee !important;
  text-decoration: none !important;
}

html body.dark-mode .breadcrumb-item a:hover {
  color: #3a56d4 !important;
  text-decoration: underline !important;
}

html body.dark-mode .breadcrumb-item.active {
  color: #e0e0e0 !important;
}

html body.dark-mode .breadcrumb-item + .breadcrumb-item::before {
  color: #666 !important;
}

/* Card header برای فیلترها */
html body.dark-mode .card-header {
  background: linear-gradient(135deg, #2c3136, #1a1d1e) !important;
  color: #e0e0e0 !important;
  border-bottom: 1px solid #444 !important;
}

/* Gap utility برای فیلترها */
html body.dark-mode .gap-2 > * {
  margin: 0 0.5rem !important;
}

html body.dark-mode .gap-2 > *:first-child {
  margin-right: 0 !important;
}

html body.dark-mode .gap-2 > *:last-child {
  margin-left: 0 !important;
}

/* موجودی - بهبود رنگ‌ها برای دارک مود */
html body.dark-mode .stock-status {
  font-weight: 600 !important;
  border-radius: 6px !important;
  padding: 6px 12px !important;
  font-size: 0.85rem !important;
  transition: all 0.3s ease !important;
}

html body.dark-mode .stock-normal:not(.hist-stat-value):not(.stock-status) {
  background: linear-gradient(135deg, #28a745, #218838) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3) !important;
}

html body.dark-mode .stock-low:not(.hist-stat-value):not(.stock-status) {
  background: linear-gradient(135deg, #ffc107, #e0a800) !important;
  color: #212529 !important;
  box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3) !important;
}

html body.dark-mode .stock-critical:not(.hist-stat-value):not(.stock-status) {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3) !important;
}

html body.dark-mode .hist-stat-value.stock-normal { background: none !important; color: #4ade80 !important; box-shadow: none !important; }
html body.dark-mode .hist-stat-value.stock-low { background: none !important; color: #facc15 !important; box-shadow: none !important; }
html body.dark-mode .hist-stat-value.stock-critical { background: none !important; color: #f87171 !important; box-shadow: none !important; }

html body.dark-mode .stock-status:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

/* دکمه‌های btn-light در header — استایل شیشه‌ای (هماهنگ با صفحه انبار) */
html body.dark-mode .card-header.bg-primary .btn-light,
/* دکمه افزودن (btn-add): لایت و دارک — یکسان — پس‌زمینه سفید، متن مشکی */
html body.dark-mode .card-header.bg-primary .btn-add,
html body.dark-mode .card-header.bg-primary #addDropdown.btn-add {
  background-color: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 1) !important;
  color: #000 !important;
  box-shadow: none !important;
}
html body.dark-mode .card-header.bg-primary .btn-add:hover,
html body.dark-mode .card-header.bg-primary .btn-add:focus,
html body.dark-mode .card-header.bg-primary .btn-add.show,
html body.dark-mode .card-header.bg-primary #addDropdown.btn-add:hover,
html body.dark-mode .card-header.bg-primary #addDropdown.btn-add:focus,
html body.dark-mode .card-header.bg-primary #addDropdown.btn-add.show {
  background-color: rgba(255, 255, 255, 1) !important;
  border-color: rgba(255, 255, 255, 1) !important;
  color: #000 !important;
  transform: none !important;
}
html body.dark-mode .card-header.bg-primary .btn-add i,
html body.dark-mode .card-header.bg-primary #addDropdown.btn-add i {
  color: #000 !important;
}
html body.dark-mode .card-header.bg-primary .btn-add:hover i,
html body.dark-mode .card-header.bg-primary #addDropdown.btn-add:hover i {
  color: #000 !important;
}

/* دکمه‌های btn-light بدون btn-add در هدر primary: استایل شیشه‌ای — آیکون و متن سفید */
html body.dark-mode .card-header.bg-primary .btn-light:not(.btn-add) {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
  box-shadow: none !important;
}
html body.dark-mode .card-header.bg-primary .btn-light:not(.btn-add):hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
  color: #fff !important;
  transform: none !important;
}
html body.dark-mode .card-header.bg-primary .btn-light:not(.btn-add) i,
html body.dark-mode .card-header.bg-primary .btn-light:not(.btn-add) .fas,
html body.dark-mode .card-header.bg-primary .btn-light:not(.btn-add) .fa {
  color: #fff !important;
}
html body.dark-mode .card-header.bg-primary .btn-light:not(.btn-add):hover i {
  color: #fff !important;
}

/* بخش ثبت عملکرد - بهبود برای دارک مود */
html body.dark-mode .performance-registration {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
  padding: 20px !important;
  border-radius: 8px !important;
}

html body.dark-mode .performance-registration h3 {
  color: #e0e0e0 !important;
  border-bottom: 2px solid #4361ee !important;
  padding-bottom: 10px !important;
}

html body.dark-mode .performance-form {
  background-color: #2c3136 !important;
  padding: 20px !important;
  border-radius: 8px !important;
  border: 1px solid #444 !important;
}

html body.dark-mode .performance-form .form-label {
  color: #e0e0e0 !important;
  font-weight: 600 !important;
}

html body.dark-mode .performance-form .form-control {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
  transition: all 0.3s ease !important;
}

html body.dark-mode .performance-form .form-control:focus {
  background-color: #1a1d1e !important;
  color: #ffffff !important;
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

html body.dark-mode .performance-form .form-control:disabled {
  background-color: #2c3136 !important;
  color: #888 !important;
  border-color: #444 !important;
}

html body.dark-mode .performance-form .form-control::placeholder {
  color: #888 !important;
}

/* جدول برش در بخش ثبت عملکرد */
html body.dark-mode .performance-registration .card {
  background-color: #2c3136 !important;
  border-color: #444 !important;
}

html body.dark-mode .performance-registration .card-header {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  color: #ffffff !important;
  border-bottom: 1px solid #555 !important;
}

html body.dark-mode .performance-registration .card-body {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .performance-registration .table {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .performance-registration .table thead th {
  background: linear-gradient(135deg, #2c3136, #1a1d1e) !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
}

html body.dark-mode .performance-registration .table tbody td {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #444 !important;
}

html body.dark-mode .performance-registration .table tbody tr:hover {
  background-color: rgba(67, 97, 238, 0.1) !important;
}

html
  body.dark-mode
  .performance-registration
  .table-striped
  tbody
  tr:nth-of-type(odd) {
  background-color: rgba(44, 49, 54, 0.3) !important;
}

/* دکمه‌های عملیات در بخش ثبت عملکرد */
html body.dark-mode .performance-registration .btn-secondary {
  background: linear-gradient(135deg, #6c757d, #5a6268) !important;
  border-color: #6c757d !important;
  color: #ffffff !important;
}

html body.dark-mode .performance-registration .btn-secondary:hover {
  background: linear-gradient(135deg, #5a6268, #545b62) !important;
  border-color: #5a6268 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(108, 117, 125, 0.4) !important;
}

html body.dark-mode .performance-registration .btn-primary {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  border-color: #4361ee !important;
  color: #ffffff !important;
}

html body.dark-mode .performance-registration .btn-primary:hover {
  background: linear-gradient(135deg, #3a56d4, #2d4bcc) !important;
  border-color: #3a56d4 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 8px rgba(67, 97, 238, 0.4) !important;
}

html body.dark-mode .performance-registration .btn:disabled {
  background: linear-gradient(135deg, #6c757d, #5a6268) !important;
  border-color: #6c757d !important;
  color: #888 !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

/* Project Info Panel */
html body.dark-mode .project-info .card {
  background-color: #2c3136 !important;
  border-color: #444 !important;
}

html body.dark-mode .project-info .card-header {
  background: linear-gradient(135deg, #17a2b8, #138496) !important;
  color: #ffffff !important;
  border-bottom: 1px solid #555 !important;
}

html body.dark-mode .project-info .card-body {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

/* متن‌های muted در بخش ثبت عملکرد */
html body.dark-mode .performance-registration .text-muted {
  color: #888 !important;
}

/* بهبود dropdown ها در دارک مود */
html body.dark-mode .select2-container--default .select2-selection--single {
  background-color: #1a1d1e !important;
  border-color: #555 !important;
  color: #e0e0e0 !important;
}

html
  body.dark-mode
  .select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: #e0e0e0 !important;
}

html
  body.dark-mode
  .select2-container--default
  .select2-selection--single
  .select2-selection__placeholder {
  color: #888 !important;
}

html
  body.dark-mode
  .select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  color: #e0e0e0 !important;
}

html body.dark-mode .select2-dropdown {
  background-color: #2c3136 !important;
  border-color: #555 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

html body.dark-mode .select2-container--default .select2-results__option {
  color: #e0e0e0 !important;
  background-color: #2c3136 !important;
}

html
  body.dark-mode
  .select2-container--default
  .select2-results__option--highlighted {
  background-color: #4361ee !important;
  color: #ffffff !important;
}

html
  body.dark-mode
  .select2-container--default
  .select2-results__option[aria-selected="true"] {
  background-color: #3a3f44 !important;
  color: #ffffff !important;
}

html body.dark-mode .select2-search--dropdown .select2-search__field {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
}

html body.dark-mode .select2-search--dropdown .select2-search__field:focus {
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

/* Select2 Bootstrap 5 theme – دراپ‌داون پارچه جدول برش و سایر صفحات */
html body.dark-mode .select2-container--bootstrap-5 .select2-selection,
html body.dark-mode .select2-container--bootstrap-5 .select2-selection--single,
html body.dark-mode .select2-container--bootstrap-5 .select2-selection--multiple {
  background-color: #2b3035 !important;
  border-color: #495057 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .select2-container--bootstrap-5 .select2-selection__placeholder,
html body.dark-mode .select2-container--bootstrap-5 .select2-selection__rendered {
  color: #e0e0e0 !important;
}

html body.dark-mode .select2-container--bootstrap-5 .select2-dropdown {
  background-color: #1a1d1e !important;
  border-color: #495057 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .select2-container--bootstrap-5 .select2-search--dropdown,
html body.dark-mode .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
  background-color: #2b3035 !important;
  border-color: #495057 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus {
  background-color: #2b3035 !important;
  border-color: #86b7fe !important;
  color: #e0e0e0 !important;
  outline: none !important;
}

html body.dark-mode .select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field::placeholder {
  color: #868e96 !important;
}

html body.dark-mode .select2-container--bootstrap-5 .select2-results__option {
  background-color: transparent !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .select2-container--bootstrap-5 .select2-results__option--highlighted,
html body.dark-mode .select2-container--bootstrap-5 .select2-results__option--selectable:hover {
  background-color: #0d6efd !important;
  color: #ffffff !important;
}

html body.dark-mode .select2-container--bootstrap-5 .select2-results__option--selected,
html body.dark-mode .select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
  background-color: #495057 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
  color: #ffffff !important;
}

/* مودال مصرف جدول برش — ردیف خلاصه در دارک مود (کادر روشن و متن مشکی) */
html body.dark-mode #consumptionModal .consumption-summary-row,
html body.dark-mode #consumptionModal .consumption-summary-row td,
html body.dark-mode #consumptionModal .consumption-summary-cell {
  background-color: #e9ecef !important;
  color: #1a1d21 !important;
  border-color: #dee2e6 !important;
}
html body.dark-mode #consumptionModal .consumption-summary-cell,
html body.dark-mode #consumptionModal .consumption-summary-cell *,
html body.dark-mode #consumptionModal .consumption-summary-cell span,
html body.dark-mode #consumptionModal .consumption-summary-cell strong,
html body.dark-mode #consumptionModal .consumption-summary-row strong {
  color: #1a1d21 !important;
}
html body.dark-mode #consumptionModal .table-primary:not(.consumption-summary-row),
html body.dark-mode #consumptionModal tr.table-primary:not(.consumption-summary-row) td {
  background-color: #343a40 !important;
  color: #e0e0e0 !important;
  border-color: #495057 !important;
}
html body.dark-mode #consumptionModal .table-warning,
html body.dark-mode #consumptionModal tr.table-warning td {
  background-color: #343a40 !important;
  color: #f0f0f0 !important;
  border-color: #495057 !important;
}
html body.dark-mode #consumptionModal .table-warning .form-label,
html body.dark-mode #consumptionModal .table-warning label {
  color: #f0f0f0 !important;
}
html body.dark-mode #consumptionModal .table-success,
html body.dark-mode #consumptionModal tr.table-success td {
  background-color: #343a40 !important;
  color: #f0f0f0 !important;
  border-color: #495057 !important;
}
html body.dark-mode #consumptionModal .table-success .form-label,
html body.dark-mode #consumptionModal .table-success label {
  color: #f0f0f0 !important;
}
html body.dark-mode #consumptionModal .table {
  color: #e0e0e0 !important;
}
html body.dark-mode #consumptionModal .table thead {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #495057 !important;
}
html body.dark-mode #consumptionModal .table tbody tr {
  background-color: #23272b !important;
  color: #e0e0e0 !important;
  border-color: #495057 !important;
}
html body.dark-mode #consumptionModal .table tbody tr.consumption-summary-row td {
  background-color: #e9ecef !important;
  color: #1a1d21 !important;
  border-color: #dee2e6 !important;
}
html body.dark-mode #consumptionModal .table tbody tr:nth-of-type(odd) {
  background-color: #2c3136 !important;
}

/* بهبود آیکون‌های تب در دارک مود */
html body.dark-mode .nav-tabs .nav-link i {
  color: #e0e0e0 !important;
}

html body.dark-mode .nav-tabs .nav-link.active i {
  color: #ffffff !important;
}

html body.dark-mode .nav-tabs .nav-link:hover i {
  color: #ffffff !important;
}

/* کارت هدر جدول برش - یکسان با بقیه صفحات */
html body.dark-mode .performance-registration .card-header.bg-primary {
  background: linear-gradient(135deg, #2c3136, #1a1d1e) !important;
  color: #e0e0e0 !important;
  border-bottom: 1px solid #444 !important;
}

html body.dark-mode .performance-registration .card-header.bg-primary h5 {
  color: #e0e0e0 !important;
}

html body.dark-mode .performance-registration .card-header.bg-primary i {
  color: #e0e0e0 !important;
}

/* یکسان کردن جدول برش با بقیه صفحات */
html body.dark-mode .performance-registration .table.table-dark {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .performance-registration .table.table-dark thead {
  background: linear-gradient(135deg, #2c3136, #1a1d1e) !important;
}

html body.dark-mode .performance-registration .table.table-dark thead th {
  background: linear-gradient(135deg, #2c3136, #1a1d1e) !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
  border-bottom: 2px solid #444 !important;
}

html body.dark-mode .performance-registration .table.table-dark tbody {
  background-color: #2c3136 !important;
}

html body.dark-mode .performance-registration .table.table-dark tbody td {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #444 !important;
  border-bottom: 1px solid #444 !important;
}

html body.dark-mode .performance-registration .table.table-dark tbody tr:hover {
  background-color: rgba(67, 97, 238, 0.1) !important;
}

html
  body.dark-mode
  .performance-registration
  .table.table-dark.table-striped
  tbody
  tr:nth-of-type(odd) {
  background-color: rgba(44, 49, 54, 0.3) !important;
}

html
  body.dark-mode
  .performance-registration
  .table.table-dark.table-striped
  tbody
  tr:nth-of-type(odd)
  td {
  background-color: rgba(44, 49, 54, 0.3) !important;
}

/* حذف کلاس table-dark در دارک مود */
html body.dark-mode .table-dark {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .table-dark thead th {
  background: linear-gradient(135deg, #2c3136, #1a1d1e) !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
}

html body.dark-mode .table-dark tbody td {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #444 !important;
}

/* بهبود سایدبار در دارک مود */
html body.dark-mode .sidebar {
  background: linear-gradient(135deg, #1a1d1e, #2c3136) !important;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3) !important;
}

html body.dark-mode .sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html body.dark-mode .sidebar-user {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html body.dark-mode .nav-link {
  border: none !important;
  background: transparent !important;
  transition: all 0.3s ease !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .nav-link:hover {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4) !important;
}

html body.dark-mode .nav-link.active {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4) !important;
}

html body.dark-mode .nav-link.active i {
  color: #ffffff !important;
}

html body.dark-mode .submenu-link {
  border: none !important;
  background: transparent !important;
  transition: all 0.3s ease !important;
  color: #b0b0b0 !important;
}

html body.dark-mode .submenu-link:hover {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(67, 97, 238, 0.3) !important;
}

html body.dark-mode .submenu-link.active {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4) !important;
}

html body.dark-mode .submenu-link.active i {
  color: #ffffff !important;
}

html body.dark-mode .nav-divider {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

html body.dark-mode .sidebar-brand {
  color: #ffffff !important;
}

html body.dark-mode .sidebar-brand:hover {
  color: #e0e0e0 !important;
}

html body.dark-mode .user-info h6 {
  color: #ffffff !important;
}

html body.dark-mode .user-info span {
  color: rgba(255, 255, 255, 0.8) !important;
}

html body.dark-mode .user-avatar {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

html body.dark-mode .submenu-arrow {
  color: rgba(255, 255, 255, 0.8) !important;
}

html body.dark-mode .nav-link[aria-expanded="true"] .submenu-arrow {
  color: #ffffff !important;
  transform: rotate(-90deg) !important;
}

/* Dark Mode Override Styles */

/* Apply Template Page */
body.dark-mode .template-card {
  background: #2d3748 !important;
  border: 1px solid #4a5568 !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .template-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
  transition: none !important;
}

body.dark-mode .template-card.selected {
  border: 3px solid #4299e1 !important;
  box-shadow: 0 8px 25px rgba(66, 153, 225, 0.4) !important;
}

body.dark-mode .template-stats {
  background-color: #4a5568 !important;
  border-bottom: 1px solid #718096 !important;
}

body.dark-mode .stat-value {
  color: #e2e8f0 !important;
}

body.dark-mode .stat-label {
  color: #a0aec0 !important;
}

body.dark-mode .form-section {
  background: #2d3748 !important;
  border: 1px solid #4a5568 !important;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3) !important;
}

body.dark-mode .form-section h4,
body.dark-mode .form-section h5,
body.dark-mode .form-section h6 {
  color: #e2e8f0 !important;
}

body.dark-mode .form-section strong {
  color: #e2e8f0 !important;
}

body.dark-mode .form-section .text-muted {
  color: #a0aec0 !important;
}

body.dark-mode .warning-section {
  background: linear-gradient(
    135deg,
    #c53030 0%,
    #e53e3e 50%,
    #fc8181 100%
  ) !important;
  color: #fff !important;
}

body.dark-mode .current-processes {
  background: #4a5568 !important;
  border: 1px solid #718096 !important;
}

body.dark-mode .process-item {
  background: #2d3748 !important;
  border-left: 4px solid #4299e1 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .process-item small {
  color: #a0aec0 !important;
}

body.dark-mode .no-templates {
  color: #a0aec0 !important;
}

body.dark-mode .selection-indicator {
  background: #4299e1 !important;
}

body.dark-mode .alert-info {
  background-color: #2c5282 !important;
  border-color: #4299e1 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .alert-success {
  background-color: #22543d !important;
  border-color: #48bb78 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .btn-outline-secondary {
  color: #e2e8f0 !important;
  border-color: #718096 !important;
}

body.dark-mode .btn-outline-secondary:hover {
  background-color: #4a5568 !important;
  border-color: #a0aec0 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .form-check-label {
  color: #e2e8f0 !important;
}

body.dark-mode .form-check-input {
  background-color: #4a5568 !important;
  border-color: #718096 !important;
}

body.dark-mode .form-check-input:checked {
  background-color: #4299e1 !important;
  border-color: #4299e1 !important;
}

body.dark-mode .form-select {
  background-color: #4a5568 !important;
  border-color: #718096 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .form-select option {
  background-color: #4a5568 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .badge.bg-secondary {
  background-color: #718096 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .badge.bg-warning {
  background-color: #d69e2e !important;
  color: #1a202c !important;
}

body.dark-mode .badge.bg-light {
  background-color: #4a5568 !important;
  color: #e2e8f0 !important;
}

body.dark-mode .text-primary {
  color: #4299e1 !important;
}

body.dark-mode .text-info {
  color: #63b3ed !important;
}

body.dark-mode .text-danger {
  color: #f56565 !important;
}

body.dark-mode .text-muted {
  color: #a0aec0 !important;
}

/* ===== DARK MODE FOR TREE CHART TAB ===== */

/* Tree chart container */
html body.dark-mode #tree-chart-container {
  background-color: #1a1d1e !important;
}

/* Branch boxes */
html body.dark-mode .branch-box {
  background-color: #2c3136 !important;
  border-color: #444 !important;
}

html body.dark-mode .branch-box:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
  transition: none !important;
}

/* Branch header */
html body.dark-mode .branch-header {
  background: linear-gradient(135deg, #1976d2, #0d47a1) !important;
  border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

/* Branch info */
html body.dark-mode .branch-info {
  background-color: #1a1d1e !important;
  border-bottom-color: #444 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .branch-info small {
  color: #b0b0b0 !important;
}

html body.dark-mode .branch-info .fas {
  color: #64b5f6 !important;
}

/* Branch processes */
html body.dark-mode .branch-processes {
  background-color: #2c3136 !important;
}

html body.dark-mode .branch-processes::-webkit-scrollbar-track {
  background: #1a1d1e !important;
}

html body.dark-mode .branch-processes::-webkit-scrollbar-thumb {
  background: #555 !important;
}

/* Process boxes */
html body.dark-mode .process-box {
  background-color: #1a1d1e !important;
  border-right-color: #ef5350 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .process-box:hover {
  background-color: #1a1d1e !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
  transition: none !important;
}

html body.dark-mode .process-name {
  color: #e0e0e0 !important;
}

/* No processes message */
html body.dark-mode .no-processes {
  background-color: #1a1d1e !important;
  color: #b0b0b0 !important;
  border-color: #444 !important;
}

/* Tree chart card */
html body.dark-mode #tree-chart-content .card {
  background-color: #2c3136 !important;
  border-color: #444 !important;
}

html body.dark-mode #tree-chart-content .card-header {
  background: linear-gradient(135deg, #1976d2, #0d47a1) !important;
  border-bottom-color: #444 !important;
}

html body.dark-mode #tree-chart-content .card-body {
  background-color: #2c3136 !important;
}

/* Process number badge */
html body.dark-mode .process-number {
  background: linear-gradient(135deg, #f44336, #c62828) !important;
  box-shadow: 0 3px 6px rgba(244, 67, 54, 0.4) !important;
}

/* Branch number badge */
html body.dark-mode .branch-number {
  background-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* ===== DARK MODE FOR EDIT PROCESS FORM ===== */

/* Edit process form card */
html body.dark-mode .card-header.bg-primary {
  background: linear-gradient(135deg, #1976d2, #0d47a1) !important;
}

html body.dark-mode .card-header.bg-info {
  background: linear-gradient(135deg, #0288d1, #01579b) !important;
}

/* Form inputs in dark mode */
html body.dark-mode .form-control {
  background-color: #2c3136 !important;
  border-color: #444 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .form-control:focus {
  background-color: #3a3f44 !important;
  border-color: #64b5f6 !important;
  color: #e0e0e0 !important;
  box-shadow: 0 0 0 0.2rem rgba(100, 181, 246, 0.25) !important;
}

html body.dark-mode .form-control:disabled {
  background-color: #1a1d1e !important;
  color: #b0b0b0 !important;
}

html body.dark-mode .form-select {
  background-color: #2c3136 !important;
  border-color: #444 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode .form-select:focus {
  background-color: #3a3f44 !important;
  border-color: #64b5f6 !important;
  color: #e0e0e0 !important;
  box-shadow: 0 0 0 0.2rem rgba(100, 181, 246, 0.25) !important;
}

/* Input group text */
html body.dark-mode .input-group-text {
  background-color: #1a1d1e !important;
  border-color: #444 !important;
  color: #e0e0e0 !important;
}

/* Form labels */
html body.dark-mode .form-label {
  color: #e0e0e0 !important;
}

/* Text muted */
html body.dark-mode .text-muted {
  color: #b0b0b0 !important;
}

/* Badges */
html body.dark-mode .badge.bg-warning {
  background-color: #f57c00 !important;
  color: #fff !important;
}

html body.dark-mode .badge.bg-success {
  background-color: #388e3c !important;
  color: #fff !important;
}

/* List items */
html body.dark-mode .list-unstyled li {
  color: #e0e0e0 !important;
}

html body.dark-mode .list-unstyled li strong {
  color: #64b5f6 !important;
}

/* ===== DARK MODE OVERRIDE - قوانین قوی برای فیلدهای جستجو ===== */

/* فیلدهای جستجو در حالت دارک مود - قوانین با بالاترین specificity */
body.dark-mode input[type="text"][name="search"]::placeholder,
body.dark-mode input[type="search"][name="search"]::placeholder,
body.dark-mode input[name="search"]::placeholder {
  color: #b0b0b0 !important;
  opacity: 1 !important;
}

body.dark-mode input[type="text"][name="search"]::-webkit-input-placeholder,
body.dark-mode input[type="search"][name="search"]::-webkit-input-placeholder,
body.dark-mode input[name="search"]::-webkit-input-placeholder {
  color: #b0b0b0 !important;
  opacity: 1 !important;
}

body.dark-mode input[type="text"][name="search"]::-moz-placeholder,
body.dark-mode input[type="search"][name="search"]::-moz-placeholder,
body.dark-mode input[name="search"]::-moz-placeholder {
  color: #b0b0b0 !important;
  opacity: 1 !important;
}

body.dark-mode input[type="text"][name="search"]:-ms-input-placeholder,
body.dark-mode input[type="search"][name="search"]:-ms-input-placeholder,
body.dark-mode input[name="search"]:-ms-input-placeholder {
  color: #b0b0b0 !important;
  opacity: 1 !important;
}

/* اطمینان از رنگ متن در فیلدهای جستجو */
body.dark-mode input[type="text"][name="search"],
body.dark-mode input[type="search"][name="search"],
body.dark-mode input[name="search"] {
  color: #e0e0e0 !important;
  background-color: #2c3136 !important;
  border-color: #555 !important;
}

body.dark-mode input[type="text"][name="search"]:focus,
body.dark-mode input[type="search"][name="search"]:focus,
body.dark-mode input[name="search"]:focus {
  color: #ffffff !important;
  background-color: #2c3136 !important;
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

/* دکمه‌های اضافی در دارک مود */
body.dark-mode .btn-light {
  background-color: #3a3f44 !important;
  border-color: #555 !important;
  color: #e0e0e0 !important;
}

body.dark-mode .btn-light:hover {
  background-color: #4a4f54 !important;
  border-color: #666 !important;
  color: #fff !important;
}

body.dark-mode .btn-success {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
  color: #fff !important;
}

body.dark-mode .btn-success:hover {
  background-color: #218838 !important;
  border-color: #1e7e34 !important;
  color: #fff !important;
}

/* اطمینان از نمایش صحیح همه فیلدهای input */
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  color: #e0e0e0 !important;
  background-color: #2c3136 !important;
  border-color: #555 !important;
}

body.dark-mode input:focus,
body.dark-mode textarea:focus,
body.dark-mode select:focus {
  color: #ffffff !important;
  background-color: #2c3136 !important;
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

/* Placeholder برای همه فیلدها */
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #b0b0b0 !important;
  opacity: 1 !important;
}

body.dark-mode input::-webkit-input-placeholder,
body.dark-mode textarea::-webkit-input-placeholder {
  color: #b0b0b0 !important;
  opacity: 1 !important;
}

body.dark-mode input::-moz-placeholder,
body.dark-mode textarea::-moz-placeholder {
  color: #b0b0b0 !important;
  opacity: 1 !important;
}

body.dark-mode input:-ms-input-placeholder,
body.dark-mode textarea:-ms-input-placeholder {
  color: #b0b0b0 !important;
  opacity: 1 !important;
}

/* 🎯 بهبود لیست عملکرد در دارک مود */
html body.dark-mode #performance-list {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode #performance-list .card {
  background-color: #2c3136 !important;
  border-color: #444 !important;
}

html body.dark-mode #performance-list .card-header {
  background: linear-gradient(135deg, #2c3136, #1a1d1e) !important;
  color: #e0e0e0 !important;
  border-bottom: 1px solid #555 !important;
}

html body.dark-mode #performance-list .card-body {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode #performance-list .performance-table-container {
  background-color: #2c3136 !important;
  border-color: #555 !important;
}

html body.dark-mode #performance-list .table {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

/* performance-table همان thead.table-dark دارد؛ گرادیان اینجا با هدر تیرهٔ جدول تولید تداخل داشت */
html body.dark-mode #performance-list .table:not(.performance-table) thead th {
  background: linear-gradient(135deg, #2c3136, #1a1d1e) !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
  border-bottom: 2px solid #444 !important;
}

html body.dark-mode #performance-list .table tbody td {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #444 !important;
  border-bottom: 1px solid #444 !important;
}

html body.dark-mode #performance-list .table tbody tr:hover {
  background-color: rgba(67, 97, 238, 0.02) !important;
}

html body.dark-mode #performance-list .table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(44, 49, 54, 0.2) !important;
}

html
  body.dark-mode
  #performance-list
  .table-striped
  tbody
  tr:nth-of-type(odd)
  td {
  background-color: rgba(44, 49, 54, 0.2) !important;
}

/* بهبود hover برای ردیف‌های striped */
html
  body.dark-mode
  #performance-list
  .table-striped
  tbody
  tr:nth-of-type(odd):hover {
  background-color: rgba(67, 97, 238, 0.02) !important;
}

html
  body.dark-mode
  #performance-list
  .table-striped
  tbody
  tr:nth-of-type(odd):hover
  td {
  background-color: rgba(67, 97, 238, 0.02) !important;
}

html
  body.dark-mode
  #performance-list
  .table-striped
  tbody
  tr:nth-of-type(even):hover {
  background-color: rgba(67, 97, 238, 0.02) !important;
}

html
  body.dark-mode
  #performance-list
  .table-striped
  tbody
  tr:nth-of-type(even):hover
  td {
  background-color: rgba(67, 97, 238, 0.02) !important;
}

html body.dark-mode #performance-list .table-hover tbody tr:hover {
  background-color: rgba(67, 97, 238, 0.02) !important;
}

html body.dark-mode #performance-list .table-hover tbody tr:hover td {
  background-color: rgba(67, 97, 238, 0.02) !important;
}

/* 🎯 بهبود آمار کلی در لیست عملکرد */
html body.dark-mode #performance-list .bg-primary {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  color: #ffffff !important;
}

html body.dark-mode #performance-list .bg-success {
  background: linear-gradient(135deg, #28a745, #20c997) !important;
  color: #ffffff !important;
}

html body.dark-mode #performance-list .bg-warning {
  background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
  color: #000000 !important;
}

html body.dark-mode #performance-list .bg-info {
  background: linear-gradient(135deg, #17a2b8, #138496) !important;
  color: #ffffff !important;
}

/* 🎯 بهبود فیلترها در لیست عملکرد */
html body.dark-mode #performance-list .form-label {
  color: #e0e0e0 !important;
  font-weight: 600 !important;
}

html body.dark-mode #performance-list .form-select {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
}

html body.dark-mode #performance-list .form-select:focus {
  background-color: #1a1d1e !important;
  color: #ffffff !important;
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

html body.dark-mode #performance-list .form-select option {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
}

html body.dark-mode #performance-list .form-control {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
}

html body.dark-mode #performance-list .form-control:focus {
  background-color: #1a1d1e !important;
  color: #ffffff !important;
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

html body.dark-mode #performance-list .form-control::placeholder {
  color: #888 !important;
}

/* 🎯 بهبود متن‌های muted در لیست عملکرد */
html body.dark-mode #performance-list .text-muted {
  color: #888 !important;
}

/* 🎯 بهبود دکمه‌های عملیات در جدول */
html body.dark-mode #performance-list .btn {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
}

html body.dark-mode #performance-list .btn:hover {
  background-color: #3a3f44 !important;
  color: #ffffff !important;
  border-color: #666 !important;
}

html body.dark-mode #performance-list .btn-primary {
  background: linear-gradient(135deg, #4361ee, #3a56d4) !important;
  color: #ffffff !important;
  border-color: #4361ee !important;
}

html body.dark-mode #performance-list .btn-primary:hover {
  background: linear-gradient(135deg, #3a56d4, #2d4bcc) !important;
  color: #ffffff !important;
  border-color: #3a56d4 !important;
}

html body.dark-mode #performance-list .btn-success {
  background: linear-gradient(135deg, #28a745, #20c997) !important;
  color: #ffffff !important;
  border-color: #28a745 !important;
}

html body.dark-mode #performance-list .btn-success:hover {
  background: linear-gradient(135deg, #20c997, #17a2b8) !important;
  color: #ffffff !important;
  border-color: #20c997 !important;
}

html body.dark-mode #performance-list .btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
  color: #ffffff !important;
  border-color: #dc3545 !important;
}

html body.dark-mode #performance-list .btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #bd2130) !important;
  color: #ffffff !important;
  border-color: #c82333 !important;
}

html body.dark-mode #performance-list .btn-warning {
  background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
  color: #000000 !important;
  border-color: #ffc107 !important;
}

html body.dark-mode #performance-list .btn-warning:hover {
  background: linear-gradient(135deg, #fd7e14, #e55a00) !important;
  color: #000000 !important;
  border-color: #fd7e14 !important;
}

/* 🎯 بهبود badge ها در جدول */
html body.dark-mode #performance-list .badge {
  color: #ffffff !important;
}

html body.dark-mode #performance-list .badge.bg-success {
  background-color: #28a745 !important;
  color: #ffffff !important;
}

html body.dark-mode #performance-list .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000000 !important;
}

html body.dark-mode #performance-list .badge.bg-danger {
  background-color: #dc3545 !important;
  color: #ffffff !important;
}

html body.dark-mode #performance-list .badge.bg-info {
  background-color: #17a2b8 !important;
  color: #ffffff !important;
}

html body.dark-mode #performance-list .badge.bg-secondary {
  background-color: #6c757d !important;
  color: #ffffff !important;
}

/* 🎯 اصلاح رنگ هدر جدول لیست عملکرد */
html body.dark-mode #performance-list .performance-table thead.table-dark,
html body.dark-mode #performance-list .performance-table thead.table-dark th,
html body.dark-mode #performance-list .table-dark,
html body.dark-mode #performance-list .table-dark th {
  background-color: #2c2f33 !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

/* 🎯 اصلاح رنگ هدر جدول لیست تولید */
html body.dark-mode #productionJobsTable thead.table-dark,
html body.dark-mode #productionJobsTable thead.table-dark th {
  background-color: #2c2f33 !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

/* 🎯 اصلاح رنگ هدر جدول لیست خرابی */
html body.dark-mode #damage-list .damage-table thead.table-dark,
html body.dark-mode #damage-list .damage-table thead.table-dark th {
  background-color: #2c2f33 !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

/* 🎯 جدول برش - عین رنگ صفحه پروژه (projects) */
html body.dark-mode #cuttingsTable thead th,
html body.dark-mode #cuttingsTable thead.table-dark th {
  background-color: rgb(74, 85, 104) !important;
  background: rgb(74, 85, 104) !important;
  color: rgb(226, 232, 240) !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

/* 🎯 قانون کلی برای تمام هدرهای جدول در دارک مود */
html body.dark-mode .table-dark,
html body.dark-mode .table-dark th,
html body.dark-mode thead.table-dark,
html body.dark-mode thead.table-dark th {
  background-color: #2c2f33 !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

/* 🚨 قانون فوق‌العاده قوی برای هدر جدول لیست عملکرد - مثل جدول خرابی */
html body.dark-mode #performance-list .performance-table thead,
html body.dark-mode #performance-list .performance-table thead tr,
html body.dark-mode #performance-list .performance-table thead th,
html body.dark-mode #performance-list .performance-table .table-dark,
html body.dark-mode #performance-list .performance-table .table-dark th {
  background-color: #2c2f33 !important;
  background: #2c2f33 !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

/* قانون اضافی برای override کردن هر CSS دیگری */
html
  body.dark-mode
  div#performance-list
  div.performance-table-container
  table.performance-table
  thead.table-dark
  th {
  background-color: #2c2f33 !important;
  background: #2c2f33 !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

/* 🚨 قانون نهایی با بالاترین specificity برای هدر جدول عملکرد */
html
  body.dark-mode
  div#performance-list
  div.performance-table-container
  table.table.table-striped.table-hover.table-bordered.mb-0.performance-table
  thead.table-dark,
html
  body.dark-mode
  div#performance-list
  div.performance-table-container
  table.table.table-striped.table-hover.table-bordered.mb-0.performance-table
  thead.table-dark
  tr,
html
  body.dark-mode
  div#performance-list
  div.performance-table-container
  table.table.table-striped.table-hover.table-bordered.mb-0.performance-table
  thead.table-dark
  th {
  background-color: #2c2f33 !important;
  background: #2c2f33 !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

/* قانون اضافی برای تمام th های هدر */
html
  body.dark-mode
  #performance-list
  .performance-table
  thead
  th[class*="sticky"],
html
  body.dark-mode
  #performance-list
  .performance-table
  thead
  th[class*="text-center"],
html body.dark-mode #performance-list .performance-table thead th {
  background-color: #2c2f33 !important;
  background: #2c2f33 !important;
  color: #ffffff !important;
}

/* 🚨 قانون با attribute selector برای table با data-dark-hover */
html body.dark-mode table[data-dark-hover="transparent"] thead.table-dark,
html body.dark-mode table[data-dark-hover="transparent"] thead.table-dark tr,
html body.dark-mode table[data-dark-hover="transparent"] thead.table-dark th {
  background-color: #2c2f33 !important;
  background: #2c2f33 !important;
  color: #ffffff !important;
  border-color: #444 !important;
}

/* 🚨 قانون فوق‌العاده قوی برای حذف کامل hover effect */
html body.dark-mode #performance-list .performance-table tbody tr:hover,
html body.dark-mode #performance-list .performance-table tbody tr:hover td,
html body.dark-mode #performance-list .performance-table tbody tr:hover *,
html
  body.dark-mode
  #performance-list
  .table.table-striped.table-hover
  tbody
  tr:hover,
html
  body.dark-mode
  #performance-list
  .table.table-striped.table-hover
  tbody
  tr:hover
  td,
html
  body.dark-mode
  #performance-list
  .table.table-striped.table-hover
  tbody
  tr:hover
  *,
html body.dark-mode #performance-list .table-hover tbody tr:hover,
html body.dark-mode #performance-list .table-hover tbody tr:hover td,
html body.dark-mode #performance-list .table-hover tbody tr:hover *,
html body.dark-mode #performance-list .table-striped tbody tr:hover,
html body.dark-mode #performance-list .table-striped tbody tr:hover td,
html body.dark-mode #performance-list .table-striped tbody tr:hover * {
  background-color: transparent !important;
  background: transparent !important;
  background-image: none !important;
  background-clip: unset !important;
  background-origin: unset !important;
  background-size: unset !important;
  background-repeat: unset !important;
  background-position: unset !important;
  background-attachment: unset !important;
}

/* قانون اضافی برای Bootstrap table-hover */
html body.dark-mode .table-hover tbody tr:hover,
html body.dark-mode .table-hover tbody tr:hover td,
html body.dark-mode .table-hover tbody tr:hover * {
  background-color: transparent !important;
  background: transparent !important;
}

/* 🎯 قانون نهایی با بالاترین specificity برای performance-table */
html
  body.dark-mode
  div#performance-list
  div.performance-table-container
  table.table.table-striped.table-hover.table-bordered.mb-0.performance-table
  tbody
  tr:hover,
html
  body.dark-mode
  div#performance-list
  div.performance-table-container
  table.table.table-striped.table-hover.table-bordered.mb-0.performance-table
  tbody
  tr:hover
  td,
html
  body.dark-mode
  div#performance-list
  div.performance-table-container
  table.table.table-striped.table-hover.table-bordered.mb-0.performance-table
  tbody
  tr:hover
  * {
  background-color: transparent !important;
  background: transparent !important;
  background-image: none !important;
}

/* 🚨 قانون فوق‌العاده قوی با attribute selector */
html body.dark-mode table[data-dark-hover="transparent"] tbody tr:hover,
html body.dark-mode table[data-dark-hover="transparent"] tbody tr:hover td,
html body.dark-mode table[data-dark-hover="transparent"] tbody tr:hover * {
  background-color: transparent !important;
  background: transparent !important;
  background-image: none !important;
}

/* 🎯 اصلاح نهایی hover effect برای لیست عملکرد - قوانین بسیار قوی */
html body.dark-mode #performance-list .table tbody tr:hover,
html body.dark-mode #performance-list .table-hover tbody tr:hover,
html body.dark-mode #performance-list .table-striped tbody tr:hover,
html body.dark-mode #performance-list .table tbody tr:hover td,
html body.dark-mode #performance-list .table-hover tbody tr:hover td,
html body.dark-mode #performance-list .table-striped tbody tr:hover td,
html body.dark-mode #performance-list .table tbody tr:hover *,
html body.dark-mode #performance-list .table-hover tbody tr:hover *,
html body.dark-mode #performance-list .table-striped tbody tr:hover * {
  background-color: rgba(67, 97, 238, 0.01) !important;
  transition: background-color 0.2s ease !important;
}

/* قانون فوق‌العاده قوی برای override کردن هر CSS دیگری */
html body.dark-mode #performance-list table tbody tr:hover,
html body.dark-mode #performance-list table tbody tr:hover td,
html body.dark-mode #performance-list table tbody tr:hover * {
  background-color: rgba(67, 97, 238, 0.005) !important;
  background: rgba(67, 97, 238, 0.005) !important;
}

/* 🎯 بهبود scrollbar در لیست عملکرد */
html
  body.dark-mode
  #performance-list
  .performance-table-container::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

html
  body.dark-mode
  #performance-list
  .performance-table-container::-webkit-scrollbar-track {
  background: #1a1d1e !important;
}

html
  body.dark-mode
  #performance-list
  .performance-table-container::-webkit-scrollbar-thumb {
  background: #555 !important;
  border-radius: 4px !important;
}

html
  body.dark-mode
  #performance-list
  .performance-table-container::-webkit-scrollbar-thumb:hover {
  background: #666 !important;
}

/* 🎯 بهبود فیلدهای ورودی زمان در datepicker */
html body.dark-mode .time-input {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
}

html body.dark-mode .time-input:focus {
  background-color: #1a1d1e !important;
  color: #ffffff !important;
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

html body.dark-mode .time-input:hover {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #666 !important;
}

html body.dark-mode .time-inputs {
  background-color: #2c3136 !important;
  border-color: #555 !important;
}

/* 🎯 بهبود دکمه‌های تنظیم زمان در datepicker */
html body.dark-mode .time-field .btn {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
}

html body.dark-mode .time-field .btn:hover {
  background-color: #3a3f44 !important;
  color: #ffffff !important;
  border-color: #666 !important;
}

html body.dark-mode .time-field .btn:active {
  background-color: #1a1d1e !important;
  color: #ffffff !important;
  border-color: #4361ee !important;
}

/* 🎯 بهبود container زمان در datepicker */
html body.dark-mode .time-container {
  background-color: #2c3136 !important;
  border-color: #555 !important;
}

html body.dark-mode .time-container .time-label {
  color: #e0e0e0 !important;
}

/* 🎯 بهبود تمام input های عددی در datepicker */
html body.dark-mode input[type="number"] {
  background-color: #1a1d1e !important;
  color: #e0e0e0 !important;
  border-color: #555 !important;
}

html body.dark-mode input[type="number"]:focus {
  background-color: #1a1d1e !important;
  color: #ffffff !important;
  border-color: #4361ee !important;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25) !important;
}

html body.dark-mode input[type="number"]:hover {
  background-color: #2c3136 !important;
  color: #e0e0e0 !important;
  border-color: #666 !important;
}

/* 🎯 بهبود placeholder برای input های عددی */
html body.dark-mode input[type="number"]::placeholder {
  color: #888 !important;
}

html body.dark-mode input[type="number"]::-webkit-input-placeholder {
  color: #888 !important;
}

html body.dark-mode input[type="number"]::-moz-placeholder {
  color: #888 !important;
}

html body.dark-mode input[type="number"]:-ms-input-placeholder {
  color: #888 !important;
}

/* دکمه‌های btn-light در header های رنگی (info, warning, success) - بهبود برای دارک مود */
html body.dark-mode .card-header.bg-info.text-white .btn-light,
html body.dark-mode .card-header.bg-warning.text-white .btn-light,
html body.dark-mode .card-header.bg-success.text-white .btn-light {
  background-color: rgba(255, 255, 255, 0.3) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  color: #000000 !important;
  font-weight: 600 !important;
}

html body.dark-mode .card-header.bg-info.text-white .btn-light:hover,
html body.dark-mode .card-header.bg-warning.text-white .btn-light:hover,
html body.dark-mode .card-header.bg-success.text-white .btn-light:hover {
  background-color: rgba(255, 255, 255, 0.45) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
  color: #000000 !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

html body.dark-mode .card-header.bg-info.text-white .btn-light:active,
html body.dark-mode .card-header.bg-warning.text-white .btn-light:active,
html body.dark-mode .card-header.bg-success.text-white .btn-light:active {
  background-color: rgba(255, 255, 255, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  color: #000000 !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
}

html body.dark-mode .card-header.bg-info.text-white .btn-light:focus,
html body.dark-mode .card-header.bg-warning.text-white .btn-light:focus,
html body.dark-mode .card-header.bg-success.text-white .btn-light:focus {
  background-color: rgba(255, 255, 255, 0.35) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  color: #000000 !important;
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.35) !important;
  outline: none !important;
}

html body.dark-mode .card-header.bg-info.text-white .btn-light i,
html body.dark-mode .card-header.bg-warning.text-white .btn-light i,
html body.dark-mode .card-header.bg-success.text-white .btn-light i {
  color: #000000 !important;
  font-weight: 700 !important;
}

html body.dark-mode .card-header.bg-info.text-white .btn-light span,
html body.dark-mode .card-header.bg-warning.text-white .btn-light span,
html body.dark-mode .card-header.bg-success.text-white .btn-light span {
  color: #000000 !important;
  font-weight: 600 !important;
}

/* ============================================ */
/* غیرفعال کردن انیمیشن‌های hover برای کارت‌ها در دارک مود */
/* ============================================ */

/* غیرفعال کردن transition و transform برای همه کارت‌ها در دارک مود */
html body.dark-mode .card,
html body.dark-mode .card.shadow,
html body.dark-mode .card.shadow-sm,
html body.dark-mode .card.h-100,
html body.dark-mode .card.border,
html body.dark-mode .card.shadow-lg,
html body.dark-mode .card.shadow-md {
  transition: none !important;
  transform: none !important;
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -o-transition: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
}

/* غیرفعال کردن انیمیشن hover برای کارت‌ها در دارک مود */
html body.dark-mode .card:hover,
html body.dark-mode .card.shadow:hover,
html body.dark-mode .card.shadow-sm:hover,
html body.dark-mode .card.h-100:hover,
html body.dark-mode .card.border:hover,
html body.dark-mode .card.shadow-lg:hover,
html body.dark-mode .card.shadow-md:hover {
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
  transition: none !important;
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -o-transition: none !important;
}

/* غیرفعال کردن انیمیشن برای card-body و card-header در دارک مود */
html body.dark-mode .card-body,
html body.dark-mode .card-header,
html body.dark-mode .card-footer {
  transition: none !important;
  transform: none !important;
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -o-transition: none !important;
}

html body.dark-mode .card-body:hover,
html body.dark-mode .card-header:hover,
html body.dark-mode .card-footer:hover {
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -o-transform: none !important;
}

/* ===== دارک مود — رنگ انتخاب ردیف (خوانا و مشخص) ===== */
html body.dark-mode .table tbody tr.table-active,
html body.dark-mode .table tbody tr.selected-row,
html body.dark-mode .table tbody tr.movement-row.table-active,
html body.dark-mode .table tbody tr.movement-row.selected-row,
html body.dark-mode .table tbody tr.material-row.table-active,
html body.dark-mode .table tbody tr.material-row.selected-row,
html body.dark-mode .table tbody tr.fabric-row.table-active,
html body.dark-mode .table tbody tr.fabric-row.selected-row,
html body.dark-mode .table tbody tr.product-row.table-active,
html body.dark-mode .table tbody tr.product-row.selected-row,
html body.dark-mode .table tbody tr.forecast-row.table-active,
html body.dark-mode .table tbody tr.forecast-row.selected-row,
html body.dark-mode .table tbody tr.row-selected,
html body.dark-mode .locations-table tbody tr.location-row.selected-row {
  background-color: rgba(59, 130, 246, 0.55) !important;
  color: #ffffff !important;
  border-left-color: #60a5fa !important;
}
html body.dark-mode .table tbody tr.table-active td,
html body.dark-mode .table tbody tr.selected-row td,
html body.dark-mode .table tbody tr.movement-row.table-active td,
html body.dark-mode .table tbody tr.movement-row.selected-row td,
html body.dark-mode .table tbody tr.material-row.table-active td,
html body.dark-mode .table tbody tr.material-row.selected-row td,
html body.dark-mode .table tbody tr.fabric-row.table-active td,
html body.dark-mode .table tbody tr.fabric-row.selected-row td,
html body.dark-mode .table tbody tr.product-row.table-active td,
html body.dark-mode .table tbody tr.product-row.selected-row td,
html body.dark-mode .table tbody tr.forecast-row.table-active td,
html body.dark-mode .table tbody tr.forecast-row.selected-row td,
html body.dark-mode .table tbody tr.row-selected td,
html body.dark-mode .locations-table tbody tr.location-row.selected-row td {
  background-color: rgba(59, 130, 246, 0.55) !important;
  color: #ffffff !important;
}
html body.dark-mode .table tbody tr.table-active td *,
html body.dark-mode .table tbody tr.selected-row td *,
html body.dark-mode .table tbody tr.movement-row.table-active td *,
html body.dark-mode .table tbody tr.movement-row.selected-row td *,
html body.dark-mode .table tbody tr.material-row.table-active td *,
html body.dark-mode .table tbody tr.material-row.selected-row td *,
html body.dark-mode .table tbody tr.fabric-row.table-active td *,
html body.dark-mode .table tbody tr.fabric-row.selected-row td *,
html body.dark-mode .table tbody tr.product-row.table-active td *,
html body.dark-mode .table tbody tr.product-row.selected-row td *,
html body.dark-mode .table tbody tr.forecast-row.table-active td *,
html body.dark-mode .table tbody tr.forecast-row.selected-row td *,
html body.dark-mode .table tbody tr.row-selected td *,
html body.dark-mode .locations-table tbody tr.location-row.selected-row td * {
  color: #ffffff !important;
}
/* override table-striped برای ردیف انتخاب‌شده */
html body.dark-mode .table-striped tbody tr.table-active,
html body.dark-mode .table-striped tbody tr.selected-row,
html body.dark-mode .table-striped tbody tr.table-active td,
html body.dark-mode .table-striped tbody tr.selected-row td {
  background-color: rgba(59, 130, 246, 0.55) !important;
  color: #ffffff !important;
}
/* form-select — متن انتخاب‌شده خوانا */
html body.dark-mode .form-select,
html body.dark-mode select.form-select {
  background-color: #2c3136 !important;
  color: #e8e8e8 !important;
}
html body.dark-mode .form-select option,
html body.dark-mode select.form-select option {
  background-color: #2c3136 !important;
  color: #e8e8e8 !important;
}
/* dropdown option انتخاب‌شده */
html body.dark-mode .select2-results__option[aria-selected="true"],
html body.dark-mode .select2-results__option--highlighted {
  background-color: rgba(59, 130, 246, 0.5) !important;
  color: #ffffff !important;
}

/* جدول برش در دارک مود - عین رنگ صفحه پروژه (آخرین قانون برای override همه) */
html body.dark-mode.cutting-new-system-page #cuttingsTable thead,
html body.dark-mode.cutting-new-system-page #cuttingsTable thead tr,
html body.dark-mode.cutting-new-system-page #cuttingsTable thead th,
html body.dark-mode .cutting-new-system-container #cuttingsTable thead,
html body.dark-mode .cutting-new-system-container #cuttingsTable thead tr,
html body.dark-mode .cutting-new-system-container #cuttingsTable thead th {
  background-color: rgb(74, 85, 104) !important;
  background: rgb(74, 85, 104) !important;
  color: rgb(226, 232, 240) !important;
  border: none !important;
  border-color: transparent !important;
}

/* =============================================================================
   تب «لیست عملکرد» — یکپارچه‌سازی پس‌زمینه دارک مود (رفع دو رنگی)
   همان رنگ سطح کارت اصلی (#23272b per dark-mode.css) برای کل تب، جدول، فوتر و نوار اسکرول
   ============================================================================= */
html body.dark-mode #productionTabContent #performance-list.tab-pane {
  background-color: #23272b !important;
}

html body.dark-mode #performance-list .performance-table-container {
  background-color: #23272b !important;
  border-color: #3a4046 !important;
}

html body.dark-mode #performance-list table.table.performance-table {
  background-color: #23272b !important;
  --bs-table-bg: #23272b !important;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.05) !important;
}

html body.dark-mode #performance-list .table tbody td {
  background-color: #23272b !important;
}

html body.dark-mode #performance-list .table-striped tbody tr:nth-of-type(odd) td {
  background-color: rgba(255, 255, 255, 0.045) !important;
}

html body.dark-mode #performance-list .table tbody tr.overdue-row td,
html body.dark-mode #performance-list .table tbody tr.table-overdue td {
  background-color: rgba(220, 53, 69, 0.22) !important;
}

html body.dark-mode #performance-list .card.border-0.shadow-sm,
html body.dark-mode #performance-list .card.border-0.shadow-sm .card-body {
  background-color: #23272b !important;
}

html body.dark-mode #performance-list .production-footer-actions,
html body.dark-mode #performance-list .performance-list-footer-bar {
  background-color: #23272b !important;
}

html body.dark-mode #performance-list .performance-table-container::-webkit-scrollbar-track {
  background: #23272b !important;
}

html body.dark-mode #performance-list .performance-table-container {
  scrollbar-color: #555 #23272b !important;
}

/*
 * لیست عملکرد sewing — بعد از تنظیم --bs-table-bg روی table (بالا)، همهٔ th هدر یک رنگ
 * (کلاس sewing-perf-list-table روی جدول در sewing.html)
 */
html
  body.dark-mode
  div#performance-list
  div.performance-table-container
  table.sewing-perf-list-table.table.table-striped.table-hover.table-bordered.mb-0.performance-table
  thead.table-dark
  > tr
  > th {
  background-color: #2c2f33 !important;
  background: #2c2f33 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: #444 !important;
}
