:root {
  --brand: #1a73e8;
  --brand-dark: #1557b0;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1c2433;
  --muted: #6b7a90;
  --line: #e3eaf4;
  --green: #00a862;
  --red: #e53935;
  --orange: #f59e0b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
button, input, select { font: inherit; }
.hidden { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn { border: 0; border-radius: 10px; padding: 9px 16px; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.light { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.btn.danger { background: var(--red); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; color: var(--text); outline: none; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 120px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 32px 28px; }
.logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, #1a73e8, #0b1426); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; margin: 0 auto 12px; }
.login-card h1 { text-align: center; margin: 0 0 4px; font-size: 22px; }
.login-card p.sub { text-align: center; color: var(--muted); margin: 0 0 24px; }
.login-card .btn { width: 100%; padding: 12px; }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100%; }
.sidebar { width: 230px; background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; font-size: 16px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; margin: 0; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: var(--bg); }
.nav a.active { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); font-weight: 700; }
.nav .ico { width: 18px; text-align: center; }
.sidebar .foot { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sidebar .foot b { color: var(--text); display: block; font-size: 13px; }
.main { flex: 1; min-width: 0; padding: 24px 28px 60px; }
.topbar { display: none; }
h2.page { margin: 0 0 4px; font-size: 22px; }
p.page-sub { margin: 0 0 20px; color: var(--muted); }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 14px; font-size: 15px; }
.grid { display: grid; gap: 16px; }
.grid.stats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: 320px 1fr; align-items: start; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 13px; }
.stat.brand { background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; }
.stat.brand .l { color: rgba(255, 255, 255, .85); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.actions { text-align: right; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.active { background: #e6f6ee; color: var(--green); }
.pill.expired { background: #fff4e5; color: #b26a00; }
.pill.blocked { background: #fdecec; color: var(--red); }
.uname { font-weight: 700; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: 13px; }
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.icon-btn.red:hover { border-color: var(--red); color: var(--red); }

/* ---------- modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--card); border-radius: 18px; width: 100%; max-width: 420px; padding: 22px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1c2433; color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 60; max-width: 90%; box-shadow: var(--shadow); }
.toast.err { background: var(--red); }
.copybox { display: flex; gap: 8px; }
.copybox .input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.log-list div { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }
.log-list div:last-child { border-bottom: 0; }
.tag { font-size: 12px; background: var(--bg); padding: 1px 8px; border-radius: 6px; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; background: var(--card); padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; font-weight: 800; }
  .layout { flex-direction: column; }
  .main { padding: 16px 14px 60px; }
  th.hide-sm, td.hide-sm { display: none; }
}
.mb12 { margin-bottom: 12px; }
.mt12 { margin-top: 12px; }
.small { font-size: 12px; }
.w-auto { width: auto; }
.grid > * { min-width: 0; }
@media (max-width: 720px) {
  /* Accounts table becomes stacked rows: name/status/expiry on top, buttons underneath */
  table.acc thead { display: none; }
  table.acc tbody tr { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.acc td { border: 0; padding: 0; }
  table.acc td.actions { grid-column: 1 / -1; text-align: left; white-space: normal; padding-top: 6px; }
  table.acc td.actions .icon-btn { margin: 0 4px 4px 0; padding: 7px 11px; }
}
.credits { margin: 8px 0 4px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); font-size: 13px; }
.credits b { display: inline; color: var(--brand); }
.pill.trial { background: #efe9ff; color: #6d28d9; }
.dot-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 4px; }
.hint { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.pill.online { background: #e6f6ee; color: var(--green); }
.pill.offline { background: #fdecec; color: var(--red); }
.pill.waiting { background: #fff4e5; color: #b26a00; }
.cmd { width: 100%; min-height: 84px; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.steps { margin: 6px 0 0 18px; padding: 0; font-size: 13px; }
.steps li { margin: 4px 0; }
a.icon-btn { display: inline-block; text-decoration: none; color: inherit; }
.row.between { justify-content: space-between; align-items: center; }
.field.w-port { width: 96px; flex: 0 0 96px; }
.pill.proto { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.log-box { background: #0b1426; color: #cfe3ff; border-radius: 10px; padding: 10px 12px; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 0 0 8px; }
.modal { max-height: 92vh; overflow: auto; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.feat { display: grid; gap: 2px; }
.feat .check { margin: 2px 0; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.shade { display: none; }
@media (max-width: 720px) {
  .shade.show { display: block; position: fixed; inset: 0; background: rgba(11, 20, 38, .45); z-index: 35; }
  .sidebar { overflow-y: auto; }
}

/* logout always reachable (top bar on phones, menu item everywhere) */
.top-logout { margin-left: auto; }
.nav a.nav-logout { color: #dc2626; margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.nav a.nav-logout:hover { background: #fef2f2; }

/* ---------- v2.8: dashboard map, free access, branding ---------- */
.logo { background: linear-gradient(135deg, var(--brand), #0b1426); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; margin-bottom: 16px; }
h3.section { margin: 8px 0 12px; font-size: 15px; color: var(--muted); }
.map-wrap { display: grid; grid-template-columns: minmax(0, 3fr) minmax(240px, 1fr); gap: 12px; align-items: start; }
.map { position: relative; width: 100%; padding-top: 50.6%; overflow: hidden; border-radius: 12px; background: #eef2f7; border: 1px solid var(--line); }
.map-inner { position: absolute; left: 0; width: 100%; }
.map-tile { position: absolute; display: block; user-select: none; pointer-events: none; }
.map-pin { position: absolute; transform: translate(-50%, -50%); min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--brand);
  color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(0, 0, 0, .08); }
.map-pin.off { background: var(--red); }
.map-attr { position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: var(--muted); background: rgba(255, 255, 255, .8); padding: 0 4px; border-radius: 4px; }
.map-list { max-height: 330px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.map-row { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.map-row .flag { font-size: 20px; }
.grow { flex: 1; min-width: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.input.w-name { width: 130px; flex: 0 0 130px; }
textarea.input { resize: vertical; font: inherit; }
.ok-text { color: var(--green); }
.bad-text { color: var(--red); }
.maint { background: #fff4e5; color: #8a5300; border-bottom: 1px solid #ffd9a8; padding: 10px 16px; font-weight: 600; }
.login-msg { white-space: pre-line; text-align: center; color: var(--text); background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-top: 16px; font-size: 13px; }
.app-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.app-links a { background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: 13px; }
@media (max-width: 900px) { .map-wrap { grid-template-columns: 1fr; } }
.row.gap8 { gap: 8px; }
.row.gap4 { gap: 4px; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.hint.hint-bad { border-color: #fca5a5; background: #fef2f2; }
.login-card p.sub.sub-link { margin: 14px 0 0; text-align: center; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 6px; }
.card.inner { box-shadow: none; border: 1px solid var(--line); margin: 0; }
.map-tile { filter: saturate(.6) brightness(1.04); }
.stat.sm .n { font-size: 22px; }
.grid.stats.proto-row { margin-top: -4px; }

/* =====================================================================
   v2.9 — design system: typography, spacing, icons, calmer surfaces
   ===================================================================== */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e5e8ee;
  --line-2: #eef1f5;
  --green: #059669;
  --red: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}
body { font: 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-feature-settings: "cv11", "ss01"; }
.mono, .code, .cmd, .log-box, .copybox .input, .input.mono { font-family: var(--mono); }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }

/* icons */
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -4px; }
.ic { display: inline-flex; align-items: center; }
.ic + * { margin-left: 0; }
.icon-btn .i { width: 16px; height: 16px; vertical-align: -3px; }
.stat .l .i, .small .i, .pill .i { width: 14px; height: 14px; vertical-align: -2px; }
h3 .i { width: 17px; height: 17px; color: var(--brand); margin-right: 2px; }

/* headings & text */
h2.page { font-size: 24px; font-weight: 700; letter-spacing: -.022em; line-height: 1.25; color: var(--text); }
p.page-sub { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.card h3, .modal h3 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; color: var(--text); display: flex; align-items: center; gap: 6px; }
.uname { font-weight: 600; letter-spacing: -.005em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
b, strong { font-weight: 600; }

/* sidebar */
.sidebar { width: 240px; background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; }
.brand { gap: 11px; padding: 2px 8px 22px; font-size: 15.5px; font-weight: 700; letter-spacing: -.015em; }
.logo { background: var(--brand); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 1px 2px rgba(15, 23, 42, .12); }
.logo .mark { width: 62%; height: 62%; }
.brand .logo { width: 34px; height: 34px; border-radius: 9px; }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: #94a3b8; padding: 14px 12px 6px; }
.nav a { gap: 11px; padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; margin-bottom: 1px; transition: background .15s, color .15s; }
.nav a .ico { width: 18px; display: inline-flex; justify-content: center; color: #94a3b8; transition: color .15s; }
.nav a:hover { background: var(--line-2); color: var(--text); }
.nav a:hover .ico { color: var(--text-2); }
.nav a.active { background: color-mix(in srgb, var(--brand) 9%, #fff); color: var(--brand); font-weight: 600; }
.nav a.active .ico { color: var(--brand); }
.nav a.nav-logout { color: var(--red); border-top: 1px solid var(--line); border-radius: 0; margin-top: 10px; padding-top: 12px; }
.nav a.nav-logout .ico { color: var(--red); }
.nav a.nav-logout:hover { background: transparent; opacity: .8; }
.sidebar .foot { padding: 14px 8px 0; font-size: 12px; }
.sidebar .foot b { font-size: 13px; font-weight: 600; margin-bottom: 2px; }

/* main */
.main { padding: 32px 36px 72px; max-width: 1480px; }

/* cards & stats */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column-reverse; gap: 6px; }
.stat .n { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.stat .l { font-size: 13px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat.sm { padding: 14px 18px; }
.stat.sm .n { font-size: 22px; }
.stat.brand { background: var(--brand); border-color: transparent; color: #fff; box-shadow: 0 6px 20px color-mix(in srgb, var(--brand) 28%, transparent); }
.stat.brand .n { color: #fff; }
.stat.brand .l { color: rgba(255, 255, 255, .82); }
.grid.stats { gap: 14px; }
h3.section { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; margin: 10px 0 12px; }

/* buttons */
.btn { border-radius: 8px; padding: 9px 16px; font-weight: 600; font-size: 14px; letter-spacing: -.005em; transition: background .15s, box-shadow .15s, transform .05s; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active { transform: translateY(1px); }
.btn.light { box-shadow: none; }
.btn.ghost { box-shadow: none; }
.btn.ghost:hover { background: var(--line-2); color: var(--text); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 32px; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text-2); font-size: 13px; font-weight: 500; transition: border-color .15s, color .15s, background .15s; }
.icon-btn:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, #fff); }
.icon-btn.red { color: #94a3b8; }
.icon-btn.red:hover { border-color: #fca5a5; color: var(--red); background: #fef2f2; }
td.actions .icon-btn { margin-left: 4px; }

/* forms */
.field { gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.input { height: 40px; border: 1px solid #d9dee6; border-radius: 8px; padding: 0 12px; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.5; }
select.input { padding-right: 32px; }
.input::placeholder { color: #a0aabb; }
.input:hover { border-color: #c7ced9; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.check { font-size: 14px; color: var(--text-2); }
.check input { width: 16px; height: 16px; }

/* tables */
th { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; padding: 10px 10px; border-bottom: 1px solid var(--line); }
td { padding: 13px 10px; border-bottom: 1px solid var(--line-2); color: var(--text-2); font-variant-numeric: tabular-nums; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }

/* pills & tags */
.pill { padding: 3px 9px; font-size: 12px; font-weight: 600; letter-spacing: .005em; line-height: 1.4; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px; }
.pill.active, .pill.online { background: #ecfdf5; color: #047857; }
.pill.offline, .pill.blocked { background: #fef2f2; color: #b91c1c; }
.pill.waiting, .pill.expired { background: #fffbeb; color: #b45309; }
.pill.proto { background: color-mix(in srgb, var(--brand) 8%, #fff); color: var(--brand); }
.pill.online::before, .pill.active::before, .pill.offline::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag { font-size: 11.5px; font-weight: 500; font-family: var(--mono); background: var(--line-2); color: var(--text-2); padding: 2px 7px; border-radius: 5px; }
.cc { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 5px; border-radius: 5px; background: var(--line-2); color: var(--text-2); font: 600 11px/1 var(--mono); letter-spacing: .04em; }

/* hints, logs, modals, toasts */
.hint { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.hint b { color: var(--text); }
.log-list div { padding: 10px 0; border-bottom: 1px solid var(--line-2); align-items: baseline; font-size: 13.5px; }
.log-list .muted { font-variant-numeric: tabular-nums; font-size: 12.5px; }
.modal-bg { background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.modal { border-radius: 14px; padding: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.toast { background: #0f172a; font-size: 13.5px; font-weight: 500; border-radius: 10px; padding: 11px 16px; box-shadow: var(--shadow-lg); }
.log-box { background: #0b1220; color: #d6e2f5; border-radius: 10px; font-size: 12px; line-height: 1.6; }

/* dashboard map */
.map { border-radius: 10px; border-color: var(--line); background: #e9eef4; }
.map-pin { background: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent), 0 2px 6px rgba(15, 23, 42, .25); font-variant-numeric: tabular-nums; }
.map-row { border-color: var(--line); border-radius: 10px; padding: 10px 12px; gap: 10px; }
.map-row b { font-weight: 600; }
.card.inner { border: 1px solid var(--line); padding: 18px; }

/* login */
.login-wrap { background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 70%), var(--bg); }
.login-card { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 20px 50px rgba(15, 23, 42, .08); padding: 36px 32px; }
.login-card .logo { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 16px; }
.login-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -.022em; }
.login-card p.sub { font-size: 14px; }
.login-card .btn { height: 42px; }

/* maintenance band */
.maint { font-size: 13px; font-weight: 500; text-align: center; }

@media (max-width: 720px) {
  .main { padding: 18px 14px 60px; }
  h2.page { font-size: 21px; }
  .topbar { font-weight: 700; letter-spacing: -.01em; }
  .stat .n { font-size: 24px; }
}
.stat.brand { text-align: left; align-items: stretch; justify-content: flex-start; }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.sidebar .foot #logoutBtn { display: none; }

/* v2.9.1 — lighter weights (Segoe UI on Windows renders heavier than Inter) */
body { font-weight: 400; color: #1e293b; }
h2.page { font-weight: 600; font-size: 23px; letter-spacing: -.018em; }
.card h3, .modal h3 { font-weight: 600; font-size: 14.5px; }
.brand { font-weight: 600; }
.stat .n { font-weight: 600; font-size: 26px; letter-spacing: -.02em; }
.stat.sm .n { font-size: 21px; }
.stat .l { font-weight: 400; }
.uname, b, strong, .map-row b { font-weight: 600; }
.nav a { font-weight: 450; }
.nav a.active { font-weight: 550; }
.btn { font-weight: 550; }
.pill { font-weight: 550; }
th { font-weight: 550; }
.login-card h1 { font-weight: 600; }

/* v2.9.3: uploaded panel logo */
.logo { position: relative; overflow: hidden; }
.logo .logo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.logo.has-img { background: transparent; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.logo.has-img .mark { visibility: hidden; }
.logo-preview { width: 48px; height: 48px; border-radius: 12px; margin: 0; flex: none; }

/* v3.0: panel rent */
.rent-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.rent-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rent-chip.ok { background: #e8f6ee; color: #137a44; }
.rent-chip.warn { background: #fff4e5; color: #9a5b00; }
.rent-chip.bad { background: #fdecec; color: #b42318; }
.rent-card .rent-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.rent-card h3 { margin-bottom: 10px; }
.rent-date { font-size: 18px; font-weight: 600; margin-top: 2px; }
.rent-days { text-align: right; line-height: 1; }
.rent-days b { display: block; font-size: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rent-days span { font-size: 12px; color: var(--muted, #667085); }
.rent-bar { height: 6px; border-radius: 999px; background: rgba(15, 23, 42, .07); margin: 14px 0 10px; overflow: hidden; }
.rent-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: #16a34a; transition: width .6s ease; }
.rent-card.warn .rent-bar i { background: #f59e0b; } .rent-card.bad .rent-bar i { background: #dc2626; }
.rent-card.warn { border-color: #ffd9a8; } .rent-card.bad { border-color: #f5c2c0; }
.rent-banner { background: #fff4e5; }
#loginMsg.closed { background: #fdecec; color: #b42318; border-color: #f5c2c0; }

/* =====================================================================
   v3.0 design: "night harbour" — one bold live band, everything else quiet
   ===================================================================== */
:root {
  --harbour: #10213f;      /* the live band */
  --harbour-2: #172d52;
  --mist: #f3f6fa;         /* page */
  --ink: #14213d;          /* text */
  --signal: #2bd4a3;       /* online / healthy */
  --ember: #f5a524;        /* needs a look */
  --rose: #e5484d;         /* down */
  --k-ssh: #5b9bff; --k-openvpn: #b39dfa; --k-udp: #f7b955; --k-v2ray: #2bd4a3;
  --bg: var(--mist);
  --text: var(--ink);
}
body { -webkit-font-smoothing: antialiased; }

/* ---- the live band ---- */
.pulse { position: relative; background: var(--harbour); color: #e8eefb; border-radius: 20px; padding: 22px 24px 18px; margin-bottom: 18px; overflow: hidden; isolation: isolate; }
.pulse::after { content: ""; position: absolute; inset: auto -10% -60% 30%; height: 120%; background: radial-gradient(closest-side, rgba(43, 212, 163, .14), transparent 70%); z-index: -1; pointer-events: none; }
.pulse-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.hello { margin: 0; font-size: 15px; color: #b8c5de; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #8fa1c4; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 rgba(43, 212, 163, .6); animation: beat 2.4s ease-out infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(43, 212, 163, .55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(43, 212, 163, 0); } }
.pulse-body { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.6fr); gap: 28px; align-items: center; margin-top: 10px; }
.pulse-count .big { font-size: clamp(56px, 7vw, 88px); line-height: .95; font-weight: 650; letter-spacing: -.045em; font-variant-numeric: tabular-nums; color: #fff; }
.pulse-count .cap { margin: 8px 0 18px; color: #b8c5de; font-size: 15px; }
.seg { display: flex; gap: 3px; height: 10px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.seg i { flex: 1 1 0; min-width: 4px; transition: flex-grow .9s cubic-bezier(.2, .8, .2, 1); }
.seg i.zero { min-width: 0; flex-basis: 0; }
.k-ssh { background: var(--k-ssh); } .k-openvpn { background: var(--k-openvpn); } .k-udp { background: var(--k-udp); } .k-v2ray { background: var(--k-v2ray); }
.seg-legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; font-size: 13px; color: #b8c5de; }
.seg-legend li { display: flex; align-items: center; gap: 8px; }
.seg-legend li i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.seg-legend b { margin-left: auto; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.pulse-foot { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.pulse-foot div { display: flex; flex-direction: column; gap: 2px; }
.pulse-foot span { font-size: 12px; color: #8fa1c4; }
.pulse-foot b { font-size: 17px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.pulse-foot .warn b { color: var(--ember); }

/* night map: the same tiles, turned dark */
.map.dark { background: #0c1a33; border: 0; border-radius: 14px; }
.map.dark .map-tile { filter: invert(1) hue-rotate(185deg) saturate(.35) brightness(.62) contrast(1.15); }
.map.dark .map-attr { background: transparent; color: #5d7092; }
.map.dark .map-pin { background: var(--signal); color: #062b22; font-weight: 700; border: 0; box-shadow: 0 0 0 4px rgba(43, 212, 163, .18), 0 0 18px rgba(43, 212, 163, .55); }
.map.dark .map-pin.on::before { content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 2px solid rgba(43, 212, 163, .55); animation: ring 2.8s ease-out infinite; }
.map.dark .map-pin.off { background: var(--rose); color: #fff; box-shadow: 0 0 0 4px rgba(229, 72, 77, .2); }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }

/* server list under the band */
.srv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.srv-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--mist); }

/* quieter cards: no shadow stack, hierarchy from space and type */
.card { box-shadow: 0 1px 0 rgba(20, 33, 61, .04); }
h3.section { margin: 22px 0 10px; font-size: 15px; font-weight: 600; color: var(--muted); }

/* sidebar: active item gets a brand rail instead of a filled pill */
.nav a { position: relative; }
.nav a.active { background: transparent; color: var(--ink); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a.active .ico, .nav a.active .i { color: var(--brand); }

/* ---- phone: bottom tab bar within thumb reach ---- */
.tabbar { display: none; }
@media (max-width: 720px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: 11px; color: var(--muted); background: none; border: 0; cursor: pointer; }
  .tabbar a.active { color: var(--brand); font-weight: 600; }
  .tabbar .i { width: 22px; height: 22px; }
  .main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .pulse { border-radius: 18px; padding: 18px 16px 14px; margin: 0 -2px 16px; }
  .pulse-body { grid-template-columns: 1fr; gap: 18px; }
  .pulse-foot { gap: 20px; }
}
@media (max-width: 1100px) and (min-width: 721px) { .pulse-body { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .live i, .map.dark .map-pin.on::before { animation: none; }
  .seg i { transition: none; }
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* v3.0 login: the card sits on the night harbour, with a faint signal glow */
.login-wrap { background:
  radial-gradient(600px 380px at 78% 18%, rgba(43, 212, 163, .16), transparent 70%),
  radial-gradient(700px 420px at 12% 92%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%),
  var(--harbour); }
.login-card { box-shadow: 0 24px 60px rgba(4, 10, 24, .45); border: 0; }
.login-wrap .app-links a, .login-wrap > .muted { color: #b8c5de; }

/* =====================================================================
   v3.0 colour pass 2 — Meta-style: light grey canvas, white surfaces,
   one blue, quiet greys. Overrides the night band above.
   ===================================================================== */
:root {
  --mist: #f0f2f5;   /* canvas (Facebook grey) */
  --ink: #1c1e21;    /* text */
  --muted: #65676b;
  --line: #e4e6eb;
  --signal: #31a24c; /* online */
  --ember: #e8a215;
  --rose: #e41e3f;
  --k-ssh: var(--brand); --k-openvpn: #8f5bff; --k-udp: #f7b928; --k-v2ray: #00a400;
  --bg: var(--mist); --text: var(--ink);
}
.card, .stat { border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); border-radius: 12px; }

/* live band becomes a clean white board */
.pulse { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); border-radius: 12px; }
.pulse::after { display: none; }
.hello { color: var(--ink); font-size: 17px; font-weight: 600; }
.live { color: var(--muted); }
.live i { background: var(--signal); animation-name: beat-g; }
@keyframes beat-g { 0% { box-shadow: 0 0 0 0 rgba(49, 162, 76, .5); } 70%, 100% { box-shadow: 0 0 0 9px rgba(49, 162, 76, 0); } }
.pulse-count .big { color: var(--ink); font-weight: 700; }
.pulse-count .cap { color: var(--muted); }
.seg { background: var(--mist); height: 8px; }
.seg-legend { color: var(--muted); }
.seg-legend b { color: var(--ink); }
.pulse-foot { border-top-color: var(--line); }
.pulse-foot span { color: var(--muted); }
.pulse-foot b { color: var(--ink); }
.pulse-foot .warn b { color: var(--rose); }

/* map: natural light tiles, brand-blue pins */
.map.dark { background: #e9edf2; border-radius: 10px; }
.map.dark .map-tile { filter: saturate(.25) brightness(1.06) contrast(.95); }
.map.dark .map-attr { color: var(--muted); background: rgba(255, 255, 255, .7); }
.map.dark .map-pin { background: var(--brand); color: #fff; box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 45%, transparent); }
.map.dark .map-pin.on::before { border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.map.dark .map-pin.off { background: var(--rose); }

.srv-row { background: var(--mist); }
.pill.active, .pill.online { background: #e7f3ea; color: #1e7b34; }
.nav a:hover { background: var(--mist); }
.btn { border-radius: 8px; }
.input { border-color: #ccd0d5; border-radius: 8px; }

/* login: Facebook-like grey page, white card */
.login-wrap { background: var(--mist); }
.login-card { box-shadow: 0 2px 4px rgba(0, 0, 0, .1), 0 8px 16px rgba(0, 0, 0, .1); border-radius: 12px; }
.tabbar { background: #fff; }
.seg i.none { opacity: .16; }

/* ---------- v3.1: result pop-up with copy, transfer suggestions, reseller list ---------- */
.pill.pending { background: #eef2ff; color: #4338ca; }
.m0 { margin: 0; }
.btn.block { width: 100%; padding: 12px 16px; font-size: 15px; }
.modal.result { position: relative; text-align: center; max-width: 400px; }
.modal.result .x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 18px; color: var(--muted); cursor: pointer; padding: 6px; }
.modal.result .ok-mark { width: 52px; height: 52px; margin: 4px auto 10px; border-radius: 50%; display: grid; place-items: center;
  background: #e6f6ee; color: var(--green); font-size: 26px; font-weight: 700; }
.modal.result h3 { margin: 0 0 4px; }
.modal.result p { margin: 0 0 12px; }
pre.ready { text-align: left; white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-height: 50vh; overflow: auto; }
.sugg-wrap { position: relative; }
.sugg { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 4px; margin-top: 4px; }
.sugg button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.sugg button:hover, .sugg button:focus { background: var(--bg); outline: none; }
.sugg .muted { display: block; padding: 10px 12px; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--brand) 14%, #fff); color: var(--brand); font-weight: 700; }
.credit-chip { display: inline-block; min-width: 32px; text-align: center; padding: 2px 10px; border-radius: 999px; background: #fff7e6; color: #9a6400; }

/* ---------- v3.1.1: each action button has its own colour ---------- */
td.actions .icon-btn { --c: var(--brand); color: var(--c); border-color: color-mix(in srgb, var(--c) 28%, #fff);
  background: color-mix(in srgb, var(--c) 9%, #fff); font-weight: 600; }
td.actions .icon-btn:hover { color: #fff; background: var(--c); border-color: var(--c); }
td.actions .icon-btn[data-act=copy]    { --c: #2563eb; }
td.actions .icon-btn[data-act=links]   { --c: #7c3aed; }
td.actions .icon-btn[data-act=extend]  { --c: #059669; }
td.actions .icon-btn[data-act=edit]    { --c: #d97706; }
td.actions .icon-btn[data-act=devices] { --c: #0891b2; }
td.actions .icon-btn[data-act=block]   { --c: #ca8a04; }
td.actions .icon-btn[data-act=delete]  { --c: #dc2626; }
td.actions .icon-btn[data-act=credits] { --c: #059669; }
td.actions .icon-btn[data-act=pass]    { --c: #d97706; }
.mt8 { margin-top: 8px; }
.usage { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 4px 0 10px; background: var(--bg); }
.usage.over { border-color: #fca5a5; background: #fef2f2; }
.usage .bar { height: 6px; border-radius: 99px; background: var(--line); margin-top: 8px; overflow: hidden; }
.usage .bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.usage.over .bar i { background: var(--red); }

/* ---------- v3.1.2: coloured menu icons + logo in the mobile top bar ---------- */
.nav a[data-page] .ico, .nav a[data-page] .i, .nav a.nav-logout .ico, .nav a.nav-logout .i {
  --c: #64748b; width: 30px; height: 30px; flex: none; display: inline-grid; place-items: center; border-radius: 9px;
  background: var(--c); color: #fff !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .15); }
.nav a[data-page] .i svg, .nav a[data-page] svg.i { width: 17px; height: 17px; }
.nav a[data-page=dashboard] :is(.ico, .i) { --c: #2563eb; }
.nav a[data-page=accounts]  :is(.ico, .i) { --c: #16a34a; }
.nav a[data-page=resellers] :is(.ico, .i) { --c: #ea580c; }
.nav a[data-page=bulk]      :is(.ico, .i) { --c: #7c3aed; }
.nav a[data-page=servers]   :is(.ico, .i) { --c: #0284c7; }
.nav a[data-page=configs]   :is(.ico, .i) { --c: #db2777; }
.nav a[data-page=dns]       :is(.ico, .i) { --c: #0d9488; }
.nav a[data-page=genkeys]   :is(.ico, .i) { --c: #ca8a04; }
.nav a[data-page=logs]      :is(.ico, .i) { --c: #475569; }
.nav a[data-page=settings]  :is(.ico, .i) { --c: #334155; }
.nav a.nav-logout :is(.ico, .i) { --c: #dc2626; }
.nav a.active { background: color-mix(in srgb, var(--brand) 9%, #fff); }
.tabbar a[data-page] :is(.ico, .i) { --c: #64748b; color: var(--c); }
.tabbar a[data-page=dashboard] :is(.ico, .i) { --c: #2563eb; }
.tabbar a[data-page=accounts]  :is(.ico, .i) { --c: #16a34a; }
.tabbar a[data-page=servers]   :is(.ico, .i) { --c: #0284c7; }
.tabbar a[data-page=configs]   :is(.ico, .i) { --c: #db2777; }
.tabbar a[data-page=settings]  :is(.ico, .i) { --c: #334155; }
.tabbar a[data-page=logs]      :is(.ico, .i) { --c: #475569; }
.topbar .top-logo { width: 30px; height: 30px; border-radius: 9px; margin: 0; flex: none; }
