/* SM VPN admin panel. Colours match the app. No scripts, no external assets. */
:root {
  --blue: #1d6bff; --blue-deep: #0b5cf0; --blue-soft: #e8f0ff; --green: #12b76a; --red: #d92d20; --amber: #f79009;
  --bg: #f5f7fb; --card: #fff; --text: #101828; --muted: #667085; --line: #e4e7ec;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --blue: #5b93ff; --blue-deep: #1d6bff; --blue-soft: #12305f; --bg: #0b0f17; --card: #121926; --text: #f2f4f7; --muted: #98a2b3; --line: #232b38; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); }
h1 { font-size: 1.6rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 16px 0 8px; }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--blue-soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); }
small { color: var(--muted); }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand span { color: var(--muted); font-weight: 500; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px; }
.top nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 500; }
.top nav a:hover, .top nav a[aria-current="page"] { background: var(--blue-soft); color: var(--text); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.narrow { max-width: 460px; margin: 40px auto; }
.flash { background: #ecfdf3; color: #05603a; border: 1px solid #abefc6; padding: 10px 14px; border-radius: 12px; }
.error { background: #fef3f2; color: #912018; border: 1px solid #fecdca; padding: 10px 14px; border-radius: 12px; }
@media (prefers-color-scheme: dark) { .flash { background: #053321; color: #a6f4c5; border-color: #085d3a; } .error { background: #3a1212; color: #fecdca; border-color: #7a271a; } }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
label small { font-weight: 400; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
button, .button { font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 10px; padding: 9px 16px; background: var(--blue); color: #fff; text-decoration: none; display: inline-block; }
button:hover, .button:hover { background: var(--blue-deep); }
button.secondary, .button.secondary { background: var(--blue-soft); color: var(--text); }
button.danger { background: var(--red); }
button.link { background: none; color: var(--blue); padding: 0; font-weight: 500; }
.stack { display: grid; gap: 14px; }
.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 8px 0; }
.inline.tight { margin: 0; display: inline-flex; }
.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.grid-form .full { grid-column: 1 / -1; }
.steps { padding-left: 1.2em; }
.steps li { margin-bottom: 10px; }
.qr { margin: 10px 0; border-radius: 8px; background: #fff; padding: 6px; image-rendering: pixelated; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: 0.9rem; }
.stat b { font-size: 1.8rem; line-height: 1.2; margin: 4px 0; }

.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 180px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 0.75rem; }
.bar i { display: block; width: 100%; background: var(--blue); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bar span { order: -1; color: var(--muted); }
.bar small { white-space: nowrap; }
@media (max-width: 640px) { .bar small { display: none; } }
.bar i.h0 { height: 0%; }
.bar i.h5 { height: 5%; }
.bar i.h10 { height: 10%; }
.bar i.h15 { height: 15%; }
.bar i.h20 { height: 20%; }
.bar i.h25 { height: 25%; }
.bar i.h30 { height: 30%; }
.bar i.h35 { height: 35%; }
.bar i.h40 { height: 40%; }
.bar i.h45 { height: 45%; }
.bar i.h50 { height: 50%; }
.bar i.h55 { height: 55%; }
.bar i.h60 { height: 60%; }
.bar i.h65 { height: 65%; }
.bar i.h70 { height: 70%; }
.bar i.h75 { height: 75%; }
.bar i.h80 { height: 80%; }
.bar i.h85 { height: 85%; }
.bar i.h90 { height: 90%; }
.bar i.h95 { height: 95%; }
.bar i.h100 { height: 100%; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.flag { font-size: 1.2em; }
.pill { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); }
.pill.premium { background: #fef0c7; color: #93370d; }
@media (prefers-color-scheme: dark) { .pill.premium { background: #4e1d09; color: #fedf89; } }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot.ok { background: var(--green); }
.dot.bad { background: var(--red); }

.servers { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.server-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 12px; }
.facts dt { color: var(--muted); font-size: 0.85rem; }
.facts dd { margin: 0; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { display: flex; gap: 8px; flex-wrap: wrap; }
.settings { display: grid; gap: 18px; }
.setting .field { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.setting input { width: 140px; }
.notice { border-color: var(--blue); }
.copy { display: block; padding: 10px; user-select: all; }
.danger-zone { border-color: #fecdca; }
@media (max-width: 640px) { .servers { grid-template-columns: 1fr; } .who { margin-left: 0; } }
