/* Custom Fonts */
@font-face {
  font-family: "Vazir";
  src: url("../../static/fonts/Vazirmatn-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazir";
  src: url("../../static/fonts/Vazirmatn-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Vazir";
  src: url("../../static/fonts/Vazirmatn-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ===== NOTIFICATION STYLES ===== */
.notification-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
}

.notification-item .icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  flex-shrink: 0;
}

.notification-item .icon i {
  color: white;
  font-size: 16px;
}

.notification-item .content {
  flex: 1;
  min-width: 0;
}

.notification-item .content p {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
}

/* Dark mode support for notification text */
.dark-mode .notification-item .content p {
  color: #e9ecef !important;
}

.notification-item .content small {
  color: #666;
  font-size: 12px;
}

/* Dark mode support for notification time */
.dark-mode .notification-item .content small {
  color: #adb5bd !important;
}

.dropdown-footer {
  border-top: 1px solid #e9ecef;
  padding: 8px 16px;
  text-align: center;
}

.dropdown-footer a {
  color: #007bff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.dropdown-footer a:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Dark mode support for dropdown footer */
.dark-mode .dropdown-footer {
  border-top-color: #495057;
}

.dark-mode .dropdown-footer a {
  color: #6ea8fe !important;
}

.dark-mode .dropdown-footer a:hover {
  color: #9ec5fe !important;
}

/* Toast notification styles */
#toast-container > .toast-info {
  background-color: #17a2b8;
  border: 1px solid #138496;
}

#toast-container > .toast-info:hover {
  background-color: #138496;
}

.dark-mode #toast-container > .toast-info {
  background-color: #0dcaf0;
  border: 1px solid #0aa2c0;
  color: #000;
}

.dark-mode #toast-container > .toast-info:hover {
  background-color: #0aa2c0;
}

/* Toast positioning for RTL */
#toast-container.toast-top-left {
  top: 12px;
  left: 12px;
}

#toast-container.toast-top-right {
  top: 12px;
  right: 12px;
}

/* ===== DASHBOARD STYLES ===== */

/* General Styles */
:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --success-color: #4caf50;
  --info-color: #2196f3;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --dark-color: #212529;
  --light-color: #f8f9fa;
  --sidebar-width: 260px;
  /* --sidebar-collapsed-width حذف شد */
  --header-height: 60px;
  --footer-height: 50px;
  --transition-speed: 0.3s;
}

body {
  font-family: "Vazir", system-ui, -apple-system, sans-serif;
  background-color: var(--ds-bg-page);
  color: #333;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-height: 100vh;
}

.dashboard-body {
  position: relative;
}

/* Dashboard Container */
.dashboard-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ===== SIDEBAR — ShadCN Style ===== */
:root {
  --sidebar-width: 260px;
  --sidebar-rail-width: 48px;
  --sidebar-collapsed: 0;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--ds-surface);
  border-left: 1px solid var(--ds-border);
  color: var(--ds-text);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
}

/* Collapsed state — icon rail only */
.sidebar.sidebar-collapsed {
  width: var(--sidebar-rail-width);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  width: var(--sidebar-width);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: hsl(0 0% 85%) transparent;
  background: inherit;
}

.sidebar::-webkit-scrollbar { width: 0; }
.sidebar-inner::-webkit-scrollbar { width: 4px; }
.sidebar-inner::-webkit-scrollbar-track { background: transparent; }
.sidebar-inner::-webkit-scrollbar-thumb { background: var(--ds-border); border-radius: 4px; }

/* HEADER */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  height: 52px;
  border-bottom: 1px solid var(--ds-border);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: hsl(240 10% 4%);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}

.sidebar-brand:hover { color: hsl(240 10% 4%); }
.sidebar-brand .brand-logo { flex-shrink: 0; width: 28px; height: auto; }
.sidebar-brand .brand-text { overflow: hidden; white-space: nowrap; transition: opacity 0.15s, width 0.2s; }

/* Collapse button */
.sidebar-collapse-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: hsl(240 5% 64%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: background 0.15s, color 0.15s;
}
.sidebar-collapse-btn:hover { background: hsl(0 0% 92%); color: hsl(240 10% 4%); }

/* When collapsed — sidebar-inner shrinks to rail width too */
.sidebar.sidebar-collapsed .sidebar-inner { width: var(--sidebar-rail-width); }

