/* =====================================================================
   DOCUMENTS ULTIMATE - ULTIMATE CSS
   PART 1: GLOBAL VARIABLES (LIGHT & DARK MODES)
   ===================================================================== */

/* ---------- Import Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700;14..32,800&family=Cinzel:wght@400;500;600;700;800;900&display=swap');
@import url('https://sunrp.ir/assets/Vazirmatn-Medium-D86t5Axy.woff2');

/* ============================================ */
/* 1. LIGHT MODE VARIABLES (پیش‌فرض)           */
/* ============================================ */
:root {
  /* ----- رنگ‌های اصلی (طلایی-شیشه‌ای) ----- */
  --gold-base: #d4af37;
  --gold-bright: #f5d878;
  --gold-dark: #b8941f;
  --gold-darker: #8a6820;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --gold-glow-strong: rgba(212, 175, 55, 0.6);
  --gold-dim: rgba(212, 175, 55, 0.08);
  --gold-border: rgba(212, 175, 55, 0.25);
  --gold-border-strong: rgba(212, 175, 55, 0.5);
  
  /* ----- رنگ‌های پس‌زمینه و کارت (تم روشن) ----- */
  --bg-body: #fef9f0;
  --bg-dark: #f8fafc;
  --bg-darker: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.75);
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-light: rgba(0, 0, 0, 0.05);
  
  /* ----- رنگ‌های متن (تم روشن) ----- */
  --text-main: #1e293b;
  --text-muted: #475569;
  --text-light: #64748b;
  --text-dim: #94a3b8;
  --text-0: #ffffff;
  --text-1: #f1f5f9;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;
  --text-4: #64748b;
  --text-5: #475569;
  
  /* ----- رنگ‌های کاربردی (آکسان) ----- */
  --c-exam: #3b82f6;
  --c-teacher: #a855f7;
  --c-robbery: #ef4444;
  --c-security: #10b981;
  --c-supervisor: #8b5cf6;
  --c-info: #06b6d4;
  
  /* ----- وضعیت‌ها ----- */
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;
  
  /* ----- سایه‌ها (تم روشن) ----- */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.15);
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.25);
  --shadow-gold-sm: 0 0 12px rgba(212, 175, 55, 0.15);
  
  /* ----- فاصله‌ها (border-radius) ----- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-3xl: 48px;
  --r-full: 9999px;
  
  /* ----- انیمیشن‌ها (timing functions) ----- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s var(--ease-out);
  --transition-slow: 0.5s var(--ease-out);
  
  /* ----- ابعاد و اندازه‌ها ----- */
  --header-height: 88px;
  --header-scrolled: 70px;
  --container-max: 1800px;
  
  /* ----- لایه‌ها (z-index) ----- */
  --z-bg: 0;
  --z-content: 2;
  --z-header: 100;
  --z-tabs: 199;
  --z-modal: 9999;
  --z-toast: 10000;
  --z-scanner: 10010;
  --z-loader: 99999;
}

/* ============================================ */
/* 2. DARK MODE VARIABLES (با کلاس dark-mode)  */
/* ============================================ */
body.dark-mode {
  /* ----- رنگ‌های اصلی طلایی (در دارک درخشان‌تر) ----- */
  --gold-base: #f5d878;
  --gold-bright: #ffe6b3;
  --gold-dark: #d4af37;
  --gold-darker: #b8941f;
  --gold-glow: rgba(245, 216, 120, 0.3);
  --gold-glow-strong: rgba(245, 216, 120, 0.55);
  --gold-dim: rgba(245, 216, 120, 0.1);
  --gold-border: rgba(245, 216, 120, 0.25);
  --gold-border-strong: rgba(245, 216, 120, 0.45);
  
  /* ----- رنگ‌های پس‌زمینه و کارت (تم تاریک) ----- */
  --bg-body: #0a0e1a;
  --bg-dark: #050814;
  --bg-darker: #020617;
  --bg-card: rgba(15, 23, 42, 0.85);
  --glass-bg: rgba(0, 0, 0, 0.45);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-light: rgba(255, 255, 255, 0.03);
  
  /* ----- رنگ‌های متن (تم تاریک) ----- */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;
  --text-dim: #64748b;
  
  /* ----- سایه‌ها (تم تاریک) ----- */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 0 25px rgba(245, 216, 120, 0.2);
  --shadow-gold-sm: 0 0 12px rgba(245, 216, 120, 0.12);
}

/* پایان پارت ۱ */
/* =====================================================================
   PART 2: RESET, BASE, TYPOGRAPHY, SCROLLBAR
   ===================================================================== */

/* ---------- Reset & Base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Vazirmatn', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.3s var(--ease-out), color 0.25s var(--ease-out);
}

/* ---------- Selection (انتخاب متن) ---------- */
::selection {
  background: var(--gold-dim);
  color: var(--gold-base);
}
::-moz-selection {
  background: var(--gold-dim);
  color: var(--gold-base);
}

/* ---------- Typography (تایپوگرافی) ---------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.5em;
  color: var(--text-main);
}

h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

a {
  color: var(--gold-base);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

/* ---------- Lists (لیست‌ها) ---------- */
ul, ol {
  padding-right: 1.5rem;
  margin-bottom: 1rem;
}
li {
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

/* ---------- Custom Scrollbar (اسکرول بار سفارشی) ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--glass-border);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--gold-base);
  border-radius: 10px;
  transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-bright);
}

/* اسکرول بار برای المان‌های دارای overflow-y: auto */
*::-webkit-scrollbar {
  width: 6px;
}
*::-webkit-scrollbar-track {
  background: var(--glass-border-light);
}
*::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--gold-base);
}

/* ---------- Utility Classes (کلاس‌های کمکی) ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-gold { color: var(--gold-base); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }

.bg-gold { background: var(--gold-dim); }
.bg-success { background: rgba(16, 185, 129, 0.1); }
.bg-danger { background: rgba(239, 68, 68, 0.1); }
.bg-warning { background: rgba(245, 158, 11, 0.1); }

/* فاصله‌ها (Margin & Padding) */
.m-0 { margin: 0; }
.m-1 { margin: 0.5rem; }
.m-2 { margin: 1rem; }
.m-3 { margin: 1.5rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mr-1 { margin-left: 0.5rem; }
.ml-1 { margin-right: 0.5rem; }
.p-0 { padding: 0; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* نمایش و مخفی کردن */
.hidden { display: none !important; }
.visible { display: block !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-column { display: flex; flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* حلقه (Spinner) ساده */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--gold-base);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Responsive adjustments ---------- */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  .container {
    padding: 0 1rem;
  }
}

/* پایان پارت ۲ */
/* =====================================================================
   PART 3: GLOBAL ANIMATIONS (KEYFRAMES & UTILITY CLASSES)
   ===================================================================== */

/* ---------- Fade & Slide Animations ---------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.92);
  }
}

/* ---------- Glow & Pulse Animations ---------- */
@keyframes glowPulse {
  0%, 100% {
    text-shadow: 0 0 5px var(--gold-glow);
    box-shadow: 0 0 5px var(--gold-glow);
  }
  50% {
    text-shadow: 0 0 20px var(--gold-glow-strong);
    box-shadow: 0 0 20px var(--gold-glow-strong);
  }
}

@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
  }
  50% {
    border-color: rgba(212, 175, 55, 0.8);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes pulseGreen {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

/* ---------- Loading & Shimmer ---------- */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes loaderFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* ---------- Ripple Effect ---------- */
@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ---------- Shake Effect (برای خطاهای اعتبارسنجی) ---------- */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* ---------- Rotate & Spin ---------- */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rotateSeal {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Typewriter (برای افکت تایپ) ---------- */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCaret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--gold-base);
  }
}

/* ---------- Cinematic Scanner (برای اسکنر بلک‌لیست) ---------- */
@keyframes scanLine {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

@keyframes scanGlow {
  0%, 100% {
    box-shadow: 0 0 10px var(--gold-glow);
  }
  50% {
    box-shadow: 0 0 30px var(--gold-glow-strong);
  }
}

/* ---------- Confetti (اختیاری برای ثبت موفق) ---------- */
@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* ============================================ */
/* ANIMATION UTILITY CLASSES (کلاس‌های کمکی)   */
/* ============================================ */

.fade-up {
  animation: fadeUp 0.5s var(--ease-out) both;
}
.fade-down {
  animation: fadeDown 0.5s var(--ease-out) both;
}
.fade-left {
  animation: fadeLeft 0.5s var(--ease-out) both;
}
.fade-right {
  animation: fadeRight 0.5s var(--ease-out) both;
}
.scale-in {
  animation: scaleIn 0.4s var(--ease-spring) both;
}
.glow-pulse {
  animation: glowPulse 2s infinite;
}
.border-glow {
  animation: borderGlow 2s infinite;
}
.pulse {
  animation: pulse 1.5s infinite;
}
.pulse-green {
  animation: pulseGreen 2s infinite;
}
.shake {
  animation: shake 0.3s ease-in-out;
}
.rotate-in {
  animation: rotateIn 0.4s var(--ease-spring) both;
}

/* Stagger animations for cards */
.stagger-item {
  opacity: 0;
  animation: fadeUp 0.4s var(--ease-out) forwards;
}
.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* پایان پارت ۳ */
/* =====================================================================
   PART 4: BUTTONS & INTERACTIONS (RIBBON, RIPPLE, SHIMMER, HOVER)
   ===================================================================== */

/* ---------- Base Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.8rem 1.8rem;
  border: none;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* Ripple Effect (موج کلیک) */
.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.4), transparent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
  pointer-events: none;
}
.btn:active::after {
  width: 200%;
  height: 200%;
}

/* Shine Effect (درخشش روی دکمه) */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}
.btn:hover::before {
  left: 100%;
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
  color: #0a0e27;
  border: none;
  box-shadow: var(--shadow-gold);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--gold-glow-strong);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--gold-border);
  color: var(--text-main);
}
.btn-secondary:hover {
  background: var(--gold-dim);
  border-color: var(--gold-base);
  transform: translateY(-2px);
}

