/* پنل واحد کنکور کامپیوتر
   رنگ هر پلتفرم از config/platforms.php می‌آید و با --pc روی ردیف‌ها و برچسب‌ها می‌نشیند. */

:root {
  --canvas: #EDF0F4;
  --surface: #FFFFFF;
  --raised: #F6F8FA;
  --ink: #17202C;
  --muted: #5D6878;
  --faint: #8B95A3;
  --line: #DCE1E8;
  --line-strong: #C5CCD6;
  --side: #142033;
  --side-ink: #C9D2DE;
  --side-dim: #7F8DA1;
  --gold: #C29A2E;
  --gold-soft: #F4ECD6;
  --focus: #2F6BD8;
  --ok: #138A63;
  --ok-soft: #E2F3EC;
  --warn: #B26A0A;
  --warn-soft: #FBF0DE;
  --bad: #B3362C;
  --bad-soft: #FBE6E3;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 14px;
  --shadow: 0 1px 0 rgba(20, 32, 51, .04), 0 1px 2px rgba(20, 32, 51, .06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0E141C; --surface: #161F2B; --raised: #1B2533; --ink: #E5EAF1; --muted: #9AA6B6; --faint: #6F7C8E;
    --line: #253142; --line-strong: #33415A; --side: #0A1018; --side-ink: #C9D2DE; --side-dim: #6E7C90;
    --gold-soft: #2E2716; --ok-soft: #12291F; --warn-soft: #2D2312; --bad-soft: #2E1715; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0E141C; --surface: #161F2B; --raised: #1B2533; --ink: #E5EAF1; --muted: #9AA6B6; --faint: #6F7C8E;
  --line: #253142; --line-strong: #33415A; --side: #0A1018; --side-ink: #C9D2DE; --side-dim: #6E7C90;
  --gold-soft: #2E2716; --ok-soft: #12291F; --warn-soft: #2D2312; --bad-soft: #2E1715; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 14.5px/1.75 Vazirmatn, Tahoma, sans-serif;
  font-feature-settings: "ss01";
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--gold-soft); }

/* ---------- قاب ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { padding: 22px 20px 18px; text-decoration: none; display: block; }
.brand b { display: block; font: 700 22px/1.2 "Markazi Text", Vazirmatn, serif; color: #fff; }
.brand span { font-size: 12px; color: var(--side-dim); }
.brand::after { content: ""; display: block; width: 28px; height: 3px; background: var(--gold); margin-top: 12px; border-radius: 2px; }

.nav { padding: 4px 10px; }
.nav h6 { margin: 18px 10px 6px; font-size: 11.5px; font-weight: 500; color: var(--side-dim); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  text-decoration: none; color: var(--side-ink); font-size: 14px;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(194, 154, 46, .16); color: #fff; box-shadow: inset -3px 0 0 var(--gold); }
.nav a .ico { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .plat { font-size: 13.5px; }
.nav .plat i { width: 8px; height: 8px; border-radius: 2px; background: var(--pc); flex: none; }
.nav .plat .ext { margin-inline-start: auto; opacity: 0; font-size: 12px; color: var(--side-dim); }
.nav .plat:hover .ext { opacity: 1; }
.nav .plat.off { color: var(--side-dim); }

.me { margin-top: auto; padding: 14px 20px 18px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 13px; }
.me b { color: #fff; font-weight: 600; display: block; }
.me span { color: var(--side-dim); }
.me .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.me a, .me button { color: var(--side-dim); background: none; border: 0; font: inherit; cursor: pointer; padding: 0; text-decoration: none; }
.me a:hover, .me button:hover { color: #fff; }

.main { min-width: 0; padding: 26px 32px 60px; }
.wrap { max-width: 1240px; margin: 0 auto; }
.topbar { display: none; }

/* ---------- سرصفحه ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { margin: 0; font: 700 34px/1.15 "Markazi Text", Vazirmatn, serif; letter-spacing: -.2px; }
.head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.head .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 6px; }
.crumb:hover { color: var(--ink); }

h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
h2 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-inline-start: 6px; }
.section { margin-top: 30px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; direction: ltr; unicode-bidi: isolate; }

/* ---------- دکمه و فرم ---------- */
.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 600 13.5px/1 Vazirmatn, Tahoma, sans-serif; padding: 9px 14px; border-radius: 8px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--side); border-color: var(--side); color: #fff; }
.btn.primary:hover { background: #22324c; }
:root[data-theme="dark"] .btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1406; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1406; } }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn.link { border-color: transparent; background: none; padding-inline: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 4px; display: block; }
input[type=text], input[type=search], input[type=url], input[type=number], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px;
}
input:focus, select:focus, textarea:focus, .editor:focus-within { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 96px; }
input[type=number] { max-width: 140px; }
.field { margin-bottom: 18px; }
.field.err input, .field.err select, .field.err textarea, .field.err .editor { border-color: var(--bad); }
.field .error { color: var(--bad); font-size: 12.5px; margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--side); margin: 0; }