.sidebar.sidebar-collapsed .brand-text { opacity: 0; width: 0; overflow: hidden; }
.sidebar.sidebar-collapsed .sidebar-collapse-btn { opacity: 0.7; }
.sidebar.sidebar-collapsed .submenu-arrow,
.sidebar.sidebar-collapsed .user-info,
.sidebar.sidebar-collapsed .submenu,
.sidebar.sidebar-collapsed .login-buttons a + a { display: none !important; }
/* hide text spans, keep icons — sidebar-nav-icon باید همیشه نمایش داده شود */
.sidebar.sidebar-collapsed .nav-link > span:not(.sidebar-nav-icon),
.sidebar.sidebar-collapsed .submenu-link > span:not(.sidebar-nav-icon) { display: none !important; }
.sidebar.sidebar-collapsed .sidebar-nav-icon { display: inline-flex !important; }
.sidebar.sidebar-collapsed .nav-item { margin: 2px 0; }
.sidebar.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
  margin: 0 6px;
  gap: 0;
  border-radius: 8px;
}
.sidebar.sidebar-collapsed .nav-link i {
  margin: 0;
  width: auto;
  font-size: 1.1rem;
  opacity: 1;
}
.sidebar.sidebar-collapsed .nav-link .nav-icon {
  width: 20px;
  height: 20px;
}
.sidebar.sidebar-collapsed .sidebar-header { padding: 0; justify-content: center; }
.sidebar.sidebar-collapsed .sidebar-brand { justify-content: center; }
.sidebar.sidebar-collapsed .sidebar-brand .brand-logo { width: 28px; height: 28px; }
.sidebar.sidebar-collapsed .sidebar-user { justify-content: center; padding: 10px 0; }
.sidebar.sidebar-collapsed .user-avatar { margin: 0; }

/* USER */
.sidebar-user {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid hsl(0 0% 91%);
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: hsl(225 57% 93%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(226 71% 57%);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; overflow: hidden; }

.user-info h6 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(240 10% 4%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info span {
  font-size: 0.6875rem;
  color: hsl(240 5% 45%);
}

.login-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

/* NAV */
.sidebar-nav {
  list-style: none;
  padding: 6px 0 16px;
  margin: 0;
  flex: 1;
}

.nav-item { margin: 1px 0; }

.nav-link {
  display: flex;
  align-items: center;
  padding: 7px 12px;
  color: hsl(240 6% 25%);
  text-decoration: none;
  border-radius: 6px;
  margin: 0 8px;
  font-size: 0.875rem;
  font-weight: 500;
  gap: 10px;
  transition: background 0.1s, color 0.1s;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--ds-surface-hover);
  color: var(--ds-text);
}

.nav-link.active {
  background: var(--ds-surface-hover);
  color: var(--ds-text);
  font-weight: 600;
}

.nav-link i {
  font-size: 0.875rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  color: var(--ds-text-muted);
  transition: color 0.1s;
}

.nav-link .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ds-text-muted);
  transition: color 0.1s;
  display: block;
}

.nav-link:hover i,
.nav-link.active i { color: var(--ds-text); }

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon { color: var(--ds-text); }

.nav-link-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.submenu-arrow {
  flex-shrink: 0;
  font-size: 0.625rem;
  color: var(--ds-text-subtle);
  transition: transform 0.2s;
  margin-right: auto;
  margin-left: 0;
}

.nav-link[aria-expanded="true"] .submenu-arrow { transform: rotate(-90deg); }

/* SUBMENU */
.submenu {
  list-style: none;
  padding: 2px 0 4px;
  margin: 0;
  margin-right: 28px;
  border-right: 1.5px solid var(--ds-border);
}

.submenu .submenu {
  margin-right: 14px;
}

.submenu-link {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  color: var(--ds-text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  border-radius: 5px;
  margin: 1px 6px 1px 4px;
  gap: 8px;
  transition: background 0.1s, color 0.1s;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
}

.submenu-link:hover {
  background: var(--ds-surface-hover);
  color: var(--ds-text);
  font-weight: 500;
}

.submenu-link.active {
  color: var(--ds-text);
  font-weight: 600;
  background: var(--ds-surface-hover);
}

.submenu-link i { display: none; }

.submenu-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.nav-divider {
  height: 1px;
  background: var(--ds-border);
  margin: 6px 12px;
}

/* Sidebar section label */
.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: hsl(240 5% 64%);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 20px 4px;
}

/* RAIL — thin strip visible when collapsed */
.sidebar-rail {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
  z-index: 10;
}
.sidebar-rail:hover { background: hsl(226 71% 57% / 0.25); }

/* Native browser tooltip via title attr handles collapsed icon labels */

/* Main Content Styles */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  transition: margin 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Collapsed sidebar → content expands */
.sidebar-collapsed ~ .main-content,
body.sidebar-is-collapsed .main-content {
  margin-right: var(--sidebar-rail-width);
}

