:root {
  --bg: #060a12;
  --bg-2: #0a101c;
  --panel: rgba(15, 23, 38, .82);
  --panel-solid: #0f1726;
  --panel-2: #131d2f;
  --line: rgba(148, 163, 184, .14);
  --line-strong: rgba(148, 163, 184, .26);
  --text: #e8eefb;
  --text-2: #b8c4d9;
  --muted: #7f8da6;
  --accent: #22d3ee;
  --accent-2: #6366f1;
  --accent-soft: rgba(34, 211, 238, .12);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, .12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, .12);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, .12);
  --violet: #a78bfa;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 50px rgba(0, 0, 0, .35);
  --sidebar: 248px;
  --font: "Inter", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1100px 700px at 12% -10%, rgba(34, 211, 238, .10), transparent 60%),
    radial-gradient(900px 650px at 100% 0%, rgba(99, 102, 241, .12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code { font-family: var(--mono); font-size: .9em; background: rgba(148, 163, 184, .12); padding: 2px 6px; border-radius: 6px; color: #c7d7f5; }
::selection { background: rgba(34, 211, 238, .3); color: white; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, .22); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.grad-text { background: linear-gradient(100deg, #67e8f9, #818cf8 75%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .22em; color: var(--accent); text-transform: uppercase; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.6; }
.form-error { margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(251, 113, 133, .3); background: var(--red-soft); color: #fecdd3; border-radius: 10px; font-size: 13px; }

/* ---------------- brand ---------------- */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(140deg, #22d3ee, #6366f1);
  color: #071018; font-weight: 900; font-size: 21px; letter-spacing: -.04em;
  box-shadow: 0 8px 24px rgba(34, 211, 238, .25), inset 0 1px 0 rgba(255,255,255,.35);
}
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: 15px; letter-spacing: .02em; line-height: 1.2; }
.brand-text em { font-style: normal; font-size: 8px; letter-spacing: .28em; color: var(--muted); margin-top: 3px; }
.brand-lg .brand-mark { width: 46px; height: 46px; border-radius: 15px; font-size: 26px; }
.brand-lg .brand-text { font-size: 18px; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 16px; border-radius: 11px; border: 1px solid transparent;
  background: #1b2639; color: var(--text); font-size: 13px; font-weight: 600;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: #223047; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(120deg, #22d3ee, #4f7df7 55%, #6366f1);
  color: #06101b; border: none;
  box-shadow: 0 10px 30px rgba(34, 211, 238, .18), inset 0 1px 0 rgba(255,255,255,.35);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(120deg, #22d3ee, #4f7df7 55%, #6366f1); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text-2); }
.btn-ghost:hover { background: rgba(148, 163, 184, .08); border-color: rgba(148, 163, 184, .4); }
.btn-danger { background: var(--red-soft); color: #fda4af; border-color: rgba(251, 113, 133, .28); }
.btn-danger:hover { background: rgba(251, 113, 133, .2); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; min-height: 34px; padding: 0; border-radius: 9px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(15, 23, 38, .6); color: var(--muted);
  transition: .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(30, 41, 59, .7); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------------- fields ---------------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field > span i { font-style: normal; font-weight: 400; color: var(--muted); font-size: 11px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: rgba(6, 10, 18, .55);
  border-radius: 10px; padding: 10px 12px; outline: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  min-height: 40px;
}
.field textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: #53617a; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: rgba(34, 211, 238, .55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .1);
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; padding: 8px 0; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------------- login ---------------- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(430px, .88fr); }
.login-art { position: relative; overflow: hidden; display: flex; align-items: center; padding: 7vw 6vw; border-right: 1px solid var(--line); }
.art-content { position: relative; z-index: 2; max-width: 640px; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; }
.orb-a { width: 520px; height: 520px; background: #0ea5e9; top: -160px; left: -100px; }
.orb-b { width: 480px; height: 480px; background: #6366f1; bottom: -180px; right: -80px; opacity: .3; }
.grid-overlay {
  position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148,163,184,.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 40% 45%, black 15%, transparent 72%);
}
.login-art h1 { font-size: clamp(34px, 4.2vw, 58px); line-height: 1.13; letter-spacing: -.035em; margin: 42px 0 18px; font-weight: 800; }
.art-sub { color: var(--text-2); font-size: 15px; max-width: 520px; line-height: 1.75; }
.feature-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.feature-chips span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); font-size: 12px; background: rgba(15, 23, 38, .5); backdrop-filter: blur(8px); }
.feature-chips svg { width: 14px; height: 14px; color: var(--accent); }
.art-foot { display: flex; align-items: center; gap: 10px; margin-top: 54px; color: var(--muted); font-size: 12px; }
.art-foot .sep { width: 1px; height: 12px; background: var(--line-strong); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2.2s infinite; flex: none; }
.pulse-dot.off { background: var(--red); animation: none; box-shadow: 0 0 0 3px rgba(251,113,133,.12); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 44px 5vw; position: relative; background: linear-gradient(180deg, rgba(10,16,28,.72), rgba(6,10,18,.92)); }
.login-card { width: 100%; max-width: 410px; }
.login-card h2 { font-size: 28px; letter-spacing: -.03em; margin: 8px 0 8px; }
.login-card > div > .muted { margin: 0 0 26px; font-size: 13px; line-height: 1.7; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 16px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.verify-note { display: flex; flex-direction: column; gap: 10px; }
.verify-step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.verify-step b { width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; background: rgba(34,211,238,.1); color: var(--accent); font-size: 10px; border: 1px solid rgba(34,211,238,.2); }
.verify-group-line { margin-top: 16px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 12px; }
.verify-group-line b { color: var(--text-2); }
.login-foot { display: flex; justify-content: space-between; margin-top: 36px; color: #53617a; font-size: 11px; }
.code-box { margin-top: 18px; border: 1px solid rgba(34,211,238,.25); background: linear-gradient(160deg, rgba(34,211,238,.07), rgba(99,102,241,.06)); border-radius: 16px; padding: 18px; text-align: center; }
.code-head { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-size: 12px; }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s infinite; }
.code-digits { font-family: var(--mono); font-size: 40px; letter-spacing: .18em; font-weight: 700; margin: 14px 0 8px; color: #a5f3fc; text-shadow: 0 0 30px rgba(34,211,238,.35); }
.code-box .btn-ghost { margin-bottom: 14px; }
.code-instruction { color: var(--text-2); font-size: 12px; line-height: 1.6; margin-bottom: 14px; }
.code-instruction code { color: #a5f3fc; }
.code-progress { height: 3px; background: rgba(148,163,184,.15); border-radius: 4px; overflow: hidden; }
.code-progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s linear; }
.code-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin: 9px 0 12px; font-family: var(--mono); }
#cancel-code { border: none; background: transparent; color: var(--muted); }
#cancel-code:hover { color: var(--text-2); }

/* ---------------- app shell ---------------- */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  width: var(--sidebar); flex: none; position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column; padding: 24px 15px 18px;
  background: linear-gradient(180deg, rgba(11, 17, 30, .96), rgba(7, 11, 19, .98));
  border-right: 1px solid var(--line); backdrop-filter: blur(20px);
}
.sidebar .brand { padding: 0 10px 26px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 11px;
  color: var(--muted); font-size: 13px; font-weight: 550; border: 1px solid transparent;
  transition: .15s; min-height: 40px;
}
.nav-item svg { width: 18px; height: 18px; opacity: .85; }
.nav-item:hover { color: var(--text-2); background: rgba(148,163,184,.06); }
.nav-item.active { color: #d9fbff; background: linear-gradient(90deg, rgba(34,211,238,.13), rgba(99,102,241,.08)); border-color: rgba(34,211,238,.16); }
.nav-item.active svg { color: var(--accent); opacity: 1; }
.nav-badge { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--muted); background: rgba(148,163,184,.1); border-radius: 999px; padding: 1px 6px; }
.nav-badge:empty { display: none; }
.nav-sep { height: 1px; background: var(--line); margin: 14px 8px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.bot-mini { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 11px; background: rgba(148,163,184,.05); border: 1px solid var(--line); }
.bot-mini b { display: block; font-size: 12px; font-weight: 600; }
.bot-mini small { display: block; color: var(--muted); font-size: 10px; margin-top: 1px; }
.nav-logout { width: 100%; background: none; color: var(--muted); }
.nav-logout:hover { color: #fda4af; background: rgba(251,113,133,.07); }
.main { flex: 1; min-width: 0; margin-left: var(--sidebar); display: flex; flex-direction: column; }
.topbar {
  height: 82px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  background: rgba(6, 10, 18, .76); backdrop-filter: blur(18px);
}
.page-head h1 { font-size: 19px; margin: 0; letter-spacing: -.02em; font-weight: 700; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.conn-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; background: rgba(15,23,38,.6); white-space: nowrap; }
.conn-pill.off { color: #fda4af; border-color: rgba(251,113,133,.25); }
.admin-chip { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(140deg, #0e7490, #4338ca); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: white; text-transform: uppercase; }
.admin-meta b { display: block; font-size: 12px; font-weight: 600; }
.admin-meta small { display: block; color: var(--muted); font-size: 10px; }
.page-content { padding: 26px 30px 46px; max-width: 1500px; width: 100%; margin: 0 auto; }

/* ---------------- common page bits ---------------- */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.hero h2 { margin: 6px 0 6px; font-size: 27px; letter-spacing: -.03em; }
.hero p { margin: 0; color: var(--muted); font-size: 13px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { border: 1px solid var(--line); background: linear-gradient(160deg, rgba(19,29,47,.8), rgba(11,17,30,.7)); border-radius: var(--radius-sm); padding: 15px 16px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 70px; height: 70px; right: -25px; top: -30px; border-radius: 50%; background: var(--accent); opacity: .06; filter: blur(10px); }
.stat-label { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 6px; }
.stat-label svg { width: 13px; height: 13px; }
.stat-value { font-size: 26px; font-weight: 750; letter-spacing: -.04em; margin-top: 7px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-foot { color: var(--muted); font-size: 10px; margin-top: 4px; }
.stat-foot b { color: var(--green); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.grid-2-eq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); min-height: 56px; }
.card-title { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; }
.card-title svg { width: 16px; height: 16px; color: var(--accent); }
.card-sub { color: var(--muted); font-size: 11px; font-weight: 400; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 12px; }
.section-title h3 { margin: 0; font-size: 14px; font-weight: 650; }
.section-title p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }

.chart { display: flex; gap: 10px; align-items: stretch; height: 190px; padding-top: 10px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.chart-bar { width: 34%; max-width: 17px; min-height: 3px; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #22d3ee, rgba(34,211,238,.25)); opacity: .85; transition: height .4s; }
.chart-bar.mod { background: linear-gradient(180deg, #fb7185, rgba(251,113,133,.2)); }
.chart-label { color: var(--muted); font-size: 10px; font-family: var(--mono); white-space: nowrap; }
.legend { display: flex; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.legend i.mod { background: var(--red); }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: flex-start; gap: 11px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: none; }
.list-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; background: var(--accent); flex: none; }
.list-dot.green { background: var(--green); } .list-dot.red { background: var(--red); } .list-dot.amber { background: var(--amber); }
.list-main { min-width: 0; flex: 1; }
.list-main b { font-size: 12px; font-weight: 550; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main small { color: var(--muted); font-size: 10px; display: block; margin-top: 2px; }
.list-time { color: #53617a; font-size: 10px; white-space: nowrap; font-family: var(--mono); margin-top: 1px; }

.bot-panel { display: flex; flex-direction: column; gap: 13px; }
.bot-hero { display: flex; align-items: center; gap: 13px; }
.bot-avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(140deg, rgba(34,211,238,.18), rgba(99,102,241,.2)); border: 1px solid rgba(34,211,238,.2); color: var(--accent); }
.bot-avatar svg { width: 22px; height: 22px; }
.bot-hero b { display: block; font-size: 13px; }
.bot-hero small { color: var(--muted); font-size: 11px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-weight: 550; color: var(--text-2); text-align: right; word-break: break-all; }
.notice-banner { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 11px; border: 1px solid rgba(251,191,36,.22); background: var(--amber-soft); color: #fde68a; font-size: 12px; line-height: 1.6; margin-bottom: 16px; }
.notice-banner svg { width: 16px; height: 16px; margin-top: 1px; flex: none; }
.notice-banner.red { border-color: rgba(251,113,133,.25); background: var(--red-soft); color: #fecdd3; }

/* ---------------- toolbar / table ---------------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; background: rgba(6,10,18,.5); height: 38px; min-width: 220px; }
.search svg { width: 15px; height: 15px; color: var(--muted); }
.search input { border: none; background: none; outline: none; width: 100%; font-size: 12px; }
.search input::placeholder { color: #53617a; }
.select-inline { height: 38px; border: 1px solid var(--line); background: rgba(6,10,18,.5); border-radius: 10px; padding: 0 30px 0 11px; font-size: 12px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th { text-align: left; color: var(--muted); font-weight: 550; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(148,163,184,.025); }
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(148,163,184,.035); }
.td-main { font-weight: 550; color: var(--text); }
.td-sub { color: var(--muted); font-size: 10px; margin-top: 2px; }
.td-actions { display: flex; gap: 4px; justify-content: flex-end; }
.td-actions .icon-btn { width: 30px; height: 30px; background: transparent; border-color: transparent; }
.td-actions .icon-btn:hover { background: rgba(148,163,184,.08); border-color: var(--line); }
.table-empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 12px; }
.table-empty svg { width: 28px; height: 28px; opacity: .35; margin-bottom: 8px; }
.pager { display: flex; justify-content: center; padding: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 6px; font-size: 10px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.green { background: var(--green-soft); color: #6ee7b7; border-color: rgba(52,211,153,.2); }
.badge.red { background: var(--red-soft); color: #fda4af; border-color: rgba(251,113,133,.2); }
.badge.amber { background: var(--amber-soft); color: #fcd34d; border-color: rgba(251,191,36,.2); }
.badge.blue { background: rgba(34,211,238,.1); color: #67e8f9; border-color: rgba(34,211,238,.18); }
.badge.violet { background: rgba(167,139,250,.1); color: #c4b5fd; border-color: rgba(167,139,250,.2); }
.badge.gray { background: rgba(148,163,184,.08); color: var(--muted); border-color: var(--line); }

.tabs { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); background: rgba(6,10,18,.5); border-radius: 11px; }
.tab { border: none; background: transparent; color: var(--muted); padding: 7px 13px; border-radius: 8px; font-size: 12px; font-weight: 550; transition: .15s; }
.tab:hover { color: var(--text-2); }
.tab.active { background: rgba(34,211,238,.12); color: #a5f3fc; box-shadow: inset 0 0 0 1px rgba(34,211,238,.15); }

.toggle { position: relative; display: inline-flex; width: 38px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: rgba(148,163,184,.16); border-radius: 999px; cursor: pointer; transition: .2s; border: 1px solid var(--line); }
.toggle span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #94a3b8; transition: .2s; }
.toggle input:checked + span { background: rgba(34,211,238,.28); border-color: rgba(34,211,238,.4); }
.toggle input:checked + span::after { transform: translateX(16px); background: #67e8f9; }

/* ---------------- groups ---------------- */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.group-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(19,29,47,.82), rgba(10,16,28,.8)); padding: 16px; display: flex; flex-direction: column; gap: 13px; transition: .18s; }
.group-card:hover { border-color: rgba(148,163,184,.28); transform: translateY(-1px); }
.group-top { display: flex; align-items: flex-start; gap: 11px; }
.group-avatar { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(140deg, rgba(99,102,241,.25), rgba(34,211,238,.16)); display: grid; place-items: center; font-size: 16px; font-weight: 700; color: #a5f3fc; border: 1px solid rgba(34,211,238,.15); flex: none; }
.group-name { min-width: 0; flex: 1; }
.group-name b { display: block; font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-name small { display: block; color: var(--muted); font-size: 10px; font-family: var(--mono); margin-top: 2px; }
.group-meta { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.group-meta span { display: inline-flex; align-items: center; gap: 5px; }
.group-meta svg { width: 13px; height: 13px; }
.group-actions { display: flex; gap: 7px; padding-top: 11px; border-top: 1px solid var(--line); }
.group-actions .btn { flex: 1; }
.group-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.group-tags { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---------------- empty / skeleton ---------------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 54px 20px; text-align: center; color: var(--muted); }
.empty-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(148,163,184,.06); border: 1px solid var(--line); color: #53617a; }
.empty-icon svg { width: 24px; height: 24px; }
.empty b { color: var(--text-2); font-size: 13px; font-weight: 600; }
.empty p { margin: 0; font-size: 12px; max-width: 340px; line-height: 1.65; }
.skeleton { height: 13px; border-radius: 6px; background: linear-gradient(90deg, rgba(148,163,184,.06), rgba(148,163,184,.13), rgba(148,163,184,.06)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-page { display: grid; gap: 14px; }
.loading-page .skeleton:nth-child(1) { height: 120px; }
.loading-page .skeleton:nth-child(2) { height: 220px; }

/* ---------------- modal ---------------- */
#modal-root:empty { display: none; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(2, 6, 12, .72); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; max-height: min(88vh, 900px); display: flex; flex-direction: column; background: #0e1625; border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow); animation: rise .2s ease; }
.modal.wide { max-width: 780px; }
.modal.narrow { max-width: 420px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.modal-close { width: 30px; height: 30px; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; display: grid; place-items: center; }
.modal-close:hover { color: var(--text); background: rgba(148,163,184,.08); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgba(6,10,18,.3); border-radius: 0 0 20px 20px; }
.form-section { border: 1px solid var(--line); border-radius: 13px; padding: 14px; margin-bottom: 14px; }
.form-section:last-child { margin-bottom: 0; }
.form-section h4 { margin: 0 0 12px; font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.form-section h4 svg { width: 14px; height: 14px; color: var(--accent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: none; }
.switch-row b { display: block; font-size: 12px; font-weight: 550; }
.switch-row small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.code-reveal { background: #060b14; border: 1px solid rgba(34,211,238,.25); border-radius: 12px; padding: 14px; font-family: var(--mono); font-size: 13px; color: #a5f3fc; word-break: break-all; line-height: 1.6; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }

/* ---------------- toast ---------------- */
.toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: min(380px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 9px; background: rgba(14,22,37,.96); border: 1px solid var(--line-strong); border-radius: 12px; padding: 11px 14px; font-size: 12px; color: var(--text-2); box-shadow: var(--shadow); animation: toastIn .2s ease; pointer-events: auto; }
.toast.success { border-color: rgba(52,211,153,.3); }
.toast.error { border-color: rgba(251,113,133,.35); }
.toast svg { width: 15px; height: 15px; margin-top: 1px; color: var(--accent); }
.toast.success svg { color: var(--green); } .toast.error svg { color: var(--red); }
@keyframes toastIn { from { opacity: 0; transform: translateX(10px); } }

/* ---------------- detail bits ---------------- */
.alert-box { border: 1px solid rgba(251,113,133,.24); background: var(--red-soft); color: #fecdd3; padding: 13px 15px; border-radius: 11px; font-size: 12px; line-height: 1.65; }
.info-box { border: 1px solid rgba(34,211,238,.2); background: var(--accent-soft); color: #bae6fd; padding: 13px 15px; border-radius: 11px; font-size: 12px; line-height: 1.65; }
.warn-box { border: 1px solid rgba(251,191,36,.24); background: var(--amber-soft); color: #fde68a; padding: 13px 15px; border-radius: 11px; font-size: 12px; line-height: 1.65; }
.setting-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 16px; }
.scope-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 14px; max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.scope-list .check { padding: 5px 0; font-size: 12px; }
.kbd { font-family: var(--mono); background: rgba(148,163,184,.1); border: 1px solid var(--line); border-bottom-color: var(--line-strong); border-radius: 5px; padding: 1px 5px; font-size: 10px; color: var(--text-2); }
.small { font-size: 11px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .flex-wrap { flex-wrap: wrap; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

@media (max-width: 1240px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  :root { --sidebar: 76px; }
  .sidebar { padding: 20px 10px 14px; align-items: center; }
  .sidebar .brand { padding: 0 0 22px; }
  .brand-text, .nav-item span, .nav-badge, .sidebar-foot .bot-mini div, .nav-logout span { display: none; }
  .nav { width: 100%; align-items: center; }
  .nav-item { width: 48px; justify-content: center; padding: 11px; }
  .nav-sep { width: 32px; margin: 12px 0; }
  .bot-mini { width: 46px; justify-content: center; padding: 10px; }
  .sidebar-foot { width: 100%; align-items: center; }
  .nav-logout { width: 48px; }
  .page-content { padding: 22px 20px 40px; }
  .topbar { padding: 0 20px; }
  .admin-meta { display: none; }
  .admin-chip { padding-left: 8px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { min-height: 100vh; }
}
@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .app-shell { display: block; }
  .sidebar { inset: auto 0 0 0; width: 100%; height: 66px; flex-direction: row; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(8,13,23,.97); }
  .sidebar .brand, .sidebar-foot, .nav-sep { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 0; }
  .nav-item { width: auto; flex: 1; flex-direction: column; gap: 3px; padding: 5px 2px; min-height: 50px; font-size: 9px; border-radius: 8px; }
  .nav-item span { display: block; font-size: 9px; line-height: 1; }
  .nav-item svg { width: 18px; height: 18px; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .topbar { height: 66px; padding: 0 14px; }
  .page-head h1 { font-size: 16px; }
  .page-head p { display: none; }
  .topbar-actions { gap: 8px; }
  .conn-pill { padding: 5px 8px; font-size: 10px; }
  .admin-chip { display: none; }
  .page-content { padding: 16px 14px 28px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-value { font-size: 22px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero h2 { font-size: 22px; }
  .grid-2-eq { grid-template-columns: 1fr; }
  .groups-grid { grid-template-columns: 1fr; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: 18px; }
  .modal-foot { border-radius: 0 0 18px 18px; }
  .setting-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search { min-width: 0; flex: 1; }
  .login-panel { padding: 30px 20px; }
  .login-card h2 { font-size: 24px; }
  .code-digits { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