.btn-gold {
  background: linear-gradient(145deg, var(--gold-base), var(--gold-dark));
  color: #0a0e27;
  font-weight: 800;
  box-shadow: 0 0 12px var(--gold-glow);
  border: none;
}
.btn-gold:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 20px var(--gold-bright);
}
.btn-gold:active {
  transform: translateY(-1px) scale(0.99);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  border: none;
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(16,185,129,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
  color: white;
  border: none;
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(239,68,68,0.3);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid currentColor;
  color: var(--gold-base);
}
.btn-outline:hover {
  background: var(--gold-dim);
  transform: translateY(-2px);
}

/* Button Sizes */
.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  gap: 0.4rem;
}
.btn-lg {
  padding: 1rem 2.2rem;
  font-size: 1rem;
  gap: 0.8rem;
}
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--r-full);
  justify-content: center;
}
.btn-icon-sm {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--r-full);
}

/* Loading State on Buttons */
.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}
.btn.loading .btn-text,
.btn.loading i:not(.spinner) {
  visibility: hidden;
}
.btn.loading .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Disabled State */
.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}

/* ---------- Add Button (برای افزودن قسط/فرد) ---------- */
.btn-add {
  background: rgba(16,185,129,0.1);
  border: 1.5px solid rgba(16,185,129,0.3);
  border-radius: var(--r-full);
  padding: 0.4rem 1rem;
  color: var(--success);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}
.btn-add:hover {
  background: rgba(16,185,129,0.2);
  transform: translateY(-2px);
}

/* ---------- Icon Button (برای حذف و عملیات) ---------- */
.btn-icon-sm {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.btn-icon-sm:hover {
  background: var(--gold-dim);
  border-color: var(--gold-base);
  color: var(--gold-base);
}

/* ---------- Link Button (شبیه لینک) ---------- */
.btn-link {
  background: transparent;
  border: none;
  color: var(--gold-base);
  padding: 0;
  font-weight: 600;
}
.btn-link:hover {
  text-decoration: underline;
  transform: none;
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 768px) {
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }
  .btn-sm {
    padding: 0.3rem 0.8rem;
  }
  .btn-icon {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  .btn-lg {
    padding: 0.7rem 1.5rem;
  }
}

/* پایان پارت ۴ */
/* =====================================================================
   PART 5: FORMS & INPUTS (فیلدها، چک‌باکس، رادیو، اعتبارسنجی)
   ===================================================================== */

/* ---------- Form Container ---------- */
.form-container {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-2xl);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all var(--transition-normal);
}
.form-container:hover {
  border-color: var(--gold-border);
  box-shadow: var(--shadow-md);
}

.form-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gold-border);
  flex-wrap: wrap;
}
.form-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--gold-dim), transparent);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--gold-base);
  border: 1px solid var(--gold-border);
}
.form-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-main), var(--gold-base));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.form-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Form Groups ---------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  position: relative;
}
.form-group label {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-group label i {
  color: var(--gold-base);
  width: 20px;
}
.required {
  color: var(--danger);
  margin-right: 0.25rem;
}
.input-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.input-hint i {
  color: var(--gold-base);
  font-size: 0.7rem;
}

/* ---------- Form Controls (Input, Select, Textarea) ---------- */
.form-control,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg-darker);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--r-lg);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}
.form-control:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold-base);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.form-control::placeholder,
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-dim);
  opacity: 0.7;
}
.form-group textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
  padding-left: 2.5rem;
  cursor: pointer;
}
body.dark-mode .form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
.form-group select option {
  background: var(--bg-dark);
  color: var(--text-main);
}

/* ---------- Floating Label ---------- */
.form-group.floating {
  position: relative;
}
.form-group.floating input,
.form-group.floating select,
.form-group.floating textarea {
  padding-top: 1.4rem;
}
.form-group.floating label {
  position: absolute;
  top: 0.7rem;
  right: 1rem;
  font-size: 0.75rem;
  color: var(--gold-base);
  pointer-events: none;
  transition: all var(--transition-fast);
  background: transparent;
  z-index: 1;
}
.form-group.floating input:placeholder-shown:not(:focus) + label,
.form-group.floating select:placeholder-shown:not(:focus) + label,
.form-group.floating textarea:placeholder-shown:not(:focus) + label {
  top: 0.9rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.form-group.floating input:focus + label,
.form-group.floating select:focus + label,
.form-group.floating textarea:focus + label {
  color: var(--gold-bright);
}

/* ---------- Form Row (دو ستونه) ---------- */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Checkbox & Radio (سفارشی) ---------- */
.checkbox-label,
.radio-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-main);
}
.checkbox-label input,
.radio-label input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold-base);
  cursor: pointer;
}
.checkbox-label.disabled,
.radio-label.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.checkbox-group,
.radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

/* Radio & Checkbox Cards (برای انتخاب نوع سند) */
.type-card {
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  text-align: center;
}
.type-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-base);
  box-shadow: var(--shadow-md);
}
.type-card input {
  display: none;
}
.type-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}
.type-content i {
  font-size: 1.8rem;
  color: var(--gold-base);
}
.type-card:has(input:checked) {
  border-color: var(--gold-base);
  background: var(--gold-dim);
  box-shadow: 0 0 15px var(--gold-glow);
}
.type-card:has(input:checked) .type-content {
  color: var(--text-main);
}
.type-card:has(input:checked) i {
  color: var(--gold-bright);
  text-shadow: 0 0 6px var(--gold-glow);
}

/* ---------- Validation States (اعتبارسنجی) ---------- */
.form-control.is-valid,
.form-group input.is-valid,
.form-group select.is-valid,
.form-group textarea.is-valid {
  border-color: var(--success);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.75rem center;
  padding-left: 2.2rem;
}
.form-control.is-invalid,
.form-group input.is-invalid,
.form-group select.is-invalid,
.form-group textarea.is-invalid {
  border-color: var(--danger);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.75rem center;
  padding-left: 2.2rem;
  animation: shake 0.3s ease-in-out;
}
.error-message {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.success-message {
  color: var(--success);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ---------- Date Input Wrapper (با دکمه تقویم) ---------- */
.date-input-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.date-input-wrap input {
  flex: 1;
}
.date-input-wrap .btn-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}

/* ---------- Range Slider (برای ساعت فعالیت) ---------- */
.range-slider {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.range-slider input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  background: var(--glass-border);
  border-radius: 10px;
  outline: none;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--gold-base);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}
.range-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.range-value {
  background: var(--gold-dim);
  padding: 0.3rem 0.8rem;
  border-radius: var(--r-full);
  font-weight: 700;
  color: var(--gold-base);
  font-size: 0.9rem;
  min-width: 60px;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .form-container {
    padding: 1.5rem;
  }
  .form-header {
    flex-direction: column;
    text-align: center;
  }
  .form-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
  .form-header h2 {
    font-size: 1.3rem;
  }
  .date-input-wrap {
    flex-direction: column;
  }
  .date-input-wrap .btn-icon {
    width: 100%;
  }
  .range-slider {
    flex-direction: column;
    align-items: stretch;
  }
  .range-value {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .form-container {
    padding: 1rem;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.7rem;
  }
}

/* پایان پارت ۵ */
/* =====================================================================
   PART 6: HEADER & TABS (سربرگ و تب‌ها)
   ===================================================================== */

/* ---------- Main Header ---------- */
.page-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--gold-border);
  height: var(--header-height);
  transition: height 0.3s var(--ease-out), background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}
.page-header.scrolled {
  height: var(--header-scrolled);
  background: rgba(5, 8, 20, 0.95);
  backdrop-filter: blur(25px) saturate(200%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
body.dark-mode .page-header.scrolled {
  background: rgba(2, 6, 20, 0.98);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.header-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

/* ---------- Logo ---------- */
.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}
.logo i {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #0a0e27;
  box-shadow: 0 8px 20px var(--shadow-gold);
  transition: transform 0.3s var(--ease-spring);
}
.logo i:hover {
  transform: scale(1.05) rotate(5deg);
}
.logo h1 {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-main);
}
.logo span {
  font-size: 0.7rem;
  color: var(--gold-base);
  letter-spacing: 2px;
  display: block;
}

/* ---------- Header Actions (دکمه‌ها و اطلاعات کاربر) ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.user-info {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.user-info i {
  color: var(--gold-base);
}
.btn-logout, .btn-home {
  background: transparent;
  border: 1px solid var(--gold-border);
  border-radius: var(--r-full);
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.btn-logout:hover, .btn-home:hover {
  border-color: var(--gold-base);
  color: var(--gold-base);
  transform: translateY(-2px);
}
.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- Tabs Container ---------- */
.tabs-container {
  position: sticky;
  top: var(--header-height);
  z-index: var(--z-tabs);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-border);
  transition: top 0.3s;
}
.page-header.scrolled + .tabs-container {
  top: var(--header-scrolled);
}
.tabs {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}

/* ---------- Tab Item ---------- */
.tab {
  padding: 0.9rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.tab i {
  font-size: 1rem;
  transition: transform 0.2s;
}
.tab:hover i {
  transform: translateY(-2px);
}
.tab:hover {
  color: var(--text-main);
}
.tab.active {
  color: var(--gold-base);
  border-bottom-color: var(--gold-base);
}
.tab.active i {
  color: var(--gold-base);
}
.tab::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--gold-base);
  transition: all 0.3s var(--ease-spring);
  transform: translateX(-50%);
  border-radius: 3px 3px 0 0;
}
.tab.active::after {
  width: 80%;
}
.tab:hover::after {
  width: 40%;
}

/* ---------- Tab Content ---------- */
.tab-content {
  display: none;
  animation: fadeUp 0.4s var(--ease-out);
}
.tab-content.active {
  display: block;
}

/* ---------- Responsive Header ---------- */
@media (max-width: 992px) {
  .header-container {
    padding: 0 1rem;
  }
  .logo i {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
  .logo h1 {
    font-size: 1rem;
  }
  .tab {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .page-header {
    height: auto;
  }
  .page-header.scrolled {
    height: auto;
  }
  .header-container {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
  }
  .tabs-container {
    top: auto;
  }
  .tabs {
    padding: 0 0.5rem;
  }
  .tab {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
  }
  .user-info {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
  }
  .btn-logout, .btn-home {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .header-actions {
    gap: 0.5rem;
  }
  .tab {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }
  .tab i {
    font-size: 0.8rem;
  }
}

/* پایان پارت ۶ */
/* =====================================================================
   PART 7: CONTAINERS, CARDS & GRIDS
   ===================================================================== */

/* ---------- Main Content Container ---------- */
.main-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: var(--z-content);
}
@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }
}
@media (max-width: 480px) {
  .main-content {
    padding: 0.8rem;
  }
}