/* انتخاب پلتفرم به شکل دکمه‌های رنگی */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; margin: 0; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.chip span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; border: 2px solid var(--pc); }
.chip input:checked + span { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, var(--surface)); }
.chip input:checked + span::before { background: var(--pc); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip input:disabled + span { opacity: .45; cursor: not-allowed; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; padding: 2px; background: var(--surface); flex-wrap: wrap; }
.seg label { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg input:checked + span { background: var(--side); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--focus); }
.seg a { display: block; padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); text-decoration: none; }
.seg a[aria-current="true"] { background: var(--side); color: #fff; }

/* ویرایشگر ساده */
.editor { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); overflow: hidden; }
.editor .bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); background: var(--raised); }
.editor .bar button { border: 0; background: none; width: 32px; height: 30px; border-radius: 6px; cursor: pointer; color: var(--ink); font: 700 14px Vazirmatn, sans-serif; }
.editor .bar button:hover { background: var(--line); }
.editor [contenteditable] { min-height: 140px; padding: 12px 14px; outline: none; }
.editor [contenteditable]:empty::before { content: attr(data-placeholder); color: var(--faint); }
.editor [contenteditable] p { margin: 0 0 .6em; }

/* ---------- پیام‌ها ---------- */
.flash { padding: 11px 14px; border-radius: 9px; margin-bottom: 18px; font-weight: 500; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.flash.error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.flash.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
.flash ul { margin: 6px 0 0; padding-inline-start: 18px; font-weight: 400; }

/* ---------- سطح‌ها ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow); }
.panel.pad { padding: 20px 22px; }
.panel + .panel { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.grid-form { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: 20px; }

/* ---------- جدول ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: start; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--raised); }
.table th:first-child { border-start-start-radius: var(--radius-l); }
.table th:last-child { border-start-end-radius: var(--radius-l); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--raised) 60%, transparent); }
.table .end { text-align: end; }
.table a.rowlink { text-decoration: none; font-weight: 600; }
.table a.rowlink:hover { text-decoration: underline; }
.scroll { overflow-x: auto; }

/* ---------- تابلوی پلتفرم‌ها (عنصر شاخص) ---------- */
.board td:first-child { box-shadow: inset -4px 0 0 var(--pc); padding-inline-start: 18px; }
.board .pname { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.board .pname a { text-decoration: none; }
.board .pname a:hover { text-decoration: underline; }
.board .sub { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
.board .metric { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; }
.board .metric small { display: block; font-size: 11.5px; color: var(--faint); font-weight: 400; }
.board tr.off td { color: var(--faint); }
.board tfoot td { border-top: 2px solid var(--line-strong); font-weight: 700; background: var(--raised); }
.board tfoot td:first-child { box-shadow: none; }
.board tfoot td:first-child { border-end-start-radius: var(--radius-l); }

.light { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--faint); }
.light.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.light.err { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 22%, transparent); }
.light.idle { background: var(--line-strong); }

/* سرجمع بالای داشبورد */
.totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; margin-bottom: 26px; }
.totals div, .totals a { background: var(--surface); padding: 14px 18px; display: block; }
.totals b { display: block; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.totals span { font-size: 12.5px; color: var(--muted); }
.totals em { font-style: normal; font-size: 12px; color: var(--faint); display: block; }

/* ---------- برچسب ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--raised); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.tag.p { border-color: color-mix(in srgb, var(--pc) 35%, transparent); background: color-mix(in srgb, var(--pc) 9%, var(--surface)); color: var(--ink); }
.tag.p::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--pc); }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.gold { background: var(--gold-soft); color: #7a5e14; border-color: transparent; }
:root[data-theme="dark"] .tag.gold { color: var(--gold); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- فهرست‌های کوتاه ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.list li:last-child { border-bottom: 0; }
.list .ttl { font-weight: 600; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .ttl:hover { text-decoration: underline; }
.list .meta { font-size: 12.5px; color: var(--muted); }
.list .grow { min-width: 0; flex: 1; }
.empty { padding: 28px 22px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 10px; }

/* ---------- پرونده‌ی کاربر ---------- */
.person { margin-bottom: 18px; }
.person > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.person > header h3 { margin: 0; font-size: 18px; }
.person > header .muted { font-size: 13px; }
.presence { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.presence > div { padding: 14px 20px; border-inline-start: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: inset 0 3px 0 var(--pc); }
.presence dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; }
.presence dt { color: var(--muted); }
.presence dd { margin: 0; font-variant-numeric: tabular-nums; }
.presence .absent { color: var(--faint); font-size: 13px; box-shadow: none; }

/* ---------- نفرات برتر ---------- */
.rank { font-variant-numeric: tabular-nums; font-weight: 700; width: 36px; }
.rank.r1 { color: var(--gold); }
.cells { display: flex; gap: 4px; }
.cell { min-width: 44px; text-align: center; font-size: 12.5px; font-weight: 700; padding: 3px 6px; border-radius: 6px; background: color-mix(in srgb, var(--pc) 13%, var(--surface)); color: var(--ink); font-variant-numeric: tabular-nums; }
.cell.none { background: transparent; color: var(--faint); font-weight: 400; border: 1px dashed var(--line); }
.selbar { position: sticky; bottom: 16px; margin-top: 16px; display: none; align-items: center; gap: 12px; justify-content: space-between; background: var(--side); color: #fff; padding: 10px 12px 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.selbar.on { display: flex; }
.selbar .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #fff; }
.selbar .btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1406; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; flex-wrap: wrap; padding: 0 8px; }
.tabs button { border: 0; background: none; font: 600 14px Vazirmatn, sans-serif; padding: 12px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tabs button i { width: 8px; height: 8px; border-radius: 2px; background: var(--pc); }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--pc, var(--gold)); }
[role="tabpanel"][hidden] { display: none; }

