:root {
    --gold: #ca9b5d;
    --gold-soft: #d4a916;
    --bg: #09111d;
    --panel: #131c2a;
    --card: #1c2432;
    --border: rgba(255, 255, 255, 0.08);
    --title: #f2f2f2;
    --muted: #9aa3b0;
    --green: #66d98c;
    --red: #f27373;
    --input: rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body, #root, .admin {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(202, 155, 93, 0.08), transparent 55%), var(--bg);
    color: var(--title);
    font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
}
button, input, textarea, select {
    font-family: inherit;
}
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.card {
    background: linear-gradient(180deg, #2a3448, #1c2432);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}
.login { width: min(420px, 100%); display: grid; gap: 10px; }
.brand .logo { font-size: 36px; font-weight: 700; color: var(--gold); }
.brand .logo-ex { font-size: 36px; font-weight: 500; color: #f0e6c0; }
.brand-sub { color: var(--muted); margin-top: 4px; font-size: 13px; }
.center { text-align: center; margin-bottom: 8px; }
label { font-size: 13px; color: var(--muted); }
input, textarea, select {
    background: var(--input);
    border: 1px solid var(--border);
    color: var(--title);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
}
textarea { min-height: 220px; width: 100%; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
button { cursor: pointer; }
button.gold {
    background: linear-gradient(180deg, #d4a916, #c09249);
    color: #20150a;
    border: 0;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 700;
}
button.gold:disabled { opacity: .55; cursor: default; }
button.ghost {
    background: transparent;
    color: var(--gold);
    border: 1px solid rgba(202, 155, 93, 0.35);
    border-radius: 10px;
    padding: 8px 12px;
}
.err { color: var(--red); font-size: 13px; }
.err.small { font-size: 11px; margin-top: 6px; }
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side {
    background: #0d1522;
    border-left: 1px solid var(--border);
    padding: 18px 12px;
    overflow: auto;
}
.side .brand { padding: 0 8px 16px; }
.nav {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: transparent;
    color: #d6d6d6;
    border: 0;
    border-radius: 10px;
    padding: 8px 10px;
    text-align: right;
    font-size: 13px;
}
.nav.on { background: rgba(202, 155, 93, 0.14); color: var(--gold); }
.g-label { font-size: 11px; color: var(--muted); margin: 14px 8px 4px; }
.main { display: flex; flex-direction: column; min-width: 0; }
.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
}
.content { padding: 22px; }
.head-row { display: flex; justify-content: space-between; align-items: center; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2.g-title { font-size: 14px; color: var(--muted); margin: 24px 0 10px; }
h3 { margin: 0 0 10px; font-size: 14px; color: var(--gold); }
.hint { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }
.code, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.stats { display: flex; gap: 12px; margin: 16px 0 8px; }
.stat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 18px;
    min-width: 100px;
}
.stat .n { font-size: 26px; font-weight: 700; }
.stat .n.ok { color: var(--green); }
.stat .n.bad { color: var(--red); }
.stat .l { color: var(--muted); font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card.svc { text-align: right; color: inherit; cursor: pointer; }
.svc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--red); display: inline-block; flex: 0 0 8px;
}
.dot.ok { background: var(--green); }
.dot.bad { background: var(--red); }
.tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.tab {
    background: var(--panel);
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
}
.tab.on { color: #20150a; background: var(--gold); border-color: transparent; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    color: #d6d6d6;
    max-height: 480px;
    overflow: auto;
}
.row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.row.wrap { flex-wrap: wrap; }
.back { margin-bottom: 10px; }
.banner {
    margin-top: 12px;
    background: rgba(242, 115, 115, 0.12);
    color: #ffc9c9;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
}
@media (max-width: 860px) {
    .layout { grid-template-columns: 1fr; }
    .side { display: none; }
    .split { grid-template-columns: 1fr; }
}