/* ---------- Dual Panel Layout (برای ویزارد + پیش‌نمایش) ---------- */
.dual-panel-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media (max-width: 1200px) {
  .dual-panel-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ---------- Wizard Panel ---------- */
.wizard-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: var(--r-2xl);
  padding: 1.5rem;
  border: 1px solid var(--glass-border);
  transition: all var(--transition-normal);
}
.wizard-panel:hover {
  border-color: var(--gold-border);
  box-shadow: var(--shadow-md);
}

/* ---------- Preview Panel ---------- */
.preview-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: var(--r-2xl);
  display: flex;
  flex-direction: column;
  height: fit-content;
  position: sticky;
  top: 120px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: all var(--transition-normal);
}
.preview-panel:hover {
  border-color: var(--gold-border);
  box-shadow: var(--shadow-md);
}
@media (max-width: 1200px) {
  .preview-panel {
    position: static;
    margin-top: 1.5rem;
  }
}

/* ---------- Cards (کارت‌های عمومی) ---------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 1.2rem;
  transition: all var(--transition-fast);
}
.card:hover {
  border-color: var(--gold-border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ---------- Document Type Cards (کارت انتخاب نوع سند) ---------- */
.document-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.type-card {
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.type-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-base);
  box-shadow: var(--shadow-md);
}
.type-card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.type-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.type-content i {
  font-size: 1.8rem;
  color: var(--gold-base);
}
.type-card:has(input:checked) {
  border-color: var(--gold-base);
  background: var(--gold-dim);
  box-shadow: 0 0 15px var(--gold-glow);
}
.type-card:has(input:checked) .type-content {
  color: var(--text-main);
}
.type-card:has(input:checked) i {
  color: var(--gold-bright);
  text-shadow: 0 0 6px var(--gold-glow);
}

/* ---------- Document Cards (کارت اسناد در لیست) ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.doc-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
  position: relative;
  animation: fadeUp 0.4s var(--ease-out) both;
  animation-delay: calc(var(--card-index, 0) * 0.05s);
}
.doc-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold-base);
  box-shadow: var(--shadow-lg);
}
.doc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold-base), var(--gold-bright));
  opacity: 0;
  transition: opacity 0.3s;
}
.doc-card:hover::before {
  opacity: 1;
}
.doc-card-header {
  padding: 1rem 1.2rem;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.doc-code {
  font-family: monospace;
  font-weight: 800;
  color: var(--gold-base);
  background: var(--gold-dim);
  padding: 0.2rem 0.8rem;
  border-radius: var(--r-full);
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.doc-code i.fa-copy {
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s;
}
.doc-code i.fa-copy:hover {
  opacity: 1;
  color: var(--gold-bright);
  transform: scale(1.05);
}
.doc-badge {
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: var(--r-full);
  padding: 0.2rem 0.7rem;
  font-size: 0.7rem;
  color: var(--c-exam);
}
.doc-card-body {
  padding: 1rem;
}
.doc-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.8rem;
}
.doc-persons {
  background: rgba(0,0,0,0.15);
  border-radius: var(--r-md);
  padding: 0.5rem;
  margin: 0.5rem 0;
}
.doc-person-item {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.8rem;
  border-bottom: 1px dashed var(--glass-border);
}
.doc-person-item:last-child {
  border-bottom: none;
}
.doc-person-name {
  color: var(--gold-base);
  font-weight: 600;
}
.doc-person-phone {
  color: var(--text-dim);
  direction: ltr;
  font-family: monospace;
}
.doc-card-footer {
  padding: 0.8rem 1rem;
  background: rgba(0,0,0,0.1);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
}
.doc-creator i {
  color: var(--gold-base);
}
.doc-date {
  direction: ltr;
}
/* استایل برای stagger effect کارت‌ها */
.doc-card:nth-child(1) { --card-index: 1; }
.doc-card:nth-child(2) { --card-index: 2; }
.doc-card:nth-child(3) { --card-index: 3; }
.doc-card:nth-child(4) { --card-index: 4; }
.doc-card:nth-child(5) { --card-index: 5; }
.doc-card:nth-child(6) { --card-index: 6; }

/* ---------- Responsive Grids ---------- */
@media (max-width: 768px) {
  .doc-grid {
    grid-template-columns: 1fr;
  }
  .document-types {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
  .doc-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 480px) {
  .document-types {
    grid-template-columns: repeat(2, 1fr);
  }
  .type-content {
    padding: 0.7rem;
  }
  .type-content i {
    font-size: 1.2rem;
  }
  .type-content span {
    font-size: 0.75rem;
  }
}

/* پایان پارت ۷ */
/* =====================================================================
   PART 8: WIZARD & STEPS (مراحل ثبت سند)
   ===================================================================== */

/* ---------- Wizard Header ---------- */
.wizard-header {
  margin-bottom: 1.5rem;
}
.wizard-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.wizard-step-indicator {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.wizard-step-icon {
  width: 48px;
  height: 48px;
  background: var(--gold-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--gold-base);
  transition: all 0.2s;
}
.wizard-step-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
}
.wizard-step-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Quick Actions (دکمه‌های سریع ویزارد) ---------- */
.wizard-quick-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

/* ---------- Progress Bar ---------- */
.wizard-progress-wrap {
  width: 200px;
  height: 6px;
  background: var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
}
.wizard-progress-track {
  width: 100%;
  height: 100%;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-base), var(--gold-bright));
  width: 0%;
  transition: width 0.4s var(--ease-out);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ---------- Step Panels ---------- */
.step-panel {
  animation: fadeLeft 0.4s var(--ease-out);
}
.step-section-header {
  margin: 1.5rem 0 1rem;
}
.step-section-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}
.step-section-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.step-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 1.5rem 0;
}
.step-hint-box {
  background: var(--gold-dim);
  border-right: 3px solid var(--gold-base);
  border-radius: var(--r-md);
  padding: 0.8rem;
  margin: 1rem 0;
  display: flex;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 0.85rem;
}
.step-hint-box i {
  color: var(--gold-base);
  font-size: 1rem;
}

/* ---------- Step Circles (نشانگرهای مرحله) ---------- */
.form-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.form-steps::before {
  content: '';
  position: absolute;
  top: 25px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--glass-border);
  z-index: 0;
}
.step {
  flex: 1;
  text-align: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: all var(--transition-fast);
}
.step-circle {
  width: 50px;
  height: 50px;
  background: var(--bg-card);
  border: 2px solid var(--glass-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-normal);
}
.step.active .step-circle {
  background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
  border-color: transparent;
  color: #0a0e27;
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--gold-glow);
  animation: pulse 1.5s infinite;
}
.step.completed .step-circle {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success);
  color: var(--success);
}
.step.completed .step-circle i {
  font-size: 1.2rem;
}
.step-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.step.active .step-label,
.step.completed .step-label {
  color: var(--text-main);
}
@media (max-width: 768px) {
  .form-steps::before {
    top: 20px;
  }
  .step-circle {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
  .step-label {
    font-size: 0.65rem;
  }
}
@media (max-width: 480px) {
  .step-circle {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }
  .step-label {
    font-size: 0.6rem;
  }
}

/* ---------- Wizard Footer (دکمه‌های ناوبری) ---------- */
.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}
.wizard-footer-center {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 576px) {
  .wizard-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .wizard-footer-center {
    order: 2;
    justify-content: center;
  }
}

/* ---------- Party Role Badge (برچسب نقش طرفین) ---------- */
.party-role-badge {
  background: var(--gold-dim);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-base);
  margin-right: 0.5rem;
}

/* ---------- Auto Save Indicator (نشانگر ذخیره خودکار) ---------- */
.auto-save-indicator {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--success);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: var(--z-toast);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.auto-save-indicator i {
  font-size: 0.8rem;
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 768px) {
  .wizard-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .wizard-progress-wrap {
    width: 100%;
  }
  .wizard-step-indicator {
    width: 100%;
  }
  .wizard-quick-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* پایان پارت ۸ */
/* =====================================================================
   PART 9: LIVE PREVIEW PANEL & DOCUMENT PAPER STYLES
   ===================================================================== */

/* ---------- Preview Panel Header ---------- */
.preview-panel-header {
  padding: 1rem 1.2rem;
  background: var(--gold-dim);
  border-bottom: 1px solid var(--gold-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.preview-panel-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
}
.live-badge {
  background: var(--danger);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: white;
  animation: pulse 1.5s infinite;
}
.live-dot {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  display: inline-block;
}
.preview-panel-actions {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Preview Completeness (نشانگرهای تکمیل) ---------- */
.preview-completeness {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
}
.preview-comp-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.preview-section-badge {
  width: 20px;
  text-align: center;
}
.preview-section-badge.empty {
  color: var(--text-dim);
}
.preview-section-badge.filled {
  color: var(--success);
}
.preview-section-badge i {
  font-size: 0.8rem;
}

/* ---------- Preview Scroll Area ---------- */
.preview-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
  max-height: 60vh;
  scrollbar-width: thin;
}
.preview-scroll-area::-webkit-scrollbar {
  width: 6px;
}
.preview-scroll-area::-webkit-scrollbar-track {
  background: var(--glass-border-light);
  border-radius: 10px;
}
.preview-scroll-area::-webkit-scrollbar-thumb {
  background: var(--gold-dim);
  border-radius: 10px;
}
.preview-scroll-area::-webkit-scrollbar-thumb:hover {
  background: var(--gold-base);
}

/* ---------- Preview Panel Footer ---------- */
.preview-panel-footer {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
}
.preview-footer-note {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ============================================ */
/* DOCUMENT PAPER (استایل نمایش سند HTML)      */
/* ============================================ */
.doc-paper {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: 1rem;
  font-size: 0.85rem;
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}
.doc-paper:hover {
  border-color: var(--gold-border);
}

/* Document Header */
.doc-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  border-bottom: 2px solid var(--gold-border);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.doc-seal-mini svg {
  width: 60px;
  height: 60px;
}
.doc-header-text {
  flex: 1;
}
.doc-court-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gold-base);
}
.doc-court-sub {
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.doc-divider-gold {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-base), transparent);
  margin: 0.3rem 0;
}
.doc-type-badge {
  display: inline-block;
  background: var(--gold-dim);
  border-radius: var(--r-full);
  padding: 0.2rem 0.8rem;
  font-size: 0.7rem;
  color: var(--gold-base);
}

