:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e6ecf5;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --cyan: #0891b2;
  --emerald: #059669;
  --amber: #d97706;
  --rose: #e11d48;
  --violet: #7c3aed;
  --shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 12px 32px -14px rgba(15, 23, 42, .18);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 100% -10%, rgba(79, 70, 229, .07), transparent 60%),
    radial-gradient(700px 420px at -10% 25%, rgba(8, 145, 178, .05), transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; color: #4338ca; }
.icon { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.empty { color: var(--muted); font-size: 13px; padding: 18px 0; margin: 0; }

/* ----------------------------- app shell ----------------------------- */
.app-shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 16px 18px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 8px 22px; color: var(--text); font-weight: 700; font-size: 17px;
  letter-spacing: .2px;
}
.brand:hover { color: var(--text); }
.logo-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .65);
}
.logo-mark.light { background: rgba(255, 255, 255, .16); box-shadow: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: #94a3b8;
  padding: 18px 10px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 11px;
  color: #475569; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #f1f5f9; color: var(--text); }
.nav-item.active { background: #eef2ff; color: var(--primary); font-weight: 600; }
.nav-item.active .icon { color: var(--primary); }
.side-foot { margin-top: auto; padding-top: 16px; }
.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface);
}
.side-user-info { min-width: 0; flex: 1; }
.side-user-email { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-role { font-size: 11px; color: var(--muted); }
.icon-btn {
  border: 0; background: transparent; color: #94a3b8; cursor: pointer;
  padding: 6px; border-radius: 8px; display: inline-flex;
}
.icon-btn:hover { background: #f1f5f9; color: var(--text); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 28px 36px 0;
}
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.server-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: #ecfdf5; color: #047857; font-size: 12px; font-weight: 600;
  border: 1px solid #d1fae5;
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .45); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.content { padding: 24px 36px 56px; max-width: 1460px; width: 100%; display: flex; flex-direction: column; gap: 18px; }