/* Top Navbar Styles — superseded by .ds-topbar in design-system.css */
.top-navbar { display: none; } /* replaced by ds-topbar */

.action-btn .badge {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 0.6rem;
  padding: 0.25rem 0.4rem;
}

.notification-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
}

.notification-item .icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-left: 12px;
}

.notification-item .content p {
  margin: 0 0 5px 0;
  font-size: 0.85rem;
}

.notification-item .content small {
  color: #777;
  font-size: 0.75rem;
}

.dropdown-header {
  font-weight: 600;
  color: #555;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
}

.dropdown-footer {
  text-align: center;
  padding: 10px;
  border-top: 1px solid #eee;
}

.dropdown-footer a {
  color: var(--primary-color);
  font-size: 0.85rem;
  text-decoration: none;
}

/* Page Content Styles */
.page-content {
  flex: 1;
  padding: 20px;
  background-color: var(--ds-bg-page);
}

/* Footer Styles */
.footer {
  background-color: white;
  padding: 15px 20px;
  color: #666;
  font-size: 0.85rem;
  border-top: 1px solid #eee;
  position: relative !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  text-align: center !important;
  direction: rtl !important;
  margin: 0 !important;
  float: none !important;
  clear: both !important;
}

/* اصلاح برای RTL */
.footer .container-fluid {
  direction: rtl !important;
}

.footer .row {
  direction: rtl !important;
  margin: 0 !important;
}

.footer .col-md-6 {
  direction: rtl !important;
  text-align: center !important;
}

.footer .text-md-end {
  text-align: center !important;
}

.copyright,
.version {
  margin: 0;
  direction: rtl !important;
}

/* Card Styles */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  transition: none;
}

