/* RealmPanel — light frosted-glass theme (Apple system palette) */
:root {
  --blue: #007aff; --green: #34c759; --orange: #ff9500; --red: #ff3b30; --purple: #af52de; --cyan: #5ac8fa;
  --ink: #1c1c1e;
  --ink2: rgba(60, 60, 67, .78);
  --ink3: rgba(60, 60, 67, .58);
  --ink4: rgba(60, 60, 67, .40);
  --glass: rgba(255, 255, 255, .55);
  --glass2: rgba(255, 255, 255, .68);
  --glass3: rgba(255, 255, 255, .82);
  --stroke: rgba(255, 255, 255, .75);
  --hair: rgba(60, 60, 67, .10);
  --hair2: rgba(60, 60, 67, .16);
  --blur: blur(30px) saturate(180%);
  --sh-1: 0 1px 2px rgba(28, 28, 30, .04), 0 6px 18px rgba(40, 60, 110, .07);
  --sh-2: 0 2px 6px rgba(28, 28, 30, .05), 0 14px 38px rgba(40, 60, 110, .10);
  --sh-3: 0 8px 20px rgba(28, 28, 30, .07), 0 30px 70px rgba(40, 60, 110, .16);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* aliases used by templates */
  --text: var(--ink); --muted: var(--ink3); --primary: var(--blue);
  --ok: #1f8f43; --warn: #a35f00; --danger: var(--red);
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgba(60,60,67,.24) transparent; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  min-width: 320px; color: var(--ink); font-size: 13px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-synthesis: none;
  background: linear-gradient(165deg, #f2f6fd 0%, #eef1fb 40%, #f6f2fb 100%);
}
body::before {
  content: ""; position: fixed; inset: -15%; z-index: -1; pointer-events: none; filter: blur(24px);
  background:
    radial-gradient(48vw 40vw at 12% 6%, rgba(0,122,255,.24), transparent 62%),
    radial-gradient(46vw 42vw at 88% 2%, rgba(175,82,222,.20), transparent 64%),
    radial-gradient(52vw 46vw at 78% 74%, rgba(90,200,250,.24), transparent 62%),
    radial-gradient(44vw 40vw at 6% 82%, rgba(255,138,190,.18), transparent 62%),
    radial-gradient(40vw 36vw at 46% 48%, rgba(52,199,89,.10), transparent 66%);
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; color: var(--ink); }
code, .mono { font-family: var(--mono); font-size: 12px; }
::selection { background: rgba(0,122,255,.18); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(60,60,67,.2) padding-box content-box; border: 2px solid transparent; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(60,60,67,.34) padding-box content-box; }

/* ---------- shell ---------- */
.layout { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px; padding: 20px 14px; z-index: 10;
  display: flex; flex-direction: column; border-radius: 24px;
  background: var(--glass); border: 1px solid var(--stroke); box-shadow: var(--sh-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand .logo {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-size: 18px; flex: none;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6); box-shadow: 0 6px 18px rgba(0,122,255,.36), inset 0 1px rgba(255,255,255,.4);
}
.brand > div { display: flex; flex-direction: column; min-width: 0; }
.brand b { font-size: 15px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font: 600 8px/1 var(--mono); color: var(--ink4); letter-spacing: 2.2px; margin-top: 4px; }
.nav { flex: 1; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.nav p { margin: 0; color: var(--ink4); text-transform: uppercase; letter-spacing: 1.4px; padding: 14px 12px 6px; font-size: 10px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 10px; border-radius: 12px; margin-bottom: 2px;
  color: var(--ink2); font-size: 13px; font-weight: 500;
  transition: background .22s var(--ease), color .22s var(--ease);
}
.nav a:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.nav a.active { color: #0062cc; background: rgba(0,122,255,.12); box-shadow: inset 0 0 0 1px rgba(0,122,255,.16); }
.nav .ico { width: 18px; text-align: center; font-size: 13px; opacity: .75; }
.nav a.active .ico { opacity: 1; }
.sidebar-foot { color: var(--ink3); border-top: 1px solid var(--hair); margin-top: 16px; padding: 16px 10px 0; font-size: 10.5px; }
.sidebar-foot small { display: block; color: var(--ink4); margin-top: 5px; font: 600 8.5px var(--mono); letter-spacing: .6px; }
.main { min-width: 0; }
.topbar {
  position: sticky; top: 12px; z-index: 8; height: 72px; margin: 12px 12px 0; padding: 0 22px; border-radius: 22px;
  display: flex; align-items: center; gap: 18px;
  background: var(--glass2); border: 1px solid var(--stroke); box-shadow: var(--sh-1);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.global-state { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.global-state > div { display: flex; flex-direction: column; min-width: 0; }
.global-state b { color: var(--ink); font-size: 12.5px; }
.global-state small { color: var(--ink3); margin-top: 3px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--green); box-shadow: 0 0 0 3px rgba(52,199,89,.18); }
.topbar .user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 600; letter-spacing: .5px;
  background: linear-gradient(135deg, #5ac8fa, #007aff); box-shadow: 0 4px 12px rgba(0,122,255,.28), inset 0 1px rgba(255,255,255,.35);
}
.icon-btn { display: grid; place-items: center; padding: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink3); cursor: pointer; transition: background .22s var(--ease), color .22s var(--ease); }
.icon-btn:hover { color: var(--ink); background: rgba(255,255,255,.72); }
.menu-btn { display: none; }
.content { max-width: 1700px; margin: auto; padding: 26px 24px 34px; }
.page-title { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 20px; padding: 0 4px; }
.page-title p { margin: 0 0 6px; color: var(--ink4); text-transform: uppercase; letter-spacing: 1.3px; font-size: 10.5px; font-weight: 600; }
.page-title h1 { font-size: 27px; font-weight: 700; letter-spacing: -.6px; }
.live { display: inline-flex; align-items: center; font: 600 9.5px var(--mono); color: #1f8f43; background: rgba(52,199,89,.14); border: 1px solid rgba(52,199,89,.24); border-radius: 999px; padding: 8px 12px; letter-spacing: .4px; white-space: nowrap; }
.live span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 6px; display: inline-block; }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 214px 1fr; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .brand b { font-size: 13px; letter-spacing: 1.2px; }
  .brand small { letter-spacing: 1.6px; }
  .topbar { gap: 14px; padding: 0 18px; }
  .content { padding: 22px 18px 30px; }
}
@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar { position: fixed; left: -300px; top: 12px; width: 262px; margin: 0; transition: left .3s var(--ease); z-index: 30; background: rgba(255,255,255,.92); }
  .sidebar.open { left: 12px; }
  .overlay { position: fixed; inset: 0; z-index: 25; background: rgba(120,130,160,.24); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .menu-btn { display: grid; }
  .topbar { height: 60px; margin: 10px 10px 0; padding: 0 14px; gap: 10px; border-radius: 18px; top: 10px; }
  .global-state small, .topbar .badge { display: none; }
  .content { padding: 18px 12px 26px; }
  .page-title h1 { font-size: 22px; }
}

/* ---------- cards ---------- */
.card {
  border-radius: 20px; overflow: hidden; position: relative;
  background: var(--glass2); border: 1px solid var(--stroke); box-shadow: var(--sh-1);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--hair); }
.card-h h2 { font-size: 15px; font-weight: 650; letter-spacing: -.2px; }
.card-h h2 .muted { font: 600 9.5px var(--mono); color: var(--ink3); border: 1px solid var(--stroke); background: rgba(255,255,255,.6); border-radius: 999px; padding: 3px 8px; margin-left: 6px; vertical-align: 2px; }
.card-b { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* ---------- summary bar ---------- */
.summary {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; border-radius: 22px; overflow: hidden;
  background: var(--glass); border: 1px solid var(--stroke); box-shadow: var(--sh-2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.summary > div { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; padding: 20px 22px; border-right: 1px solid var(--hair); min-width: 0; }
.summary > div:last-child { border-right: 0; }
.summary-icon { grid-row: 1 / 3; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 16px; font-weight: 700; box-shadow: inset 0 1px rgba(255,255,255,.5); }
.summary-icon.blue { color: #0062cc; background: rgba(0,122,255,.14); }
.summary-icon.teal { color: #1f8f43; background: rgba(52,199,89,.16); }
.summary-icon.purple { color: #7d2fae; background: rgba(175,82,222,.16); }
.summary-icon.amber { color: #b56a00; background: rgba(255,149,0,.16); }
.summary p { margin: 0; display: flex; flex-direction: column; color: var(--ink2); font-size: 11.5px; font-weight: 500; }
.summary p small { font: 600 7.5px var(--mono); color: var(--ink4); letter-spacing: .6px; margin-top: 4px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary b { font: 600 19px var(--mono); color: var(--ink); align-self: end; white-space: nowrap; }
.summary b i { color: var(--ink4); font-size: 12px; font-style: normal; }
.summary b.danger { color: var(--red); }
.summary > div > div { grid-column: 2; align-self: end; }
@media (max-width: 1100px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .summary > div:nth-child(2) { border-right: 0; }
  .summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--hair); }
}
@media (max-width: 420px) {
  .summary { grid-template-columns: 1fr; }
  .summary > div { border-right: 0; border-bottom: 1px solid var(--hair); }
  .summary > div:last-child { border-bottom: 0; }
}

/* ---------- utilities ---------- */
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink3); }
.small { font-size: 11.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.empty { padding: 48px 20px; text-align: center; color: var(--ink3); font-size: 12.5px; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 18px; text-align: left; border-bottom: 1px solid var(--hair); vertical-align: middle; }
th { font: 600 10px var(--mono); color: var(--ink4); letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
td { font-size: 12.5px; }
td.mono, td .mono { font-size: 11.5px; color: var(--ink2); }
th.chk, td.chk { width: 40px; padding-right: 0; text-align: center; }
th.chk input, td.chk input { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
tbody tr { transition: background .18s var(--ease); }
tbody tr.picked { background: rgba(0,122,255,.07); }
tbody tr:hover { background: rgba(255,255,255,.55); }
tbody tr:last-child td { border-bottom: none; }
td .actions { display: flex; gap: 4px; flex-wrap: nowrap; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font: 600 10px var(--mono); letter-spacing: .3px; white-space: nowrap; border: 1px solid transparent; line-height: 1.4; }
.b-ok { color: #1f8f43; background: rgba(52,199,89,.14); border-color: rgba(52,199,89,.24); }
.b-off { color: var(--ink3); background: rgba(120,130,150,.14); border-color: rgba(255,255,255,.5); }
.b-warn { color: #a35f00; background: rgba(255,149,0,.14); border-color: rgba(255,149,0,.26); }
.b-danger { color: #c02a20; background: rgba(255,59,48,.12); border-color: rgba(255,59,48,.24); }
.b-info { color: #0062cc; background: rgba(0,122,255,.12); border-color: rgba(0,122,255,.2); }
.b-purple { color: #7d2fae; background: rgba(175,82,222,.14); border-color: rgba(175,82,222,.24); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(52,199,89,.18); }
.dot.off { background: #aeaeb2; box-shadow: 0 0 0 3px rgba(174,174,178,.16); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,.62); color: var(--ink2); font-size: 12.5px; font-weight: 500; cursor: pointer; line-height: 1; white-space: nowrap;
  transition: background .22s var(--ease), color .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}
.btn:hover { color: var(--ink); background: #fff; box-shadow: var(--sh-1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn-primary {
  color: #fff; font-weight: 600; border: 1px solid transparent;
  background: linear-gradient(135deg, #0a84ff, #0060df); box-shadow: 0 6px 18px rgba(0,122,255,.3), inset 0 1px rgba(255,255,255,.28);
}
.btn-primary:hover { color: #fff; background: linear-gradient(135deg, #2b95ff, #0a6ce6); box-shadow: 0 10px 26px rgba(0,122,255,.36), inset 0 1px rgba(255,255,255,.28); }
.btn-danger { color: var(--red); background: rgba(255,59,48,.08); border-color: rgba(255,59,48,.2); }
.btn-danger:hover { color: #c02a20; background: rgba(255,59,48,.14); box-shadow: none; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 9px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink3); }
.btn-ghost:hover { background: rgba(255,255,255,.72); box-shadow: none; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink3); text-transform: uppercase; letter-spacing: 1px; font-size: 10px; font-weight: 600; }
.field .hint { font-size: 11px; color: var(--ink4); line-height: 1.6; }
input[type=text], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; height: 40px; padding: 0 13px; border-radius: 12px; outline: 0; color: var(--ink); font-size: 13px;
  background: rgba(255,255,255,.6); border: 1px solid var(--stroke);
  transition: border-color .22s var(--ease), box-shadow .22s var(--ease), background .22s var(--ease);
}
textarea { height: auto; min-height: 76px; padding: 10px 13px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--ink4); }
input:focus, select:focus, textarea:focus { background: rgba(255,255,255,.9); border-color: rgba(0,122,255,.45); box-shadow: 0 0 0 4px rgba(0,122,255,.12); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink2); }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-group label {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 11px; cursor: pointer; color: var(--ink2); font-size: 12.5px; font-weight: 500;
  background: rgba(255,255,255,.55); border: 1px solid var(--stroke); transition: all .22s var(--ease);
}
.radio-group label:hover { background: #fff; color: var(--ink); }
.radio-group label.on { color: #0062cc; background: rgba(0,122,255,.12); border-color: rgba(0,122,255,.3); box-shadow: inset 0 0 0 1px rgba(0,122,255,.1); }
.radio-group input { display: none; }
.search { max-width: 260px; }

/* ---------- segmented tabs ---------- */
.tabs { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(120,130,150,.12); border: 1px solid var(--stroke); margin-bottom: 16px; }
.tabs button { padding: 6px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ink3); font-size: 12px; font-weight: 500; cursor: pointer; transition: all .22s var(--ease); }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--blue); background: #fff; box-shadow: 0 2px 6px rgba(28,28,30,.08); }

/* ---------- gauge ---------- */
.progress { height: 6px; width: 100%; min-width: 80px; border-radius: 999px; overflow: hidden; background: rgba(120,130,150,.16); box-shadow: inset 0 1px 2px rgba(28,28,30,.08); }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5ac8fa, #007aff); transition: width .4s var(--ease); }
.progress > div.warn { background: linear-gradient(90deg, #ffc65c, #ff9500); }
.progress > div.danger { background: linear-gradient(90deg, #ff7b73, #ff3b30); }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(120,130,160,.24); -webkit-backdrop-filter: blur(10px) saturate(140%); backdrop-filter: blur(10px) saturate(140%);
  animation: fade .25s;
}
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 26px;
  background: rgba(255,255,255,.76); border: 1px solid var(--stroke); box-shadow: var(--sh-3);
  -webkit-backdrop-filter: blur(40px) saturate(190%); backdrop-filter: blur(40px) saturate(190%);
  animation: pop .28s var(--ease);
}
.modal.lg { max-width: 900px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px 16px; border-bottom: 1px solid var(--hair); flex: none; }
.modal-h h3 { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.modal-b { padding: 20px 26px; overflow-y: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 26px 22px; flex: none; }
.modal .card { background: rgba(255,255,255,.6); box-shadow: none; }
.diag-sum { padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-size: 15px; font-weight: 700; }
.diag-sum.ok { color: #1f8f43; background: rgba(52,199,89,.14); }
.diag-sum.blocked { color: #c02a20; background: rgba(255,59,48,.12); }
.diag-sum.warn { color: #a35f00; background: rgba(255,149,0,.14); }
.diag-list { display: flex; flex-direction: column; gap: 8px; }
.diag-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.55); border: 1px solid var(--hair); }
.diag-row .badge { margin-top: 1px; flex: none; }
.diag-row .mono { font-size: 12px; color: var(--ink2); }
.confirm-msg { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink2); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
pre.code {
  margin: 0; padding: 12px 14px; border-radius: 12px; display: block; white-space: pre-wrap; word-break: break-all; user-select: all;
  font: 500 11.5px/1.75 var(--mono); color: #22304a; background: rgba(120,130,150,.1); border: 1px solid var(--stroke);
}

/* ---------- toast ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 11px 16px; border-radius: 14px; max-width: 360px; font-size: 12.5px; font-weight: 500; color: var(--ink);
  background: var(--glass3); border: 1px solid var(--stroke); box-shadow: var(--sh-2); animation: pop .25s var(--ease);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--blue); box-shadow: 0 0 0 3px rgba(0,122,255,.16); }
.toast.ok::before { background: var(--green); box-shadow: 0 0 0 3px rgba(52,199,89,.18); }
.toast.err::before { background: var(--red); box-shadow: 0 0 0 3px rgba(255,59,48,.16); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); display: flex; flex-direction: column; padding: 34px; border-radius: 28px; margin: 0;
  background: rgba(255,255,255,.66); border: 1px solid var(--stroke); box-shadow: var(--sh-3);
  -webkit-backdrop-filter: blur(40px) saturate(190%); backdrop-filter: blur(40px) saturate(190%);
}
.login-card .brand { padding: 0 0 22px; }
.login-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.login-sub { color: var(--ink3); margin: 8px 0 22px; font-size: 12px; }
.login-card .field { margin-bottom: 14px; }
.login-card input { height: 44px; border-radius: 13px; }
.login-card .btn-primary { width: 100%; height: 46px; border-radius: 14px; font-size: 13.5px; margin-top: 6px; }
.login-foot { color: var(--ink4); text-align: center; margin: 16px 0 0; font-size: 10px; line-height: 1.7; }

/* ---------- chart ---------- */
.chart { width: 100%; height: auto; aspect-ratio: 800 / 220; display: block; }
.chart .bar-in { fill: url(#barIn); }
.chart .bar-out { fill: url(#barOut); }
.chart rect { rx: 1.5; }
.chart text { font: 500 9.5px var(--mono); fill: var(--ink4); }
.legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--ink3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .lg-in { background: linear-gradient(#5ac8fa, #007aff); }
.legend .lg-out { background: linear-gradient(#c77dff, #af52de); }

/* ---------- node traffic monitor ---------- */
.speed-cell { line-height: 1.7; }
.speed-down { color: #0062cc; }
.speed-up { color: #7d2fae; }
.traffic-cell { cursor: pointer; }
.traffic-cell:hover b { color: var(--blue); }
tr.clickable { cursor: pointer; }
.mon-summary { margin-bottom: 16px; box-shadow: none; background: rgba(255,255,255,.5); }
.mon-summary > div { padding: 14px 16px; }
.mon-summary b { font-size: 16px; }
@media (max-width: 1100px) { .modal .mon-summary { grid-template-columns: 1fr 1fr; } }

/* ---------- misc ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; font-size: 12.5px; }
.kv dt { color: var(--ink3); }
.kv dd { margin: 0; color: var(--ink); }
.copy { cursor: pointer; border-bottom: 1px dashed var(--ink4); }
.copy:hover { color: var(--blue); border-bottom-color: var(--blue); }
.addr { display: inline-flex; align-items: center; gap: 6px; }

/* fallback for browsers without backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar, .topbar, .summary, .card, .toast { background: rgba(255,255,255,.94); }
  .modal, .login-card { background: rgba(255,255,255,.97); }
  .modal-mask { background: rgba(120,130,160,.42); }
}