/* ----------------------------- cards ----------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 15.5px; margin: 0; letter-spacing: -.01em; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 16px;
}
.card-head p { margin: 3px 0 0; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.layout-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .95fr); gap: 18px; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 0; }
.stat-card {
  display: flex; align-items: flex-start; gap: 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 17px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .02);
  transform-style: preserve-3d;
  transition: transform .15s ease-out, box-shadow .18s ease;
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eef2ff; color: var(--primary); flex: none;
}
.stat-body { min-width: 0; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 23px; font-weight: 700; letter-spacing: -.03em; line-height: 1.25; margin-top: 1px; }
.stat-sub { font-size: 11.5px; color: #94a3b8; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tone-cyan .stat-icon { background: #ecfeff; color: #0891b2; }
.tone-emerald .stat-icon { background: #ecfdf5; color: #059669; }
.tone-amber .stat-icon { background: #fffbeb; color: #d97706; }
.tone-violet .stat-icon { background: #f5f3ff; color: #7c3aed; }
.tone-rose .stat-icon { background: #fff1f2; color: #e11d48; }
.tone-slate .stat-icon { background: #f1f5f9; color: #64748b; }

/* ----------------------------- charts ----------------------------- */
.chart {
  display: flex; align-items: stretch; gap: 4px;
  height: var(--chart-height, 160px);
  padding-top: 8px;
}
.chart-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chart-bar-wrap { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar {
  width: 100%; max-width: 30px; min-height: 3px;
  display: flex; flex-direction: column;
  border-radius: 7px 7px 3px 3px; overflow: hidden;
  background: #eef2f8;
  transition: height .35s ease, filter .15s;
}
.chart-col:hover .chart-bar, .chart-col:hover .latency-bar { filter: brightness(1.04); }
.chart-seg.up { background: linear-gradient(180deg, #67e8f9, #06b6d4); }
.chart-seg.down { flex: 1; background: linear-gradient(180deg, #818cf8, #4f46e5); }
.chart-label {
  height: 18px; margin-top: 6px; font-size: 10px; color: #94a3b8;
  text-align: center; white-space: nowrap; overflow: visible;
}
.legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.legend .dot { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.legend .dot.up { background: #06b6d4; }
.legend .dot.down { background: #4f46e5; margin-left: 6px; }
.latency-chart .chart-bar-wrap { align-items: flex-end; }
.latency-bar {
  width: 58%; max-width: 22px; min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #6ee7b7, #10b981);
}
.latency-bar.mid { background: linear-gradient(180deg, #fcd34d, #f59e0b); }
.latency-bar.bad { background: linear-gradient(180deg, #fda4af, #f43f5e); }

/* ----------------------------- live ----------------------------- */
.live-card {
  background:
    radial-gradient(620px 200px at 100% -40%, rgba(6, 182, 212, .12), transparent 60%),
    linear-gradient(135deg, #eef2ff 0%, #ffffff 42%, #ecfeff 100%);
  border-color: #dbe4ff;
}
.live-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 10px;
}
.live-title { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
  animation: pulse 2s infinite;
}
.live-speeds { display: flex; align-items: baseline; gap: 28px; flex-wrap: wrap; }
.live-speed { display: flex; align-items: baseline; gap: 7px; font-variant-numeric: tabular-nums; }
.live-speed .arrow { font-size: 17px; font-weight: 700; line-height: 1; }
.live-speed.up .arrow { color: #0891b2; }
.live-speed.down .arrow { color: #4f46e5; }
.live-speed strong { font-size: 24px; letter-spacing: -.04em; line-height: 1.1; }
.live-status { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.live-canvas { width: 100%; display: block; }
.live-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-top: 7px;
  color: var(--muted); font-size: 11.5px;
}
.live-foot strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .live-head { gap: 10px; }
  .live-speeds { gap: 18px; }
  .live-speed strong { font-size: 20px; }
}

/* ----------------------------- tables ----------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
th {
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: #94a3b8; white-space: nowrap;
  background: #fbfcfe;
}
th:first-child { border-radius: 8px 0 0 8px; }
th:last-child { border-radius: 0 8px 8px 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: #eef2ff; color: #4338ca; font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-email { font-weight: 600; font-size: 13px; color: var(--text); }
.user-email:hover { color: var(--primary); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; flex: none; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  letter-spacing: -.02em;
}
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mini-bar { width: 86px; height: 5px; border-radius: 999px; background: #eef2f8; margin-top: 4px; overflow: hidden; }
.mini-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.mini-bar > div.over { background: linear-gradient(90deg, #fb7185, #e11d48); }
.quota-cell { min-width: 110px; }

/* ----------------------------- badges ----------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: #f1f5f9; color: #475569; border: 1px solid transparent;
}
.badge.ok { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.badge.off { background: #fff1f2; color: #be123c; border-color: #ffe4e6; }
.badge.warn { background: #fffbeb; color: #b45309; border-color: #fef3c7; }
.badge.violet { background: #f5f3ff; color: #6d28d9; border-color: #ede9fe; }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.state.ok { color: #047857; }
.state.warn { color: #b45309; }
.state.off { color: #94a3b8; }
.online-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}

/* ----------------------------- buttons / forms ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px;
  border: 1px solid transparent; font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform .1s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .8);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: #334155; }
.btn.ghost:hover { border-color: #c7d2fe; background: #f8faff; }
.btn.danger { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.btn.danger:hover { background: #ffe4e6; }
.btn.small { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.inline { display: inline; margin: 0; }
.link-more { font-size: 12px; color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

.form { display: flex; flex-direction: column; gap: 13px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: #475569; }
.form label.check { flex-direction: row; align-items: center; gap: 9px; font-weight: 500; color: #334155; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=email], input[type=password], input[type=text], input[type=number], select, textarea {
  width: 100%; background: #f8fafc; border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 10px 12px;
  font-size: 13.5px; font-family: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: #a5b4fc; background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
textarea { resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

/* ----------------------------- alerts ----------------------------- */
.alert, .flash {
  padding: 11px 14px; border-radius: 11px; font-size: 13px;
  margin-bottom: 14px; border: 1px solid var(--line); background: var(--surface);
}
.alert.error, .flash.error { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert.success, .flash.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.flash.secret {
  background: #fffbeb; border-color: #fcd34d; color: #78350f;
  font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all;
}
.notice {
  padding: 11px 15px; border-radius: 11px; margin-bottom: 14px;
  background: #eef2ff; border: 1px solid #e0e7ff; color: #3730a3; font-size: 13px;
}
.flashes { margin-bottom: 0; }
.content > .alert, .content > .notice { margin-bottom: 0; }
.flashes .flash:last-child { margin-bottom: 0; }

/* ----------------------------- misc cards ----------------------------- */
.kv { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 7px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.profile { display: flex; align-items: center; gap: 13px; }
.profile-email { font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.quota-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; margin-bottom: 7px; }
.quota-bar { height: 8px; border-radius: 999px; background: #eef2f8; overflow: hidden; }
.quota-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.quota-bar > div.over { background: linear-gradient(90deg, #fb7185, #e11d48); }
.cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat-row { min-width: 0; }
.cat-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; margin-bottom: 5px; }
.cat-track { height: 7px; border-radius: 999px; background: #eef2f8; overflow: hidden; }
.cat-fill { height: 100%; border-radius: 999px; min-width: 3px; }
.cat-fill.c0 { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.cat-fill.c1 { background: linear-gradient(90deg, #06b6d4, #0891b2); }
.cat-fill.c2 { background: linear-gradient(90deg, #10b981, #059669); }
.cat-fill.c3 { background: linear-gradient(90deg, #f59e0b, #d97706); }
.cat-fill.c4 { background: linear-gradient(90deg, #f43f5e, #e11d48); }
.cat-fill.c5 { background: linear-gradient(90deg, #8b5cf6, #6d28d9); }
.online-list { display: flex; flex-direction: column; gap: 4px; }
.online-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 7px; border-radius: 10px; color: var(--text);
}
.online-item:hover { background: #f8faff; }
.online-meta { min-width: 0; flex: 1; }
.online-email { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.status-line { margin: 7px 0 4px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 14px; }
.meta-card { box-shadow: none; }
.qr { display: block; margin: 0 auto 14px; width: 190px; height: 190px; background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--line); }
.connect-actions { display: flex; flex-direction: column; gap: 8px; }
.link-details { margin: 12px 0; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 11px; background: var(--surface-2); }
.link-details summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.link-details textarea { margin-top: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; background: #fff; }
.tiny { font-size: 11.5px; }

/* ----------------------------- search / popover ----------------------------- */
.search-form { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 460px; position: relative; }
.search-form input { padding-left: 34px; background: #f8fafc; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; display: inline-flex; }
.inline-details { position: relative; }
.inline-details summary { list-style: none; cursor: pointer; }
.inline-details summary::-webkit-details-marker { display: none; }
.popover {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  width: 330px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px; box-shadow: 0 24px 50px -20px rgba(15, 23, 42, .35);
}
@media (max-width: 640px) { .popover { position: fixed; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); width: auto; } }

/* ----------------------------- clients ----------------------------- */
.client-connect-grid {
  display: grid; grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px; align-items: center;
}
.client-qr .qr { margin: 0 auto 12px; }
.client-info { min-width: 0; }
.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.client-card.wide { grid-column: 1 / -1; }
.platform-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.platform-icon {
  width: 40px; height: 40px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eef2ff; color: var(--primary); border: 1px solid #e0e7ff;
  flex: none;
}
.platform-head h2 { margin: 0; }
.platform-head p { margin: 2px 0 0; }
.app-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.app-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 12px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2);
}
.app-item strong { display: block; font-size: 13px; }
.app-item small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.app-item .btn { flex: none; }
.app-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.app-actions .btn { flex: none; }
.client-note {
  padding: 10px 12px; border-radius: 10px;
  background: #fffbeb; border: 1px solid #fde68a;
  color: #92400e; font-size: 11.5px; line-height: 1.65;
  margin: 0 0 14px;
}
.client-note.info {
  background: #eef2ff; border-color: #e0e7ff; color: #3730a3;
}
.download-check {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; background: var(--surface-2);
}
.download-check summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.download-check p { margin: 10px 0 0; font-size: 11.5px; line-height: 1.7; color: #475569; }
.download-check .sha {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px; color: #334155; word-break: break-all;
}
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.65; color: #475569; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: #eef2ff; color: var(--primary);
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.steps code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px;
  background: #f1f5f9; padding: 1px 5px; border-radius: 4px;
}
.faq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.faq-item h3 { margin: 0 0 5px; font-size: 13px; }
.faq-item p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
@media (max-width: 900px) {
  .client-connect-grid { grid-template-columns: 1fr; }
  .client-qr { max-width: 240px; margin: 0 auto; }
  .client-grid { grid-template-columns: 1fr; }
  .client-card.wide { grid-column: auto; }
  .faq-grid { grid-template-columns: 1fr; }
}

/* ----------------------------- auth ----------------------------- */
.auth-body {
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(79, 70, 229, .06), transparent 60%),
    radial-gradient(700px 420px at -10% 25%, rgba(8, 145, 178, .05), transparent 55%),
    var(--bg);
  min-height: 100vh;
}
.auth-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.auth-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(79, 70, 229, .12) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  opacity: .55;
}
.auth-stage {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px 18px;
}
.auth-shell {
  display: grid; grid-template-columns: 1.02fr .98fr;
  width: 100%; max-width: 980px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 70px -30px rgba(15, 23, 42, .28), 0 2px 6px rgba(15, 23, 42, .04);
  overflow: hidden;
}
.auth-aside {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 38px 40px;
  background:
    radial-gradient(420px 300px at 90% 0%, rgba(6, 182, 212, .10), transparent 60%),
    linear-gradient(155deg, #eef2ff 0%, #f8fafc 55%, #ecfeff 100%);
  border-right: 1px solid var(--line);
}
.auth-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-weight: 700; font-size: 17px; }
.auth-brand:hover { color: var(--text); }
.auth-aside-main { margin: 32px 0; }
.auth-aside h1 {
  margin: 0 0 14px; font-size: 34px; line-height: 1.22;
  letter-spacing: -.035em; color: var(--text);
}
.auth-grad {
  background: linear-gradient(120deg, var(--primary), var(--cyan));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-lead { margin: 0 0 26px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.auth-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-features li { display: flex; align-items: center; gap: 12px; }
.auth-feature-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .75); border: 1px solid #e0e7ff;
  color: var(--primary);
  box-shadow: 0 4px 12px -6px rgba(79, 70, 229, .25);
}
.auth-features strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.auth-aside-foot { font-size: 11px; color: #94a3b8; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 42px 44px; background: var(--surface); }
.auth-panel-inner { width: 100%; max-width: 360px; }
.auth-form-head { margin-bottom: 22px; }
.auth-form-head h2 { margin: 0 0 5px; font-size: 25px; letter-spacing: -.03em; }
.auth-form-head p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-panel .alert { margin-bottom: 14px; }
.auth-switch { margin: 18px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-switch a { font-weight: 600; }
.auth-note { margin: 14px 0 0; text-align: center; font-size: 10.5px; color: #94a3b8; line-height: 1.6; }
.auth-panel .flash { margin-bottom: 14px; }
.auth-message { text-align: center; }
.auth-message h2 { margin: 0 0 7px; font-size: 23px; letter-spacing: -.02em; }
.auth-muted { margin: 0 0 20px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.message-icon {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  background: #eef2ff; color: var(--primary); border: 1px solid #e0e7ff;
  font-size: 22px; font-weight: 700;
}
@media (max-width: 900px) {
  .auth-stage { padding: 20px 14px; }
  .auth-shell { grid-template-columns: 1fr; border-radius: 20px; }
  .auth-aside { padding: 24px 24px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-aside-main { margin: 20px 0 0; }
  .auth-aside h1 { font-size: 26px; margin-bottom: 8px; }
  .auth-lead { margin-bottom: 0; font-size: 12.5px; }
  .auth-features, .auth-aside-foot { display: none; }
  .auth-panel { padding: 26px 24px 30px; }
}
@media (max-width: 520px) {
  .auth-panel { padding: 22px 20px 26px; }
  .auth-form-head h2 { font-size: 23px; }
}
@media (max-height: 720px) {
  .auth-stage { justify-content: flex-start; }
}

/* ----------------------------- responsive ----------------------------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-main { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 2px 4px 12px; }
  .side-nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .side-nav::-webkit-scrollbar { display: none; }
  .nav-label { display: none; }
  .nav-item { white-space: nowrap; padding: 8px 11px; }
  .side-foot { display: none; }
  .topbar { padding: 20px 20px 0; }
  .content { padding: 18px 20px 40px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .topbar-actions { width: 100%; }
  .page-title { font-size: 21px; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 15px 14px; }
  .stat-value { font-size: 21px; }
  .card { padding: 17px; border-radius: 15px; }
  .form-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 82px minmax(0, 1fr); }
  .chart-label { font-size: 9px; }
}
