/* --- فونت و تنظیمات پایه --- */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #e0e7ff;
  --bg: #f8fafc;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; font-family: 'Vazirmatn', Tahoma, sans-serif; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* --- هدر و منو --- */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

header h1 { margin: 0; font-size: 1.25rem; font-weight: 700; }

nav {
  background: white;
  display: flex;
  flex-wrap: wrap;
  padding: 0 2rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  border-bottom: 1px solid var(--border);
}

nav a {
  color: var(--text-light);
  padding: 1rem 1.5rem;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}

nav a:hover { color: var(--primary); background: var(--bg); }

nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* --- بدنه اصلی --- */
main { padding: 2rem 3rem; width: 100%; margin: 0 auto; box-sizing: border-box; }

/* --- کارت‌ها --- */
.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow-lg); }

.card h2 {
  margin-top: 0;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  border-bottom: 2px solid var(--bg);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

/* --- فرم‌ها و دکمه‌ها --- */
input, select, button {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  width: 100%;
  font-family: inherit;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

button {
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

button:hover { background: var(--primary-dark); transform: translateY(-1px); }
button:active { transform: translateY(0); }

/* --- جدول‌ها --- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 1rem;
  font-size: 0.9rem;
}

th, td {
  padding: 0.875rem 1rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

tbody tr { transition: background 0.15s; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

/* --- استایل‌های داشبورد --- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-box {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s;
}

.stat-box:hover { transform: translateY(-3px); }
.stat-box .label { font-size: 0.9rem; color: var(--text-light); font-weight: 500; }
.stat-box .num { font-size: 1.75rem; font-weight: 800; color: var(--primary); margin-top: 0.5rem; }

/* --- کلاس‌های کمکی --- */
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #059669; }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* --- تنظیمات چاپ --- */
@media print {
  header, nav, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: 100%; }
  .card { box-shadow: none; padding: 0; border: none; }
  .stats { display: none; }
}

/* --- موبایل --- */
@media (max-width: 768px) {
  main { padding: 1rem; }
  header { padding: 1rem; }
  nav { padding: 0; justify-content: center; }
  nav a { padding: 0.75rem 1rem; font-size: 0.85rem; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.5rem; }
}