.card:hover {
  transform: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card-header {
  background-color: #fff !important;
  color: #222 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header .card-title,
.card-title {
  color: #222 !important;
  font-weight: 700;
  font-size: 1.2rem;
}

.card-header .card-actions {
  display: flex;
  gap: 5px;
}

.card-body {
  padding: 1.5rem;
}

/* Stats Card */
.stat-card {
  background-color: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  transition: none;
}

.stat-card:hover {
  transform: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-card .icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background-color: rgba(67, 97, 238, 0.1);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-card .title {
  font-size: 0.9rem;
  color: #777;
  margin: 0;
}

.stat-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  color: var(--dark-color);
}

/* Quick Actions */
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: 10px;
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: none;
  text-decoration: none;
  color: var(--dark-color);
  height: 100%;
}

.quick-action-btn:hover {
  transform: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

.quick-action-btn i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.quick-action-btn span {
  font-weight: 500;
}

/* Form Styles */
.form-control {
  border-radius: 5px;
  border: 1px solid #ddd;
  padding: 0.6rem 1rem;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #555;
}

/* Button Styles */
.btn {
  border-radius: 5px;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

/* Table Styles */
.table-container {
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  background-color: #f8f9fa;
  font-weight: 600;
  border-top: none;
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
}

.table-hover tbody tr:hover {
  background-color: rgba(67, 97, 238, 0.05);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .sidebar {
    right: calc(-1 * var(--sidebar-width));
    width: var(--sidebar-width);
    transition: right 0.2s ease, width 0.2s ease;
  }

  .sidebar.sidebar-collapsed {
    width: var(--sidebar-width);
    right: calc(-1 * var(--sidebar-width));
  }

  .sidebar.mobile-open {
    right: 0;
  }

  .main-content {
    margin-right: 0 !important;
  }

  .stat-card .value {
    font-size: 1.5rem;
  }
}

/* Table Styles */
.table {
  margin-bottom: 0;
}

.table th {
  font-weight: 500;
  background-color: #f8f9fa;
}

.table td {
  vertical-align: middle;
}

/* Button Styles */
.btn {
  padding: 0.5rem 1rem;
  font-weight: 500;
}

.btn-group-sm > .btn {
  padding: 0.25rem 0.5rem;
}

/* Alert Styles */
.alert {
  border: none;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* دکمه close کوچک‌تر */
.btn-close-sm {
  width: 0.8rem;
  height: 0.8rem;
  font-size: 0.65rem;
  padding: 0.3rem;
}

/* بهبود نمایش alert در صفحه تولید */
.alert.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 3px solid #dc3545;
}

.alert.alert-success {
  background-color: #d4edda;
  color: #155724;
  border-left: 3px solid #28a745;
}

.alert.alert-warning {
  background-color: #fff3cd;
  color: #856404;
  border-left: 3px solid #ffc107;
}

.alert.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border-left: 3px solid #17a2b8;
}

/* تنظیمات responsive برای alert */
@media (max-width: 768px) {
  .alert {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
}

@media (max-width: 576px) {
  .alert {
    font-size: 0.8rem;
    padding: 0.5rem 0.7rem;
  }
}

/* Pagination Styles */
.pagination {
  margin-bottom: 0;
  margin-top: 1.5rem;
}

.page-link {
  padding: 0.5rem 1rem;
  border: none;
  margin: 0 0.25rem;
  border-radius: 0.25rem;
}

.page-item.active .page-link {
  background-color: #0d6efd;
}

/* Custom Utilities */
.shadow {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05) !important;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .card-body {
    padding: 1rem;
  }

  .table-responsive {
    margin: 0 -1rem;
  }
}

/* RTL Specific Styles */
.me-1 {
  margin-left: 0.25rem !important;
  margin-right: 0 !important;
}

.me-2 {
  margin-left: 0.5rem !important;
  margin-right: 0 !important;
}

.ms-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

/* Custom Components */
.status-badge {
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 500;
  border-radius: 0.25rem;
}

/* Dashboard Widgets */
.stat-card {
  background: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: none;
}

.stat-card:hover {
  transform: none;
}

.stat-card .icon {
  font-size: 2rem;
  color: #0d6efd;
}

.stat-card .title {
  color: #6c757d;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0;
}

/* Custom Form Elements */
.custom-file-input:lang(fa) ~ .custom-file-label::after {
  content: "انتخاب فایل";
}

/* Loading Spinner */
.loading-spinner {
  width: 3rem;
  height: 3rem;
}

/* ===== IMPROVED TABLE STYLES ===== */

/* Enhanced Table Headers */
.table thead th {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  text-align: center !important;
  padding: 12px 8px !important;
  border: 1px solid #34495e !important;
  font-size: 14px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  position: relative !important;
}

.table thead th:hover {
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%) !important;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  transition: none !important;
}

/* Table Header with better contrast */
.table-dark thead th {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
  color: #ffffff !important;
  border-color: #404040 !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
}

/* Enhanced Tab Styles */
.nav-tabs {
  border-bottom: 3px solid #dee2e6 !important;
  background: #f8f9fa !important;
  border-radius: 8px 8px 0 0 !important;
  padding: 0 10px !important;
}

.nav-tabs .nav-link {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  color: #495057 !important;
  border: 2px solid transparent !important;
  border-radius: 8px 8px 0 0 !important;
  margin: 0 5px 0 0 !important;
  padding: 12px 20px !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.nav-tabs .nav-link:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important;
  color: #212529 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
  border-color: #adb5bd !important;
}

.nav-tabs .nav-link.active {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
  color: #ffffff !important;
  border-color: #007bff !important;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3) !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.nav-tabs .nav-link.active:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%) !important;
  transform: translateY(-1px) !important;
}

/* Special tab styles for depot */
.nav-tabs .nav-link#depot-tab.active {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
  border-color: #28a745 !important;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

.nav-tabs .nav-link#depot-tab.active:hover {
  background: linear-gradient(135deg, #1e7e34 0%, #155724 100%) !important;
}

/* Tab content with better styling */
.tab-content {
  background: #ffffff !important;
  border: 2px solid #dee2e6 !important;
  border-top: none !important;
  border-radius: 0 0 10px 10px !important;
  padding: 25px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  min-height: 400px !important;
}

/* Enhanced table body */
.table tbody td {
  background: #ffffff !important;
  color: #212529 !important;
  border: 1px solid #dee2e6 !important;
  padding: 10px 8px !important;
  vertical-align: middle !important;
  font-size: 14px !important;
}

.table tbody tr:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
}

/* Table responsive improvements */
.table-responsive {
  overflow-x: auto;
}

/* Persian text improvements */
.table th,
.table td {
  font-family: "Vazir", "Tahoma", sans-serif !important;
  direction: rtl !important;
  text-align: center !important;
}

/* Loading states */
.loading-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 1000 !important;
  border-radius: 8px !important;
}

/* Empty state styling */
.empty-message {
  text-align: center !important;
  padding: 60px 20px !important;
  color: #6c757d !important;
  font-style: italic !important;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  border-radius: 8px !important;
  border: 2px dashed #dee2e6 !important;
}

/* Card improvements for better contrast */
.card {
  border: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
}

.card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
  border-bottom: 2px solid #dee2e6 !important;
  padding: 15px 20px !important;
  font-weight: 600 !important;
}

