/* m2admin — design system. Dark by default; [data-theme="light"] on <html> switches. */
:root {
  color-scheme: dark;
  --bg: #0a0b10;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.10), transparent 60%), radial-gradient(900px 500px at 110% 0%, rgba(34, 211, 238, 0.06), transparent 60%);
  --surface: #11131a;
  --surface-2: #161923;
  --surface-3: #1c2030;
  --hover: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #e7e9f0;
  --text-2: #b2b7c6;
  --muted: #7e8497;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(124, 92, 255, 0.14);
  --accent-text: #b7a6ff;
  --grad: linear-gradient(135deg, #7c5cff 0%, #5b8cff 50%, #22d3ee 100%);
  --good: #22c55e;
  --good-soft: rgba(34, 197, 94, 0.12);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, 0.12);
  --bad: #f04444;
  --bad-soft: rgba(240, 68, 68, 0.12);
  --info: #3b9eff;
  --info-soft: rgba(59, 158, 255, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);
  /* chart series (dataviz reference palette, dark steps) */
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --grid: #24273a; --axis: #383b4f;
  --seq0: #1a1d2a; --seq1: #184f95; --seq2: #1c5cab; --seq3: #256abf; --seq4: #3987e5; --seq5: #6da7ec; --seq6: #9ec5f4;
  --emp1: #e66767; --emp2: #c98500; --emp3: #3987e5;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 248px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'SF Mono', Consolas, monospace;
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-grad: radial-gradient(1200px 600px at 10% -10%, rgba(124, 92, 255, 0.08), transparent 60%), radial-gradient(900px 500px at 110% 0%, rgba(34, 211, 238, 0.06), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f6;
  --hover: rgba(15, 18, 40, 0.04);
  --border: rgba(15, 18, 40, 0.08);
  --border-strong: rgba(15, 18, 40, 0.15);
  --text: #12141c;
  --text-2: #464b5e;
  --muted: #7a8094;
  --accent: #6a46ff;
  --accent-soft: rgba(106, 70, 255, 0.10);
  --accent-text: #5634e6;
  --good: #16a34a; --good-soft: rgba(22, 163, 74, 0.10);
  --warn: #d97706; --warn-soft: rgba(217, 119, 6, 0.10);
  --bad: #dc2626; --bad-soft: rgba(220, 38, 38, 0.08);
  --info: #2563eb; --info-soft: rgba(37, 99, 235, 0.08);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 20px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, 0.18);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --grid: #eceef3; --axis: #c9ccd6;
  --seq0: #eef1f7; --seq1: #cde2fb; --seq2: #9ec5f4; --seq3: #6da7ec; --seq4: #3987e5; --seq5: #256abf; --seq6: #184f95;
  --emp1: #e34948; --emp2: #eda100; --emp3: #2a78d6;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
::selection { background: var(--accent-soft); }
.ico { display: block; flex-shrink: 0; }
.ico-wrap { display: inline-flex; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; color: white; font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 20px rgba(124, 92, 255, 0.35), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-name { font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.nav-group { margin-top: 14px; }
.nav-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0 10px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--text-2); font-weight: 500; text-decoration: none; position: relative; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav a.active .ico { color: var(--accent-text); }
.nav .badge-count { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); flex-shrink: 0;
}
.avatar.lg { width: 56px; height: 56px; font-size: 20px; border-radius: 16px; }
.avatar.grad { background: var(--grad); color: white; border: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.topbar .crumbs { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .crumbs .sep { color: var(--muted); }
.searchbox {
  margin-left: auto; display: flex; align-items: center; gap: 8px; width: 340px; max-width: 40vw;
  height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer;
}
.searchbox:hover { border-color: var(--border-strong); }
.searchbox > span:not(.ico-wrap) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); }
.content { padding: 26px 28px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.icon-btn.mobile-menu { display: none; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); margin-top: 4px; }
.page-loading { display: grid; place-items: center; padding: 120px 0; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-title .ico { color: var(--muted); }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.span2 { grid-column: span 2; }

/* stat tiles */
.stat { padding: 16px 18px; position: relative; overflow: hidden; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.stat-foot { color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stat .spark { position: absolute; right: 14px; bottom: 12px; opacity: .9; }
.stat.hero { background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 22%, var(--surface)) 0%, var(--surface) 60%); }

/* status hero */
.hero-status { display: flex; align-items: center; gap: 18px; padding: 20px 22px; }
.hero-orb { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; }
.hero-orb.ok { background: var(--good-soft); color: var(--good); }
.hero-orb.degraded { background: var(--warn-soft); color: var(--warn); }
.hero-orb.down { background: var(--bad-soft); color: var(--bad); }
.hero-text { font-size: 18px; font-weight: 650; }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap;
}
.pill.ok { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.dot.live { box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.badge-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; color: var(--text-2); }
.emp { display: inline-flex; align-items: center; gap: 6px; }
.emp::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.emp.e1::before { background: var(--emp1); } .emp.e2::before { background: var(--emp2); } .emp.e3::before { background: var(--emp3); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s, opacity .12s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--text-2); border-top-color: transparent; animation: spin .7s linear infinite; }
.btn.primary { background: var(--grad); border-color: transparent; color: white; box-shadow: 0 4px 14px rgba(124, 92, 255, 0.3); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--bad); border-color: transparent; color: white; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.soft-danger { color: var(--bad); }
.btn.soft-danger:hover { background: var(--bad-soft); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.input {
  width: 100%; height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font: inherit; outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.45; }
select.input { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 30px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); min-width: 0; }
.field .hint { color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { white-space: nowrap; height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; }
.search-input { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-input .ico-wrap { position: absolute; left: 10px; top: 9px; color: var(--muted); pointer-events: none; }
.search-input .input { padding-left: 34px; width: 100%; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr:hover { background: var(--hover); }
.table td.r, .table th.r { text-align: right; }
.table .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .who .avatar { width: 28px; height: 28px; font-size: 11px; }
.name-strong { font-weight: 600; color: var(--text); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }

/* key-value */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 9px 18px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad); }

/* ---------- callouts, empty, spinner ---------- */
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; color: var(--text-2); align-items: flex-start; }
.callout .ico-wrap { margin-top: 1px; }
.callout.info { background: var(--info-soft); border-color: transparent; }
.callout.info .ico-wrap { color: var(--info); }
.callout.warn { background: var(--warn-soft); border-color: transparent; }
.callout.warn .ico-wrap { color: var(--warn); }
.callout.danger { background: var(--bad-soft); border-color: transparent; color: var(--text); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--surface-3); color: var(--text-2); margin-bottom: 12px; }
.empty-title { font-weight: 650; color: var(--text); font-size: 15px; }
.empty-text { margin-top: 4px; max-width: 460px; margin-left: auto; margin-right: auto; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- toasts & modal ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 11px 14px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-weight: 500; transform: translateY(8px); opacity: 0; transition: transform .2s, opacity .2s; }
.toast.in { transform: none; opacity: 1; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex-shrink: 0; }
.toast.err .toast-dot { background: var(--bad); }
.toast.warn .toast-dot { background: var(--warn); }
.overlay { position: fixed; inset: 0; z-index: 500; background: rgba(5, 6, 12, 0.6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .18s; }
.overlay.in { opacity: 1; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .18s; }
.modal.wide { max-width: 860px; }
.overlay.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-body { padding: 4px 18px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }

/* command palette */
.palette { max-width: 620px; align-self: start; margin-top: 12vh; }
.palette .modal-head { display: none; }
.palette .modal-body { padding: 0; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; outline: none; }
.palette-list { max-height: 420px; overflow-y: auto; padding: 6px; }
.palette-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 10px 4px; font-weight: 600; }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text-2); }
.palette-item.sel, .palette-item:hover { background: var(--accent-soft); color: var(--text); }
.palette-item .meta { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ---------- server tiles ---------- */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.channel { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.channel-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.channel-name { font-weight: 700; font-size: 15px; }
.channel-players { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.core-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.core-line .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.state-online { color: var(--good); } .state-starting, .state-stopping, .state-degraded { color: var(--warn); }
.state-stopped { color: var(--muted); } .state-failed, .state-unresponsive, .state-down { color: var(--bad); }
.meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter > div { height: 100%; border-radius: 3px; background: var(--grad); }
.meter.warn > div { background: var(--warn); } .meter.bad > div { background: var(--bad); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; padding: 8px 0; position: relative; font-size: 13px; }
.tl-item .dot { margin-top: 6px; }
.tl-item .when { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* ---------- player profile ---------- */
.profile-head { display: flex; gap: 18px; align-items: center; padding: 20px 22px; flex-wrap: wrap; }
.profile-name { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-meta { color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.profile-meta > span { display: inline-flex; gap: 6px; align-items: center; }
.profile-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.statbar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--border); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.statbar > div { background: var(--surface); padding: 12px 16px; }
.statbar .k { color: var(--muted); font-size: 12px; }
.statbar .v { font-weight: 700; font-size: 16px; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* inventory */
.inv-wrap { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.inv-grid { display: grid; grid-template-columns: repeat(5, 40px); grid-auto-rows: 40px; gap: 3px; padding: 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.inv-cell { background: var(--surface-3); border-radius: 6px; position: relative; }
.inv-item { position: relative; border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, var(--surface-3)); border: 1px solid var(--border-strong); cursor: pointer; display: grid; place-items: center; overflow: hidden; transition: border-color .1s, transform .1s; }
.inv-item:hover { border-color: var(--accent); transform: translateY(-1px); z-index: 2; }
.inv-item img { width: 32px; height: auto; image-rendering: auto; }
.inv-item .cnt { position: absolute; right: 2px; bottom: 0; font-size: 10.5px; font-weight: 700; text-shadow: 0 1px 2px #000; color: #fff; }
.inv-item.attr { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--s7) 60%, transparent); }
.inv-page-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.equip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; flex: 1; min-width: 280px; }
.equip { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; }
.equip:hover { border-color: var(--border-strong); }
.equip img { width: 32px; }
.item-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.item-icon img { width: 32px; }
.item-icon.sm { width: 28px; height: 28px; } .item-icon.sm img { width: 24px; }
.attr-list { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.attr-list .a { color: var(--s7); }
:root[data-theme='light'] .attr-list .a { color: var(--accent-text); }
.item-pick { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-top: 6px; }
.item-pick > div { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.item-pick > div:hover, .item-pick > div.sel { background: var(--accent-soft); }

/* chat */
.chat-feed { display: flex; flex-direction: column; }
.chat-line { display: grid; grid-template-columns: 120px 92px minmax(0, 1fr); gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; align-items: baseline; }
.chat-line:hover { background: var(--hover); }
.chat-when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chat-msg { overflow-wrap: anywhere; }
.chat-msg .who { font-weight: 600; }
.chat-item { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.chat-item img { width: 16px; }
.ct { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); text-transform: uppercase; letter-spacing: .03em; }
.ct.WHISPER { background: color-mix(in srgb, var(--s5) 18%, transparent); color: var(--s5); }
.ct.PARTY { background: color-mix(in srgb, var(--s3) 18%, transparent); color: var(--s3); }
.ct.GUILD { background: color-mix(in srgb, var(--s7) 18%, transparent); color: var(--s7); }
.ct.SHOUT { background: color-mix(in srgb, var(--s2) 18%, transparent); color: var(--s2); }
.dialog { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.bubble { max-width: 70%; padding: 8px 12px; border-radius: 14px; background: var(--surface-3); font-size: 13.5px; }
.bubble.me { align-self: flex-end; background: var(--accent-soft); }
.bubble .t { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* notice preview */
.game-preview { position: relative; border-radius: 12px; overflow: hidden; min-height: 190px; background: radial-gradient(ellipse at 50% 120%, #2c4a2a 0%, #16251a 45%, #0c130e 100%); border: 1px solid var(--border); }
.game-preview .gp-big { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); width: 86%; text-align: center; font-weight: 700; font-size: 17px; color: #fff3c4; text-shadow: 0 0 2px #000, 0 2px 6px #000; padding: 10px 14px; background: linear-gradient(90deg, transparent, rgba(0,0,0,.55) 15%, rgba(0,0,0,.55) 85%, transparent); }
.game-preview .gp-chat { position: absolute; left: 14px; bottom: 12px; right: 14px; font-size: 12.5px; color: #ffd36b; text-shadow: 0 1px 2px #000; display: flex; flex-direction: column; gap: 2px; }
.game-preview .gp-chat .n { color: #e8e8e8; }

/* charts */
.chart { position: relative; }
.chart-plot { position: relative; padding-left: 40px; padding-bottom: 20px; }
.chart-svg { width: 100%; height: 220px; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-svg .axis { stroke: var(--axis); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-svg .line { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-ylabels span { position: absolute; left: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-ylabels { position: absolute; left: 0; top: 0; bottom: 20px; width: 40px; }
.chart-xlabels { position: absolute; left: 40px; right: 0; bottom: 0; height: 18px; }
.chart-xlabels span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-tip { position: absolute; display: none; pointer-events: none; z-index: 10; min-width: 140px; padding: 8px 10px; border-radius: 9px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); font-size: 12.5px; }
.tip-title { font-weight: 650; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-key { width: 10px; height: 3px; border-radius: 2px; }
.tip-label { color: var(--text-2); }
.tip-val { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; padding-left: 12px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bars { display: flex; align-items: flex-end; gap: 6px; padding-top: 8px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; cursor: default; }
.bar { width: 100%; max-width: 44px; border-radius: 4px 4px 0 0; transition: filter .1s; }
.bar-col:hover .bar { filter: brightness(1.2); }
.bar-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; gap: 8px; }
.hbar-label { display: inline-flex; align-items: center; gap: 7px; }
.hbar-val { font-weight: 650; font-variant-numeric: tabular-nums; }
.hbar-val small { color: var(--muted); font-weight: 500; }
.hbar-track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px; }
.heat { display: grid; grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 3px; }
.heat-h { font-size: 10px; color: var(--muted); text-align: center; }
.heat-d { font-size: 11px; color: var(--muted); display: flex; align-items: center; }
.heat-cell { aspect-ratio: 1; border-radius: 3px; background: var(--seq0); min-height: 10px; }
.heat-cell.q1 { background: var(--seq1); } .heat-cell.q2 { background: var(--seq2); } .heat-cell.q3 { background: var(--seq3); }
.heat-cell.q4 { background: var(--seq4); } .heat-cell.q5 { background: var(--seq5); } .heat-cell.q6 { background: var(--seq6); }
.heat-scale { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 10px; font-size: 11px; color: var(--muted); }
.heat-scale .heat-cell { width: 12px; min-height: 12px; }
.heat-scale span:first-child { margin-right: 4px; } .heat-scale span:last-child { margin-left: 4px; }

/* log viewer */
.logview { font-family: var(--mono); font-size: 12px; line-height: 1.55; background: #07080c; color: #c9cede; padding: 12px 14px; border-radius: 10px; max-height: 70vh; overflow: auto; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--border); }
.logview .e { color: #ff8a8a; } .logview .w { color: #ffc56b; }
.term { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; background: #07080c; color: #c9cede; padding: 12px; border-radius: 10px; max-height: 50vh; overflow: auto; }

/* login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; background: #07070d; display: flex; flex-direction: column; justify-content: space-between; padding: 40px; color: #fff; }
.login-art::before { content: ''; position: absolute; inset: -20%; background: radial-gradient(circle at 30% 30%, rgba(124,92,255,.55), transparent 45%), radial-gradient(circle at 70% 60%, rgba(34,211,238,.35), transparent 45%), radial-gradient(circle at 40% 90%, rgba(240,68,68,.25), transparent 40%); filter: blur(40px); animation: drift 18s ease-in-out infinite alternate; }
.login-art::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 75%); }
.login-art > * { position: relative; z-index: 1; }
@keyframes drift { to { transform: translate(4%, -3%) rotate(8deg); } }
.login-art h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.03em; max-width: 480px; }
.login-art p { color: rgba(255,255,255,.7); max-width: 440px; margin-top: 14px; font-size: 15px; }
.login-feats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.login-feats span { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); font-size: 12.5px; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; }
.login-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.login-form h2 { font-size: 24px; }

/* responsive */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 100; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); background: var(--surface); }
  .sidebar.open { transform: none; }
  .icon-btn.mobile-menu { display: inline-grid; }
  .statbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 50px; }
  .g2, .g-2-1, .g-1-2, .g3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .searchbox { width: auto; flex: 1; }
  .searchbox > span:not(.ico-wrap), .searchbox kbd { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .chat-line { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr; }
}