/* ---------- پیش‌نمایش پاپ‌آپ ---------- */
.stage { position: relative; height: 380px; border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--line); background:
  linear-gradient(var(--raised), var(--raised)) 16px 16px / 40% 10px no-repeat,
  linear-gradient(var(--line), var(--line)) 16px 40px / calc(100% - 32px) 8px no-repeat,
  linear-gradient(var(--line), var(--line)) 16px 56px / calc(100% - 80px) 8px no-repeat,
  linear-gradient(var(--line), var(--line)) 16px 72px / calc(100% - 120px) 8px no-repeat,
  var(--surface); }
.stage-cap { font-size: 12.5px; color: var(--muted); margin: 8px 2px 0; }
.stage--m { width: 300px; max-width: 100%; height: 520px; margin: 18px auto 0; border-radius: 28px; border: 8px solid #1b1e27; }

/* ---------- آمار ---------- */
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.kv div { background: var(--surface); padding: 12px 16px; }
.kv b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.kv span { font-size: 12.5px; color: var(--muted); }

.prose { line-height: 1.9; }
.prose p { margin: 0 0 .7em; }
.bodybox { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--raised); }

.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; font-size: 13px; background: var(--surface); }
.pager span.cur { background: var(--side); color: #fff; border-color: var(--side); }
.pager span.dis { color: var(--faint); }

details.more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--raised); padding: 1px 6px; border-radius: 4px; direction: ltr; unicode-bidi: isolate; }
pre.code { direction: ltr; text-align: left; background: var(--side); color: #dce4ee; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; }

/* ---------- صفحه‌ی ورود ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--side); }
.login .box { width: min(420px, 100%); background: var(--surface); border-radius: 18px; padding: 34px 30px 28px; }
.login h1 { font: 700 34px/1.15 "Markazi Text", Vazirmatn, serif; margin: 0 0 6px; }
.login p { color: var(--muted); margin: 0 0 22px; }
.login .btn { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.login .sites { display: flex; gap: 6px; margin-top: 24px; justify-content: center; }
.login .sites i { width: 22px; height: 4px; border-radius: 2px; background: var(--pc); }

/* ---------- موبایل ---------- */
@media (max-width: 980px) {
  .grid2, .grid-form { grid-template-columns: minmax(0, 1fr); }
  .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .totals div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .sticky { position: static; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 0 0 auto; width: 260px; transform: translateX(100%); transition: transform .2s; z-index: 50; }
  .side.open { transform: none; box-shadow: -10px 0 40px rgba(0, 0, 0, .3); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 40; }
  .topbar b { font: 700 20px "Markazi Text", serif; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
  .main { padding: 18px 16px 50px; }
  .head h1 { font-size: 28px; }
  .row2, .row3 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ---------- پنل هر پلتفرم داخل مرکز مدیریت ---------- */
.nav .plat[aria-current="page"] { background: color-mix(in srgb, var(--pc) 22%, transparent); color: #fff; box-shadow: inset -3px 0 0 var(--pc); }
body.embed .main { padding: 0; }
body.embed .wrap { max-width: none; }
body.embed .flash { margin: 12px 16px 0; }
.pa { display: flex; flex-direction: column; height: 100vh; }
.pa-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; box-shadow: inset 0 3px 0 var(--pc); }
.pa-title { display: flex; align-items: center; gap: 10px; }
.pa-title i { width: 12px; height: 12px; border-radius: 3px; background: var(--pc); }
.pa-title b { font: 700 22px/1.1 "Markazi Text", Vazirmatn, serif; }
.pa-title .sub { font-size: 12.5px; color: var(--muted); display: block; }
.pa-menu { background: var(--surface); border-bottom: 1px solid var(--line); }
.pa-groups { display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.pa-groups button { flex: none; border: 0; background: none; font: 600 14px Vazirmatn, sans-serif; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.pa-groups button:hover { color: var(--ink); }
.pa-groups button[aria-selected="true"] { color: var(--ink); border-color: var(--pc); }
.pa-items { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; background: var(--raised); }
.pa-items a { flex: none; text-decoration: none; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 8px; color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.pa-items a:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.pa-items a[aria-current="page"] { background: var(--pc); color: #fff; }
.pa-frame { position: relative; flex: 1; min-height: 0; background: var(--surface); }
.pa-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.pa-hint { position: absolute; inset: auto 16px 16px 16px; background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 12px 14px; font-size: 13px; box-shadow: var(--shadow); }
.pa-hint a { font-weight: 700; }
@media (max-width: 820px) { .pa { height: calc(100vh - 52px); } }

/* ---------- نسخه‌ی ۱.۱ ---------- */
.nbadge { margin-inline-start: auto; background: var(--gold); color: #1a1406; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }

/* صندوق پشتیبانی */
.sup { list-style: none; margin: 0; padding: 0; }
.sup > li { border-bottom: 1px solid var(--line); box-shadow: inset -4px 0 0 var(--pc); }
.sup > li:last-child { border-bottom: 0; }
.sup details > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; }
.sup details > summary::-webkit-details-marker { display: none; }
.sup details[open] > summary { background: var(--raised); }
.sup .s-title { font-weight: 700; }
.sup .s-prev { color: var(--muted); font-size: 13.5px; grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup .s-meta { font-size: 12.5px; color: var(--faint); text-align: end; white-space: nowrap; }
.sup .s-body { padding: 4px 18px 18px; }
.thread { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; max-width: 760px; }
.bubble { padding: 9px 13px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; max-width: 85%; }
.bubble small { display: block; font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.bubble.user { background: var(--raised); align-self: flex-start; border-start-start-radius: 4px; }
.bubble.admin { background: color-mix(in srgb, var(--pc) 13%, var(--surface)); align-self: flex-end; border-start-end-radius: 4px; }
.reply { display: grid; gap: 8px; max-width: 760px; }
.reply .row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* تقویم */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); }
.cal .wd { padding: 8px; font-size: 12.5px; color: var(--muted); background: var(--raised); border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.cal .day { min-height: 112px; padding: 6px; border-inline-end: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day.out { background: var(--raised); }
.cal .day .n { font-weight: 700; font-size: 13px; color: var(--muted); }
.cal .day.today .n { background: var(--gold); color: #1a1406; border-radius: 999px; width: 24px; height: 24px; display: grid; place-items: center; }
.cal .day.fri .n { color: var(--bad); }
.cal .ev { font-size: 11.5px; line-height: 1.5; padding: 2px 6px; border-radius: 5px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; background: var(--raised); border-inline-start: 3px solid var(--faint); }
.cal .ev.konkur { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); font-weight: 700; }
.cal .ev.campaign { background: var(--gold-soft); border-color: var(--gold); }
.cal .ev.broadcast { background: color-mix(in srgb, #2F6BD8 12%, var(--surface)); border-color: #2F6BD8; }
.cal .ev.popup, .cal .ev.pin { background: color-mix(in srgb, #7A4BD0 12%, var(--surface)); border-color: #7A4BD0; }
.cal .ev.coupon { background: var(--ok-soft); border-color: var(--ok); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
@media (max-width: 820px) { .cal .day { min-height: 70px; } .cal .ev { font-size: 0; height: 6px; padding: 0; } }

/* ماتریس مسیر */
.matrix td, .matrix th { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: start; }
.heat { display: block; border-radius: 6px; padding: 6px 4px; font-variant-numeric: tabular-nums; font-weight: 600; }
.heat small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bars .b { display: grid; grid-template-columns: 140px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 13.5px; }
.bars .track { height: 12px; background: var(--raised); border-radius: 6px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--gold); border-radius: 6px; }

/* سلامت */
.hcard { padding: 16px 18px; box-shadow: inset 0 3px 0 var(--pc), var(--shadow); }
.hcard dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 0; font-size: 13.5px; }
.hcard dt { color: var(--muted); } .hcard dd { margin: 0; font-variant-numeric: tabular-nums; }
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.meter { height: 6px; background: var(--raised); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.meter i { display: block; height: 100%; background: var(--ok); }
.meter i.warn { background: var(--warn); } .meter i.bad { background: var(--bad); }
pre.report { white-space: pre-wrap; font-family: inherit; font-size: 15px; line-height: 2; margin: 0; }

/* انتخاب‌گر تاریخ شمسی */
.jdp { position: relative; display: flex; gap: 6px; align-items: stretch; }
.jdp-field { flex: 1; text-align: start; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.jdp-field.empty { color: var(--faint); }
.jdp-clear { border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); border-radius: 8px; width: 38px; cursor: pointer; font-size: 18px; }
.jdp-pop { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 40; width: 300px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20,32,51,.18); padding: 12px; }
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdp-head button { border: 0; background: var(--raised); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 18px; color: var(--ink); }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jdp-grid .w { font-size: 12px; color: var(--muted); padding: 4px 0; }
.jdp-grid .d { border: 0; background: none; border-radius: 8px; padding: 7px 0; cursor: pointer; font: inherit; color: var(--ink); font-variant-numeric: tabular-nums; }
.jdp-grid .d:hover { background: var(--raised); }
.jdp-grid .d.today { box-shadow: inset 0 0 0 1px var(--gold); }
.jdp-grid .d.on { background: var(--side); color: #fff; }
.jdp-time { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.jdp-time label { display: flex; align-items: center; gap: 6px; }
.jdp-time input { width: 64px; padding: 6px 8px; }
.jdp-acts { display: flex; justify-content: space-between; margin-top: 10px; }

/* فروش بازه */
.sales-form { padding: 16px 20px 4px; margin-bottom: 22px; }
.sales-range { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-start; }
.sales-range .field { margin-bottom: 14px; }
.sales-range .jdp { min-width: 190px; }
.dash-range { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 18px; margin-bottom: 22px; }
.dash-range b { font-size: 14px; }
.dash-range .jdp { min-width: 170px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* کاربران */
.buys { display: flex; flex-direction: column; gap: 6px; min-width: 260px; }
.buy { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13px; }
.buy .items { flex-basis: 100%; color: var(--muted); font-size: 12.5px; padding-inline-start: 4px; border-inline-start: 2px solid color-mix(in srgb, var(--pc) 45%, transparent); }
label.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* فروش: جعبه‌ی ماه‌ها و مقایسه */
.sales-top { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; margin-bottom: 22px; }
.sales-top .sales-form { margin-bottom: 0; }
.months-box { padding: 14px 16px; }
.mb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mb-head b { font-size: 16px; font-variant-numeric: tabular-nums; }
.mb-nav { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 16px; }
.mb-nav:hover { border-color: var(--muted); }
.mb-nav.dis { opacity: .35; }
.mb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mb-grid a, .mb-grid span { display: block; text-align: center; padding: 7px 4px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink); background: var(--raised); border: 1px solid var(--line); }
.mb-grid a:hover { border-color: var(--gold); }
.mb-grid a[aria-current="true"] { background: var(--side); border-color: var(--side); color: #fff; }
.mb-grid span.dis { color: var(--faint); opacity: .55; }
.mb-cmp { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mb-cmp a { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); }
.mb-cmp a:hover { border-color: var(--gold); }
.mb-cmp a[aria-current="true"] { background: var(--gold-soft); border-color: var(--gold); }
.mb-cmp a.mb-year { color: var(--gold); border-style: dashed; }
.cmp-line { margin: -6px 0 12px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.totals em.cmp { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--muted); }
.totals em.cmp i, .dl { font-style: normal; font-weight: 700; }
.up { color: var(--ok); }
.down { color: var(--bad); }
/* ماه‌به‌ماه */
.mm-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; align-items: end; height: 190px; padding: 10px 6px 0; }
.mm-bars .col { display: flex; gap: 3px; align-items: flex-end; height: 100%; justify-content: center; }
.mm-bars .bar { width: 42%; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 2px; }
.mm-bars .bar.cur { background: var(--gold); }
.mm-bars .bar.old { background: var(--line-strong); }
.mm-names { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; padding: 6px 6px 12px; font-size: 11.5px; color: var(--muted); text-align: center; }
.mm-legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.mm-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
@media (max-width: 1100px) { .sales-top { grid-template-columns: minmax(0, 1fr); } .months-box { order: -1; } }
@media (max-width: 640px) { .mm-bars, .mm-names { gap: 3px; } .mm-names { font-size: 10px; } }

/* تخفیف خودکار */
.tiers { display: flex; flex-direction: column; gap: 6px; }
.tier-row { display: flex; align-items: center; gap: 6px; }
.tier-row input { width: 96px; }
.tier-row .tier-n { width: 22px; height: 22px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.tier-prog { position: relative; display: flex; gap: 8px; align-items: baseline; padding: 2px 0 6px; }
.tier-prog b { min-width: 34px; }
.tier-prog span { color: var(--muted); font-size: 12.5px; }
.tier-prog i { position: absolute; bottom: 2px; right: 0; left: 0; height: 3px; border-radius: 2px; background: var(--line); }
.tier-prog i::after { content: ""; position: absolute; inset: 0 0 0 auto; width: var(--w); background: var(--gold); border-radius: 2px; }
.tier-prog.on b { color: var(--ok); }
.ds-new { padding: 0; margin-bottom: 18px; }
.ds-new > summary { padding: 14px 20px; font-weight: 700; cursor: pointer; }
.ds-form { padding: 4px 20px 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; align-items: start; }
.ds-form > .field, .ds-form > .row2 { min-width: 0; }
.ds-form > .btn { grid-column: 1 / -1; justify-self: start; padding: 10px 28px; }
.ds-form > .flash, .ds-form > .errors { grid-column: 1 / -1; }
@media (max-width: 900px) { .ds-form { grid-template-columns: minmax(0, 1fr); } }
.table tr.sum td { border-top: 2px solid var(--line-strong); background: var(--raised); }

/* فعال‌سازی دستی (صفحه و پنجره‌ی پرونده‌ی کاربر) */
[hidden] { display: none !important; }
.grant-who { margin: 0 0 6px; font-size: 13.5px; }
.grant-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.grant-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(90px, auto) 110px; gap: 10px; align-items: center; padding: 9px 14px; margin: 0; font-weight: 500; border-top: 1px solid var(--line); cursor: pointer; }
.grant-row:first-child { border-top: 0; }
.grant-row:hover:not(.is-active):not(.grant-head) { background: var(--raised); }
.grant-row:has(input:checked) { background: var(--gold-soft); }
.grant-row.is-active { cursor: default; color: var(--muted); }
.grant-row .nt { display: block; font-size: 11.5px; margin-top: 2px; }
.grant-row .pr { font-size: 12.5px; color: var(--muted); text-align: left; }
.grant-row input { width: 17px; height: 17px; margin: 0; vertical-align: middle; accent-color: var(--gold); }
.grant-head { background: var(--raised); font-size: 12.5px; color: var(--muted); font-weight: 600; cursor: default; position: sticky; top: 0; z-index: 1; }
.grant-all { display: inline-flex; gap: 6px; align-items: center; margin: 0; cursor: pointer; color: var(--ink); }
.grant-group { padding: 8px 14px 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; border-top: 1px solid var(--line); background: var(--surface); }
.grant-foot { display: grid; grid-template-columns: auto minmax(140px, 220px) minmax(0, 1fr) auto; gap: 0 16px; align-items: end; margin-top: 14px; }
.grant-foot .field { margin-bottom: 0; min-width: 0; }
.grant-foot .hint { display: block; font-size: 11.5px; margin-top: 3px; }
.grant-go { padding: 10px 22px; white-space: nowrap; }
.grant-go[disabled] { opacity: .5; cursor: not-allowed; }
.grant-history { margin-top: 14px; }
@media (max-width: 760px) {
  .grant-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .grant-row > :nth-child(4) { display: none; }
  .grant-head .grant-all span { display: none; }
  .grant-foot { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .grant-go { width: 100%; justify-content: center; }
}
dialog.modal { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(10, 16, 24, .45); }
/* پنجره‌ی فعال‌سازی دستی از بالا می‌نشیند: وسط‌چین بود و با تیک هر درس (باز شدن جعبه‌ی قیمت، «در حال حساب…» و بعد سطرهای
   تخفیف) ارتفاعش عوض می‌شد و کل پنجره بالا و پایین می‌پرید. حالا بالای پنجره ثابت است و فقط پایینش بلند و کوتاه می‌شود. */
#grant-modal { margin: 20px auto auto; }
#grant-modal .grant-price .gp-lines { min-height: 3.6em; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 16px 18px 18px; }
.modal-body .grant-list { max-height: 52vh; overflow: auto; }
.modal-wait { padding: 30px 0; text-align: center; color: var(--muted); }
.table th.grp { text-align: center; border-bottom: 1px solid var(--line); }
.table.reach td.num { white-space: nowrap; }
.grant-price { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--raised); font-size: 13.5px; }
.grant-price .gp-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.grant-price .gp-row.off span:last-child { color: var(--ok); font-weight: 600; }
.grant-price .gp-final { display: flex; justify-content: space-between; gap: 12px; border-top: 1px dashed var(--line-strong); margin-top: 6px; padding-top: 8px; font-weight: 700; }
.grant-price .gp-final b { font-size: 15px; }
.grant-price .gp-words, .grant-price .gp-note { font-size: 12px; text-align: left; }
.grant-price .gp-note { text-align: right; margin-top: 4px; }
.grant-price .gp-note:empty, .grant-price .gp-words:empty { display: none; }
.money-words { color: var(--ok); font-weight: 600; }
.money-words:empty { display: none; }
.bc-reach { margin-bottom: 14px; }
.bc-reach > header { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bc-reach > header .ttl { display: block; font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none; margin-bottom: 2px; }
.bc-reach .bc-tot { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.bc-reach .bc-tot b { font-size: 17px; }
.bc-reach .bc-tot small { display: block; color: var(--faint); font-size: 11.5px; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
@media (max-width: 760px) { .pf-grid { grid-template-columns: minmax(0, 1fr); } }
.pf-form .hint { display: block; font-size: 12px; margin-top: 4px; }
.pf-person { margin-top: 14px; }
.pf-person > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pf-person > header h3 { margin: 0 0 4px; font-size: 16px; }
.pf-grid .pf-wide { grid-column: 1 / -1; }
.am-link { display: inline-block; margin-top: 10px; font-size: 12.5px; color: var(--muted); text-decoration: underline dotted; }
.am-link:hover { color: var(--ink); }
.am-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 28px; }
@media (max-width: 760px) { .am-grid { grid-template-columns: minmax(0, 1fr); } }
.am-grid h3 { margin: 0 0 8px; font-size: 14.5px; }
.am-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13.5px; }
.am-dl dt { color: var(--muted); }
.am-dl dd { margin: 0; }
.am-confirm { display: flex; gap: 8px; align-items: center; margin: 10px 0 14px; font-size: 13.5px; }