/* Document Meta Row */
.doc-meta-row {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.doc-meta-item {
  display: flex;
  gap: 0.3rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.doc-meta-label {
  font-weight: 700;
  color: var(--gold-base);
  font-size: 0.75rem;
}
.doc-meta-val {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-main);
}
.doc-meta-written {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Document Sections */
.doc-section {
  margin-bottom: 1rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 0.8rem;
  transition: all 0.2s;
}
.doc-section:hover {
  border-color: var(--gold-border);
  background: var(--gold-dim);
}
.doc-section-title {
  font-weight: 800;
  color: var(--gold-base);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.doc-num {
  background: var(--gold-dim);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.7rem;
  color: var(--gold-base);
}
.doc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.doc-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: baseline;
}
.doc-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.doc-val {
  color: var(--text-main);
  font-size: 0.85rem;
}
.doc-placeholder {
  color: var(--text-dim);
  font-style: italic;
}
.doc-desc {
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text-light);
}
.doc-field-block {
  margin-top: 0.5rem;
}
.doc-block-text {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  border-radius: var(--r-sm);
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.doc-section-warning {
  border-right: 3px solid var(--warning);
}
.doc-section-danger {
  border-right: 3px solid var(--danger);
}
.doc-witness-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
  border-radius: var(--r-md);
  margin-bottom: 0.5rem;
}

/* Document Legal & Signatures */
.doc-legal {
  margin-top: 1rem;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--r-md);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.doc-legal-title {
  font-weight: 800;
  margin-bottom: 0.3rem;
  color: var(--gold-base);
}
.doc-signatures {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--glass-border);
}
.doc-sig-box {
  text-align: center;
  width: 40%;
}
.doc-sig-line {
  width: 100%;
  height: 1px;
  background: var(--text-dim);
  margin-bottom: 0.3rem;
}
.doc-sig-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.doc-sig-seal svg {
  opacity: 0.4;
}
.doc-footer-stamp {
  text-align: center;
  font-size: 0.7rem;
  margin-top: 1rem;
  color: var(--text-dim);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .preview-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .preview-completeness {
    gap: 0.5rem;
  }
  .doc-grid-2 {
    grid-template-columns: 1fr;
  }
  .doc-header {
    flex-direction: column;
    text-align: center;
  }
  .doc-meta-row {
    flex-direction: column;
  }
  .doc-signatures {
    flex-direction: column;
    gap: 1rem;
  }
  .doc-sig-box {
    width: 100%;
  }
}

/* پایان پارت ۹ */
/* =====================================================================
   PART 10: INSTALLMENTS & PERSONS (اقساط و افراد مرتبط)
   ===================================================================== */

/* ---------- Installments Section ---------- */
.installments-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.installment-item {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
  align-items: center;
  background: var(--bg-darker);
  padding: 0.6rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}
.installment-item:hover {
  border-color: var(--gold-border);
  background: var(--gold-dim);
}
.installment-item input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  color: var(--text-main);
  font-family: inherit;
  transition: all var(--transition-fast);
}
.installment-item input:focus {
  outline: none;
  border-color: var(--gold-base);
  box-shadow: 0 0 0 2px var(--gold-dim);
}
.btn-remove-item {
  background: rgba(239, 68, 68, 0.15);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--danger);
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-remove-item:hover {
  background: var(--danger);
  color: white;
  transform: scale(1.05);
}
.empty-message {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-dim);
  font-style: italic;
  background: var(--glass-bg);
  border-radius: var(--r-lg);
  border: 1px dashed var(--glass-border);
}

/* ---------- Persons Section (افراد مرتبط) ---------- */
.persons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}
.person-card {
  flex: 1;
  min-width: 240px;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 1rem;
  transition: all var(--transition-fast);
  position: relative;
}
.person-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-sm);
}
.person-card input {
  width: 100%;
  margin-bottom: 0.6rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg-darker);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  color: var(--text-main);
  font-family: inherit;
  transition: all var(--transition-fast);
}
.person-card input:focus {
  outline: none;
  border-color: var(--gold-base);
  box-shadow: 0 0 0 2px var(--gold-dim);
}
.person-card input:last-of-type {
  margin-bottom: 0;
}
.btn-remove-person {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(239, 68, 68, 0.15);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--danger);
  transition: all 0.2s;
}
.btn-remove-person:hover {
  background: var(--danger);
  color: white;
  transform: scale(1.08);
}

/* ---------- Section Headers (برای بخش‌های اقساط و افراد) ---------- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.section-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold-base);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-header h3 i {
  font-size: 1.1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .installment-item {
    flex-direction: column;
    align-items: stretch;
  }
  .installment-item input {
    width: 100%;
  }
  .btn-remove-item {
    align-self: flex-end;
  }
  .persons-container {
    flex-direction: column;
  }
  .person-card {
    min-width: 100%;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 480px) {
  .installment-item {
    padding: 0.5rem;
  }
  .person-card {
    padding: 0.8rem;
  }
  .btn-remove-person {
    top: 0.4rem;
    left: 0.4rem;
    width: 24px;
    height: 24px;
  }
}

/* پایان پارت ۱۰ */
/* =====================================================================
   PART 11: SEARCH, FILTERS & PAGINATION
   ===================================================================== */

/* ---------- Search Bar ---------- */
.doc-search-bar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-radius: var(--r-2xl);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--glass-border);
  transition: all var(--transition-fast);
}
.doc-search-bar:hover {
  border-color: var(--gold-border);
  box-shadow: var(--shadow-sm);
}

/* Search Wrapper (آیکون و ورودی) */
.doc-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.doc-search-wrapper i {
  position: absolute;
  right: 1rem;
  color: var(--gold-base);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}
.doc-search-wrapper input {
  width: 100%;
  padding: 0.8rem 2.5rem 0.8rem 1rem;
  background: var(--bg-darker);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.doc-search-wrapper input:focus {
  outline: none;
  border-color: var(--gold-base);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.doc-search-wrapper input::placeholder {
  color: var(--text-dim);
  opacity: 0.7;
}

/* Clear Search Button */
.doc-search-clear {
  position: absolute;
  left: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.doc-search-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  transform: scale(1.05);
}

/* ---------- Filters (Chips) ---------- */
.doc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.doc-filter-chip {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  padding: 0.4rem 1.2rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.doc-filter-chip i {
  font-size: 0.7rem;
}
.doc-filter-chip:hover {
  border-color: var(--gold-base);
  color: var(--gold-base);
  transform: translateY(-2px);
}
.doc-filter-chip.active {
  background: var(--gold-dim);
  border-color: var(--gold-base);
  color: var(--gold-base);
  font-weight: 600;
  box-shadow: var(--shadow-gold-sm);
}

/* ---------- Stats Bar ---------- */
.doc-stats-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--glass-border);
}
.doc-stats-total {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.doc-stats-total strong {
  color: var(--gold-base);
  font-size: 1.2rem;
  margin: 0 0.2rem;
}
.doc-refresh-btn {
  background: transparent;
  border: 1px solid var(--gold-border);
  border-radius: var(--r-full);
  padding: 0.3rem 1rem;
  color: var(--gold-base);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}
.doc-refresh-btn:hover {
  background: var(--gold-dim);
  transform: rotate(15deg);
}

/* ---------- Pagination ---------- */
.doc-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}
.doc-pagination-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 0.4rem 0.8rem;
  min-width: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.doc-pagination-btn:hover:not(:disabled) {
  background: var(--gold-dim);
  border-color: var(--gold-base);
  color: var(--gold-base);
  transform: translateY(-2px);
}
.doc-pagination-btn.active {
  background: var(--gold-base);
  border-color: var(--gold-base);
  color: #0a0e27;
  font-weight: 800;
  box-shadow: 0 0 8px var(--gold-glow);
}
.doc-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.doc-pagination-ellipsis {
  color: var(--text-dim);
  padding: 0 0.3rem;
  font-size: 0.9rem;
}

/* ---------- Empty State (حالت خالی) ---------- */
.doc-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px dashed var(--gold-border);
  margin: 2rem 0;
}
.doc-empty-state i {
  font-size: 3rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  opacity: 0.5;
}
.doc-empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.doc-empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Skeleton Loading ---------- */
.doc-skeleton {
  background: linear-gradient(110deg, var(--glass-border) 8%, var(--glass-bg) 18%, var(--glass-border) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--r-xl);
  height: 280px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .doc-search-bar {
    padding: 1rem;
  }
  .doc-stats-bar {
    flex-direction: column;
    text-align: center;
  }
  .doc-pagination {
    gap: 0.3rem;
  }
  .doc-pagination-btn {
    padding: 0.3rem 0.6rem;
    min-width: 34px;
    font-size: 0.75rem;
  }
  .doc-filters {
    gap: 0.4rem;
  }
  .doc-filter-chip {
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
  }
}
@media (max-width: 480px) {
  .doc-pagination-btn {
    min-width: 30px;
    padding: 0.2rem 0.5rem;
  }
  .doc-empty-state {
    padding: 2rem 1rem;
  }
  .doc-empty-state i {
    font-size: 2.5rem;
  }
}

/* پایان پارت ۱۱ */
/* =====================================================================
   PART 12: MODALS & TOASTS
   ===================================================================== */

