/* ============================================================
   🍏 فارسیب — style.css (نسخه امنیتی v2.0)
   ============================================================
   شامل:
   - تمام استایل‌های اصلی برنامه
   - قوانین امنیتی [hidden]
   - اسپینر authChecking
   - تم روشن/تاریک
   ============================================================ */

/* ============ Reset و متغیرها ============ */
:root {
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --primary-light: #86efac;
  --primary-soft: #dcfce7;
  --accent: #4ade80;
  --accent-2: #a3e635;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-1: #f0fdf4;
  --bg-2: #dcfce7;
  --bg-3: #ecfdf5;
  --card: #ffffff;
  --card-soft: rgba(255,255,255,.85);
  --text: #14532d;
  --text-muted: #4b5563;
  --text-dim: #6b7280;
  --border: #d1fae5;
  --border-strong: #a7f3d0;
  --shadow-sm: 0 1px 3px rgba(20,83,45,.06);
  --shadow-md: 0 4px 16px rgba(20,83,45,.08);
  --shadow-lg: 0 12px 40px rgba(20,83,45,.12);
  --shadow-primary: 0 8px 24px rgba(34,197,94,.28);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --primary: #4ade80;
  --primary-dark: #22c55e;
  --primary-light: #86efac;
  --primary-soft: #052e16;
  --accent: #86efac;
  --accent-2: #bef264;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --bg-1: #0a1f14;
  --bg-2: #052e16;
  --bg-3: #071a10;
  --card: #0f2c1e;
  --card-soft: rgba(15,44,30,.85);
  --text: #e8fdf0;
  --text-muted: #a7f3d0;
  --text-dim: #86efac;
  --border: #14532d;
  --border-strong: #166534;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,.5);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.6);
  --shadow-primary: 0 8px 24px rgba(74,222,128,.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { transition: background-color .3s ease, color .3s ease; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
  min-height: 100vh;
  padding: 30px 20px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   🔐 امنیت — مخفی‌سازی سخت‌گیرانه
   ============================================================ */
[hidden] {
  display: none !important;
}

#appScreen[hidden],
#appScreen[aria-hidden="true"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* ============ اسپینر بررسی اعتبار ============ */
#authChecking {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  background: linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 100%);
  z-index: 99999;
  transition: opacity .3s ease;
}

#authChecking .spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-right-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  box-shadow: 0 6px 20px rgba(34,197,94,.25);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ تم ============ */
.apple-logo { width: 100%; height: 100%; filter: drop-shadow(0 6px 14px rgba(34,197,94,.35)); }
.theme-toggle {
  position: fixed; top: 20px; left: 20px;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--border-strong);
  color: var(--primary-dark); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); transition: var(--transition);
  z-index: 9999; font-size: 20px;
}
.theme-toggle:hover {
  transform: rotate(20deg) scale(1.1);
  box-shadow: var(--shadow-lg); border-color: var(--primary);
}
[data-theme="dark"] .theme-toggle { color: var(--warning); }

/* ============ صفحه لاگین ============ */
#loginScreen {
  display: flex; justify-content: center; align-items: center;
  min-height: 85vh; animation: fadeIn .5s ease;
}
.login-wrapper { position: relative; width: 100%; max-width: 420px; }
.login-wrapper::before {
  content: ''; position: absolute; inset: -40px;
  background: radial-gradient(circle at 30% 20%, rgba(34,197,94,.20), transparent 60%),
              radial-gradient(circle at 70% 80%, rgba(163,230,53,.15), transparent 60%);
  border-radius: 40px; z-index: -1; filter: blur(30px);
}
.login-box {
  background: var(--card-soft);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 38px 32px 30px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .55s cubic-bezier(.4,0,.2,1);
}
.brand-logo {
  width: 86px; height: 86px; margin: 0 auto 14px;
  transition: var(--transition);
  animation: appleBounce 3s ease-in-out infinite;
}
.login-box:hover .brand-logo { animation: appleShake .6s ease; }
.brand-name {
  text-align: center; font-size: 24px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.5px; margin-bottom: 4px;
}
.brand-tagline {
  text-align: center; font-size: 12.5px;
  color: var(--text-muted); margin-bottom: 24px;
}
.login-box h2 {
  text-align: center; font-size: 16px; font-weight: 700;
  color: var(--text); margin-bottom: 18px;
  padding-top: 16px; border-top: 1px dashed var(--border);
}

/* ============ فیلدها ============ */
.field { margin-bottom: 16px; }
.field label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text);
  font-weight: 600; margin-bottom: 7px;
}
.field label .ico { font-size: 14px; opacity: .8; }
.field input, .field select {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--card); transition: var(--transition);
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(34,197,94,.15);
}
.field input::placeholder { color: var(--text-dim); opacity: .6; }

/* ============ دکمه لاگین ============ */
.btn-login {
  width: 100%; padding: 13px; border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 15px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(34,197,94,.4);
}
.btn-login:disabled { opacity: .65; cursor: not-allowed; }
.login-msg {
  margin-top: 16px; padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 13px;
  text-align: center; min-height: 20px;
  transition: var(--transition);
}
.login-msg.error {
  color: var(--danger); background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
}
.login-msg.success {
  color: var(--success); background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.3);
}

/* ============ اپ اصلی ============ */
#appScreen { display: none; animation: fadeIn .4s ease; }
#appScreen:not([hidden]) { display: block; }
.container { max-width: 1200px; margin: 0 auto; }

/* ============ تاپ‌بار ============ */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card-soft); backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  padding: 14px 22px; border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.topbar .brand { display: flex; align-items: center; gap: 12px; }
.topbar .brand-logo-sm { width: 42px; height: 42px; }
.topbar .brand-text .name {
  font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar .brand-text .sub { font-size: 11px; color: var(--text-muted); }
.topbar .user {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text);
}
.topbar .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 16px; font-weight: 700;
  box-shadow: var(--shadow-primary);
}
.topbar .user b { color: var(--primary-dark); }
[data-theme="dark"] .topbar .user b { color: var(--primary); }
.topbar .logout {
  padding: 8px 16px; font-size: 13px; background: transparent;
  color: var(--danger); border: 1.5px solid rgba(239,68,68,.4);
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-weight: 600;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.topbar .logout:hover {
  background: var(--danger); color: #fff; border-color: var(--danger);
}

/* ============ نشان نقش ============ */
.role-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.role-badge.admin {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.role-badge.user {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
}

/* ============ میان‌برها ============ */
.shortcuts-hint {
  text-align: center; font-size: 11.5px; color: var(--text-muted);
  margin-bottom: 14px; padding: 8px 14px;
  background: var(--bg-3); border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
}
.kbd {
  display: inline-block; padding: 1px 8px; margin: 0 2px;
  background: var(--card); border: 1px solid var(--border-strong);
  border-radius: 5px; font-family: monospace;
  font-size: 11px; font-weight: 700; color: var(--primary-dark);
}
[data-theme="dark"] .kbd { color: var(--primary); }

/* ============ حالت ساده/پیشرفته ============ */
.mode-tabs {
  display: flex; gap: 8px; padding: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 12px; max-width: 520px;
  margin-left: auto; margin-right: auto;
}
.mode-tab {
  flex: 1; padding: 12px 18px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 8px; transition: var(--transition);
}
.mode-tab:hover:not(.active) { background: var(--bg-3); color: var(--text); }
.mode-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; box-shadow: var(--shadow-primary);
}
.mode-desc {
  text-align: center; font-size: 12.5px; color: var(--text-muted);
  margin: 0 auto 14px; max-width: 760px; line-height: 1.8;
  padding: 10px 18px; background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
}

/* ============ Backup Bar ============ */
.backup-bar {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap; margin: 0 auto 12px;
  max-width: 900px; padding: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.backup-btn {
  padding: 10px 18px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-3);
  color: var(--text); font-family: inherit;
  font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: var(--transition); position: relative;
}
.backup-btn:hover {
  border-color: var(--primary); background: rgba(34,197,94,.1);
  color: var(--primary-dark); transform: translateY(-2px);
}
.backup-btn.danger:hover {
  border-color: var(--danger); background: rgba(239,68,68,.1);
  color: var(--danger);
}
.backup-btn.admin:hover {
  border-color: var(--warning); background: rgba(245,158,11,.1);
  color: #b45309;
}
.backup-btn input[type=file] { display: none; }
.backup-btn .ico { font-size: 16px; }

/* ============ Tooltip ============ */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(-6px);
  padding: 8px 12px; background: rgba(15,44,30,.96);
  color: #fff; font-size: 11.5px; border-radius: 8px;
  max-width: 240px; width: max-content;
  white-space: normal; text-align: right;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease; z-index: 9999;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  line-height: 1.7;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

/* ============ Help Icon ============ */
.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 6px rgba(34,197,94,.3);
  transition: var(--transition);
}
.help-icon:hover { transform: scale(1.15); }
.help-icon-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 10px; font-weight: 700; cursor: pointer; margin-left: 4px;
}

