@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* سئویار — پنل سنجش
   پالت: جوهر شبانه + چهار رنگ داده
   امضا: ریل موقعیت */

:root {
  --ink:      #12141C;
  --panel:    #191C27;
  --panel-2:  #1F2331;
  --line:     #2A2F40;
  --line-2:   #353B4F;
  --fg:       #E7EAF2;
  --fg-2:     #9AA1B8;
  --fg-3:     #697089;

  --sky:      #58C4F0;
  --violet:   #A98BF5;
  --amber:    #F0B152;
  --rose:     #F07396;
  --mint:     #5FD3A8;

  --r:   10px;
  --r-s: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: Vazirmatn, 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ── چیدمان ─────────────────────────────────── */

.shell { display: flex; min-height: 100vh; }

.rail {
  width: 232px; flex: none;
  background: var(--panel);
  border-inline-start: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: linear-gradient(150deg, var(--sky), var(--violet));
  box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset;
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; inset-inline-start: 6px; top: 11px;
  width: 14px; height: 4px; border-radius: 2px; background: rgba(18,20,28,.75);
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.03em; }

.rail-label { display: block; font-size: 11px; color: var(--fg-3); padding: 0 8px 5px; }
.site-pick { padding-bottom: 16px; }
.site-pick select {
  width: 100%; background: var(--panel-2); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 8px 10px; direction: ltr; text-align: right;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--r-s);
  color: var(--fg-2); transition: background .13s, color .13s;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav a:hover { background: var(--panel-2); color: var(--fg); }
.nav a.on { background: var(--panel-2); color: var(--fg); box-shadow: inset 2px 0 0 var(--sky); }
.nav a.on svg { color: var(--sky); opacity: 1; }

.rail-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.sync-note { font-size: 11px; color: var(--fg-3); padding: 0 8px 10px; line-height: 1.5; }
.sync-note b { color: var(--fg-2); font-weight: 600; }
.logout { display: block; padding: 7px 10px; font-size: 12px; color: var(--fg-3); border-radius: var(--r-s); }
.logout:hover { background: var(--panel-2); color: var(--rose); }

.main { flex: 1; min-width: 0; padding: 28px 32px 60px; max-width: 1400px; }

/* ── سرصفحه ─────────────────────────────────── */

.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.ph h1 { font-size: 25px; }
.ph-sub { margin: 4px 0 0; color: var(--fg-3); font-size: 12.5px; }
.ph-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── دکمه و فرم ─────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--panel-2); color: var(--fg);
  border: 1px solid var(--line-2); border-radius: var(--r-s);
  padding: 8px 15px; cursor: pointer;
  transition: border-color .13s, background .13s;
}
.btn:hover { border-color: var(--fg-3); background: #252A3A; }
.btn.primary { background: var(--sky); border-color: var(--sky); color: #0C1219; font-weight: 700; }
.btn.primary:hover { background: #7AD2F5; border-color: #7AD2F5; }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--rose); color: var(--rose); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; color: var(--fg-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--fg-3); margin-top: 5px; line-height: 1.6; }
.inp, textarea.inp, select.inp {
  width: 100%; background: var(--ink); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--r-s);
  padding: 9px 12px; outline: none; transition: border-color .13s;
}
.inp:focus { border-color: var(--sky); }
textarea.inp { min-height: 120px; resize: vertical; line-height: 1.9; }
.inp.ltr { direction: ltr; text-align: left; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }

/* ── کارت و پنل ─────────────────────────────── */

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h2 { font-size: 15px; }
.card-h .sub { font-size: 11.5px; color: var(--fg-3); }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── آمار ───────────────────────────────────── */

.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px;
  border-top: 2px solid var(--line-2);
}
.stat.sky    { border-top-color: var(--sky); }
.stat.violet { border-top-color: var(--violet); }
.stat.amber  { border-top-color: var(--amber); }
.stat.mint   { border-top-color: var(--mint); }
.stat-l { font-size: 11.5px; color: var(--fg-3); margin-bottom: 3px; }
.stat-v { font-size: 24px; font-weight: 800; letter-spacing: -.03em; display: flex; align-items: baseline; gap: 8px; }

.delta { font-size: 12px; font-weight: 600; }
.delta.up   { color: var(--mint); }
.delta.down { color: var(--rose); }
.delta.flat { color: var(--fg-3); }

/* ── ریل موقعیت (امضا) ──────────────────────── */

.rail-pos { position: relative; height: 22px; min-width: 150px; display: flex; align-items: center; }
.rail-pos::before {
  content: ''; position: absolute; inset-inline: 0; height: 2px;
  background: var(--line); border-radius: 2px;
}
.rp-zone { position: absolute; height: 2px; border-radius: 2px; }
.rp-z1 { inset-inline-start: 0; width: 33.3%; background: rgba(95,211,168,.30); }
.rp-z2 { inset-inline-start: 33.3%; width: 33.3%; background: rgba(240,177,82,.20); }

.rp-track { position: absolute; height: 2px; border-radius: 2px; }
.rp-track.up   { background: var(--mint); }
.rp-track.down { background: var(--rose); }

.rp-ghost {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink); border: 1.5px solid var(--fg-3);
  transform: translateX(50%);
}
.rp-dot {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  transform: translateX(50%); box-shadow: 0 0 0 3px var(--panel);
}
.rp-dot.top { background: var(--mint); }
.rp-dot.p1  { background: var(--sky); }
.rp-dot.p2  { background: var(--amber); }
.rp-dot.far { background: var(--fg-3); }
.rp-num {
  position: absolute; inset-inline-end: -34px; font-size: 11.5px;
  color: var(--fg-2); font-weight: 600;
}