/* ---------- General Modal (برای مدیریت فولدر و غیره) ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(2, 6, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[style*="display: flex"] {
  display: flex !important;
  animation: fadeIn 0.25s ease;
}
.modal-content {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-3xl);
  max-width: 900px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.35s var(--ease-spring);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gold-border);
  background: var(--gold-dim);
  position: sticky;
  top: 0;
  z-index: 1;
}
.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}
.modal-close {
  width: 40px;
  height: 40px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  font-size: 1.2rem;
}
.modal-close:hover {
  background: var(--danger);
  color: white;
  transform: rotate(90deg);
}
.modal-body {
  padding: 1.5rem;
  color: var(--text-main);
}

/* ---------- Confirm Modal (مودال تأیید عمومی) ---------- */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 1);
  background: rgba(2, 6, 15, 0.8);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.confirm-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.confirm-modal {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 2px solid var(--gold-border);
  border-radius: var(--r-3xl);
  max-width: 500px;
  width: 90%;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-spring);
  overflow: hidden;
}
.confirm-modal-overlay.active .confirm-modal {
  transform: scale(1);
}
.confirm-modal-header {
  padding: 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
}
.confirm-modal-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1rem;
  background: var(--gold-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--gold-base);
}
.confirm-modal-icon.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}
.confirm-modal-icon.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.confirm-modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
}
.confirm-modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}
.confirm-modal-body {
  padding: 0 1.5rem 1.5rem;
}
.summary-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--r-lg);
  padding: 1rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--glass-border);
}
.summary-row:last-child {
  border-bottom: none;
}
.summary-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.summary-value {
  color: var(--text-main);
  font-weight: 700;
}
.confirm-modal-footer {
  padding: 1rem 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  border-top: 1px solid var(--glass-border);
}
.confirm-btn {
  flex: 1;
  padding: 0.7rem;
  border-radius: var(--r-full);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}
.confirm-btn-primary {
  background: linear-gradient(135deg, var(--gold-base), var(--gold-dark));
  color: #0a0e27;
}
.confirm-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}
.confirm-btn-secondary {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}
.confirm-btn-secondary:hover {
  background: var(--gold-dim);
  border-color: var(--gold-base);
}
.confirm-btn-danger {
  background: var(--danger);
  color: white;
}
.confirm-btn-danger:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* ---------- Toasts (اعلان‌های موقت) ---------- */
.toasts {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-right: 4px solid;
  border-radius: var(--r-xl);
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
  transform: translateX(-120%);
  transition: transform 0.4s var(--ease-bounce);
  max-width: 400px;
  min-width: 280px;
}
.toast.show {
  transform: translateX(0);
}
.toast.hiding {
  transform: translateX(-120%);
  transition: transform 0.3s ease-in;
}
.toast-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: currentColor;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.toast-content {
  flex: 1;
}
.toast-content h4 {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  color: var(--text-main);
}
.toast-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}
.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.toast-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--danger);
}
.toast.success {
  border-right-color: var(--success);
}
.toast.error {
  border-right-color: var(--danger);
}
.toast.warning {
  border-right-color: var(--warning);
}
.toast.info {
  border-right-color: var(--info);
}

/* ---------- Loading Overlay (همپوشان بارگذاری) ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
}
.loading-overlay.active {
  display: flex;
}
.loading-spinner {
  text-align: center;
}
.loading-spinner i {
  font-size: 2.5rem;
  color: var(--gold-base);
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}
.loading-spinner p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ---------- Gallery inside Modal (گالری فایل‌ها) ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.gallery-item {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 0.5rem;
  text-align: center;
  transition: all 0.2s;
}
.gallery-item:hover {
  transform: translateY(-3px);
  border-color: var(--gold-border);
}
.gallery-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.gallery-item i {
  font-size: 2.5rem;
  color: var(--gold-base);
}
.gallery-item a {
  display: block;
  margin-top: 0.5rem;
  color: var(--c-exam);
  text-decoration: none;
  word-break: break-word;
  font-size: 0.8rem;
}
.gallery-item a:hover {
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
  }
  .confirm-modal {
    width: 95%;
  }
  .toast {
    min-width: auto;
    width: calc(100vw - 2rem);
    max-width: none;
  }
  .toasts {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}
@media (max-width: 480px) {
  .modal-header h3 {
    font-size: 1.1rem;
  }
  .confirm-modal-title {
    font-size: 1.1rem;
  }
  .summary-row {
    flex-direction: column;
    gap: 0.3rem;
  }
  .gallery-item img {
    height: 80px;
  }
}

/* پایان پارت ۱۲ */
/* =====================================================================
   PART 13: BLACKLIST MODAL & FAQ MODAL
   ===================================================================== */

/* ============================================ */
/* BLACKLIST MODAL - ULTIMATE PROFESSIONAL EDITION */
/* ============================================ */

/* ----- Overlay با افکت تاری پیشرفته ----- */
.blacklist-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backdrop-filter: blur(28px) saturate(100%);
  z-index: calc(var(--z-modal) + 2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1), visibility 0.4s;
}
.blacklist-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ----- کانتینر اصلی مودال ----- */
.blacklist-modal {
  position: relative;
  max-width: 610px;
  width: 90%;
  background: linear-gradient(145deg, var(--bg-card), rgba(10, 15, 30, 0.98));
  backdrop-filter: blur(24px);
  border-radius: 32px;
  border: 1px solid var(--gold-border-strong);
  box-shadow: 0 35px 65px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.2) inset;
  padding: 2rem 2rem 1.8rem;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.45s cubic-bezier(0.21, 1.11, 0.35, 1);
}
.blacklist-modal-overlay.active .blacklist-modal {
  transform: scale(1) translateY(0);
}

/* خط بالایی طلایی */
.blacklist-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-base), var(--gold-bright), var(--gold-base), transparent);
  border-radius: 3px;
  z-index: 2;
}

/* آیکون */
.blacklist-modal-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
  background: rgba(212, 175, 55, 0.08);
  border: 2px solid var(--gold-border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--warning);
  transition: all 0.3s;
  animation: pulse 2s infinite;
}
.blacklist-modal-icon i {
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.4));
}

/* عنوان */
.blacklist-modal-title {
  font-size: 1.7rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-0);
  margin-bottom: 0.75rem;
  letter-spacing: -0.2px;
  border-bottom: 1px solid var(--gold-border);
  display: inline-block;
  width: auto;
  padding-bottom: 0.5rem;
  margin-left: auto;
  margin-right: auto;
}

/* متن پیام */
.blacklist-modal-message {
  text-align: center;
  color: var(--text-light);
  line-height: 1.65;
  margin-bottom: 1.6rem;
  font-size: 1rem;
  font-weight: 500;
}
.blacklist-modal-message strong {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.12);
  padding: 0.2rem 0.8rem;
  border-radius: 24px;
}

/* باکس جزئیات */
.blacklist-details {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 24px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.8rem;
  text-align: right;
  font-size: 0.9rem;
  border: 1px solid var(--gold-border);
  transition: all 0.25s;
}
.blacklist-details:hover {
  border-color: var(--gold-base);
  background: rgba(0, 0, 0, 0.45);
}
.blacklist-details p {
  margin: 0.6rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.blacklist-details strong {
  color: var(--gold-base);
  min-width: 95px;
  font-weight: 700;
}
.text-danger {
  color: var(--danger) !important;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

/* دکمه‌ها */
.blacklist-modal-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.25rem;
}
.blacklist-btn {
  flex: 1;
  min-width: 150px;
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  backdrop-filter: blur(4px);
  position: relative;
  overflow: hidden;
}
.blacklist-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.blacklist-btn:hover::after {
  opacity: 1;
}
.blacklist-btn.cash {
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: white;
  box-shadow: 0 6px 14px rgba(13, 148, 136, 0.3);
}
.blacklist-btn.cash:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #0d9488, #14b8a6);
  box-shadow: 0 10px 22px rgba(13, 148, 136, 0.45);
}
.blacklist-btn.understand {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: white;
  opacity: 0.5;
  pointer-events: none;
}
.blacklist-btn.understand.enabled {
  opacity: 1;
  pointer-events: auto;
}
.blacklist-btn.understand.enabled:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 8px 18px rgba(217, 119, 6, 0.4);
}
.blacklist-btn.details {
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: white;
}
.blacklist-btn.details:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.4);
}
.blacklist-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
#understandTimer {
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 32px;
  margin-right: 0.2rem;
}

/* ============================================ */
/* FAQ MODAL (سوالات متداول)                    */
/* ============================================ */
.faq-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 3);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.faq-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.faq-modal {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 2px solid var(--gold-border);
  border-radius: var(--r-3xl);
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.35s var(--ease-spring);
}
.faq-modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--gold-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gold-dim);
}
.faq-modal-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold-base);
}
.faq-search {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}
.faq-search input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-darker);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  color: var(--text-main);
  font-size: 0.9rem;
}
.faq-search input:focus {
  outline: none;
  border-color: var(--gold-base);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.faq-categories {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--glass-border);
}
.faq-cat-btn {
  background: var(--glass-bg);
  border: none;
  padding: 0.4rem 1rem;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.faq-cat-btn.active {
  background: var(--gold-base);
  color: #0a0e27;
  font-weight: 600;
}
.faq-cat-btn:hover:not(.active) {
  background: var(--gold-dim);
  color: var(--gold-base);
}
.faq-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}
.faq-item-modal {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  margin-bottom: 1rem;
  transition: all 0.2s;
}
.faq-item-modal:hover {
  border-color: var(--gold-border);
}
.faq-question-modal {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-main);
}
.faq-question-modal i:first-child {
  color: var(--gold-base);
  margin-left: 0.5rem;
}
.faq-question-modal i:last-child {
  transition: transform 0.3s;
  color: var(--text-muted);
}
.faq-item-modal.active .faq-question-modal i:last-child {
  transform: rotate(180deg);
}
.faq-answer-modal {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease-out);
  padding: 0 1rem;
  color: var(--text-muted);
  border-top: 1px solid transparent;
  font-size: 0.9rem;
  line-height: 1.7;
}
.faq-item-modal.active .faq-answer-modal {
  max-height: 300px;
  padding: 0.8rem 1rem;
  border-top-color: var(--glass-border);
}
.faq-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .blacklist-modal {
    padding: 1.5rem;
    width: 92%;
    border-radius: 28px;
  }
  .blacklist-modal-title {
    font-size: 1.3rem;
  }
  .blacklist-modal-icon {
    width: 70px;
    height: 70px;
    font-size: 2.2rem;
  }
  .blacklist-modal-buttons {
    flex-direction: column;
  }
  .blacklist-btn {
    width: 100%;
    min-width: auto;
  }
  .faq-modal {
    width: 95%;
    max-height: 90vh;
  }
  .faq-modal-header h3 {
    font-size: 1.2rem;
  }
  .faq-categories {
    gap: 0.3rem;
  }
  .faq-cat-btn {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
  }
}
@media (max-width: 480px) {
  .blacklist-details p {
    flex-direction: column;
    gap: 0.3rem;
  }
  .faq-question-modal {
    font-size: 0.9rem;
  }
}