/* ============ Hero ============ */
.hero {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 55%, #65a30d 120%);
  color: #fff; padding: 32px 34px;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(34,197,94,.3);
  margin-bottom: 22px; position: relative; overflow: hidden;
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #166534 0%, #14532d 55%, #3f6212 120%);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.hero::after {
  content: ''; position: absolute; top: -60px; left: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%);
  border-radius: 50%;
}
.hero-content {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 22px;
}
.hero-logo { width: 88px; height: 88px; flex-shrink: 0; }
.hero h1 { font-size: 23px; font-weight: 800; margin-bottom: 8px; }
.hero p { font-size: 13.5px; line-height: 1.9; opacity: .95; max-width: 720px; }
.hero .badges { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero .badge {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.3);
  padding: 5px 12px; border-radius: 20px;
  font-size: 11.5px; display: flex; align-items: center; gap: 5px;
}

/* ============ کارت‌ها ============ */
.card {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-md);
  margin-bottom: 22px; border: 1px solid var(--border);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); }
.section-head {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.step-num {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  box-shadow: var(--shadow-primary); flex-shrink: 0;
}
.section-head h3 {
  font-size: 16px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-head .desc {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px; font-weight: 400;
}

/* ============ جداول عمومی ============ */
.shift-table, .personnel-table, .report-table,
.logs-table, .forecast-detail-table, .users-table {
  width: 100%; border-collapse: separate;
  border-spacing: 0; font-size: 13px;
}
.shift-table thead th, .personnel-table thead th,
.report-table thead th, .logs-table thead th,
.forecast-detail-table thead th, .users-table thead th {
  text-align: right; padding: 10px 12px; font-size: 12px;
  color: var(--text-muted); font-weight: 600;
  background: var(--bg-3); border-bottom: 2px solid var(--border);
}
.shift-table tbody td, .personnel-table tbody td { padding: 8px 6px; }
.shift-table input, .personnel-table input, .personnel-table select {
  width: 100%; padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 12.5px; font-family: inherit;
  color: var(--text); background: var(--card);
  transition: var(--transition);
}
.shift-table input:focus, .personnel-table input:focus,
.personnel-table select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.shift-table input[type=time] { direction: ltr; text-align: center; }

/* ============ دکمه حذف ============ */
.btn-del {
  width: 30px; height: 30px; border: 0; border-radius: 8px;
  background: rgba(239,68,68,.15); color: var(--danger);
  cursor: pointer; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.btn-del:hover {
  background: var(--danger); color: #fff;
  transform: rotate(90deg) scale(1.1);
}

/* ============ دکمه افزودن ============ */
.btn-add {
  margin-top: 14px; padding: 10px 20px;
  background: rgba(34,197,94,.1);
  color: var(--primary-dark);
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: var(--transition);
}
[data-theme="dark"] .btn-add { color: var(--primary); }
.btn-add:hover {
  background: var(--primary); color: #fff;
  border-style: solid; transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(34,197,94,.3);
}

/* ============ تنظیمات محاسبه ============ */
.opts-box {
  margin-top: 20px; padding: 20px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.opts-box .title {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.opts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

/* ============ Toggle Switch ============ */
.toggle-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
  user-select: none;
}
.toggle-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(34,197,94,.12);
  transform: translateY(-1px);
}
.toggle-item .label {
  font-size: 12.5px; color: var(--text); font-weight: 600;
  line-height: 1.5;
}
.toggle-item .sub {
  font-size: 11px; color: var(--text-muted);
  display: block; margin-top: 2px; font-weight: 400;
}
.switch {
  position: relative; display: inline-block;
  width: 42px; height: 24px; flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cbd5e1; border-radius: 24px;
  transition: var(--transition);
}
[data-theme="dark"] .slider { background: #334155; }
.slider::before {
  content: ''; position: absolute;
  height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}
.switch input:checked + .slider::before { transform: translateX(-18px); }

/* ============ Week Grid ============ */
.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.week-item {
  padding: 12px 14px; background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.week-item:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(34,197,94,.15);
  transform: translateY(-2px);
}
.week-item .day {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.week-item select {
  width: 100%; padding: 7px 10px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 12.5px; font-family: inherit;
  background: var(--card); color: var(--text);
  cursor: pointer; transition: var(--transition);
}
.week-item select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

/* ============ Rotation ============ */
.rotation-toggle-row { display: flex; gap: 12px; margin-bottom: 18px; }
.rotation-form {
  display: grid; grid-template-columns: 1fr auto;
  gap: 12px; align-items: end;
  padding: 16px; background: var(--bg-3);
  border-radius: var(--radius); border: 1px solid var(--border);
  margin-bottom: 16px;
}
.rotation-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.rotation-day {
  padding: 12px 14px; background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition); position: relative;
}
.rotation-day:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(34,197,94,.15);
}
.rotation-day .rd-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; font-size: 12.5px;
  font-weight: 700; color: var(--primary-dark);
}
[data-theme="dark"] .rotation-day .rd-head { color: var(--primary); }
.rotation-day .rd-day-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 8px;
  background: var(--primary); color: #fff;
  border-radius: 8px; font-size: 12px; font-weight: 800;
}
.rotation-day select {
  width: 100%; padding: 7px 10px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 12.5px; font-family: inherit;
  background: var(--card); color: var(--text); cursor: pointer;
}
.rotation-day .rd-remove {
  position: absolute; top: 8px; left: 8px;
  width: 24px; height: 24px; border-radius: 6px; border: 0;
  background: rgba(239,68,68,.15); color: var(--danger);
  cursor: pointer; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.rotation-day .rd-remove:hover { background: var(--danger); color: #fff; }
.rotation-info {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  font-size: 12.5px;
}
.rotation-info b { color: var(--primary-dark); }
[data-theme="dark"] .rotation-info b { color: var(--primary); }

/* ============ Dropzone ============ */
.dropzone {
  border: 2.5px dashed var(--primary-light);
  border-radius: var(--radius);
  padding: 36px 20px; text-align: center;
  background: var(--bg-3); cursor: pointer;
  transition: var(--transition);
  position: relative; overflow: hidden;
  display: block;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(34,197,94,.08);
  transform: scale(1.01);
  box-shadow: 0 8px 28px rgba(34,197,94,.15);
}
.dropzone .icon {
  font-size: 42px; margin-bottom: 12px;
  display: inline-block; transition: var(--transition);
}
.dropzone:hover .icon { transform: translateY(-4px) scale(1.1); }
.dropzone .main-text {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 6px;
}
.dropzone .sub-text { font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.dropzone input[type=file] { display: none; }

/* ============ File Info ============ */
.file-info {
  margin-top: 12px; padding: 12px 16px;
  background: rgba(34,197,94,.1);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  display: none; align-items: center; gap: 10px;
  font-size: 13px; color: var(--primary-dark);
  animation: slideDown .3s ease;
}
[data-theme="dark"] .file-info { color: var(--primary-light); }
.file-info.show { display: flex; }
.file-info .check {
  width: 24px; height: 24px;
  background: var(--primary); color: #fff;
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}

/* ============ Date Filter ============ */
.date-filter-section {
  margin-top: 18px; padding: 16px 18px;
  background: linear-gradient(135deg, var(--bg-3), rgba(34,197,94,.05));
  border: 1.5px dashed var(--primary-light);
  border-radius: var(--radius);
}
.date-filter-head {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-bottom: 12px; font-size: 13px;
}
.df-icon { font-size: 18px; }
.df-title { font-weight: 700; color: var(--text); }
.df-hint { font-size: 11.5px; color: var(--text-muted); }
.date-filter-fields {
  display: grid; grid-template-columns: 1fr 1fr auto;
  gap: 10px; align-items: end;
}
.df-field { margin: 0 !important; }
.df-status {
  margin-top: 10px; font-size: 12px;
  color: var(--primary-dark); font-weight: 700;
  display: none;
}
.df-status.show { display: block; animation: slideDown .3s ease; }
[data-theme="dark"] .df-status { color: var(--primary); }

/* ============ Jalali Picker ============ */
.jalali-picker {
  display: grid; grid-template-columns: 1.15fr 1.4fr 0.9fr;
  gap: 4px; padding: 4px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  transition: var(--transition);
}
.jalali-picker:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.jalali-picker select {
  padding: 7px 8px; border: 0;
  background: var(--bg-3); border-radius: 5px;
  font-size: 12.5px; font-family: inherit;
  color: var(--text); cursor: pointer;
  transition: var(--transition);
  text-align: center; font-weight: 600;
}
.jalali-picker select:focus { outline: none; background: var(--bg-2); }
[data-theme="dark"] .jalali-picker select { background: rgba(20,83,45,.3); }
[data-theme="dark"] .jalali-picker select:focus { background: rgba(20,83,45,.55); }

/* ============ Personnel Toolbar ============ */
.personnel-toolbar {
  display: flex; gap: 10px; margin-bottom: 14px;
  flex-wrap: wrap; align-items: center;
  padding: 12px 14px; background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.personnel-toolbar .field { margin: 0; min-width: 160px; flex: 1; }
.personnel-toolbar input, .personnel-toolbar select {
  padding: 7px 10px; font-size: 12.5px; width: 100%;
  border: 1.5px solid var(--border); border-radius: 7px;
  background: var(--card); color: var(--text); font-family: inherit;
}
.personnel-toolbar input:focus, .personnel-toolbar select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

/* ============ Bulk Actions ============ */
.bulk-actions {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 12px;
  background: rgba(34,197,94,.08);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--primary);
  font-size: 12px; font-weight: 700;
  color: var(--primary-dark); margin-bottom: 10px;
}
[data-theme="dark"] .bulk-actions { color: var(--primary); }
.bulk-actions .count {
  padding: 2px 8px; background: var(--primary);
  color: #fff; border-radius: 10px; font-size: 11px;
}
.bulk-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--primary);
  background: var(--card); color: var(--primary-dark);
  border-radius: 6px; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; gap: 5px;
}
.bulk-btn:hover { background: var(--primary); color: #fff; }

/* ============ Personnel Table ============ */
.personnel-table .select-col { width: 34px; text-align: center; }
.personnel-table input[type=checkbox] {
  width: 18px !important; height: 18px;
  cursor: pointer; accent-color: var(--primary);
}
.personnel-table .avatar-cell { width: 44px; text-align: center; }
.avatar-bubble {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(34,197,94,.25);
  cursor: pointer; transition: var(--transition);
  overflow: hidden; position: relative;
}
.avatar-bubble:hover { transform: scale(1.1); }
.avatar-bubble img { width: 100%; height: 100%; object-fit: cover; }
.personnel-wrapper {
  max-height: 480px; overflow: auto;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.en-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; padding: 3px 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: 8px;
  font-size: 12px; font-weight: 700;
}
.children-input {
  width: 70px !important; text-align: center;
  font-family: monospace; font-weight: 700;
}
.group-btn {
  padding: 6px 12px; border-radius: 6px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text-muted); font-family: inherit;
  font-size: 11.5px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}
.group-btn:hover { border-color: var(--primary); color: var(--primary-dark); }

/* ============ Leave Form ============ */
.leave-form {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1.4fr 1fr auto;
  gap: 10px; align-items: end;
  margin-bottom: 18px; padding: 16px;
  background: var(--bg-3); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.leave-form .field { margin: 0; }
.leaves-list { display: flex; flex-direction: column; gap: 8px; }
.leave-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.leave-item:hover {
  border-color: var(--warning);
  box-shadow: 0 4px 12px rgba(245,158,11,.12);
}
.leave-item .info {
  flex: 1; display: flex; flex-wrap: wrap;
  align-items: center; gap: 8px; font-size: 13px;
}
.leave-item .range {
  direction: ltr; font-family: monospace;
  font-size: 12.5px; color: var(--text-muted);
  background: var(--bg-3); padding: 3px 8px; border-radius: 6px;
}
.leave-item .type-badge {
  padding: 3px 10px; border-radius: 6px;
  background: rgba(245,158,11,.15);
  color: #b45309; font-size: 11.5px; font-weight: 700;
}
.leave-item .btn-remove {
  background: rgba(239,68,68,.1); border: 0;
  color: var(--danger); width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.leave-item .btn-remove:hover { background: var(--danger); color: #fff; }
.empty-leaves {
  text-align: center; padding: 30px 20px;
  color: var(--text-muted); font-size: 13px;
}
.leave-badge {
  display: inline-block; padding: 2px 8px; margin: 1px 0;
  background: rgba(245,158,11,.15); color: #b45309;
  border-radius: 5px; font-size: 11px; font-weight: 600;
  direction: ltr;
}

/* ============ Salary ============ */
.salary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.salary-grid .field { margin: 0; }
.salary-grid input[dir=ltr] {
  text-align: center; font-family: monospace; font-size: 14px;
}
.salary-section-title {
  font-size: 13px; font-weight: 700;
  color: var(--primary-dark);
  margin: 16px 0 10px; padding-right: 10px;
  border-right: 4px solid var(--primary);
  display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .salary-section-title { color: var(--primary); }

/* ============ Rules Grid ============ */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.rule-card {
  padding: 14px 16px; background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.rule-card:hover { border-color: var(--primary-light); }
.rule-card .rc-title {
  font-size: 12.5px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.rule-card .rc-input {
  width: 100%; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--card); text-align: center;
}
.rule-card .rc-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

/* ============ Split Shift ============ */
.split-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(34,197,94,.02));
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius); margin-bottom: 14px;
}
.split-toggle .st-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.split-toggle .st-desc {
  font-size: 11.5px; color: var(--text-muted); margin-top: 3px;
}
.split-shifts-list {
  display: flex; flex-direction: column; gap: 10px; margin-top: 12px;
}
.split-shift-item {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr 1fr auto;
  gap: 8px; align-items: center;
  padding: 12px 14px; background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
}
.split-shift-item:hover { border-color: var(--primary); }
.split-shift-item .ss-num {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 800;
}
.split-shift-item input {
  padding: 7px 10px;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 12.5px; font-family: inherit;
  color: var(--text); background: var(--card); text-align: center;
}
.split-shift-item input[type=time] { direction: ltr; }
.split-shift-item .ss-del {
  width: 30px; height: 30px; border: 0; border-radius: 7px;
  background: rgba(239,68,68,.15); color: var(--danger);
  cursor: pointer; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.split-shift-item .ss-del:hover { background: var(--danger); color: #fff; }

/* ============ Holidays ============ */
.holiday-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.holiday-tab {
  padding: 8px 14px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-muted);
  font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.holiday-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-color: var(--primary);
}
.holiday-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px; max-height: 320px; overflow: auto;
  padding: 10px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.holiday-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; background: var(--card);
  border-radius: 7px; border: 1px solid var(--border);
  font-size: 12px;
}
.holiday-item.official { border-right: 3px solid var(--warning); }
.holiday-item .h-date {
  font-family: monospace; color: var(--primary-dark);
  font-weight: 700; direction: ltr;
}
.holiday-item .h-title { flex: 1; margin-right: 8px; font-weight: 600; }
.holiday-item .h-remove {
  width: 22px; height: 22px; border-radius: 5px; border: 0;
  background: rgba(239,68,68,.15); color: var(--danger);
  cursor: pointer; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.holiday-form {
  display: grid; grid-template-columns: 1.5fr 2fr auto;
  gap: 10px; align-items: end;
  padding: 12px 14px; background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 12px;
}
.holiday-info-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  font-size: 12px; margin-bottom: 12px;
}
.holiday-info-bar b { color: var(--primary-dark); }

/* ============ Groups ============ */
.group-form {
  display: grid; grid-template-columns: 1.5fr 2fr auto;
  gap: 10px; align-items: end;
  padding: 12px 14px; background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 12px;
}
.groups-list { display: flex; flex-direction: column; gap: 10px; }
.group-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
}
.group-item:hover { border-color: var(--primary); }
.group-item .g-color {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 15px; flex-shrink: 0;
}
.group-item .g-info { flex: 1; }
.group-item .g-name {
  font-size: 13.5px; font-weight: 700; color: var(--text);
}
.group-item .g-meta {
  font-size: 11.5px; color: var(--text-muted); margin-top: 3px;
}
.group-item .g-actions { display: flex; gap: 6px; }
.group-btn.assign:hover { border-color: var(--warning); color: var(--warning); }
.group-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ============ Validation ============ */
.validation-box {
  margin-bottom: 18px; border: 1.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  background: var(--card);
}
.validation-head {
  padding: 12px 16px; background: var(--bg-3);
  display: flex; justify-content: space-between;
  align-items: center; cursor: pointer;
}
.validation-head .vb-icon { font-size: 18px; margin-left: 8px; }
.validation-head .vb-title {
  font-size: 13px; font-weight: 700;
  color: var(--text); flex: 1;
}
.validation-head .vb-toggle {
  font-size: 11.5px; color: var(--text-muted); font-weight: 600;
}
.validation-body {
  padding: 0; max-height: 0; overflow: hidden;
  transition: all .3s ease;
}
.validation-body.show { padding: 14px 16px; max-height: 800px; }
.v-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  margin-bottom: 8px; font-size: 12.5px;
  border: 1px solid; line-height: 1.7;
}
.v-item:last-child { margin-bottom: 0; }
.v-item.ok {
  background: rgba(16,185,129,.08);
  border-color: rgba(16,185,129,.3); color: #047857;
}
.v-item.warn {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.3); color: #b45309;
}
.v-item.error {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.3); color: #b91c1c;
}
.v-item .v-ico { font-size: 16px; flex-shrink: 0; }
.v-item .v-text { flex: 1; }
.v-empty {
  text-align: center; padding: 18px;
  color: var(--text-muted); font-size: 12.5px;
}