/* ── جدول ───────────────────────────────────── */

.tbl-wrap { overflow-x: auto; margin: 0 -18px -18px; padding: 0 18px 4px; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: right; font-size: 11.5px; font-weight: 600; color: var(--fg-3);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
th a { color: inherit; }
th a:hover { color: var(--fg); }
th.on { color: var(--sky); }
td { padding: 10px; border-bottom: 1px solid rgba(42,47,64,.5); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(31,35,49,.5); }
td.n { font-weight: 600; white-space: nowrap; }
td.kw { max-width: 320px; }
.kw-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.rail-cell { width: 190px; padding-inline-end: 40px; }

.url {
  direction: ltr; text-align: left; font-size: 12px; color: var(--fg-2);
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px;
}
.url:hover { color: var(--sky); }

/* ── نشان‌ها ────────────────────────────────── */

.tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; white-space: nowrap;
  border: 1px solid transparent;
}
.tag.ctr   { color: var(--amber);  border-color: rgba(240,177,82,.35);  background: rgba(240,177,82,.09); }
.tag.push  { color: var(--sky);    border-color: rgba(88,196,240,.35);  background: rgba(88,196,240,.09); }
.tag.climb { color: var(--mint);   border-color: rgba(95,211,168,.35);  background: rgba(95,211,168,.09); }
.tag.far   { color: var(--fg-3);   border-color: var(--line-2); }
.tag.ok    { color: var(--mint);   border-color: rgba(95,211,168,.35);  background: rgba(95,211,168,.09); }
.tag.warn  { color: var(--amber);  border-color: rgba(240,177,82,.35);  background: rgba(240,177,82,.09); }
.tag.bad   { color: var(--rose);   border-color: rgba(240,115,150,.35); background: rgba(240,115,150,.09); }

/* ── نمودار ─────────────────────────────────── */