/* پایان پارت ۱۳ */
/* =====================================================================
   PART 14: CINEMATIC SCANNER & ADVANCED ANIMATIONS
   ===================================================================== */

/* ============================================ */
/* CINEMATIC BLACKLIST SCANNER (اسکنر سینمایی) */
/* ============================================ */
.scanner-overlay {
  position: fixed;
  inset: 0;
  backdrop-filter: blur(24px) saturate(100%);
  z-index: var(--z-scanner);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1), visibility 0.4s;
}
.scanner-overlay.active {
  opacity: 1;
  visibility: visible;
}
.scanner-card {
  background: linear-gradient(145deg, rgba(15, 25, 45, 0.98), rgba(5, 10, 25, 0.98));
  border-radius: 48px;
  border: 1px solid var(--gold-border-strong);
  padding: 2rem 2rem 1.8rem;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 175, 55, 0.2) inset, 0 0 30px var(--gold-glow);
  transform: scale(0.95);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.2);
}
.scanner-overlay.active .scanner-card {
  transform: scale(1);
}
.scanner-header {
  text-align: center;
  margin-bottom: 1.8rem;
}
.scanner-header i {
  font-size: 2.8rem;
  color: var(--gold-base);
  animation: pulse 1.5s infinite, glowPulse 2s infinite;
  display: inline-block;
}
.scanner-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-0);
  margin-top: 0.6rem;
  letter-spacing: -0.3px;
}
.scanner-steps {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}
.scanner-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 60px;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(212, 175, 55, 0.2);
  transition: all 0.3s;
}
.scanner-step.active {
  border-color: var(--gold-base);
  box-shadow: 0 0 15px var(--gold-glow);
  background: rgba(212, 175, 55, 0.08);
}
.scanner-step-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 0.2s;
}
.scanner-step.active .scanner-step-icon {
  background: var(--gold-base);
  color: #0a0e27;
  box-shadow: 0 0 12px var(--gold-glow);
}
.scanner-step-text {
  flex: 1;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.95rem;
}
.scanner-step-status {
  width: 28px;
  text-align: center;
}
.scanner-step-status i {
  font-size: 1.1rem;
}
.scanner-footer {
  text-align: center;
  margin-top: 1.2rem;
}
.scanner-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1rem;
}
.scanner-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-base), var(--gold-bright), var(--gold-base));
  background-size: 200% 100%;
  transition: width 0.5s var(--ease-out);
  animation: shimmer 1.2s infinite;
}

/* ============================================ */
/* PROGRESS LOADER (برای بررسی لیست سیاه)       */
/* ============================================ */
.blacklist-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  z-index: calc(var(--z-scanner) + 1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
}
.blacklist-progress.active {
  opacity: 1;
  visibility: visible;
}
.progress-content {
  text-align: center;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  padding: 2rem;
  border-radius: 40px;
  border: 1px solid var(--gold-border);
  min-width: 280px;
  box-shadow: var(--shadow-xl);
}
.progress-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--gold-base);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.progress-text {
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}
.progress-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================ */
/* CONFETTI & SPECIAL EFFECTS (اختیاری)       */
/* ============================================ */
.confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: calc(var(--z-modal) + 10);
}
.confetti-piece {
  position: absolute;
  width: 10px;
  height: 20px;
  background: linear-gradient(135deg, var(--gold-base), var(--gold-bright));
  opacity: 0.8;
  animation: confettiFall 3s ease-out forwards;
}
@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Glow Text Effect */
.glow-text {
  animation: glowPulse 2s infinite;
  display: inline-block;
}

/* Scanning Line Effect (برای افکت اسکن) */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-base), transparent);
  animation: scanLine 2s linear infinite;
  pointer-events: none;
}
@keyframes scanLine {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100vh);
  }
}

/* ============================================ */
/* ADVANCED STAGGER ANIMATIONS FOR CARDS       */
/* ============================================ */
.stagger-fade-up > * {
  opacity: 0;
  animation: fadeUp 0.5s var(--ease-out) forwards;
}
.stagger-fade-up > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-fade-up > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-fade-up > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-fade-up > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-fade-up > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-fade-up > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-fade-up > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-fade-up > *:nth-child(8) { animation-delay: 0.4s; }

/* Hover Glow Effect for Cards */
.card-hover-glow {
  transition: all 0.3s var(--ease-out);
}
.card-hover-glow:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--gold-base) inset;
  border-color: var(--gold-base);
}

/* ============================================ */
/* RESPONSIVE SCANNER                          */
/* ============================================ */
@media (max-width: 640px) {
  .scanner-card {
    padding: 1.5rem;
    border-radius: 36px;
  }
  .scanner-title {
    font-size: 1.2rem;
  }
  .scanner-step {
    padding: 0.6rem 0.8rem;
    gap: 0.6rem;
  }
  .scanner-step-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  .scanner-step-text {
    font-size: 0.85rem;
  }
  .progress-content {
    padding: 1.5rem;
    min-width: 240px;
  }
}
@media (max-width: 480px) {
  .scanner-card {
    width: 95%;
    padding: 1.2rem;
  }
  .scanner-header i {
    font-size: 2rem;
  }
  .scanner-title {
    font-size: 1rem;
  }
}

/* پایان پارت ۱۴ */
/* =====================================================================
   PART 15: BLACKLIST TABLE & TEMPLATES MANAGEMENT
   ===================================================================== */

/* ---------- Blacklist Table (جدول لیست سیاه) ---------- */
.blacklist-table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: var(--r-xl);
}
.cases-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cases-table th {
  background: var(--gold-dim);
  color: var(--gold-base);
  padding: 1rem;
  font-weight: 800;
  text-align: right;
  border-bottom: 2px solid var(--gold-border);
  font-size: 0.9rem;
}
.cases-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-muted);
  vertical-align: middle;
  font-size: 0.85rem;
}
.cases-table tr:hover td {
  background: var(--gold-dim);
}
.cases-table tr:last-child td {
  border-bottom: none;
}
/* وضعیت‌های خاص در جدول */
.badge-status-archived {
  background: rgba(100, 116, 139, 0.2);
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  color: var(--text-dim);
  display: inline-block;
}
/* دکمه عملیات در جدول (حذف) */
.cases-table .btn-icon {
  background: rgba(239, 68, 68, 0.15);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--danger);
  transition: all 0.2s;
}
.cases-table .btn-icon:hover {
  background: var(--danger);
  color: white;
  transform: scale(1.05);
}

/* ---------- Empty State for Blacklist ---------- */
.empty-state {
  text-align: center;
  padding: 3rem;
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px dashed var(--gold-border);
}
.empty-state i {
  font-size: 3rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

/* ---------- Templates Management (مدیریت قالب‌ها) ---------- */
.template-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.2s;
  background: var(--bg-card);
  border-radius: var(--r-md);
  margin-bottom: 0.5rem;
}
.template-item:hover {
  background: var(--gold-dim);
  transform: translateX(-3px);
}
.template-item span {
  font-weight: 500;
  color: var(--text-main);
}
.template-actions {
  display: flex;
  gap: 0.5rem;
}
.template-actions button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.2s;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.template-actions button:hover {
  background: var(--gold-dim);
  color: var(--gold-base);
  transform: translateY(-2px);
}
.template-actions button:last-child:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Templates Modal List (لیست قالب‌ها در مودال) */
.templates-list-modal {
  max-height: 300px;
  overflow-y: auto;
}
.template-item-modal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--r-md);
}
.template-item-modal:hover {
  background: var(--gold-dim);
}
.template-item-modal div {
  flex: 1;
  font-weight: 500;
}
.template-item-modal .btn-sm {
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
}

/* ---------- Recent Documents List (تاریخچه اسناد) ---------- */
.recent-docs-list {
  max-height: 300px;
  overflow-y: auto;
}
.recent-doc-item {
  padding: 0.6rem;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--r-md);
}
.recent-doc-item:hover {
  background: var(--gold-dim);
  transform: translateX(-5px);
}
.recent-doc-item strong {
  color: var(--gold-base);
  font-family: monospace;
}
.recent-doc-item small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* ---------- Drafts List (لیست پیش‌نویس‌ها) ---------- */
.drafts-list {
  max-height: 300px;
  overflow-y: auto;
}
.draft-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--r-md);
}
.draft-item:hover {
  background: var(--gold-dim);
}
.draft-item strong {
  color: var(--gold-base);
}
.draft-item small {
  font-size: 0.7rem;
  color: var(--text-dim);
}
.draft-item .btn-icon-sm {
  margin-right: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--r-sm);
}
.draft-item .btn-icon-sm:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .cases-table th,
  .cases-table td {
    padding: 0.6rem;
    font-size: 0.75rem;
  }
  .cases-table .btn-icon {
    width: 28px;
    height: 28px;
  }
  .template-item {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .template-actions {
    margin-right: auto;
  }
}
@media (max-width: 480px) {
  .cases-table {
    font-size: 0.7rem;
  }
  .cases-table th,
  .cases-table td {
    padding: 0.4rem;
  }
  .empty-state {
    padding: 2rem;
  }
}

/* پایان پارت ۱۵ */
/* =====================================================================
   PART 16: FINAL RESPONSIVE & PRINT STYLES
   ===================================================================== */

/* ============================================ */
/* 1. RESPONSIVE BREAKPOINTS (نهایی)           */
/* ============================================ */