/* ============ دکمه‌ها ============ */
.btn-primary {
  width: 100%; padding: 15px; border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark) 60%, #65a30d 120%);
  background-size: 200% 200%; color: #fff;
  font-size: 15px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 8px 24px rgba(34,197,94,.35);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 18px;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 14px 36px rgba(34,197,94,.45);
}
.btn-primary:disabled {
  background: #cbd5e1; cursor: not-allowed; transform: none;
}
.btn-excel {
  padding: 8px 14px; border: 1.5px solid var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.btn-excel:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34,197,94,.35);
}
.btn-mini {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.btn-mini:hover {
  border-color: var(--danger); color: var(--danger);
  background: rgba(239,68,68,.08);
}

/* ============ Progress ============ */
.progress {
  display: none; margin-top: 16px;
  height: 4px; background: rgba(34,197,94,.15);
  border-radius: 4px; overflow: hidden;
}
.progress.show { display: block; }
.progress-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-2));
  background-size: 200% 100%; border-radius: 4px;
  animation: shimmer 1.5s linear infinite;
  transition: width .35s ease;
}

/* ============ Log Box ============ */
.log-box {
  margin-top: 20px; padding: 16px 18px;
  background: var(--bg-3); color: var(--text);
  border-radius: var(--radius);
  font-size: 13px; line-height: 1.9;
  white-space: pre-wrap; min-height: 70px;
  display: none; border: 1px solid var(--border);
}
.log-box.show { display: block; }
.log-box .ok { color: var(--primary); font-weight: 700; }
.log-box .err { color: var(--danger); font-weight: 700; }

