/* ===== فونت ===== */
@font-face { font-family: 'Vazirmatn'; font-weight: 400; font-display: swap; src: url('../fonts/vazir/Vazirmatn-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 500; font-display: swap; src: url('../fonts/vazir/Vazirmatn-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 600; font-display: swap; src: url('../fonts/vazir/Vazirmatn-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 700; font-display: swap; src: url('../fonts/vazir/Vazirmatn-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-weight: 800; font-display: swap; src: url('../fonts/vazir/Vazirmatn-ExtraBold.woff2') format('woff2'); }

/* ===== توکن‌ها ===== */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #dbeafe;
  --input-bg: #f8fafc;
  --side: #0f172a;
  --side-text: #cbd5e1;
  --hover: #f1f5f9;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
  --radius: 20px;
  --tone-blue-bg: #dbeafe; --tone-blue-fg: #2563eb;
  --tone-green-bg: #dcfce7; --tone-green-fg: #16a34a;
  --tone-amber-bg: #fef3c7; --tone-amber-fg: #d97706;
  --tone-red-bg: #fee2e2; --tone-red-fg: #dc2626;
}
:root[data-theme="dark"] {
  --bg: #0b1120;
  --card: #111a2e;
  --line: #1f2b45;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary-soft: #1e3a8a;
  --input-bg: #0b1426;
  --side: #0a0f1d;
  --hover: #17223a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --tone-blue-bg: #1e3a8a55; --tone-blue-fg: #93c5fd;
  --tone-green-bg: #14532d66; --tone-green-fg: #86efac;
  --tone-amber-bg: #78350f66; --tone-amber-fg: #fcd34d;
  --tone-red-bg: #7f1d1d66; --tone-red-fg: #fca5a5;
}

/* ===== پایه ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif; font-size: 14.5px; line-height: 1.75;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code { background: var(--hover); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.ta-right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { color: var(--muted); font-size: 13px; margin-top: 12px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 30px; height: 30px; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

/* ===== چیدمان ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px; flex: none; background: var(--side); color: var(--side-text);
  position: sticky; top: 0; height: 100vh; padding: 26px 16px 18px; display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { background: #fff; border-radius: 14px; width: 68px; height: 44px; display: grid; place-items: center; padding: 5px 8px; flex: none; box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px;
  color: var(--side-text); font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 10px 22px rgba(37, 99, 235, .38); font-weight: 600; }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .09); margin: 10px 8px; }
.side-foot { margin-top: 18px; padding: 14px 16px 0; border-top: 1px solid rgba(255, 255, 255, .09); font-size: 13px; color: #94a3b8; display: flex; align-items: center; gap: 6px; }
.side-foot strong { color: #fff; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; padding: 22px 28px 40px; }
.topbar {
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 14px 20px; box-shadow: var(--shadow); position: sticky; top: 14px; z-index: 30;
}
.top-spacer { flex: 1; }
.top-search { position: relative; width: min(340px, 40vw); }
.top-search .i { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.top-search input {
  width: 100%; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: var(--input-bg);
  padding: 0 42px 0 14px; font: inherit; color: var(--text);
}
.top-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 13px; border: 0; background: var(--hover); color: var(--muted);
  display: inline-grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; flex: none;
}
.icon-btn:hover { background: var(--line); color: var(--text); text-decoration: none; }
.icon-btn-sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn-sm .i { width: 17px; height: 17px; }
.icon-btn .dot {
  position: absolute; top: -5px; left: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; border: 2px solid var(--card);
}
.user-chip { display: flex; align-items: center; gap: 10px; color: inherit; padding: 0 4px; }
.user-chip:hover { text-decoration: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--side); color: #fff; display: grid; place-items: center; flex: none; }
.user-meta { display: flex; flex-direction: column; line-height: 1.35; }
.user-meta strong { font-size: 14px; }
.user-meta small { color: var(--muted); font-size: 12px; }

.content { max-width: 1480px; margin: 26px auto 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; font-weight: 800; line-height: 1.4; }
.page-head p { color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-actions form { margin: 0; }

/* ===== کارت‌ها ===== */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  min-width: 0; margin-bottom: 20px;
}
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.card-head .card-title { margin: 0; }
.stack > .card:last-child { margin-bottom: 0; }

