:root {
  --bg: #f4f3ef;
  --panel: #ffffff;
  --ink: #1b1d22;
  --ink-2: #5b606b;
  --ink-3: #8b909b;
  --line: #e4e2dc;
  --side: #15181d;
  --side-ink: #a8adb8;
  --accent: #0f766e;
  --accent-soft: #e3f2f0;
  --ok: #15803d;
  --ok-soft: #e7f5ec;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --warn: #a15c07;
  --warn-soft: #fdf3e1;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Vazirmatn", Tahoma, system-ui, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--ink-3); }
.ltr { direction: ltr; unicode-bidi: plaintext; text-align: left; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--ink-2); }
.small { font-size: 12px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.brand .mark {
  width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
}
.brand b { font-size: 16px; display: block; line-height: 1.3; }
.brand span { font-size: 12px; color: var(--ink-3); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .brand { color: #fff; margin: 0 6px 22px; }
.side .brand span { color: #6c7280; }
.nav { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; }
.nav:hover { color: #fff; background: #1f232a; }
.nav.on { color: #fff; background: #262b33; box-shadow: inset -3px 0 0 var(--accent); }
.nav:focus-visible { outline: 2px solid var(--accent); }
.side .grow { flex: 1; }
.side .who { font-size: 12px; padding: 10px 12px; border-top: 1px solid #262b33; color: #6c7280; word-break: break-all; }
.main { padding: 28px 32px 60px; max-width: 1100px; width: 100%; }
h1 { font-size: 20px; margin: 0 0 4px; font-weight: 800; }
h2 { font-size: 15px; margin: 0 0 14px; font-weight: 700; }
.lead { color: var(--ink-2); margin: 0 0 22px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { all: unset; cursor: pointer; padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-color: var(--accent); font-weight: 700; }
.tab:focus-visible { outline: 2px solid var(--accent); }

/* ---------- forms ---------- */
label.f { display: block; }
label.f > span { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf8;
}
textarea { height: auto; min-height: 160px; padding: 10px 12px; font-family: var(--mono); font-size: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > .f { flex: 1; min-width: 160px; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: flex; gap: 6px; align-items: center; cursor: pointer; }

.btn {
  height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 700; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); font-weight: 500; }
.btn.danger { background: transparent; border-color: #f3c7c2; color: var(--bad); font-weight: 500; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12px; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- results ---------- */
.msg { padding: 10px 14px; border-radius: 8px; margin-top: 14px; }
.msg.bad { background: var(--bad-soft); color: var(--bad); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.result { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 16px; }
.kv { display: grid; grid-template-columns: 160px 1fr auto; gap: 8px 14px; align-items: center; }
.kv dt { color: var(--ink-2); font-size: 12px; }
.kv dd { margin: 0; font-weight: 700; }
.copy { all: unset; cursor: pointer; font-size: 11px; color: var(--accent); padding: 2px 6px; border-radius: 4px; }
.copy:hover { background: var(--accent-soft); }
.pill { display: inline-block; white-space: nowrap; padding: 1px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; background: #eceae4; color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.verdict { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 700; }
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.bad { background: var(--bad-soft); color: var(--bad); }
.verdict .big { font-size: 22px; font-weight: 800; margin-inline-start: auto; }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat span { font-size: 12px; color: var(--ink-2); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: right; font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid #efede8; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }
.revoked td { opacity: .5; }

.secret { background: #111418; color: #d8f3ee; border-radius: 8px; padding: 14px; font-family: var(--mono); font-size: 13px; word-break: break-all; margin: 10px 0; }
pre.code { background: #111418; color: #d7dae0; border-radius: 8px; padding: 14px; overflow-x: auto; font-size: 12px; direction: ltr; text-align: left; margin: 8px 0 0; }
.endpoint { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; background: var(--panel); }
.endpoint header { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #faf9f6; border-bottom: 1px solid var(--line); }
.endpoint .body { padding: 12px 14px; }
.method { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px; background: var(--accent); color: #fff; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .side .brand, .side .grow, .side .who { display: none; }
  .main { padding: 20px 16px 48px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 110px 1fr auto; }
}
@media (max-width: 520px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