/* ============ Dashboard ============ */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.dash-stat {
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--bg-3), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.dash-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.dash-stat.accent {
  background: linear-gradient(135deg, rgba(34,197,94,.15), rgba(34,197,94,.05));
  border-color: var(--primary);
}
.dash-num {
  font-size: 20px; font-weight: 800;
  color: var(--primary-dark); margin-bottom: 4px;
  text-align: center; direction: ltr;
}
.dash-label {
  font-size: 11.5px; color: var(--text-muted);
  font-weight: 600; text-align: center;
}
.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 8px;
}
.chart-box {
  padding: 14px 16px; background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  height: 280px; position: relative; overflow: hidden;
}
.chart-box h4 {
  font-size: 13px; font-weight: 700;
  margin-bottom: 10px; color: var(--text);
  text-align: center; height: 20px; line-height: 20px;
}
.chart-box canvas {
  display: block !important;
  max-height: calc(100% - 30px) !important;
  max-width: 100% !important;
}
.chart-box.wide { grid-column: 1 / -1; height: 260px; }

/* ============ Reports ============ */
.report-tabs {
  display: flex; gap: 6px; padding: 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 18px;
  overflow-x: auto; flex-wrap: wrap;
}
.report-tab {
  padding: 10px 16px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.report-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.report-content { display: none; }
.report-content.active { display: block; }
.report-head-row {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 14px;
  flex-wrap: wrap; gap: 10px;
}
.report-title { font-size: 15px; font-weight: 800; color: var(--text); }
.report-table-wrap {
  max-height: 500px; overflow: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.report-table tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.report-table tbody tr:hover { background: var(--bg-3); }
.report-table .num-cell {
  text-align: center; direction: ltr;
  font-family: monospace; font-size: 12px;
}
.report-table .pos-cell { color: var(--success); font-weight: 700; }
.report-table .neg-cell { color: var(--danger); font-weight: 700; }
.report-table .empty-cell {
  text-align: center; padding: 30px; color: var(--text-muted);
}
.report-summary-row {
  display: flex; gap: 8px; margin-bottom: 14px;
  flex-wrap: wrap; padding: 12px 14px;
  background: var(--bg-3); border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
}
.report-summary-item {
  padding: 4px 12px; background: var(--card);
  border-radius: 6px; font-size: 12px;
  border: 1px solid var(--border);
}
.report-summary-item b { color: var(--primary-dark); }
.report-filters {
  display: flex; gap: 10px; margin-bottom: 14px;
  flex-wrap: wrap; padding: 12px 14px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); align-items: end;
}
.report-filters .field { margin: 0; min-width: 180px; flex: 1; }

/* ============ Analytics ============ */
.analytics-tabs {
  display: flex; gap: 6px; padding: 6px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 18px;
  overflow-x: auto; flex-wrap: wrap;
}
.analytics-tab {
  padding: 10px 16px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 12.5px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.analytics-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.analytics-content { display: none; }
.analytics-content.active { display: block; }
.compare-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.kpi-card {
  padding: 16px 18px; background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 5px; height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
}
.kpi-card.up::before { background: linear-gradient(180deg, #22c55e, #16a34a); }
.kpi-card.down::before { background: linear-gradient(180deg, #ef4444, #b91c1c); }
.kpi-card.equal::before { background: linear-gradient(180deg, #94a3b8, #64748b); }
.kpi-label {
  font-size: 11.5px; color: var(--text-muted);
  font-weight: 700; margin-bottom: 8px;
}
.kpi-values {
  display: flex; align-items: baseline;
  gap: 10px; flex-wrap: wrap; margin-bottom: 6px;
}
.kpi-current {
  font-size: 20px; font-weight: 800;
  color: var(--text); direction: ltr;
}
.kpi-previous {
  font-size: 12px; color: var(--text-muted); direction: ltr;
}
.kpi-change {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 12px;
  font-size: 11.5px; font-weight: 800; direction: ltr;
}
.kpi-change.up { background: rgba(34,197,94,.15); color: #047857; }
.kpi-change.down { background: rgba(239,68,68,.15); color: #b91c1c; }
.kpi-change.equal { background: rgba(148,163,184,.2); color: #475569; }

.compare-bars {
  padding: 18px; background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 16px;
}
.compare-bar-row {
  display: grid; grid-template-columns: 120px 1fr 100px;
  gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.compare-bar-row:last-child { border-bottom: 0; }
.cb-label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.cb-bars { display: flex; flex-direction: column; gap: 4px; }
.compare-bar {
  height: 10px; border-radius: 5px;
  background: rgba(148,163,184,.2); overflow: hidden;
}
.compare-bar .bar-fill {
  height: 100%; border-radius: 5px;
  transition: width .6s ease;
}
.compare-bar.prev .bar-fill {
  background: linear-gradient(90deg, #94a3b8, #64748b);
}
.compare-bar.curr .bar-fill {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}
.cb-value {
  font-size: 12px; font-weight: 700;
  direction: ltr; color: var(--text); text-align: left;
}
.compare-legend {
  display: flex; gap: 16px; margin-bottom: 14px;
  padding: 10px 14px; background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
  font-size: 11.5px; font-weight: 700;
}
.compare-legend .lg-item { display: flex; align-items: center; gap: 6px; }
.compare-legend .lg-dot { width: 14px; height: 14px; border-radius: 4px; }

/* ============ Forecast ============ */
.forecast-banner {
  padding: 20px 24px; border-radius: var(--radius);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 60%, #ec4899 120%);
  color: #fff; margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(99,102,241,.35);
}
.forecast-banner h3 {
  font-size: 17px; font-weight: 800; margin-bottom: 8px;
}
.forecast-banner p { font-size: 12.5px; line-height: 1.9; opacity: .95; }
.forecast-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.forecast-stat {
  padding: 16px 18px; background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
}
.forecast-stat .fs-num {
  font-size: 20px; font-weight: 800;
  color: var(--primary-dark); direction: ltr; margin-bottom: 6px;
}
.forecast-stat .fs-label {
  font-size: 11.5px; color: var(--text-muted); font-weight: 700;
}
.forecast-stat.highlight {
  background: linear-gradient(135deg, rgba(34,197,94,.15), rgba(34,197,94,.05));
  border-color: var(--primary);
}
.confidence-bar {
  display: flex; gap: 4px; margin-top: 8px; justify-content: center;
}
.confidence-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(148,163,184,.3);
}
.confidence-dot.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.forecast-detail-table tbody td {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.forecast-detail-table .num-cell {
  text-align: center; direction: ltr; font-family: monospace;
}

/* ============ Empty State ============ */
.empty-state {
  padding: 30px 20px; text-align: center;
  color: var(--text-muted); font-size: 13px;
  background: var(--bg-3); border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong);
}

/* ============ Modals عمومی ============ */
.modal-overlay, .help-modal-overlay, .profile-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px); z-index: 10000;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.show, .help-modal-overlay.show, .profile-modal-overlay.show {
  display: flex;
}
.modal-box {
  background: var(--card); border-radius: var(--radius-lg);
  width: 100%; max-width: 1100px; max-height: 92vh;
  overflow: hidden; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  animation: slideUp .35s cubic-bezier(.4,0,.2,1);
}
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--card-soft);
}
.modal-header h3 {
  font-size: 16px; font-weight: 800; color: var(--text);
}
.modal-close {
  width: 34px; height: 34px; border-radius: 8px; border: 0;
  background: rgba(239,68,68,.1); color: var(--danger);
  cursor: pointer; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover {
  background: var(--danger); color: #fff;
  transform: rotate(90deg);
}
.modal-body { padding: 0; overflow: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: space-between;
  align-items: center; background: var(--bg-3); flex-wrap: wrap;
}
.modal-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--card);
  color: var(--text); font-family: inherit;
  font-size: 12.5px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.modal-btn:hover {
  border-color: var(--primary); color: var(--primary-dark);
}
.modal-btn.danger { color: var(--danger); }
.modal-btn.danger:hover {
  border-color: var(--danger); color: var(--danger);
}

/* ============ Help Modal ============ */
.help-modal-box {
  background: var(--card); border-radius: var(--radius-lg);
  max-width: 520px; width: 100%; max-height: 80vh;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp .35s cubic-bezier(.4,0,.2,1);
}
.help-modal-header {
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; justify-content: space-between; align-items: center;
}
.help-modal-header h3 {
  color: #fff; font-size: 15px; font-weight: 800;
}
.help-modal-header .modal-close {
  background: rgba(255,255,255,.2); color: #fff;
}
.help-modal-body {
  padding: 22px; overflow: auto;
  font-size: 13px; line-height: 2; color: var(--text);
}
.help-modal-body b { color: var(--primary-dark); }
[data-theme="dark"] .help-modal-body b { color: var(--primary); }

/* ============ Logs Modal ============ */
.logs-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; padding: 14px 24px;
  background: var(--bg-3); border-bottom: 1px solid var(--border);
}
.stat-card {
  padding: 10px 14px; background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.stat-card .num {
  font-size: 18px; font-weight: 800;
  color: var(--primary-dark); direction: ltr; text-align: center;
}
.stat-card .lbl {
  font-size: 11px; color: var(--text-muted);
  font-weight: 600; text-align: center; margin-top: 2px;
}
.logs-filters {
  display: grid;
  grid-template-columns: 1.3fr 1.3fr 1fr 1fr auto;
  gap: 10px; padding: 16px 24px;
  background: var(--bg-3); border-bottom: 1px solid var(--border);
  align-items: end;
}
.filter-field { display: flex; flex-direction: column; gap: 4px; }
.filter-field label {
  font-size: 11px; color: var(--text-muted); font-weight: 700;
  display: flex; align-items: center; gap: 4px;
}
.filter-field select, .filter-field input {
  padding: 8px 10px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 12.5px; font-family: inherit;
  color: var(--text); background: var(--card);
}
.filter-field select:focus, .filter-field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.filter-field input[type=date] { direction: ltr; text-align: center; }
.filter-actions { display: flex; gap: 8px; }
.filter-btn {
  padding: 9px 14px;
  border: 1.5px solid var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: 8px;
  cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.filter-btn.reset {
  background: transparent; color: var(--text-muted);
  border-color: var(--border);
}
.filter-btn.reset:hover {
  border-color: var(--warning); color: var(--warning);
}
.logs-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.logs-table tbody tr:hover { background: var(--bg-3); }
.logs-table .action-tag {
  padding: 3px 9px; border-radius: 5px;
  font-size: 11px; font-weight: 700;
  display: inline-block;
  background: rgba(34,197,94,.15);
  color: var(--primary-dark); white-space: nowrap;
}
.logs-table .action-tag.login { background: rgba(59,130,246,.15); color: #1d4ed8; }
.logs-table .action-tag.logout { background: rgba(107,114,128,.15); color: #4b5563; }
.logs-table .action-tag.login_failed { background: rgba(239,68,68,.15); color: #b91c1c; }
.logs-table .action-tag.login_denied { background: rgba(239,68,68,.15); color: #b91c1c; }
.logs-table .action-tag.user_created { background: rgba(16,185,129,.15); color: #047857; }
.logs-table .action-tag.user_deleted { background: rgba(239,68,68,.15); color: #b91c1c; }
.logs-table .action-tag.user_updated { background: rgba(245,158,11,.15); color: #b45309; }
.logs-table .action-tag.user_toggled { background: rgba(139,92,246,.15); color: #6d28d9; }
.logs-table .time-cell {
  direction: ltr; font-family: monospace; font-size: 11.5px;
  color: var(--text-muted); white-space: nowrap;
}
.logs-table .details-cell {
  font-size: 11.5px; color: var(--text);
  max-width: 340px; word-break: break-word;
}
.logs-table .user-cell { display: flex; align-items: center; gap: 8px; }
.logs-table .mini-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 11px;
  font-weight: 700; flex-shrink: 0;
}
.logs-empty {
  text-align: center; padding: 50px 20px;
  color: var(--text-muted); font-size: 13.5px;
}
.loading-row td {
  text-align: center; padding: 40px 20px;
  color: var(--text-muted); font-size: 13.5px;
}

/* ============ Users Modal ============ */
.users-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 14px 24px;
  background: var(--bg-3); border-bottom: 1px solid var(--border);
}
.users-toolbar {
  padding: 14px 24px; background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; gap: 10px;
}
.users-table thead th {
  padding: 12px 14px; text-align: right;
  background: var(--bg-3); color: var(--text-muted);
  font-size: 11.5px; font-weight: 700;
  border-bottom: 2px solid var(--border);
}
.users-table tbody td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.users-table tbody tr:hover { background: var(--bg-3); }
.users-table tbody tr.inactive { opacity: .55; }
.user-role-pill {
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; display: inline-block;
}
.user-role-pill.admin {
  background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff;
}
.user-role-pill.user {
  background: linear-gradient(135deg, #6b7280, #9ca3af); color: #fff;
}
.user-status-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%;
}
.user-status-dot.active {
  background: #22c55e; box-shadow: 0 0 8px rgba(34,197,94,.5);
}
.user-status-dot.inactive { background: #ef4444; }
.user-action-btn {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-muted);
  border-radius: 6px; font-family: inherit;
  font-size: 11px; font-weight: 700;
  cursor: pointer; margin-left: 4px;
  transition: var(--transition);
}
.user-action-btn:hover {
  border-color: var(--primary); color: var(--primary-dark);
}
.user-action-btn.danger:hover {
  border-color: var(--danger); color: var(--danger);
}
.user-action-btn.warning:hover {
  border-color: var(--warning); color: var(--warning);
}
.access-date-cell {
  font-size: 10.5px; color: var(--text-muted);
  direction: ltr; text-align: center;
}
.form-row-2 {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px; margin-bottom: 14px;
}
.btn-cancel {
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer;
}
.btn-cancel:hover {
  border-color: var(--danger); color: var(--danger);
}
.btn-save {
  padding: 10px 22px; border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13px;
  font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34,197,94,.35);
}

/* ============ Profile Modal ============ */
.profile-modal-box {
  background: var(--card); border-radius: var(--radius-lg);
  width: 100%; max-width: 720px; max-height: 92vh;
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.profile-modal-header {
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; display: flex; justify-content: space-between; align-items: center;
}
.profile-modal-header h3 { font-size: 15px; font-weight: 800; }
.profile-modal-body { padding: 22px; overflow: auto; }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.profile-photo-section {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 16px; background: var(--bg-3);
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
}
.profile-photo {
  width: 100px; height: 100px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 36px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-primary); overflow: hidden;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-buttons {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.photo-btn {
  padding: 6px 12px; border-radius: 6px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text); font-family: inherit;
  font-size: 11.5px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.photo-btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.photo-btn.danger { color: var(--danger); }
.photo-btn input { display: none; }
.profile-modal-footer {
  padding: 14px 22px; background: var(--bg-3);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between;
  align-items: center; gap: 10px;
}

/* ============ Shortcuts ============ */
.shortcut-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.shortcut-item {
  padding: 14px 16px; background: var(--bg-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.shortcut-item .desc {
  font-size: 12.5px; color: var(--text); font-weight: 600;
}
.shortcut-item .keys { display: flex; gap: 4px; }

/* ============ Sync Indicator ============ */
.sync-indicator {
  position: fixed; bottom: 20px; left: 20px;
  padding: 10px 16px;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 700;
  box-shadow: var(--shadow-md);
  display: none; align-items: center; gap: 8px;
  z-index: 9998;
}
.sync-indicator.show { display: flex; animation: slideInLeft .3s ease; }
.sync-indicator.saving { border-color: var(--warning); color: var(--warning); }
.sync-indicator.saved { border-color: var(--primary); color: var(--primary-dark); }
.sync-indicator.error { border-color: var(--danger); color: var(--danger); }

/* ============ PDF Payslip ============ */
#payslipsContainer { position: fixed; top: -99999px; left: -99999px; }
.payslip {
  width: 794px; padding: 40px 44px;
  background: #fff; color: #14532d;
  font-family: 'Vazirmatn', Tahoma, sans-serif; direction: rtl;
}
.payslip-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 20px;
  border-bottom: 3px solid #22c55e; margin-bottom: 24px;
}
.payslip-title { font-size: 24px; font-weight: 800; }
.payslip-subtitle { font-size: 12px; color: #64748b; margin-top: 4px; }
.payslip-logo { width: 70px; height: 70px; }
.payslip-info {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 30px; margin-bottom: 24px;
  padding: 16px; background: #f0fdf4; border-radius: 12px;
}
.payslip-info-row {
  display: flex; justify-content: space-between;
  font-size: 13px; padding: 4px 0;
}
.payslip-info-label { color: #64748b; font-weight: 600; }
.payslip-info-value { font-weight: 700; }
.payslip-table {
  width: 100%; border-collapse: collapse;
  margin-bottom: 20px; font-size: 12.5px;
}
.payslip-table th {
  background: #22c55e; color: #fff;
  padding: 10px; border: 1px solid #16a34a;
}
.payslip-table td {
  padding: 9px 12px;
  border: 1px solid #dcfce7; text-align: center;
}
.payslip-table tr:nth-child(even) td { background: #f8fafc; }
.payslip-table .net-row td {
  background: #dcfce7 !important;
  font-weight: 800; font-size: 14px;
}
.payslip-footer {
  margin-top: 30px; padding-top: 20px;
  border-top: 2px dashed #dcfce7;
  display: flex; justify-content: space-between;
  font-size: 11.5px; color: #64748b;
}
.payslip-signatures {
  display: flex; justify-content: space-around;
  margin-top: 40px; gap: 30px;
}
.payslip-sign-box {
  flex: 1; text-align: center;
  padding-top: 60px;
  border-top: 1px solid #94a3b8;
  font-size: 12px; color: #64748b;
}

/* ============ Toast ============ */
#toastContainer {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 13px 18px;
  background: var(--card); color: var(--text);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border-right: 4px solid var(--primary);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  min-width: 260px;
  animation: slideInLeft .35s ease;
  transition: var(--transition);
}
.toast.hide { animation: slideOutLeft .3s ease forwards; }
.toast.success { border-right-color: var(--success); }
.toast.error { border-right-color: var(--danger); }
.toast.warning { border-right-color: var(--warning); }
.toast .ico { font-size: 18px; }
.toast.success .ico { color: var(--success); }
.toast.error .ico { color: var(--danger); }
.toast.warning .ico { color: var(--warning); }

/* ============ Animations ============ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutLeft {
  to { opacity: 0; transform: translateX(-40px); }
}
@keyframes shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
@keyframes appleBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-4px) rotate(-3deg); }
  75% { transform: translateY(2px) rotate(3deg); }
}
@keyframes appleShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  50% { transform: rotate(12deg); }
  75% { transform: rotate(-8deg); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .logs-filters { grid-template-columns: 1fr 1fr 1fr; }
  .logs-filters .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 900px) {
  .leave-form { grid-template-columns: 1fr 1fr; }
  .leave-form > button { grid-column: 1 / -1; }
  .logs-stats { grid-template-columns: 1fr 1fr; }
  .dashboard-charts { grid-template-columns: 1fr; }
  .chart-box, .chart-box.wide { height: 240px; }
}
@media (max-width: 700px) {
  .date-filter-fields { grid-template-columns: 1fr; }
  .rotation-form { grid-template-columns: 1fr; }
  .split-shift-item { grid-template-columns: 1fr 1fr; }
  .split-shift-item .ss-num { grid-column: 1 / -1; }
  .split-shift-item .ss-del { grid-column: 1 / -1; width: 100%; }
  .form-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { padding: 16px 12px; }
  .theme-toggle { top: 12px; left: 12px; width: 42px; height: 42px; }
  .card, .hero { padding: 20px 18px; }
  .hero h1 { font-size: 18px; }
  .hero-content { flex-direction: column; text-align: center; }
  .hero-logo { width: 68px; height: 68px; }
  .topbar { padding: 10px 14px; }
  .opts-grid { grid-template-columns: 1fr; }
  .mode-tabs { flex-direction: column; }
  .leave-form { grid-template-columns: 1fr; }
  .backup-bar { flex-direction: column; }
  .logs-filters { grid-template-columns: 1fr; }
  .logs-stats { grid-template-columns: 1fr; }
  .dashboard-charts { grid-template-columns: 1fr; }
  .users-stats { grid-template-columns: 1fr; }
  #toastContainer { left: 12px; right: 12px; }
  .toast { min-width: auto; }
  .modal-overlay, .help-modal-overlay, .profile-modal-overlay { padding: 8px; }
  .modal-box { max-height: 96vh; }
  .compare-bar-row { grid-template-columns: 1fr; gap: 6px; }
  .compare-bar-row .cb-value { text-align: right; }
  .compare-legend { flex-direction: column; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}

/* ============ Print ============ */
@media print {
  .theme-toggle, .backup-bar, .mode-tabs,
  .mode-desc, .shortcuts-hint, #toastContainer {
    display: none !important;
  }
  body { background: #fff; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
  .btn-primary, .btn-excel, .btn-add, .btn-mini { display: none; }
}

/* ============================================================
   💰 الگوهای حقوقی
   ============================================================ */

.templates-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 14px 18px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 18px;
  flex-wrap: wrap;
}

.templates-default-info {
  font-size: 13px; color: var(--text);
  font-weight: 600;
}
.templates-default-info b,
.templates-default-info span {
  color: var(--primary-dark);
  font-weight: 800;
}
[data-theme="dark"] .templates-default-info span {
  color: var(--primary);
}

/* ============ Grid الگوها ============ */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.template-card {
  position: relative;
  padding: 18px 20px;
  background: var(--card);
  border: 2px solid var(--border);
  border-top: 4px solid var(--tpl-color, var(--primary));
  border-radius: var(--radius);
  transition: var(--transition);
  display: flex; flex-direction: column; gap: 10px;
}
.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(34,197,94,.15);
  border-color: var(--primary);
}
.template-card.is-default {
  background: linear-gradient(135deg, rgba(34,197,94,.06), rgba(34,197,94,.02));
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(34,197,94,.12);
}

.tpl-default-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 3px 10px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 10.5px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(34,197,94,.3);
}

.tpl-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  margin-bottom: 4px;
}

.tpl-name {
  font-size: 15px; font-weight: 800;
  color: var(--text); line-height: 1.4;
}

.tpl-desc {
  font-size: 12px; color: var(--text-muted);
  line-height: 1.7; min-height: 32px;
}

.tpl-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-muted);
  padding: 8px 10px;
  background: var(--bg-3);
  border-radius: 8px;
}
.tpl-stats b { color: var(--primary-dark); font-weight: 800; }
[data-theme="dark"] .tpl-stats b { color: var(--primary); }

.tpl-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: auto;
}

.tpl-btn {
  flex: 1;
  padding: 7px 10px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--text);
  font-family: inherit; font-size: 11.5px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 60px;
}
.tpl-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: rgba(34,197,94,.05);
}
.tpl-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239,68,68,.05);
}

/* ============ Assignment Table ============ */
.tpl-source-cell { text-align: center; }
.tpl-source-badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 8px;
  background: rgba(34,197,94,.12);
  color: var(--primary-dark);
  font-size: 11px; font-weight: 700;
}
[data-theme="dark"] .tpl-source-badge { color: var(--primary); }

.assign-tpl-select {
  width: 100%; padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px; font-family: inherit;
  background: var(--card); color: var(--text);
  cursor: pointer;
}
.assign-tpl-select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

.assignment-actions {
  display: flex; gap: 4px; justify-content: center;
}
.tpl-mini-btn {
  width: 32px; height: 32px;
  border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-muted);
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.tpl-mini-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: rgba(34,197,94,.08);
  transform: scale(1.1);
}

/* ============ Sections داخل Modal ============ */
.tpl-section {
  margin-bottom: 22px; padding: 16px 18px;
  background: var(--bg-3); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.tpl-section-title {
  font-size: 13.5px; font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 14px; padding-right: 10px;
  border-right: 4px solid var(--primary);
  display: flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .tpl-section-title { color: var(--primary); }

.tpl-hint {
  font-size: 11.5px; color: var(--text-muted);
  line-height: 1.7;
}

/* ============ Formula Builder ============ */
.formula-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-bottom: 10px; flex-wrap: wrap;
}
.formula-hint {
  font-size: 10.5px; color: var(--text-muted);
  font-family: monospace; direction: ltr;
  text-align: left;
  line-height: 1.6;
  flex: 1;
  word-break: break-word;
}

.formula-row {
  display: grid;
  grid-template-columns: 1.2fr 2fr auto auto;
  gap: 8px; align-items: center;
  padding: 10px 12px; margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.formula-row.tax-slab {
  grid-template-columns: 60px 1fr 1fr 90px auto;
}

.formula-row input[type=text],
.formula-row input[type=number] {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 12.5px; font-family: inherit;
  color: var(--text); background: var(--card);
}
.formula-row input[type=text]:focus,
.formula-row input[type=number]:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.formula-row .formula-expr {
  font-family: 'Courier New', monospace;
  direction: ltr;
}

.formula-toggle {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); cursor: pointer;
  white-space: nowrap;
}
.formula-toggle input[type=checkbox] {
  accent-color: var(--primary);
  width: 14px; height: 14px;
  cursor: pointer;
}

.formula-del {
  width: 28px; height: 28px;
  border-radius: 7px; border: 0;
  background: rgba(239,68,68,.12);
  color: var(--danger);
  cursor: pointer; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.formula-del:hover {
  background: var(--danger); color: #fff;
  transform: rotate(90deg);
}

.slab-num {
  font-size: 11px; font-weight: 800;
  color: var(--primary-dark);
  text-align: center;
  white-space: nowrap;
}
[data-theme="dark"] .slab-num { color: var(--primary); }

.empty-formula {
  text-align: center; padding: 16px;
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

/* ============ Preset Modal ============ */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.preset-card {
  padding: 20px 18px;
  background: var(--card);
  border: 2px solid var(--border);
  border-top: 4px solid var(--p-color, var(--primary));
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
}
.preset-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(34,197,94,.15);
}
.preset-icon {
  width: 64px; height: 64px;
  border-radius: 16px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
}
.preset-name {
  font-size: 14px; font-weight: 800;
  color: var(--text); margin-bottom: 6px;
}
.preset-desc {
  font-size: 11.5px; color: var(--text-muted);
  line-height: 1.7; margin-bottom: 14px;
  min-height: 40px;
}

/* ============ Override List ============ */
.override-item {
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ov-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
  font-size: 13px; color: var(--primary-dark);
}
[data-theme="dark"] .ov-head { color: var(--primary); }
.ov-details {
  font-size: 11.5px; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.ov-key { font-weight: 700; }
.ov-val { font-family: monospace; direction: ltr; }

/* ============ Simulate Result ============ */
.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.sim-box {
  padding: 16px 18px;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.sim-box.highlight {
  background: linear-gradient(135deg, rgba(34,197,94,.12), rgba(34,197,94,.04));
  border-color: var(--primary);
}
.sim-box.up {
  background: linear-gradient(135deg, rgba(34,197,94,.15), rgba(34,197,94,.05));
  border-color: #22c55e;
}
.sim-box.down {
  background: linear-gradient(135deg, rgba(239,68,68,.15), rgba(239,68,68,.05));
  border-color: var(--danger);
}
.sim-label {
  font-size: 11.5px; color: var(--text-muted);
  font-weight: 700; margin-bottom: 8px;
}
.sim-value {
  font-size: 20px; font-weight: 800;
  color: var(--text); direction: ltr;
  margin-bottom: 4px;
}
.sim-box.up .sim-value { color: #16a34a; }
.sim-box.down .sim-value { color: var(--danger); }
.sim-pct {
  font-size: 11.5px; font-weight: 700;
  color: var(--text-muted);
}
.sim-all-header {
  text-align: center; font-size: 13.5px;
  font-weight: 800; color: var(--text);
  padding: 12px; margin-bottom: 12px;
  background: var(--bg-3); border-radius: 8px;
}

.sim-detail-list {
  max-height: 360px; overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 12px;
}
.sim-detail-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 8px; align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.sim-detail-row:last-child { border-bottom: 0; }
.sim-detail-row .name { font-weight: 700; color: var(--text); }
.sim-detail-row .old,
.sim-detail-row .new {
  font-family: monospace; direction: ltr;
  color: var(--text-muted);
}
.sim-detail-row .new { font-weight: 800; color: var(--primary-dark); }
.sim-detail-row .arrow { color: var(--text-muted); }
.sim-detail-row .diff {
  font-family: monospace; direction: ltr;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
}
.sim-detail-row .diff.up {
  background: rgba(34,197,94,.15); color: #047857;
}
.sim-detail-row .diff.down {
  background: rgba(239,68,68,.15); color: #b91c1c;
}

/* ============ Compare Two Templates ============ */
.compare-tpl-head {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 14px;
  font-size: 13px; font-weight: 800;
  text-align: center;
  color: var(--primary-dark);
}
[data-theme="dark"] .compare-tpl-head { color: var(--primary); }

.compare-tpl-table {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.compare-tpl-table th {
  padding: 10px 12px;
  background: var(--bg-3);
  color: var(--text-muted);
  font-weight: 700; font-size: 11.5px;
  text-align: center;
  border-bottom: 2px solid var(--border);
}
.compare-tpl-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.compare-tpl-table tbody tr:last-child td { border-bottom: 0; }
.compare-tpl-table tbody tr:hover { background: var(--bg-3); }
.compare-tpl-table .num {
  font-family: monospace; direction: ltr;
  font-weight: 700;
}
.compare-tpl-table .num.pos { color: #16a34a; }
.compare-tpl-table .num.neg { color: var(--danger); }

/* ============ IO Box ============ */
.io-box {
  padding: 22px 24px; margin-bottom: 16px;
  background: var(--bg-3);
  border: 1.5px dashed var(--primary-light);
  border-radius: var(--radius);
}
.io-box h4 {
  font-size: 14px; font-weight: 800;
  color: var(--text); margin-bottom: 8px;
}
.io-box p {
  font-size: 12.5px; color: var(--text-muted);
  line-height: 1.8; margin-bottom: 14px;
}

/* ============ Responsive ============ */
@media (max-width: 700px) {
  .formula-row {
    grid-template-columns: 1fr;
  }
  .formula-row.tax-slab {
    grid-template-columns: 1fr;
  }
  .compare-tpl-table { font-size: 11px; }
  .compare-tpl-table th,
  .compare-tpl-table td { padding: 6px 8px; }
  .sim-detail-row {
    grid-template-columns: auto 1fr;
    gap: 4px;
  }
  .sim-detail-row .old,
  .sim-detail-row .arrow { display: none; }
}
/* ============================================================
   ⏰ ماژول مرخصی و مأموریت
   ============================================================ */

/* ============ Toolbar ============ */
.ev-toolbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.ev-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ev-filters input,
.ev-filters select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px; font-family: inherit;
  background: var(--card); color: var(--text);
  min-width: 140px;
}
.ev-filters input:focus,
.ev-filters select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

/* ============ Summary Boxes ============ */
.ev-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 18px;
}
.ev-sum-box {
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.ev-sum-box.pending { border-color: #f59e0b; background: rgba(245,158,11,.08); }
.ev-sum-box.approved { border-color: #22c55e; background: rgba(34,197,94,.08); }
.ev-sum-box.rejected { border-color: #ef4444; background: rgba(239,68,68,.08); }
.ev-sum-box.leave { border-color: #f59e0b; background: rgba(245,158,11,.06); }
.ev-sum-box.mission { border-color: #3b82f6; background: rgba(59,130,246,.08); }
.ev-sum-box.cost { border-color: #8b5cf6; background: rgba(139,92,246,.08); }
.ev-sum-box.bonus { border-color: #06b6d4; background: rgba(6,182,212,.08); }

.ev-sum-box .evs-num {
  font-size: 18px; font-weight: 800;
  color: var(--primary-dark);
  direction: ltr; margin-bottom: 2px;
}
[data-theme="dark"] .ev-sum-box .evs-num { color: var(--primary); }
.ev-sum-box .evs-label {
  font-size: 11px; color: var(--text-muted);
  font-weight: 700;
}

/* ============ جدول رویدادها ============ */
.events-table tbody td { padding: 10px 8px; vertical-align: middle; }

.ev-row.status-rejected { opacity: 0.6; }
.ev-row.status-cancelled { opacity: 0.5; text-decoration: line-through; }
.ev-row.status-pending { background: rgba(245,158,11,.04); }

.ev-name { font-weight: 700; font-size: 12.5px; color: var(--text); }
.ev-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.ev-type-badge {
  display: inline-block;
  padding: 4px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 700;
  border: 1px solid;
}

.ev-status {
  display: inline-block;
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
}

.ev-duration {
  font-size: 10.5px; color: var(--text-muted);
  font-family: monospace; direction: ltr;
  margin-top: 2px;
}

.ev-details-cell {
  font-size: 11.5px; color: var(--text);
  line-height: 1.7;
}

.ev-actions {
  display: flex; gap: 3px; flex-wrap: wrap;
}
.ev-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--card); color: var(--text-muted);
  cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.ev-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: rgba(34,197,94,.08);
}
.ev-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239,68,68,.08);
}

/* ============ Type Tabs در Modal ============ */
.ev-type-tabs {
  display: flex; gap: 8px;
  padding: 6px;
  background: var(--bg-3);
  border-radius: 10px;
}
.ev-type-tab {
  flex: 1; padding: 10px 16px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.ev-type-tab:hover:not(.active) {
  background: var(--card); color: var(--text);
}
.ev-type-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 12px rgba(34,197,94,.25);
}

/* ============ Subtype Grid ============ */
.ev-subtype-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.ev-subtype-btn {
  display: flex; flex-direction: column;
  align-items: center; gap: 4px;
  padding: 12px 10px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit;
  color: var(--text);
  transition: var(--transition);
}
.ev-subtype-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.ev-subtype-btn.active {
  border-color: var(--primary);
  background: rgba(34,197,94,.08);
  box-shadow: 0 4px 12px rgba(34,197,94,.15);
}
.esb-icon { font-size: 20px; }
.esb-label { font-size: 12px; font-weight: 700; }

/* ============ Duration Preview ============ */
.ev-duration-preview {
  padding: 10px 14px; margin-top: 10px;
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  font-size: 12.5px; color: var(--text);
  text-align: center;
}
.ev-duration-preview b {
  color: var(--primary-dark);
  font-family: monospace; direction: ltr;
}

/* ============ Balance Info ============ */
.balance-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px 14px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.bi-item {
  display: flex; justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
}
.bi-item span { color: var(--text-muted); }
.bi-item b {
  color: var(--text); font-weight: 800;
  direction: ltr;
}

/* ============ مانده مرخصی — رنگ‌بندی ============ */
.balance-ok b { color: var(--success); }
.balance-warning b { color: #f59e0b; }
.balance-critical b { color: var(--danger); }

/* ============ Responsive ============ */
@media (max-width: 700px) {
  .ev-toolbar { flex-direction: column; align-items: stretch; }
  .ev-filters { flex-direction: column; }
  .ev-filters input,
  .ev-filters select { min-width: auto; }
  .ev-subtype-grid { grid-template-columns: repeat(2, 1fr); }
  .balance-info-grid { grid-template-columns: 1fr; }
  .ev-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ============ Storage Stats ============ */
.storage-stats {
  padding: 10px;
}
.storage-stats h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 14px;
}
.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.sg-item {
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}
.sg-item b {
  color: var(--primary-dark);
  direction: ltr;
}
.storage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.storage-table th {
  padding: 8px 12px;
  background: var(--bg-3);
  color: var(--text-muted);
  font-weight: 700;
  text-align: right;
}
.storage-table td {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}