.stat-grid { display: grid; gap: 20px; margin-bottom: 20px; grid-template-columns: repeat(4, 1fr); }
.stat-grid-1 { grid-template-columns: minmax(0, 340px); }
.stat-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stat-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 24px 26px; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { color: var(--muted); font-size: 14px; }
.stat-value { font-size: 34px; font-weight: 800; line-height: 1.3; }
.stat-foot { color: var(--muted); font-size: 13px; }
.stat-icon, .li-icon { display: grid; place-items: center; border-radius: 16px; flex: none; }
.stat-icon { width: 60px; height: 60px; }
.stat-icon .i { width: 26px; height: 26px; }
.li-icon { width: 44px; height: 44px; border-radius: 13px; }
.tone-blue { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.tone-green { background: var(--tone-green-bg); color: var(--tone-green-fg); }
.tone-amber { background: var(--tone-amber-bg); color: var(--tone-amber-fg); }
.tone-red { background: var(--tone-red-bg); color: var(--tone-red-fg); }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); gap: 20px; align-items: start; }
.split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-card-wide { max-width: 820px; }
.form-card-narrow { max-width: 580px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--line); color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { text-decoration: none; background: var(--hover); border-radius: 12px; }
.li-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.li-text strong, .li-text a strong { font-size: 15px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-text small { color: var(--muted); font-size: 12.5px; }

.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty .i { margin: 0 auto 10px; opacity: .55; display: block; }

/* ===== فرم‌ها ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field.grow { flex: 1; min-width: 220px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.req { color: #ef4444; }
.input {
  width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--input-bg); color: var(--text);
  padding: 0 14px; font: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea.input { padding: 10px 14px; resize: vertical; min-height: 88px; line-height: 1.8; }
select.input {
  appearance: none; -webkit-appearance: none; padding-left: 38px;
  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='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 12px center;
}
.input::placeholder { color: #94a3b8; }
.input:focus { outline: none; background: var(--card); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.input-sm { min-height: 36px; border-radius: 10px; font-size: 13.5px; padding: 0 10px; }
select.input-sm { padding-left: 32px; }
[data-jdp] { text-align: right; direction: ltr; }
[data-time] { text-align: right; direction: ltr; }
.field-pair { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; }
.has-error .input { border-color: #ef4444; }
.error-text { color: #dc2626; font-size: 12.5px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.inline-form .input-sm { width: 180px; }
.inline-search { position: relative; margin: 0; }
.inline-search .i { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.inline-search input { height: 38px; width: 210px; border-radius: 12px; border: 1px solid var(--line); background: var(--input-bg); color: var(--text); padding: 0 38px 0 12px; font: inherit; }
.inline-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }

.filters { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.filters .field { min-width: 150px; }
.filter-actions { display: flex; gap: 8px; }

/* ===== دکمه‌ها ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 12px;
  border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, box-shadow .15s, color .15s, border-color .15s; background: transparent; color: var(--text);
}
.btn:hover { text-decoration: none; }
.btn .i { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .28); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: #16a34a; color: #fff; box-shadow: 0 8px 18px rgba(22, 163, 74, .25); }
.btn-success:hover { background: #15803d; }
.btn-ghost { border-color: var(--line); background: var(--card); color: var(--text); }
.btn-ghost:hover { background: var(--hover); }
.btn-soft { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.btn-soft:hover { filter: brightness(.96); }
.btn-soft-green { background: var(--tone-green-bg); color: var(--tone-green-fg); }
.btn-outline-danger { border-color: #ef4444; color: #ef4444; background: transparent; }
.btn-outline-danger:hover { background: var(--tone-red-bg); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13.5px; }
.btn-xs { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 6px; }
.btn-xs .i { width: 15px; height: 15px; }
.btn-block { width: 100%; }

/* ===== نشان‌ها و هشدارها ===== */
.badge { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--tone-green-bg); color: var(--tone-green-fg); }
.badge-amber { background: var(--tone-amber-bg); color: var(--tone-amber-fg); }
.badge-red { background: var(--tone-red-bg); color: var(--tone-red-fg); }
.badge-blue { background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.badge-gray { background: var(--hover); color: var(--muted); }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.alert .i { margin-top: 3px; }
.alert-success { background: var(--tone-green-bg); color: var(--tone-green-fg); border-color: #86efac55; }
.alert-danger { background: var(--tone-red-bg); color: var(--tone-red-fg); border-color: #fca5a555; }
.alert-warning { background: var(--tone-amber-bg); color: var(--tone-amber-fg); border-color: #fcd34d55; }
.form-grid > .alert { margin-bottom: 0; }

/* ===== جدول ===== */
.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table tbody tr:hover td:first-child { border-radius: 0 12px 12px 0; }
.table tbody tr:hover td:last-child { border-radius: 12px 0 0 12px; }
.col-actions { width: 1%; white-space: nowrap; text-align: left; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.row-actions form { margin: 0; }
.sort { color: inherit; font-weight: 600; }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

.pagination { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.table-foot .pagination { margin: 0; }
.pg { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 11px; border: 1px solid var(--line); display: inline-grid; place-items: center; color: var(--text); background: var(--card); font-weight: 600; }
a.pg:hover { background: var(--hover); text-decoration: none; }
.pg.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .3); }
.pg.gap { border: 0; background: transparent; color: var(--muted); }
.pg .i { width: 17px; height: 17px; }

.tabs { display: inline-flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 20px; }
.tab { padding: 7px 18px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(37, 99, 235, .28); }

.detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 32px; margin: 0; }
.detail > div { min-width: 0; }
.detail .full { grid-column: 1 / -1; }
.detail dt { color: var(--muted); font-size: 13px; }
.detail dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.detail-compact { gap: 14px 24px; }

/* ===== ورود / نصب ===== */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 500px at 80% -10%, #dbeafe 0, transparent 60%), var(--bg); }
.auth-card { width: min(900px, 100%); display: grid; grid-template-columns: 1.1fr 1fr; background: var(--card); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: 0 30px 70px rgba(15, 23, 42, .12); }
.auth-card-single { grid-template-columns: 1fr; width: min(520px, 100%); }
.auth-form { padding: 46px 44px; }
.auth-form h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.auth-form > p { margin-bottom: 24px; }
.auth-form .field { margin-bottom: 16px; }
.auth-brand { background: var(--side); color: #fff; padding: 46px 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.auth-brand h2 { font-size: 20px; font-weight: 800; margin: 14px 0 8px; }
.auth-brand p { color: #94a3b8; font-size: 14px; }
.auth-logo { background: #fff; border-radius: 22px; padding: 14px 18px; width: 150px; box-shadow: 0 14px 30px rgba(37, 99, 235, .35); }

/* ===== تقویم شمسی ===== */
.jdp { position: absolute; display: none; z-index: 1000; width: 304px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .22); direction: rtl; font-family: inherit; }
.jdp.open { display: block; }
.jdp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.jdp-nav { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--hover); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.jdp-nav:hover { background: var(--line); }
.jdp-sel { flex: 1; display: flex; gap: 6px; justify-content: center; }
.jdp-sel select { height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--input-bg); color: var(--text); padding: 0 8px; font: inherit; font-weight: 600; max-width: 110px; }
.jdp-week, .jdp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jdp-week span { color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 6px 0; }
.jdp-week .fri, .jdp-day.fri { color: #ef4444; }
.jdp-day { height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.jdp-day.fri { color: #ef4444; }
.jdp-day:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary-dark); }
.jdp-day.today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.jdp-day.sel, .jdp-day.sel:hover { background: var(--primary); color: #fff; }
.jdp-day:disabled { opacity: .3; cursor: not-allowed; }
.jdp-foot { display: flex; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.jdp-foot button { flex: 1; height: 34px; border: 0; border-radius: 10px; background: var(--hover); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.jdp-foot button:first-child { background: var(--primary-soft); color: var(--primary-dark); }
.jdp-foot button:hover { filter: brightness(.96); }

/* ===== واکنش‌گرا ===== */
@media (max-width: 1280px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .form-card { max-width: none; }
}
@media (max-width: 1100px) {
  .stat-grid, .stat-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .panel-grid, .split-even { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; top: 0; right: 0; z-index: 60; transform: translateX(100%); transition: transform .22s; height: 100%; box-shadow: -20px 0 50px rgba(0, 0, 0, .3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 55; }
  .main { padding: 14px 14px 32px; }
  .user-meta { display: none; }
  .topbar { padding: 10px 12px; gap: 8px; border-radius: 20px; }
}
@media (min-width: 901px) {
  body.nav-collapsed .sidebar { display: none; }
}
@media (max-width: 640px) {
  .stat-grid, .stat-grid-2, .stat-grid-3, .stat-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .detail { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: 23px; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-brand { order: -1; padding: 26px; }
  .auth-form { padding: 28px 22px; }
  .top-search { width: auto; flex: 1; min-width: 0; }
  .top-spacer, .user-chip { display: none; }
  .card { padding: 18px; }
  .inline-search input { width: 150px; }
}

/* ===== چاپ ===== */
@media print {
  .sidebar, .topbar, .page-actions, .tabs, .scrim, .alert, .form-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .main { padding: 0; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
