/* ═══════════════════════════════════════════════════════════
   Paya Portal — ورود و مدیریت دسترسی
   رنگ برند: #FED429 (زرد) · #BCCF00 (سبز) · #050505
   ═══════════════════════════════════════════════════════════ */

:root {
  --brand: #FED429;
  --brand-ink: #1a1500;
  --brand-2: #BCCF00;
  --bg: #f5f5f1;
  --bg-2: #efeee8;
  --card: #ffffff;
  --card-2: #fafaf7;
  --ink: #151513;
  --ink-2: #3b3b37;
  --muted: #74746d;
  --faint: #a4a49c;
  --line: #e7e6df;
  --line-2: #d9d8d0;
  --ok: #1f8a4c;   --ok-wash: #e6f5ec;
  --warn: #a86400; --warn-wash: #fff3db;
  --bad: #c62f2f;  --bad-wash: #fdeaea;
  --info: #2860c9; --info-wash: #e8effc;
  --focus: 0 0 0 3px rgba(254, 212, 41, .55);
  --shadow-sm: 0 1px 2px rgba(20, 20, 10, .06);
  --shadow: 0 1px 2px rgba(20, 20, 10, .05), 0 8px 24px rgba(20, 20, 10, .06);
  --shadow-lg: 0 24px 64px rgba(20, 20, 10, .18);
  --r: 14px;
  --r-sm: 10px;
  --r-lg: 20px;
  --font: 'Vazirmatn FD NL', 'Vazirmatn', Tahoma, sans-serif;
  --font-latin: 'Vazirmatn', ui-sans-serif, Tahoma, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --side: 260px;
  --top: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="dark"] {
  --bg: #0e0e0d;
  --bg-2: #131312;
  --card: #181817;
  --card-2: #1d1d1b;
  --ink: #f2f1ea;
  --ink-2: #d6d5ce;
  --muted: #a1a098;
  --faint: #6f6e67;
  --line: #2a2a27;
  --line-2: #363632;
  --ok: #4fc47f;   --ok-wash: #14291c;
  --warn: #f2b33d; --warn-wash: #2d220c;
  --bad: #ff6b6b;  --bad-wash: #331616;
  --info: #7aa7ff; --info-wash: #152036;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.55);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--brand); color: var(--brand-ink); }
.ltr { direction: ltr; unicode-bidi: isolate; font-family: var(--font-latin); }
.mono { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; letter-spacing: .02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }
.noscript { padding: 40px; text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── دکمه ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  text-decoration: none; user-select: none;
}
.btn:hover { background: var(--card-2); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.pri { background: var(--ink); border-color: var(--ink); color: var(--card); }
.btn.pri:hover { background: var(--ink-2); }
.btn.brand { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.brand:hover { filter: brightness(.97); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-wash); border-color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { height: 48px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--line-2); cursor: pointer; font-weight: 600; font-size: 13px; }
.link:hover { text-decoration-color: var(--ink); }

/* ───────── فرم ───────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); line-height: 1.8; }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 14px; resize: vertical; line-height: 1.8; }
.input:hover { border-color: var(--faint); }
.input:focus { border-color: var(--ink); box-shadow: var(--focus); }
.input.ltr { text-align: left; }
.input[readonly] { background: var(--bg-2); color: var(--muted); }
.input.err { border-color: var(--bad); }
.input-wrap { position: relative; }
.input-wrap .input { padding-inline-end: 46px; }
.input-wrap .eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 36px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; color: var(--muted);
  display: grid; place-items: center; }
.input-wrap .eye:hover { background: var(--bg-2); color: var(--ink); }
.otp {
  height: 58px; font-size: 26px; letter-spacing: .5em; text-align: center; font-family: var(--mono);
  padding-inline-start: .5em; direction: ltr;
}
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; user-select: none; line-height: 1.7; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.warn-line { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--warn); margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 40px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start .2s var(--ease); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { inset-inline-start: 19px; }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

.strength { display: flex; gap: 4px; margin-top: 2px; }
.strength i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .2s; }
.strength[data-s="1"] i:nth-child(-n+1) { background: var(--bad); }
.strength[data-s="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-s="3"] i:nth-child(-n+3) { background: var(--brand-2); }
.strength[data-s="4"] i { background: var(--ok); }

/* ───────── صفحهٔ ورود ───────── */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 560px);
}
.auth-side {
  position: relative; overflow: hidden; background: #111110; color: #f3f2eb;
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px 56px;
}
.auth-side::before {
  content: ''; position: absolute; inset: 0; opacity: .9;
  background:
    radial-gradient(600px 400px at 85% 10%, rgba(254,212,41,.22), transparent 60%),
    radial-gradient(500px 500px at 10% 100%, rgba(188,207,0,.14), transparent 60%);
}
.auth-side::after {
  content: ''; position: absolute; inset: 0; opacity: .08;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(circle at 60% 40%, #000, transparent 75%);
}
.auth-side > * { position: relative; z-index: 1; }
.brandmark { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; }
.brandmark .logo { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 900; font-size: 20px; box-shadow: 0 6px 20px rgba(254,212,41,.35); }
.auth-side h2 { font-size: 34px; line-height: 1.5; margin: 0 0 14px; font-weight: 800; letter-spacing: -.5px; max-width: 520px; }
.auth-side h2 em { font-style: normal; color: var(--brand); }
.auth-side p { color: #b9b8b0; max-width: 480px; margin: 0; line-height: 2; }
.auth-feats { display: grid; gap: 14px; margin-top: 34px; max-width: 460px; }
.auth-feat { display: flex; gap: 12px; align-items: flex-start; color: #d9d8d0; font-size: 13.5px; }
.auth-feat .ic { width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,.07); display: grid; place-items: center; flex: none; color: var(--brand); }
.auth-foot { color: #85847c; font-size: 12px; }

.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 40px 48px; background: var(--card); position: relative; }
.auth-main .top-tools { position: absolute; top: 18px; inset-inline-end: 18px; display: flex; gap: 6px; }
.auth-card { width: 100%; max-width: 400px; margin: 0 auto; animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.auth-card h1 { font-size: 24px; margin: 0 0 6px; font-weight: 800; letter-spacing: -.3px; }
.auth-card .sub { color: var(--muted); margin: 0 0 26px; line-height: 1.9; }
.auth-card .brandmark { display: none; margin-bottom: 28px; }
.auth-actions { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; gap: 12px; flex-wrap: wrap; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 20px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); font-size: 13px; line-height: 1.9; margin-bottom: 16px; border: 1px solid transparent; }
.alert.bad { background: var(--bad-wash); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert.ok { background: var(--ok-wash); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.alert.warn { background: var(--warn-wash); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert.info { background: var(--info-wash); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert svg { flex: none; margin-top: 3px; }
.alert .grow { flex: 1; }
.auth-back { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 18px; }

.methods { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; background: var(--bg-2); padding: 4px; border-radius: 12px; }
.methods button { flex: 1 1 auto; border: 0; background: transparent; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 12.5px;
  color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; }
.methods button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.qr-box { display: grid; place-items: center; background: #fff; border-radius: var(--r); padding: 14px; border: 1px solid var(--line); width: 212px; height: 212px; margin: 4px auto 14px; }
.qr-box img, .qr-box svg { width: 184px; height: 184px; image-rendering: pixelated; }
.secret { background: var(--bg-2); border-radius: var(--r-sm); padding: 10px 12px; text-align: center; font-size: 15px; word-break: break-all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; padding: 14px; background: var(--bg-2); border-radius: var(--r); }
.codes span { font-family: var(--mono); direction: ltr; text-align: center; font-size: 15px; padding: 6px; background: var(--card); border-radius: 8px; border: 1px dashed var(--line-2); }
.ip-banner { margin-top: 18px; }

@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 72px 22px 40px; min-height: 100vh; justify-content: flex-start; }
  .auth-card .brandmark { display: flex; }
}

/* ───────── پوستهٔ برنامه ───────── */
.shell { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px;
  padding: 0 18px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .brandmark { font-size: 15.5px; gap: 10px; min-width: calc(var(--side) - 18px); }
.topbar .brandmark .logo { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; box-shadow: none; }
.topbar .title { font-weight: 700; font-size: 15px; }
.topbar .spacer { flex: 1; }
.search { position: relative; width: min(420px, 40vw); }
.search .input { height: 38px; padding-inline-start: 38px; background: var(--card); font-size: 13px; }
.search > svg, .search > span > svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search kbd { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); }
kbd { font-family: var(--font-latin); font-size: 11px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); background: var(--card-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px;
  background: var(--brand); color: var(--brand-ink); flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.userbtn { display: flex; align-items: center; gap: 10px; border: 1px solid transparent; background: transparent; padding: 4px 6px 4px 10px;
  border-radius: 99px; cursor: pointer; }
.userbtn:hover { background: var(--bg-2); }
.userbtn .who { text-align: start; line-height: 1.35; }
.userbtn .who b { display: block; font-size: 13px; }
.userbtn .who small { color: var(--muted); font-size: 11.5px; }

.sidebar {
  position: fixed; top: var(--top); bottom: 0; inset-inline-start: 0; width: var(--side); z-index: 20;
  padding: 16px 12px 24px; overflow-y: auto; border-inline-end: 1px solid var(--line); background: var(--bg);
}
.nav-sec { font-size: 11.5px; font-weight: 700; color: var(--faint); padding: 16px 12px 6px; letter-spacing: .02em; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2);
  text-decoration: none; font-weight: 600; font-size: 13.5px; margin-bottom: 2px; transition: background .12s;
}
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 8px 11px; }
.nav a svg { color: var(--muted); flex: none; }
.nav a[aria-current="page"] svg { color: var(--ink); }
.nav a .count { margin-inline-start: auto; font-size: 11px; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.main { margin-inline-start: var(--side); padding: 26px 30px 60px; max-width: calc(var(--side) + 1240px); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0; font-weight: 800; letter-spacing: -.3px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .tools { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-toggle { display: none; }
.mobile-only { display: none !important; }
@media (max-width: 640px) {
  .topbar .search { display: none; }
  .search.mobile-only { display: block !important; }
  .topbar .spacer { display: block; }
}
.scrim { display: none; }

@media (max-width: 1020px) {
  .menu-toggle { display: inline-flex; }
  .topbar .brandmark { min-width: 0; }
  .topbar .brandmark span { display: none; }
  .search { width: auto; flex: 1; }
  .search kbd { display: none; }
  .userbtn .who { display: none; }
  /* کشوی کناری در RTL از سمت راست می‌آید؛ جابه‌جایی مثبت X آن را بیرون از صفحه می‌برد */
  .sidebar { top: 0; z-index: 50; width: min(300px, 86vw); background: var(--card); box-shadow: var(--shadow-lg);
    transform: translateX(105%); transition: transform .25s var(--ease); padding-top: 20px; }
  [dir="ltr"] .sidebar { transform: translateX(-105%); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 45; }
  .main { margin-inline-start: 0; padding: 20px 16px 60px; }
}

/* ───────── کارت و جدول ───────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.card-h p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.card-b { padding: 18px 20px 20px; }
.card-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.stack { display: grid; gap: 18px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.cols.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .cols.two { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 700; font-size: 13.5px; }
.item .s { color: var(--muted); font-size: 12px; }
.ic-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); flex: none; color: var(--ink-2); font-size: 18px; }
.ic-box.ok { background: var(--ok-wash); color: var(--ok); }
.ic-box.warn { background: var(--warn-wash); color: var(--warn); }
.ic-box.bad { background: var(--bad-wash); color: var(--bad); }

.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: start; font-weight: 700; color: var(--muted); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card-2); position: sticky; top: 0; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--card-2); }
table.t tr.dim td { opacity: .55; }
table.t .actions { text-align: end; white-space: nowrap; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-user b { display: block; font-size: 13px; }
.cell-user small { color: var(--muted); font-size: 11.5px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-wash); color: var(--ok); }
.badge.warn { background: var(--warn-wash); color: var(--warn); }
.badge.bad { background: var(--bad-wash); color: var(--bad); }
.badge.info { background: var(--info-wash); color: var(--info); }
.badge.brand { background: var(--brand); color: var(--brand-ink); }
.badge.dark { background: var(--ink); color: var(--card); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-wash); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; }
.kpi .k { color: var(--muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .v { font-size: 28px; font-weight: 800; margin-top: 4px; letter-spacing: -.5px; }
.kpi .d { font-size: 12px; color: var(--muted); }
.meter { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 6px; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; position: relative; }
.chart .bar i { display: block; border-radius: 4px 4px 2px 2px; min-height: 2px; }
.chart .bar i.a { background: var(--ink); opacity: .85; }
.chart .bar i.b { background: var(--bad); }
.chart .bar span { position: absolute; bottom: -22px; inset-inline: 0; text-align: center; font-size: 10.5px; color: var(--faint); }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 30px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }

/* ───────── خانه ───────── */
.hello { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.hello h1 { margin: 0; font-size: 24px; font-weight: 800; }
.hello p { margin: 2px 0 0; color: var(--muted); }
.sec-title { font-size: 13px; font-weight: 800; color: var(--ink-2); margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.sec-title .muted { font-weight: 500; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--r-lg);
  background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; min-height: 132px;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.tile:focus-visible { outline: none; box-shadow: var(--focus); }
.tile .emoji { width: 46px; height: 46px; border-radius: 14px; background: var(--bg-2); display: grid; place-items: center; font-size: 23px; }
.tile .nm { font-weight: 800; font-size: 14.5px; line-height: 1.5; }
.tile .pt { font-size: 11.5px; color: var(--faint); font-family: var(--font-latin); direction: ltr; text-align: end; margin-top: auto; }
.tile .star { position: absolute; top: 12px; inset-inline-end: 12px; width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent;
  color: var(--faint); cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.tile:hover .star, .tile .star.on, .tile .star:focus-visible { opacity: 1; }
.tile .star.on { color: #e0a800; }
.tile .star:hover { background: var(--bg-2); }
.tile.dragging { opacity: .4; }
.tile.drop { border-color: var(--ink); border-style: dashed; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--card); text-decoration: none; font-weight: 600; font-size: 13px; }
.chip:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.chip small { color: var(--faint); font-weight: 500; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .big { font-size: 36px; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ───────── مودال، کشو، منو ───────── */
dialog.modal { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(10,10,8,.45); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .2s var(--ease); display: flex; flex-direction: column; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-h h3 { margin: 0; font-size: 16px; font-weight: 800; }
.modal-b { padding: 20px; overflow-y: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-f .spacer { flex: 1; }

.menu { position: fixed; z-index: 80; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 6px; animation: pop .14s var(--ease); }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px;
  text-align: start; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.menu button:hover, .menu button:focus-visible { background: var(--bg-2); color: var(--ink); outline: none; }
.menu button.danger { color: var(--bad); }
.menu button.danger:hover { background: var(--bad-wash); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }

#toasts { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
[dir="ltr"] #toasts { transform: translateX(-50%); }
.toast { pointer-events: auto; background: var(--ink); color: var(--card); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13px;
  font-weight: 600; display: flex; align-items: center; gap: 10px; animation: rise .25s var(--ease); max-width: min(520px, 92vw); }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok svg { color: var(--ok); }
[data-theme="dark"] .toast.ok svg { color: #1f8a4c; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input { height: 38px; width: auto; min-width: 150px; font-size: 13px; }
.filters .input.q { min-width: 240px; flex: 1; max-width: 360px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 14px; }

/* ماتریس دسترسی */
.access-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .access-layout { grid-template-columns: 1fr; } }
.user-list { max-height: 70vh; overflow-y: auto; padding: 6px; }
.user-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: 10px;
  cursor: pointer; text-align: start; }
.user-list button:hover { background: var(--bg-2); }
.user-list button[aria-current="true"] { background: var(--ink); color: var(--card); }
.user-list button[aria-current="true"] small { color: inherit; opacity: .7; }
.user-list small { display: block; font-size: 11.5px; color: var(--muted); }
.lvl { height: 34px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--card); padding: 0 8px; min-width: 128px; }
.lvl.on { border-color: var(--ok); background: var(--ok-wash); color: var(--ok); font-weight: 700; }

.skeleton { background: linear-gradient(90deg, var(--bg-2), var(--line), var(--bg-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row .l b { display: block; font-size: 13.5px; }
.set-row .l small { color: var(--muted); font-size: 12px; line-height: 1.7; display: block; }
.set-row .input { width: 120px; height: 38px; text-align: center; }
.set-row .input.wide { width: 220px; text-align: start; }

.notice { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--r); margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.notice.warn { background: var(--warn-wash); color: var(--warn); }
.notice.danger { background: var(--bad-wash); color: var(--bad); }
.notice .grow { flex: 1; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .sidebar, .topbar { display: none; } .main { margin: 0; } }

/* ───────── جدول دسترسی (کاربر × پروژه) ───────── */
.matrix-wrap { max-height: 72vh; }
table.matrix { border-collapse: separate; border-spacing: 0; }
table.matrix th, table.matrix td { border-bottom: 1px solid var(--line); }
table.matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--card-2); vertical-align: bottom; padding: 8px 6px; }
table.matrix .mx-user { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--card); min-width: 220px; max-width: 260px; text-align: start; padding: 8px 12px; border-inline-end: 1px solid var(--line); }
table.matrix thead .mx-user { z-index: 4; background: var(--card-2); }
table.matrix tbody tr:hover .mx-user, table.matrix tbody tr:hover td { background: var(--card-2); }
.mx-col { min-width: 92px; max-width: 120px; }
.mx-col.sub { background: color-mix(in srgb, var(--card-2) 60%, var(--bg-2)); }
.mx-h { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 4px; border-radius: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-2); line-height: 1.5; text-align: center; }
.mx-h:hover:not([disabled]) { background: var(--bg-2); color: var(--ink); }
.mx-h[disabled] { cursor: default; }
.mx-ic { font-size: 18px; }
.mx-cell { text-align: center; padding: 6px !important; }
.mx-cell.sub { background: color-mix(in srgb, var(--card) 70%, var(--bg-2)); }
.mx-all { color: var(--ok); font-weight: 700; font-size: 12.5px; text-align: center; background: var(--ok-wash); }
.mx-chk { display: inline-grid; place-items: center; cursor: pointer; }
.mx-chk input { position: absolute; opacity: 0; pointer-events: none; }
.mx-chk span { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--card); display: grid; place-items: center; transition: all .12s; }
.mx-chk input:checked + span { background: var(--ok); border-color: var(--ok); }
.mx-chk input:checked + span { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E"); background-size: 16px; background-position: center; background-repeat: no-repeat; }
.mx-chk input:focus-visible + span { box-shadow: var(--focus); }
.mx-chk input:disabled + span { opacity: .5; cursor: not-allowed; }
.mx-chk:hover input:not(:disabled):not(:checked) + span { border-color: var(--ok); }

/* ───────── پروژه‌ها و صفحه‌ها ───────── */
.aud-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 18px; }
.aud-legend div { display: flex; flex-direction: column; }
.aud-legend b { font-size: 13px; }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button:hover:not([disabled]) { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg button[aria-checked="true"][data-aud="public"] { background: var(--warn-wash); color: var(--warn); }
.seg button[aria-checked="true"][data-aud="own"] { background: var(--info-wash); color: var(--info); }
.seg button[aria-checked="true"][data-aud="staff"] { background: var(--ok-wash); color: var(--ok); }
.seg button[disabled] { cursor: default; }
.proj-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; flex-wrap: wrap; }
.proj-t { display: flex; align-items: center; gap: 12px; }
.proj-t h3 { margin: 0; font-size: 15px; font-weight: 800; }
.proj-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--bg-2); display: grid; place-items: center; font-size: 20px; flex: none; }
.proj-b { border-top: 1px solid var(--line); padding: 6px 18px 12px; }
.pg-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.pg-row:last-child { border-bottom: 0; }
.pg-name { flex: 1; min-width: 180px; font-size: 13px; }
.pg-row .lvl { min-width: 210px; }
.lvl.warn { border-color: var(--warn); background: var(--warn-wash); color: var(--warn); font-weight: 700; }
.pg-internal { margin-top: 6px; }
.pg-internal summary { padding: 8px 0; cursor: pointer; }
.switch.small .track { width: 34px; height: 20px; }
.switch.small .track::after { width: 14px; height: 14px; }
.switch.small input:checked + .track::after { inset-inline-start: 17px; }
.proj.dim { opacity: .6; }
