/* پالت از تم خانهٔ اپ ژینا گرفته شده، همان پالت سایت معرفی. */
:root {
  --bg: #fcf8f4; --surface: #fffcf9; --surface-alt: #f7f0ec; --ink: #302139; --muted: #776c7c; --line: #ede2de;
  --accent: #f46f69; --accent-ink: #40202a; --accent-soft: #fceae4; --teal: #478a83; --teal-soft: #e7f1ef;
  --warn: #9a5b12; --warn-soft: #fbeedb; --danger: #b3261e; --danger-soft: #fbe4e2; --focus: #478a83;
  --radius: 14px; --shadow: 0 8px 24px rgba(48, 33, 57, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #281f30; --surface: #302638; --surface-alt: #362b3e; --ink: #f8eff6; --muted: #c5b5c9; --line: #514057;
    --accent: #ff8780; --accent-ink: #2b1620; --accent-soft: #443040; --teal: #6fb3aa; --teal-soft: #2c3c3f;
    --warn: #f2c27b; --warn-soft: #43362a; --danger: #ffb4ab; --danger-soft: #4a2a2e; --focus: #6fb3aa;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif; font-size: 15px; line-height: 1.8; }
h1, h2 { margin: 0; line-height: 1.5; font-weight: 700; }
h1 { font-size: 24px; }
h2 { font-size: 17px; margin-bottom: 12px; }
a { color: var(--teal); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 16px; top: -60px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { top: 12px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; direction: ltr; unicode-bidi: isolate; }
.meta { color: var(--muted); font-size: 13px; }

.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-inline-end: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; padding-inline: 8px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { color: var(--ink); text-decoration: none; padding: 9px 12px; border-radius: 10px; min-height: 44px; display: flex; align-items: center; }
.side nav a:hover { background: var(--surface-alt); }
.side nav a.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
@media (prefers-color-scheme: dark) { .side nav a.is-active { color: var(--ink); } }
.who { margin-top: auto; display: flex; flex-direction: column; padding: 12px; border-top: 1px solid var(--line); }
.who span { color: var(--muted); font-size: 13px; }
.main { padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.actions { display: flex; gap: 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .side nav { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; }
  .who { margin: 0 auto 0 0; border: 0; padding: 0; flex-direction: row; align-items: center; gap: 10px; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.narrow-card { max-width: 480px; margin-top: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.stack .field { width: 100%; }
.section-title { margin: 8px 0 12px; color: var(--muted); font-size: 14px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); margin: 0; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { font-size: 28px; line-height: 1.4; }
.stat:hover { border-color: var(--teal); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-danger:hover { border-color: var(--danger); }
.btn.wide { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--teal); font: inherit; cursor: pointer; min-height: 44px; text-align: start; }
form.inline { display: inline; }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field > span, .filters label > span, .row-form label > span:not(.sr-only) { font-weight: 600; font-size: 14px; }
.field small, .card small { color: var(--muted); font-size: 12.5px; display: block; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-height: 44px; width: 100%; }
textarea { line-height: 1.9; resize: vertical; }
.body-input { min-height: 480px; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--teal); }
input[type="file"] { padding: 8px; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 2px solid var(--teal-soft); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.counter { color: var(--muted); font-size: 12px; text-align: left; }
.counter.over { color: var(--danger); }
.narrow { width: 90px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; }
.filters label:first-child { flex-basis: 280px; }
.row-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row-form label { display: flex; flex-direction: column; gap: 4px; flex: 1 1 160px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: start; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--surface-alt); }
tbody tr:last-child td { border-bottom: 0; }
.cell-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reset summary { cursor: pointer; color: var(--teal); min-height: 44px; display: flex; align-items: center; }

.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--teal-soft); color: var(--teal); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-muted { background: var(--surface-alt); color: var(--muted); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.notice { background: var(--teal-soft); color: var(--ink); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.alert { background: var(--danger-soft); color: var(--ink); border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.alert p { margin: 0; font-weight: 600; }
.alert ul { margin: 4px 0 0; padding-inline-start: 20px; }
.empty { color: var(--muted); padding: 28px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; }
.pager a { min-height: 44px; display: inline-flex; align-items: center; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.activity li:last-child { border-bottom: 0; }
.activity time { color: var(--muted); font-size: 13px; }
.danger-zone { border-color: var(--danger-soft); }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.editor-side { position: sticky; top: 16px; }
.cover { border-radius: 10px; margin-bottom: 12px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--surface-alt); }
@media (max-width: 1000px) { .editor { grid-template-columns: 1fr; } .editor-side { position: static; } }

.bare main { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(420px, 100%); text-align: center; }
.login h1 { margin: 12px 0 4px; font-size: 22px; }
.login form { text-align: start; margin-top: 16px; }
