@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Medium.ttf) format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.ttf) format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f5f4fb; --surface: #fff; --text: #1d1b2c; --muted: #6f6c85; --line: #e7e5f2;
  --brand: #7c3aed; --brand2: #ec4899; --ok: #16a34a; --bad: #dc2626; --warn: #d97706;
  --grad: linear-gradient(135deg, var(--brand), var(--brand2));
  --radius: 16px; --shadow: 0 6px 24px rgba(40, 20, 90, .07);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f0d1a; --surface: #1a1729; --text: #ecebf5; --muted: #9a97b3; --line: #2b2840; --shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Vazirmatn, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.4; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.15rem; }
.muted { color: var(--muted); font-size: .9rem; }

.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1040px; margin: auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.15rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { padding: 6px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a.on, .nav a:hover { background: var(--bg); color: var(--text); }
.coins-pill { background: var(--grad); color: #fff; padding: 4px 14px; border-radius: 99px; font-weight: 700; white-space: nowrap; }

main { max-width: 1040px; margin: auto; padding: 24px 16px 64px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat .v { font-size: 1.7rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .9rem; }
.hero { background: var(--grad); color: #fff; border: 0; }
.hero .muted { color: rgba(255,255,255,.85); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--grad); color: #fff; padding: 10px 20px; border-radius: 12px; min-height: 44px; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn.white { background: #fff; color: var(--brand); }
.btn.sm { padding: 4px 12px; min-height: 32px; font-size: .85rem; }
.btn.danger { background: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

label { display: block; font-weight: 500; margin: 12px 0 6px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
textarea { min-height: 110px; resize: vertical; }
.ltr { direction: ltr; text-align: left; }

.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.types label { margin: 0; cursor: pointer; }
.types input { display: none; }
.types span { display: block; text-align: center; padding: 14px 8px; border: 2px solid var(--line); border-radius: 14px; font-weight: 700; }
.types small { display: block; font-weight: 400; color: var(--muted); }
.types input:checked + span { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; }
.table-wrap { overflow-x: auto; }
.bar { height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--grad); }
.tag { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .8rem; font-weight: 500; background: var(--bg); }
.tag.active, .tag.paid { color: var(--ok); } .tag.done { color: var(--brand); } .tag.canceled, .tag.failed { color: var(--bad); } .tag.paused, .tag.pending { color: var(--warn); }
.pos { color: var(--ok); font-weight: 700; } .neg { color: var(--bad); font-weight: 700; }

.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.alert.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.alert.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }

.pkg { text-align: center; position: relative; }
.pkg .v { font-size: 2rem; font-weight: 700; }
.pkg .badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-size: .75rem; padding: 2px 12px; border-radius: 99px; }

body.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth { width: 100%; max-width: 400px; }
.result { text-align: center; max-width: 420px; width: 100%; display: grid; gap: 10px; }
.result-icon { width: 72px; height: 72px; border-radius: 50%; margin: auto; display: grid; place-items: center; font-size: 2rem; color: #fff; }
.result-icon.ok { background: var(--ok); } .result-icon.fail { background: var(--bad); } .result-icon.wait { background: var(--warn); }
.lang select { width: auto; padding: 4px 8px; border-radius: 10px; font-size: .85rem; }
.pkg .price { font-size: 1.3rem; font-weight: 700; margin: 4px 0 12px; }
.pkg .pay { display: grid; gap: 8px; }
.logo { text-decoration: none; }
.count { background: var(--bad); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .75rem; }
.logs tr.unseen td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.tag.lv-error, .tag.lv-crash { color: var(--bad); } .tag.lv-warn { color: var(--warn); } .tag.lv-report { color: var(--brand); } .tag.lv-info { color: var(--muted); }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow: auto; max-height: 520px; font-size: .82rem; white-space: pre-wrap; word-break: break-word; }
code { background: var(--bg); border-radius: 6px; padding: 0 5px; font-size: .85em; }
.steps { padding-inline-start: 20px; color: var(--muted); }

@media (max-width: 640px) {
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
}