/* 1400px - لپ‌تاپ بزرگ */
@media (max-width: 1400px) {
  .container, .main-content {
    padding: 1.5rem;
  }
  .doc-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* 1200px - لپ‌تاپ معمولی */
@media (max-width: 1200px) {
  .dual-panel-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .preview-panel {
    position: static;
    margin-top: 1.5rem;
  }
  .wizard-progress-wrap {
    width: 160px;
  }
}

/* 992px - تبلت افقی */
@media (max-width: 992px) {
  .header-container {
    padding: 0 1rem;
  }
  .logo i {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
  .logo h1 {
    font-size: 1rem;
  }
  .tabs {
    padding: 0 1rem;
  }
  .tab {
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
  }
  .form-container {
    padding: 1.5rem;
  }
  .form-header {
    flex-direction: column;
    text-align: center;
  }
  .form-icon {
    width: 65px;
    height: 65px;
    font-size: 1.6rem;
  }
  .form-header h2 {
    font-size: 1.4rem;
  }
  .wizard-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .wizard-quick-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .document-types {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* 768px - تبلت عمودی */
@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
  }
  .page-header {
    height: auto;
  }
  .header-container {
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.8rem;
  }
  .tabs-container {
    top: auto;
  }
  .tab {
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
  }
  .tab i {
    font-size: 0.9rem;
  }
  .form-container {
    padding: 1rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .doc-grid {
    grid-template-columns: 1fr;
  }
  .preview-scroll-area {
    max-height: 50vh;
  }
  .step-circle {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }
  .step-label {
    font-size: 0.65rem;
  }
  .wizard-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .wizard-footer-center {
    order: 2;
    justify-content: center;
  }
  .preview-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .preview-completeness {
    gap: 0.5rem;
  }
  .doc-stats-bar {
    flex-direction: column;
    text-align: center;
  }
  .doc-pagination {
    gap: 0.3rem;
  }
  .doc-pagination-btn {
    padding: 0.3rem 0.6rem;
    min-width: 34px;
    font-size: 0.75rem;
  }
  .cases-table th,
  .cases-table td {
    padding: 0.5rem;
    font-size: 0.75rem;
  }
  .modal-content {
    max-width: 95%;
  }
  .toasts {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
  .toast {
    width: calc(100% - 2rem);
    max-width: none;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* 576px - موبایل بزرگ */
@media (max-width: 576px) {
  .logo i {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .logo h1 {
    font-size: 0.9rem;
  }
  .logo span {
    font-size: 0.6rem;
  }
  .user-info {
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
  }
  .btn-logout, .btn-home {
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
  }
  .tab {
    padding: 0.4rem 0.6rem;
    font-size: 0.7rem;
  }
  .tab i {
    font-size: 0.8rem;
  }
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .person-card {
    min-width: 100%;
  }
  .installment-item {
    flex-direction: column;
  }
  .installment-item input {
    width: 100%;
  }
  .btn-remove-item {
    align-self: flex-end;
  }
  .doc-code {
    font-size: 0.8rem;
  }
  .doc-person-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }
  .cases-table .btn-icon {
    width: 28px;
    height: 28px;
  }
  .blacklist-modal {
    padding: 1.2rem;
  }
  .blacklist-modal-title {
    font-size: 1.2rem;
  }
  .faq-modal-header h3 {
    font-size: 1rem;
  }
}

/* 480px - موبایل کوچک */
@media (max-width: 480px) {
  .main-content {
    padding: 0.8rem;
  }
  .form-header h2 {
    font-size: 1.1rem;
  }
  .document-types {
    grid-template-columns: repeat(2, 1fr);
  }
  .type-content {
    padding: 0.6rem;
  }
  .type-content i {
    font-size: 1.2rem;
  }
  .type-content span {
    font-size: 0.7rem;
  }
  .wizard-footer-center {
    flex-wrap: wrap;
  }
  .doc-search-wrapper input {
    font-size: 0.85rem;
    padding: 0.6rem 2rem;
  }
  .doc-filter-chip {
    padding: 0.3rem 0.6rem;
    font-size: 0.65rem;
  }
  .confirm-modal-footer {
    flex-direction: column;
  }
  .confirm-btn {
    width: 100%;
  }
  .blacklist-modal-buttons {
    flex-direction: column;
  }
  .blacklist-btn {
    width: 100%;
  }
  .scanner-card {
    padding: 1rem;
  }
  .scanner-step {
    gap: 0.5rem;
    padding: 0.5rem;
  }
  .scanner-step-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
}

/* ============================================ */
/* 2. PRINT STYLES (استایل چاپ)                */
/* ============================================ */
@media print {
  /* حذف المان‌های غیرضروری */
  .animated-bg,
  .grain-overlay,
  .page-header,
  .tabs-container,
  .doc-search-bar,
  .doc-filters,
  .doc-stats-bar,
  .doc-pagination,
  .btn,
  .btn-icon,
  .btn-sm,
  .btn-icon-sm,
  .loading-overlay,
  #globalLoader,
  .toasts,
  .confirm-modal-overlay,
  .blacklist-modal-overlay,
  .faq-modal-overlay,
  .scanner-overlay,
  .modal,
  .wizard-footer,
  .preview-panel-header,
  .preview-panel-footer,
  .preview-completeness,
  .header-actions,
  .wizard-progress-wrap,
  .section-header .btn-add,
  .theme-toggle,
  .back-to-top,
  .form-progress-wrapper,
  .form-navigation {
    display: none !important;
  }

  /* تنظیمات پایه صفحه چاپ */
  body {
    background: white;
    color: black;
    padding: 0;
    margin: 0;
    font-size: 12pt;
  }

  .main-content {
    padding: 0;
    margin: 0;
    max-width: 100%;
  }

  /* نمایش همه تب‌ها و محتواها */
  .tab-content {
    display: block !important;
    page-break-inside: avoid;
  }

  .form-container,
  .wizard-panel,
  .preview-panel {
    background: white;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  /* استایل سند چاپی */
  .doc-paper {
    background: white;
    color: black;
    border: 1px solid #ccc;
    padding: 1rem;
    box-shadow: none;
    margin-bottom: 1rem;
  }

  .doc-paper .doc-court-title,
  .doc-paper .doc-meta-label,
  .doc-paper .doc-section-title {
    color: #333;
  }

  .doc-paper .doc-val,
  .doc-paper .doc-label {
    color: #000;
  }

  .doc-placeholder {
    color: #999;
  }

  .doc-section {
    border: 1px solid #ddd;
    margin-bottom: 0.8rem;
  }

  .doc-signatures {
    margin-top: 2rem;
  }

  .doc-sig-line {
    background: #000;
  }

  .doc-footer-stamp {
    color: #666;
  }

  /* جلوگیری از بریدگی محتوا */
  .step-panel {
    page-break-inside: avoid;
  }

  /* لینک‌ها */
  a {
    text-decoration: none;
    color: black;
  }
}

/* ============================================ */
/* 3. FINAL UTILITIES & ACCESSIBILITY          */
/* ============================================ */

/* کاهش حرکت برای کاربرانی که motion را ترجیح نمی‌دهند */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* فوکوس برای دسترسی بهتر */
:focus-visible {
  outline: 2px solid var(--gold-base);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* جلوگیری از انتخاب متن روی دکمه‌ها و المان‌های تعاملی */
.btn,
.tab,
.doc-filter-chip,
.doc-pagination-btn,
.btn-add,
.btn-remove-person,
.btn-remove-item,
.type-card,
.modal-close {
  user-select: none;
}

/* تصاویر واکنش‌گرا */
img {
  max-width: 100%;
  height: auto;
}

/* کلاس‌های کمکی نهایی */
.hide-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* پایان پارت ۱۶ */

/* =====================================================================
   افکت‌های ویژه و انیمیشن‌های جذاب برای تم روز و شب
   ===================================================================== */

/* ---------- 1. پس‌زمینه داینامیک با ذرات متحرک ---------- */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.animated-bg::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle at 20% 30%, var(--gold-dim) 0%, transparent 50%);
    animation: rotateBg 30s linear infinite;
    opacity: 0.4;
}

@keyframes rotateBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ذرات معلق (CSS-only) */
.animated-bg::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 10% 20%, var(--gold-base) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: floatParticles 20s linear infinite;
    opacity: 0.15;
}

@keyframes floatParticles {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

/* ---------- 2. افکت شیشه‌ای پیشرفته (Glassmorphism) با انیمیشن ---------- */
.glass-card,
.doc-card,
.type-card,
.preview-panel,
.wizard-panel,
.form-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    transition: all 0.3s var(--ease-out);
}

.glass-card:hover,
.doc-card:hover,
.type-card:hover,
.preview-panel:hover,
.wizard-panel:hover,
.form-container:hover {
    backdrop-filter: blur(16px) saturate(200%);
    border-color: var(--gold-border);
    box-shadow: var(--shadow-gold);
}

/* ---------- 3. انیمیشن شناور (Floating) برای آیکون‌ها ---------- */
.logo i,
.form-icon i,
.step-icon i,
.wizard-step-icon i {
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ---------- 4. انیمیشن درخشش حاشیه (Border Glow) برای دکمه‌ها و کارت‌ها ---------- */
.btn-primary,
.btn-gold,
.doc-card,
.type-card {
    transition: box-shadow 0.3s, transform 0.3s;
}

.btn-primary:hover,
.btn-gold:hover {
    box-shadow: 0 0 20px var(--gold-glow-strong);
}

.doc-card:hover,
.type-card:hover {
    box-shadow: 0 10px 25px var(--shadow-gold), 0 0 0 1px var(--gold-base) inset;
    transform: translateY(-6px);
}

/* ---------- 5. انیمیشن نبض (Pulse) برای نشانگر زنده و بج‌ها ---------- */
.live-badge,
.online-badge .pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* ---------- 6. افکت اسکن لیزری (اختیاری - خط متحرک) ---------- */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-base), transparent);
    animation: scanMove 6s linear infinite;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.2;
}

@keyframes scanMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

/* ---------- 7. انیمیشن تایپ‌رایتر برای عنوان هدر (اختیاری) ---------- */
.typewriter h1 {
    overflow: hidden;
    border-left: 0.15em solid var(--gold-base);
    white-space: nowrap;
    margin: 0 auto;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--gold-base); }
}

/* ---------- 8. انیمیشن ورود پلکانی (Stagger) برای کارت‌ها ---------- */
.stagger-item {
    opacity: 0;
    animation: fadeUp 0.5s var(--ease-out) forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }

/* ---------- 9. انیمیشن جابه‌جایی گرادیان پس‌زمینه برای تم شب ---------- */
body.dark-mode .animated-bg {
    background: radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.08), transparent 80%),
                linear-gradient(145deg, #0a0e1a, #020617);
    animation: bgShift 8s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* ---------- 10. افکت درخشش متن (Text Glow) ---------- */
.text-glow {
    text-shadow: 0 0 5px var(--gold-glow), 0 0 10px var(--gold-glow);
}

.doc-court-title,
.gold-text {
    text-shadow: 0 0 8px var(--gold-glow);
}

/* ---------- 11. انیمیشن لرزش خفیف (Shake) برای خطاهای اعتبارسنجی ---------- */
.input-error {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ---------- 12. افکت نئون (Neon) برای دکمه طلایی ---------- */
.btn-gold {
    animation: neonPulse 2s infinite alternate;
}

@keyframes neonPulse {
    from { box-shadow: 0 0 5px var(--gold-glow); }
    to { box-shadow: 0 0 20px var(--gold-glow-strong); }
}

/* ---------- 13. انیمیشن چرخش برای آیکون لودینگ ---------- */
.loading-spinner i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- 14. افکت هولوگرافیک (Holographic) برای کارت‌ها (اختیاری) ---------- */
.holo-card {
    position: relative;
    overflow: hidden;
}

.holo-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--gold-dim), transparent, var(--gold-dim), transparent);
    animation: rotateHolo 6s linear infinite;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.holo-card:hover::before {
    opacity: 0.4;
}