.chart { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .tick { fill: var(--fg-3); font-size: 11px; text-anchor: middle; font-family: Vazirmatn, sans-serif; }
.chart .hp { fill: transparent; }
.chart .hp:hover { fill: rgba(88,196,240,.28); }

.legend { display: flex; gap: 16px; font-size: 12px; color: var(--fg-2); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-inline-end: 6px; vertical-align: middle; }
.legend .l-sky i { background: var(--sky); }
.legend .l-violet i { background: var(--violet); }

/* ── پیام‌ها ────────────────────────────────── */

.flash {
  padding: 11px 16px; border-radius: var(--r); margin-bottom: 18px;
  border: 1px solid; font-size: 13px;
}
.flash.ok   { border-color: rgba(95,211,168,.4);  background: rgba(95,211,168,.08);  color: var(--mint); }
.flash.err  { border-color: rgba(240,115,150,.4); background: rgba(240,115,150,.08); color: var(--rose); }
.flash.warn { border-color: rgba(240,177,82,.4);  background: rgba(240,177,82,.08);  color: var(--amber); }

.empty {
  text-align: center; padding: 56px 24px; color: var(--fg-3);
  border: 1px dashed var(--line-2); border-radius: var(--r);
}
.empty h3 { color: var(--fg); font-size: 16px; margin-bottom: 8px; }
.empty p { margin: 0 auto 18px; max-width: 420px; line-height: 1.9; font-size: 13px; }
.empty-mini { color: var(--fg-3); font-size: 12.5px; padding: 24px; text-align: center; }

/* ── چک‌لیست تحلیل ──────────────────────────── */

.checks { display: flex; flex-direction: column; gap: 1px; }
.chk { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid rgba(42,47,64,.5); align-items: flex-start; }
.chk:last-child { border-bottom: none; }
.chk-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 8px; }
.chk-dot.ok   { background: var(--mint); }
.chk-dot.warn { background: var(--amber); }
.chk-dot.bad  { background: var(--rose); }
.chk-body { flex: 1; min-width: 0; }
.chk-label { font-weight: 600; font-size: 13px; }
.chk-note { color: var(--fg-3); font-size: 12.5px; line-height: 1.7; }

/* ── حلقه امتیاز ────────────────────────────── */

.score-ring { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 86px; height: 86px; flex: none; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 800; letter-spacing: -.04em;
}

/* ── پیشنهاد لینک ───────────────────────────── */

.link-sug { border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px 14px; margin-bottom: 9px; }
.link-sug-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.anchor { background: rgba(88,196,240,.12); color: var(--sky); padding: 2px 8px; border-radius: var(--r-s); font-weight: 600; font-size: 12.5px; }
.link-sug .url { max-width: none; }
.code-line {
  direction: ltr; text-align: left; background: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 8px 10px; margin-top: 8px;
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--fg-2);
  overflow-x: auto; white-space: nowrap;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 4px 11px; border-radius: 20px; font-size: 12.5px; cursor: pointer;
}
.chip:hover { border-color: var(--sky); color: var(--sky); }

.acc { border: 1px solid var(--line); border-radius: var(--r-s); margin-bottom: 8px; overflow: hidden; }
.acc-q { padding: 11px 14px; font-weight: 600; font-size: 13px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.acc-q:hover { background: var(--panel-2); }
.acc-a { padding: 0 14px; max-height: 0; overflow: hidden; color: var(--fg-2); font-size: 13px; transition: max-height .2s, padding .2s; }
.acc.open .acc-a { max-height: 400px; padding: 0 14px 13px; }

.list-num { list-style: none; padding: 0; margin: 0; counter-reset: n; }
.list-num li {
  counter-increment: n; padding: 9px 0 9px 0; padding-inline-start: 30px;
  position: relative; border-bottom: 1px solid rgba(42,47,64,.5); font-size: 13px;
}
.list-num li:last-child { border-bottom: none; }
.list-num li::before {
  content: counter(n, persian); position: absolute; inset-inline-start: 0; top: 9px;
  color: var(--fg-3); font-size: 11.5px; font-weight: 600;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .inp { width: auto; min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.seg a { padding: 7px 13px; font-size: 12.5px; color: var(--fg-2); border-inline-start: 1px solid var(--line); }
.seg a:first-child { border-inline-start: none; }
.seg a:hover { background: var(--panel-2); color: var(--fg); }
.seg a.on { background: var(--sky); color: #0C1219; font-weight: 700; }

/* ── ورود ───────────────────────────────────── */

.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-box { width: 100%; max-width: 370px; }
.gate-box .card { padding: 26px; }
.gate .brand { justify-content: center; padding-bottom: 22px; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; }
  .brand { padding: 0; }
  .site-pick { padding: 0; flex: 1; min-width: 160px; }
  .rail-label { display: none; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .nav a span { display: none; }
  .nav a { padding: 9px 13px; }
  .rail-foot { margin: 0; padding: 0; border: none; }
  .sync-note { display: none; }
  .main { padding: 20px 16px 48px; }
  .g4, .g3, .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .ph h1 { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 3px; }