/* Form controls with better visibility */
.form-control {
  border: 2px solid #dee2e6 !important;
  border-radius: 8px !important;
  padding: 10px 15px !important;
  font-size: 14px !important;
  transition: all 0.3s ease !important;
}

.form-control:focus {
  border-color: #007bff !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
  transform: translateY(-1px) !important;
}

/* Button improvements */
.btn {
  border-radius: 8px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
  transition: all 0.3s ease !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

.btn:active {
  transform: translateY(0) !important;
}

/* فاصله مناسب بین دکمه و عنوان در هدر کارت‌های سایدبار نمونه دوزی */
.card-header .btn.ms-2 {
  margin-right: 8px !important;
  margin-left: 0 !important;
}

.card-header .d-flex.align-items-center.order-0 {
  margin-right: 0 !important;
}

/* اطمینان از فاصله کافی بین دکمه و متن در حالت flex-row-reverse */
.card-header.d-flex.flex-row-reverse .btn,
.card-header .d-flex.flex-row-reverse .btn {
  margin-left: 0 !important;
  margin-right: 12px !important;
}

/* ===== PERSIAN DATETIME DISPLAY ===== */
.persian-datetime {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border: 1px solid #dee2e6;
  margin-left: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.persian-datetime:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.datetime-display {
  text-align: center;
  direction: rtl;
}

.datetime-display .date {
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 2px;
  line-height: 1.2;
}

.datetime-display .time {
  font-size: 14px;
  font-weight: bold;
  color: #007bff;
  font-family: "Courier New", monospace;
  letter-spacing: 1px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .persian-datetime {
    margin-left: 10px;
    padding: 6px 12px;
  }

  .datetime-display .date {
    font-size: 11px;
  }

  .datetime-display .time {
    font-size: 13px;
  }
}

@media (max-width: 576px) {
  .persian-datetime {
    margin-left: 5px;
    padding: 4px 8px;
  }

  .datetime-display .date {
    font-size: 10px;
  }

  .datetime-display .time {
    font-size: 12px;
  }
}

/* ===== DARK MODE STYLES MOVED TO dark-mode.css ===== */

/* تایمر زمان سپری شده */
.timer-display {
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: #007bff;
  background-color: #f8f9fa;
  padding: 4px 8px;
  border-radius: 6px;
  border: 2px solid #007bff;
  min-width: 85px;
  display: inline-block;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: 1px;
}

.elapsed-time .timer-display {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
  }
  50% {
    opacity: 0.8;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  }
  100% {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
  }
}

/* حالت تاخیر */
.elapsed-time.overdue .timer-display {
  color: #dc3545;
  background-color: #f8d7da;
  border-color: #dc3545;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  animation: pulse-danger 1s infinite;
}

@keyframes pulse-danger {
  0% {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
  }
  100% {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
  }
}

/* 🎯 تنظیمات دکمه hamburger برای باز/بسته کردن سایدبار */
.navbar-toggler {
  background: transparent;
  border: none;
  color: #555;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.navbar-toggler:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 🎯 تنظیمات responsive برای دکمه hamburger */
@media (max-width: 768px) {
  .navbar-toggler {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
}

/* ===== استایل‌های گروه‌بندی فرآیندها ===== */

/* استایل‌های اضافی برای گروه‌های فرآیند */
.bg-purple {
  background-color: #6f42c1 !important;
}

.btn-purple {
  background-color: #6f42c1;
  border-color: #6f42c1;
  color: white;
}

.btn-purple:hover {
  background-color: #5a32a3;
  border-color: #5a32a3;
  color: white;
}

.table-group-info {
  background-color: rgba(111, 66, 193, 0.1) !important;
  border-left: 4px solid #6f42c1 !important;
  font-weight: bold;
}

/* استایل برای فرآیندهای گروه‌بندی شده */
.process-grouped {
  opacity: 0.6;
  background-color: rgba(111, 66, 193, 0.05);
}

.process-grouped:hover {
  opacity: 1;
  background-color: rgba(111, 66, 193, 0.1);
}

/* ===== فیکس دکمه‌های light در دارک مود ===== */
body.dark-mode .btn-light {
  background-color: #374151;
  border-color: #4b5563;
  color: #f3f4f6;
}

body.dark-mode .btn-light:hover {
  background-color: #4b5563;
  border-color: #6b7280;
  color: #ffffff;
}

body.dark-mode .btn-light:focus,
body.dark-mode .btn-light:active {
  background-color: #4b5563;
  border-color: #6b7280;
  color: #ffffff;
  box-shadow: 0 0 0 0.2rem rgba(75, 85, 99, 0.5);
}