@keyframes rotateHolo {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ---------- 15. انیمیشن ورود مودال (Fade In + Scale) ---------- */
.modal[style*="display: flex"],
.confirm-modal-overlay.active .confirm-modal,
.blacklist-modal-overlay.active .blacklist-modal,
.faq-modal-overlay.active .faq-modal {
    animation: modalPop 0.35s var(--ease-spring);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ---------- 16. انیمیشن ذره‌بین (Zoom) برای تصاویر گالری ---------- */
.gallery-item img {
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* ---------- 17. انیمیشن پیشرفت (Progress Fill) با درخشش ---------- */
.progress-bar,
.scanner-progress-fill {
    background: linear-gradient(90deg, var(--gold-base), var(--gold-bright), var(--gold-base));
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite, widthChange 0.5s ease-out;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes widthChange {
    from { width: 0%; }
    to { width: var(--width, 100%); }
}

/* ---------- 18. افکت فیلتر (Blur) برای محتوای پشت مودال ---------- */
.modal-open .main-content {
    filter: blur(3px);
    transition: filter 0.3s;
}

/* ---------- 19. انیمیشن اسکرول نرم (Smooth Scroll) ---------- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

/* ---------- 20. افکت درخشش مرز (Border Glow) برای فیلدهای فوکوس ---------- */
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold-base);
    box-shadow: 0 0 0 3px var(--gold-glow), 0 0 0 1px var(--gold-base) inset;
    transition: all 0.2s;
}

/* ---------- 21. انیمیشن ورود کارت‌ها (Slide In) ---------- */
.slide-in {
    animation: slideIn 0.4s var(--ease-out) both;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ---------- 22. انیمیشن پس‌زمینه متغیر برای تم روشن ---------- */
body:not(.dark-mode) .animated-bg {
    background: radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.05), transparent 70%),
                linear-gradient(145deg, #fef9f0, #f5efe6);
    animation: lightBgShift 10s ease-in-out infinite alternate;
}

@keyframes lightBgShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

/* ---------- 23. افکت درخشش آیکون‌ها در حالت hover ---------- */
.fa-icon-hover i {
    transition: all 0.3s;
}

.fa-icon-hover:hover i {
    text-shadow: 0 0 10px var(--gold-glow);
    transform: scale(1.1);
}

/* ---------- 24. انیمیشن تار شدن (Blur) برای هدر هنگام اسکرول ---------- */
.page-header.scrolled {
    backdrop-filter: blur(20px) saturate(200%);
    transition: backdrop-filter 0.3s;
}

/* ---------- 25. افکت موج (Ripple) بهبود یافته برای دکمه‌ها ---------- */
.btn {
    overflow: hidden;
    position: relative;
}

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.6), transparent);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ---------- پایان بخش افکت‌های ویژه ---------- */

:root {
  /* رنگ‌های اصلی طلایی (درخشان) */
  --gold-base: #efa329;        /* کهربایی روشن */
  --gold-bright: #000000;      /* زرد درخشان */
  --gold-dark: #e69a2e;        /* نارنجی طلایی */
  --gold-glow: rgba(245, 176, 66, 0.5);
  
  /* پس‌زمینه روشن با انرژی */
  --bg-body: #fff9ef;           /* کرم بسیار روشن */
  --bg-card: rgba(255, 248, 235, 0.85);
  --glass-bg: rgba(255, 245, 235, 0.7);
  
  /* متن با کنتراست بالا */
  --text-main: #2c1810;         /* قهوه‌ای تیره (گرم) */
  --text-muted: #6b4c3b;
  --text-light: #9b7b6b;
  
  /* آکسان‌های شاد */
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;
}

body.dark-mode {
  --gold-base: #ffce2b;        /* طلایی کم رنگ‌تر */
  --gold-bright: #ffffff;
  --gold-dark: #d4af37;
  --gold-glow: rgba(245, 216, 120, 0.3);
  
  /* پس‌زمینه عمیق با حس لوکس */
  --bg-body: #0a0e1a;
  --bg-card: rgba(20, 25, 45, 0.85);
  --glass-bg: rgba(10, 15, 35, 0.7);
  
  /* متن نقره‌ای */
  --text-main: #e8e6e3;
  --text-muted: #a0a8b8;
  --text-light: #c0c8d8;
  
  /* آکسان‌های ملایم‌تر */
  --success: #27ae60;
  --danger: #e67e22;
  --warning: #f1c40f;
  --info: #2980b9;
}

/* =====================================================================
   تکمیل استایل‌های المان‌های کمبود (برای هماهنگی کامل)
   ===================================================================== */

/* ---------- دکمه تغییر تم (Theme Toggle) ---------- */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--gold-border);
    border-radius: var(--r-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    color: var(--gold-base);
    font-size: 1.2rem;
    overflow: hidden;
}
.theme-toggle:hover {
    transform: scale(1.08) rotate(8deg);
    border-color: var(--gold-base);
    box-shadow: var(--shadow-gold);
}
.theme-toggle:active {
    transform: scale(0.95);
}
.theme-toggle i {
    transition: transform 0.5s var(--ease-bounce);
}
.theme-toggle:hover i {
    transform: rotate(360deg);
}

/* ---------- نشانگر ذخیره خودکار (Auto Save Indicator) ---------- */
.auto-save-indicator {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--r-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: calc(var(--z-toast) + 1);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateX(20px);
    pointer-events: none;
    box-shadow: var(--shadow-md);
}
.auto-save-indicator.show {
    opacity: 1;
    transform: translateX(0);
}
.auto-save-indicator i {
    font-size: 0.9rem;
}

/* ---------- یکسان‌سازی انیمیشن مودال‌ها ---------- */
.modal,
.blacklist-modal-overlay .blacklist-modal,
.faq-modal-overlay .faq-modal,
.confirm-modal-overlay .confirm-modal {
    animation: modalPop 0.35s var(--ease-spring) both;
}
@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ---------- بهبود اسکرول بار در تم تاریک ---------- */
body.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
}
body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: var(--gold-base);
}

/* ---------- انیمیشن ورود برای حالت خالی (Empty State) ---------- */
.doc-empty-state,
.empty-state {
    animation: fadeUp 0.4s var(--ease-out) both;
}

/* ---------- بهبود دکمه‌های صفحه‌بندی (Pagination) ---------- */
.doc-pagination-btn {
    transition: all 0.2s ease;
}
.doc-pagination-btn:hover:not(:disabled) {
    background: var(--gold-dim);
    border-color: var(--gold-base);
    color: var(--gold-base);
    transform: translateY(-2px) scale(1.02);
}
.doc-pagination-btn.active {
    background: var(--gold-base);
    border-color: var(--gold-base);
    color: #0a0e27;
    font-weight: 800;
    box-shadow: 0 0 8px var(--gold-glow);
}

/* ---------- لینک‌های داخل مودال FAQ ---------- */
.faq-answer-modal a {
    color: var(--gold-base);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.faq-answer-modal a:hover {
    color: var(--gold-bright);
}

/* ---------- بهبود پیشرفت ویزارد در تم تاریک ---------- */
body.dark-mode .progress-bar {
    background: linear-gradient(90deg, var(--gold-base), var(--gold-bright));
    box-shadow: 0 0 5px var(--gold-glow);
}

/* ---------- افکت درخشش برای فیلدهای فرم در حالت فوکوس ---------- */
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold-base);
    box-shadow: 0 0 0 3px var(--gold-glow), 0 0 0 1px var(--gold-base) inset;
    transition: all 0.2s;
}

/* ---------- انیمیشن تکان برای خطاها (تکرار شده برای اطمینان) ---------- */
.input-error,
.is-invalid {
    animation: shake 0.3s ease-in-out;
}

/* ---------- افکت شیشه‌ای برای هدر در حالت اسکرول ---------- */
.page-header.scrolled {
    background: rgba(5, 8, 20, 0.92);
    backdrop-filter: blur(20px);
    border-bottom-color: var(--gold-border);
}
body.dark-mode .page-header.scrolled {
    background: rgba(2, 6, 20, 0.96);
}

/* ---------- بهبود دکمه بستن مودال (عمومی) ---------- */
.modal-close,
.faq-modal-header .modal-close {
    transition: all 0.2s;
}
.modal-close:hover,
.faq-modal-header .modal-close:hover {
    transform: rotate(90deg) scale(1.05);
    background: var(--danger);
    color: white;
}

/* ---------- فوتر اختیاری (در صورت اضافه شدن در HTML) ---------- */
.footer {
    margin-top: 3rem;
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
}

/* ---------- فاصله دکمه‌های سریع ویزارد ---------- */
.wizard-quick-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.wizard-quick-actions .btn-icon-sm {
    margin: 0;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}