:root {
  --bg: #0f1115; --panel: #161a21; --line: #232832; --text: #e6e8eb; --muted: #8d96a3;
  --up: #22c55e; --down: #ef4444; --warn: #f59e0b; --accent: #60a5fa;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.6; }
.num, td.n, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.up { color: var(--up); } .down { color: var(--down); }

header.top { display: flex; align-items: center; gap: 24px; padding: 10px 20px; border-bottom: 1px solid var(--line);
  background: #12151b; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 16px; } .ver { color: var(--muted); font-weight: 400; font-size: 11px; }
nav { display: flex; gap: 4px; flex: 1; }
nav a { color: var(--muted); padding: 6px 12px; border-radius: 6px; }
nav a.on, nav a:hover { color: var(--text); background: var(--panel); }
.who { display: flex; align-items: center; gap: 12px; }
button.link { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--panel); }
.pill.warn { color: var(--warn); max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding: 20px; max-width: 1600px; margin: 0 auto; }

.login { max-width: 340px; margin: 12vh auto; text-align: center; }
.login h1 { margin: 0; } .login form { display: grid; gap: 14px; margin-top: 24px; text-align: right; }
.login label { display: grid; gap: 6px; color: var(--muted); }
input, select, button { font: inherit; }
input, select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.login button, .tabs button { background: var(--accent); color: #0b1020; border: 0; border-radius: 6px; padding: 9px; cursor: pointer; font-weight: 700; }
.error { color: var(--down); min-height: 1.4em; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.card .sym { color: var(--muted); font-size: 12px; } .card .px { font-size: 20px; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; margin-bottom: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.panel h2 { font-size: 14px; margin: 0 0 10px; }
.hint { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%;
  background: var(--line); color: var(--muted); font-size: 11px; cursor: help; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat .v { font-size: 18px; font-weight: 700; } .stat .k { color: var(--muted); font-size: 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

table { width: 100%; border-collapse: collapse; }
table.mini td, table.mini th { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: right; }
table.mini th { color: var(--muted); font-weight: 400; font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 16px; }

.toolbar { display: grid; gap: 10px; margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { background: var(--panel); color: var(--muted); border: 1px solid var(--line); font-weight: 400; padding: 6px 14px; }
.tabs button.on { background: var(--accent); color: #0b1020; border-color: var(--accent); font-weight: 700; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { width: 180px; }
.chk { display: flex; gap: 6px; align-items: center; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.scan { font-size: 13px; white-space: nowrap; }
table.scan th { position: sticky; top: 0; background: #12151b; color: var(--muted); font-weight: 400; padding: 8px;
  text-align: right; cursor: pointer; user-select: none; border-bottom: 1px solid var(--line); }
table.scan th.sorted::after { content: " ▾"; } table.scan th.sorted.asc::after { content: " ▴"; }
table.scan td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.scan tr:hover td { background: #1b2029; }
.sym-cell { font-weight: 700; }
.score { display: inline-block; min-width: 44px; text-align: center; border-radius: 5px; padding: 1px 6px; font-weight: 700; direction: ltr; }
.badge { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--line); color: var(--muted); margin-left: 3px; }
.badge.b-up { background: rgba(34,197,94,.15); color: var(--up); }
.badge.b-down { background: rgba(239,68,68,.15); color: var(--down); }
.badge.b-warn { background: rgba(245,158,11,.15); color: var(--warn); }
.badge.b-info { background: rgba(96,165,250,.15); color: var(--accent); }
.dim { opacity: .55; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } header.top { flex-wrap: wrap; gap: 8px; } }
