:root {
  --bg: #07111f;
  --panel: #102442;
  --card: #0c1e38;
  --line: rgba(84, 151, 218, .32);
  --text: #edf7ff;
  --muted: #91a9c6;
  --cyan: #00d5ff;
  --blue: #1598ff;
  --green: #25e69b;
  --yellow: #ffd166;
  --red: #ff6175;
  --purple: #a58bff;
}

* { box-sizing: border-box; }
html {
  min-width: 100%;
  min-height: 100%;
  background: #07111f;
}
body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 16% 0%, rgba(0, 213, 255, .15), transparent 32%),
    radial-gradient(circle at 86% 10%, rgba(37, 230, 155, .1), transparent 30%),
    linear-gradient(180deg, #07111f, #08172a);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body.admin-page:not(.auth-locked) {
  height: 100vh;
  overflow: hidden;
}

button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }

.shell { min-height: 100vh; width: 100%; display: block; background: transparent; }
body.admin-page:not(.auth-locked) .shell {
  height: 100vh;
  overflow: hidden;
}
.auth-locked .side {
  display: none;
}
.auth-locked .main {
  min-height: 100vh;
  margin-left: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-locked .login-panel {
  width: min(1080px, calc(100vw - 48px));
  margin: 0;
}
.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 280px;
  min-height: 100vh;
  height: 100vh;
  overflow-y: auto;
  background: rgba(8, 20, 38, .96);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 6px 18px; border-bottom: 1px solid rgba(84,151,218,.16); }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #05101e; background: linear-gradient(135deg, var(--cyan), var(--green)); font-weight: 900; font-size: 22px; }
.brand h1 { margin: 0; font-size: 17px; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.nav { display: grid; gap: 8px; margin-top: 16px; }
.nav button, .nav a {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #d7ecff;
  text-align: left;
  padding: 9px 12px;
  display: flex;
  gap: 9px;
  align-items: center;
}
.nav button.active,
.nav button.active:hover,
.nav a.active,
.nav a.active:hover {
  border-color: rgba(0,213,255,.78);
  background:
    linear-gradient(90deg, rgba(0,213,255,.2), rgba(0,213,255,.1) 58%, rgba(37,230,155,.06));
  box-shadow:
    0 12px 30px rgba(0, 213, 255, .18),
    inset 3px 0 0 rgba(0, 213, 255, .95),
    inset 0 0 0 1px rgba(0, 213, 255, .12);
  color: #f3fbff;
}
.nav button:hover,
.nav a:hover {
  border-color: rgba(0,213,255,.45);
  background: rgba(0,213,255,.12);
}
.nav button.active .mini-icon,
.nav a.active .mini-icon {
  box-shadow: 0 0 18px rgba(0, 213, 255, .62);
}
.side-card { margin-top: 16px; border: 1px solid rgba(84,151,218,.28); border-radius: 12px; background: rgba(8,22,42,.58); padding: 11px; display: flex; gap: 9px; align-items: center; }
.side-card b { display: block; font-size: 13px; }
.side-card small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }

.main { min-width: 0; margin-left: 280px; padding: 18px; }
body.admin-page:not(.auth-locked) .main {
  height: 100vh;
  overflow: hidden;
}
#adminApp {
  min-height: 0;
}
#adminApp:not(.hidden) {
  height: calc(100vh - 36px);
  overflow: hidden;
  display: block;
}
.admin-section { display: none; }
.admin-section:not(.active) {
  display: none !important;
}
.admin-section.active {
  display: block;
  height: 100%;
  min-height: 0;
  margin-top: 0 !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}
.admin-section.active.grid4,
.admin-section.active.layout { display: grid; }
.dashboard-view.active {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 12px;
}
.topbar { min-height: 54px; display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.dashboard-view .topbar { margin-bottom: 0; }
.topbar h2 { margin: 0; font-size: 22px; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; align-items: start; }
.layout.wide-left { grid-template-columns: minmax(0, 1.35fr) 460px; }
.layout.wide-left:has(.plan-editor-modal),
.layout.wide-left:has(.order-action-modal),
.layout.wide-left:has(.coupon-editor-modal),
.layout.wide-left:has(.coupon-usage-modal),
.layout.wide-left:has(.user-detail-modal),
.layout.wide-left:has(.knowledge-editor-modal) {
  grid-template-columns: minmax(0, 1fr);
}
.sticky-panel { position: sticky; top: 14px; }

.panel, .card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18,42,78,.94), rgba(10,25,47,.94));
  box-shadow: 0 18px 48px rgba(0,0,0,.24);
}
.panel { overflow: hidden; }
.panel-head { min-height: 52px; padding: 12px 14px; border-bottom: 1px solid rgba(84,151,218,.2); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 14px; display: grid; gap: 12px; }
.card { padding: 13px; }
.metric { min-height: 92px; display: grid; gap: 7px; align-content: center; }
.metric span { color: var(--muted); font-size: 12px; }
.metric b { font-size: 25px; line-height: 1; }
.metric small { color: var(--green); font-size: 12px; }
.icon-card { grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center; text-align: left; }
.icon-card b, .icon-card small, .icon-card span { display: block; }
.plan-card { width: 100%; }

.node-runtime-panel { min-width: 0; }

.dashboard-insight-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.compact-panel .panel-body { padding: 12px; }

.rank-list {
  display: grid;
  gap: 8px;
}

.rank-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(84,151,218,.25);
  border-radius: 10px;
  background: rgba(8,22,42,.48);
  padding: 9px 10px;
  font-size: 12px;
}

.rank-item b,
.rank-item small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.rank-item small { color: var(--muted); margin-top: 3px; }
.rank-item em { color: #fff; font-style: normal; font-weight: 900; }

.node-runtime-list {
  display: grid;
  gap: 12px;
}

.node-runtime-region {
  min-width: 0;
  border: 1px solid rgba(84,151,218,.34);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(0,213,255,.08), rgba(8,22,42,.62)),
    rgba(8,22,42,.58);
  overflow: hidden;
}

.node-runtime-region.risk {
  border-color: rgba(255, 52, 79, .62);
  box-shadow: inset 0 0 0 1px rgba(255, 52, 79, .16), 0 16px 36px rgba(0,0,0,.18);
}

.node-runtime-region.hot {
  border-color: rgba(255,209,102,.46);
}

.node-runtime-region.watch {
  border-color: rgba(37,230,155,.28);
}

.runtime-region-head {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid rgba(84,151,218,.22);
  background:
    linear-gradient(90deg, rgba(0,213,255,.12), rgba(37,230,155,.04) 42%, rgba(8,22,42,.58));
  padding: 11px 13px;
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(440px, 1.5fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
}

.runtime-region-title,
.runtime-region-title b,
.runtime-region-title small {
  min-width: 0;
  display: block;
  overflow-wrap: anywhere;
}

.runtime-region-title b {
  color: #fff;
  font-size: 18px;
}

.runtime-region-title small {
  margin-top: 4px;
  color: #a8d8ff;
  font-size: 12px;
}

.runtime-region-stats {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.runtime-region-stats span {
  min-width: 0;
  border: 1px solid rgba(84,151,218,.22);
  border-radius: 10px;
  background: rgba(0,213,255,.06);
  padding: 8px 9px;
}

.runtime-region-stats em,
.runtime-region-stats small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.runtime-region-stats em {
  color: #fff;
  font-style: normal;
  font-size: 14px;
  font-weight: 900;
}

.runtime-region-stats small {
  margin-top: 3px;
  color: #a8bed8;
  font-size: 11px;
}

.runtime-region-toggle {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0,213,255,.42);
  border-radius: 999px;
  background: rgba(0,213,255,.12);
  color: #b8f2ff;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.runtime-region-body {
  display: grid;
  gap: 9px;
  padding: 10px;
}

.runtime-region-body.collapsed {
  display: none;
}

.node-runtime-row {
  min-width: 0;
  position: relative;
  isolation: isolate;
  border: 1px solid rgba(84,151,218,.42);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(0,213,255,.14), rgba(37,230,155,.06) 40%, rgba(8,22,42,.76)),
    rgba(10, 20, 38, .82);
  box-shadow: inset 4px 0 0 rgba(0,213,255,.74), 0 16px 34px rgba(0,0,0,.2);
  padding: 11px;
  display: grid;
  grid-template-columns: minmax(180px, .82fr) minmax(340px, 1.4fr) minmax(210px, .7fr) minmax(180px, .62fr);
  gap: 12px;
  align-items: center;
}

.node-runtime-row::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, rgba(0,213,255,.12), transparent);
  transform: translateX(-58%);
  animation: runtimeSweep 3.6s linear infinite;
}

.node-runtime-row::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: inherit;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 100% 14px;
  opacity: .22;
}

.node-runtime-row.hot {
  border-color: rgba(255,209,102,.52);
  background:
    linear-gradient(90deg, rgba(255,209,102,.18), rgba(255,209,102,.07) 42%, rgba(8,22,42,.72)),
    rgba(10,20,38,.78);
  box-shadow: inset 4px 0 0 rgba(255,209,102,.82), 0 16px 34px rgba(0,0,0,.18);
}

.node-runtime-row.watch {
  border-color: rgba(37,230,155,.34);
  background:
    linear-gradient(90deg, rgba(37,230,155,.12), rgba(0,213,255,.04) 45%, rgba(8,22,42,.68)),
    rgba(10,20,38,.72);
  box-shadow: inset 4px 0 0 rgba(37,230,155,.65), 0 16px 34px rgba(0,0,0,.14);
}

.runtime-node-id {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.runtime-node-id b,
.runtime-node-id small,
.runtime-node-id strong {
  display: block;
  overflow-wrap: anywhere;
}

.runtime-node-id b {
  font-size: 18px;
  color: #fff;
}

.runtime-node-id small {
  margin-top: 4px;
  color: #b9cbe1;
  font-size: 11px;
  line-height: 1.45;
}

.runtime-node-id strong {
  width: fit-content;
  margin-top: 7px;
  border: 1px solid rgba(0,213,255,.42);
  border-radius: 999px;
  background: rgba(0,213,255,.12);
  color: #b8f2ff;
  padding: 3px 8px;
  font-size: 11px;
}

.runtime-dot {
  width: 12px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--cyan), var(--green));
  box-shadow: 0 0 18px rgba(0,213,255,.4);
}

.node-runtime-row.hot .runtime-dot {
  background: linear-gradient(180deg, #ffd166, #ff9f43);
  box-shadow: 0 0 18px rgba(255,209,102,.42);
}

.node-runtime-row.watch .runtime-dot {
  background: linear-gradient(180deg, var(--green), var(--cyan));
}

.runtime-bars {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.runtime-bar-line {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) minmax(74px, auto);
  gap: 8px;
  align-items: center;
}

.runtime-bar-line span {
  color: #b9cbe1;
  font-size: 11px;
}

.runtime-bar-line b {
  color: #fff;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.runtime-bar {
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.runtime-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 12px rgba(0,213,255,.36);
}

.node-runtime-row.hot .runtime-bar i {
  background: linear-gradient(90deg, #ffd166, #ff9f43);
}

.node-runtime-row.watch .runtime-bar i {
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.runtime-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.runtime-kpis div {
  min-width: 0;
  border: 1px solid rgba(84,151,218,.22);
  border-radius: 10px;
  background: rgba(0,213,255,.05);
  padding: 8px;
}

.runtime-kpis span,
.runtime-kpis b {
  display: block;
}

.runtime-kpis span {
  color: #a8bed8;
  font-size: 11px;
}

.runtime-kpis b {
  margin-top: 4px;
  color: #fff;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.runtime-advice {
  min-width: 0;
  display: grid;
  gap: 6px;
  justify-items: start;
}

.runtime-advice em {
  font-style: normal;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(0,213,255,.38);
  background: rgba(0,213,255,.12);
  color: #b8f2ff;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.runtime-advice span {
  color: #e9f4ff;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@keyframes runtimeSweep {
  0% { transform: translateX(-64%); opacity: .12; }
  35% { opacity: .5; }
  100% { transform: translateX(64%); opacity: .12; }
}

.mini-icon, .tile-icon, .step-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: var(--cyan);
}
.mini-icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(0,213,255,.45);
  background: rgba(0,213,255,.12);
}
.tile-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(0,213,255,.45);
  background: linear-gradient(135deg, rgba(0,213,255,.22), rgba(37,230,155,.15));
  box-shadow: inset 0 0 20px rgba(0,213,255,.12), 0 0 16px rgba(0,213,255,.1);
}
.step-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(0,213,255,.42);
  background: rgba(0,213,255,.12);
}
.mini-icon::before, .tile-icon::before, .step-icon::before {
  content: "";
  display: block;
  width: 62%;
  height: 62%;
  color: currentColor;
  background: currentColor;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
  -webkit-mask: var(--icon-svg, var(--icon-pulse)) center / contain no-repeat;
  mask: var(--icon-svg, var(--icon-pulse)) center / contain no-repeat;
}
.tile-icon::before { width: 58%; height: 58%; }
.mini-icon::before { width: 66%; height: 66%; }
.step-icon::before { width: 60%; height: 60%; }
.mini-icon::after,
.tile-icon::after,
.step-icon::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255,255,255,.08);
  pointer-events: none;
}
.tile-icon.order, .tile-icon.pay { color: #7dd3ff; }
.tile-icon.pulse { color: #25e69b; }
.tile-icon.gift { color: #5eead4; }
.tile-icon.user { color: #67e8f9; }
.tile-icon.plan { color: #a7f3d0; }
.tile-icon.shield { color: #93c5fd; }
.tile-icon.link { color: #22d3ee; }
.tile-icon.guide { color: #bfdbfe; }
.tile-icon.admin { color: #c4b5fd; }
.tile-icon.phone { color: #86efac; }

:root {
  --icon-order: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z'/%3E%3Cpath d='M16 8H8'/%3E%3Cpath d='M16 12H8'/%3E%3Cpath d='M10 16H8'/%3E%3C/svg%3E");
  --icon-wallet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3v3a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5'/%3E%3Cpath d='M18 12h.01'/%3E%3C/svg%3E");
  --icon-percent: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.78 4.78 4 4 0 0 1-6.74 0 4 4 0 0 1-4.78-4.78 4 4 0 0 1 0-6.75Z'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='M9 9h.01'/%3E%3Cpath d='M15 15h.01'/%3E%3C/svg%3E");
  --icon-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
  --icon-package: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7.5 4.27 9 5.15'/%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E");
  --icon-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
  --icon-book: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 7v14'/%3E%3Cpath d='M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z'/%3E%3C/svg%3E");
  --icon-settings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  --icon-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  --icon-pulse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2'/%3E%3C/svg%3E");
  --icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='20' x='5' y='2' rx='2' ry='2'/%3E%3Cpath d='M12 18h.01'/%3E%3C/svg%3E");
  --icon-server: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='8' x='2' y='2' rx='2' ry='2'/%3E%3Crect width='20' height='8' x='2' y='14' rx='2' ry='2'/%3E%3Cpath d='M6 6h.01'/%3E%3Cpath d='M6 18h.01'/%3E%3C/svg%3E");
  --icon-credit-card: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='14' x='2' y='5' rx='2'/%3E%3Cline x1='2' x2='22' y1='10' y2='10'/%3E%3C/svg%3E");
}
.mini-icon.order::before, .tile-icon.order::before, .step-icon.order::before { --icon-svg: var(--icon-order); }
.mini-icon.pay::before, .tile-icon.pay::before, .step-icon.pay::before { --icon-svg: var(--icon-credit-card); }
.mini-icon.pulse::before, .tile-icon.pulse::before, .step-icon.pulse::before { --icon-svg: var(--icon-pulse); }
.mini-icon.gift::before, .tile-icon.gift::before, .step-icon.gift::before { --icon-svg: var(--icon-percent); }
.mini-icon.user::before, .tile-icon.user::before, .step-icon.user::before { --icon-svg: var(--icon-users); }
.mini-icon.plan::before, .tile-icon.plan::before, .step-icon.plan::before { --icon-svg: var(--icon-package); }
.mini-icon.link::before, .tile-icon.link::before, .step-icon.link::before { --icon-svg: var(--icon-link); }
.mini-icon.guide::before, .tile-icon.guide::before, .step-icon.guide::before { --icon-svg: var(--icon-book); }
.mini-icon.admin::before, .tile-icon.admin::before, .step-icon.admin::before { --icon-svg: var(--icon-settings); }
.mini-icon.shield::before, .tile-icon.shield::before, .step-icon.shield::before { --icon-svg: var(--icon-shield); }
.mini-icon.phone::before, .tile-icon.phone::before, .step-icon.phone::before { --icon-svg: var(--icon-phone); }
.mini-icon.node::before, .tile-icon.node::before, .step-icon.node::before,
.mini-icon.server::before, .tile-icon.server::before, .step-icon.server::before { --icon-svg: var(--icon-server); }

.btn {
  min-height: 32px;
  border: 1px solid rgba(84,151,218,.42);
  border-radius: 999px;
  background: rgba(8,22,42,.64);
  padding: 5px 12px;
  font-size: 12px;
}
.btn.primary { border-color: rgba(0,213,255,.7); background: rgba(0,213,255,.2); font-weight: 800; }
.btn.danger { border-color: rgba(255,97,117,.58); background: rgba(255,97,117,.15); color: #ffc2ca; }
.btn.ok { border-color: rgba(37,230,155,.55); background: rgba(37,230,155,.13); }

.field { display: grid; gap: 6px; }
.field label { color: var(--muted); font-size: 12px; }
.input, select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(84,151,218,.45);
  border-radius: 10px;
  background: rgba(8,22,42,.72);
  color: var(--text);
  padding: 8px 10px;
}
.input.compact, select.compact { width: 150px; min-height: 34px; font-size: 12px; }
.textarea { min-height: 84px; resize: vertical; }
.form { display: grid; gap: 10px; }

.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; background: rgba(0,213,255,.14); color: var(--cyan); font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.ok { background: rgba(37,230,155,.14); color: var(--green); }
.badge.warn { background: rgba(255,209,102,.16); color: var(--yellow); }
.badge.risk { background: rgba(255,97,117,.14); color: #ff9aaa; }
.badge.phase { background: rgba(165,139,255,.16); color: #d1c6ff; }

.table { border: 1px solid rgba(84,151,218,.3); border-radius: 10px; background: rgba(8,22,42,.48); overflow: hidden; }
.tr { min-height: 38px; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid rgba(120,170,220,.12); font-size: 12px; }
.tr:last-child { border-bottom: 0; }
.tr.head { background: rgba(19,52,92,.72); color: #a8bed8; font-weight: 800; }
.tr.cols4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.tr.cols6 { grid-template-columns: .9fr 1fr .8fr .8fr .8fr 1fr; }
.tr.plan-row { grid-template-columns: 1.25fr .85fr .9fr .85fr .42fr 1.45fr; }
.tr.order-row { grid-template-columns: 1.05fr .95fr .9fr .92fr .55fr .68fr .92fr .48fr; }
.tr.coupon-row { grid-template-columns: 1.1fr .75fr .72fr 1fr 1.05fr 1.2fr; }
.tr.payment-row { grid-template-columns: minmax(190px, 1.05fr) .78fr minmax(250px, 1.24fr) minmax(170px, .9fr) .68fr minmax(180px, .86fr); }
.tr.knowledge-row { grid-template-columns: 1.05fr .7fr .55fr 1.35fr .65fr 1.05fr; }
.tr.emergency-row { grid-template-columns: 1.15fr .8fr .55fr .62fr 1.1fr 1.05fr; }
.tr.statistics-row { grid-template-columns: .78fr .9fr .9fr .85fr .78fr .85fr 1fr; }
.tr.agent-row { grid-template-columns: 1.15fr .78fr .82fr .7fr .9fr 1.1fr; }
.tr.user-row { grid-template-columns: minmax(190px, 1.2fr) minmax(120px, .72fr) minmax(120px, .72fr) minmax(180px, 1fr) minmax(100px, .62fr) minmax(120px, .7fr) minmax(150px, .86fr) minmax(128px, .68fr); }
.tr.device-row { grid-template-columns: minmax(170px, 1.1fr) minmax(118px, .68fr) minmax(160px, .95fr) minmax(90px, .48fr) minmax(90px, .48fr) minmax(180px, 1fr); }
.tr.subscription-row { grid-template-columns: minmax(210px, 1.2fr) minmax(130px, .65fr) minmax(220px, 1.1fr) minmax(150px, .8fr); }
.tr.admin-row { grid-template-columns: minmax(190px, 1.2fr) .78fr .58fr .92fr .85fr minmax(190px, .95fr); }
.tr span { min-width: 0; overflow-wrap: anywhere; }
.tr small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.tr.selected-row { background: rgba(0,213,255,.08); box-shadow: inset 3px 0 0 rgba(0,213,255,.8); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; }
.traffic-cell { display: grid; gap: 4px; }
.traffic-bar { width: 100%; height: 8px; margin: 0; }
.traffic-bar.warn i { background: linear-gradient(90deg, rgba(255,209,102,.95), rgba(255,176,64,.95)); }
.traffic-bar.risk i { background: linear-gradient(90deg, rgba(255,97,117,.95), rgba(255,138,138,.95)); }
.user-create-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(0,213,255,.3);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0,213,255,.08), rgba(8,22,42,.62));
  padding: 13px;
}

.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.step { min-height: 112px; border: 1px solid rgba(84,151,218,.34); border-radius: 12px; background: rgba(8,22,42,.56); padding: 10px; display: grid; gap: 7px; align-content: start; }
.step.done { border-color: rgba(37,230,155,.56); background: rgba(37,230,155,.08); }
.step.active { border-color: rgba(0,213,255,.7); background: rgba(0,213,255,.1); }
.step b { font-size: 13px; }
.step span { color: var(--muted); font-size: 12px; line-height: 1.4; }

.phone-frame {
  width: min(330px, 100%);
  min-height: 560px;
  border: 9px solid #03070e;
  border-radius: 34px;
  background: linear-gradient(180deg, #0f2444, #071321);
  padding: 16px;
  margin: 0 auto;
  display: grid;
  align-content: start;
  gap: 12px;
}
.phone-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; }
.guide-card { border: 1px solid rgba(84,151,218,.32); border-radius: 14px; background: rgba(8,22,42,.58); padding: 11px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.guide-card h3 { margin: 0 0 5px; font-size: 14px; }
.guide-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.mobile-quick { display: none; }
.card-title { min-width: 0; display: flex; gap: 10px; align-items: center; }
.card-title h3 { margin: 0; }
.card-title p { margin: 4px 0 0; overflow-wrap: anywhere; }
.subscription-card { display: grid; gap: 10px; }
.detail-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px; align-items: center; padding: 12px; border: 1px solid rgba(84,151,218,.28); border-radius: 12px; background: rgba(8,22,42,.5); }
.detail-hero h3 { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.detail-hero p { margin: 4px 0 7px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.mini-section { display: grid; gap: 8px; }
.mini-section > b { font-size: 13px; color: #dff7ff; }
.empty-state { min-height: 240px; display: grid; place-items: center; text-align: center; align-content: center; gap: 10px; color: var(--muted); }
.empty-state b { color: var(--text); }
.empty-state small { max-width: 260px; line-height: 1.6; }
.login-panel { max-width: 860px; margin: 10vh auto 0; }

.ops-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(84,151,218,.24);
  border-radius: 12px;
  background: rgba(8,22,42,.42);
  padding: 10px;
}

.node-type-toolbar {
  min-width: 0;
  order: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(84,151,218,.24);
  border-radius: 12px;
  background: rgba(8,22,42,.42);
  padding: 10px;
}

.toolbar-label {
  color: #dff7ff;
  font-size: 12px;
  font-weight: 900;
}

.node-type-buttons {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-api-panel {
  border: 1px solid rgba(0,213,255,.28);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(0,213,255,.09), rgba(37,230,155,.05)),
    rgba(8,22,42,.66);
  overflow: hidden;
}

.node-api-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, .6fr) minmax(240px, .8fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid rgba(84,151,218,.2);
}

.node-api-summary h4 {
  margin: 0;
  font-size: 15px;
}

.node-api-summary p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.node-api-kv {
  min-width: 0;
  border: 1px solid rgba(84,151,218,.2);
  border-radius: 10px;
  background: rgba(6,16,30,.48);
  padding: 9px 10px;
}

.node-api-kv span,
.node-api-kv b {
  display: block;
}

.node-api-kv span {
  color: var(--muted);
  font-size: 11px;
}

.node-api-kv b {
  margin-top: 4px;
  color: #fff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.node-api-table {
  overflow-x: auto;
}

.node-api-row {
  min-width: 1120px;
  display: grid;
  grid-template-columns: minmax(180px, .85fr) 150px 120px minmax(360px, 1.6fr) 190px;
  border-bottom: 1px solid rgba(84,151,218,.18);
}

.node-api-row:last-child {
  border-bottom: 0;
}

.node-api-row > span {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid rgba(84,151,218,.12);
  display: grid;
  align-content: center;
  gap: 3px;
}

.node-api-row > span:last-child {
  border-right: 0;
}

.node-api-row.head {
  color: #b8f2ff;
  background: rgba(0,213,255,.08);
  font-size: 12px;
}

.node-api-row b,
.node-api-row small {
  display: block;
  overflow-wrap: anywhere;
}

.node-api-row b {
  color: #fff;
  font-size: 12px;
}

.node-api-row small {
  color: var(--muted);
  font-size: 11px;
}

.node-api-actions {
  display: flex !important;
  flex-direction: row;
  gap: 8px;
  align-items: center;
}

.node-api-actions .btn {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
}

.mono {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
}

.node-editor {
  position: fixed;
  z-index: 30;
  top: clamp(14px, 6vh, 56px);
  left: 50%;
  width: min(1080px, calc(100vw - 36px));
  max-height: min(84vh, 780px);
  transform: translateX(-50%);
  display: grid;
  gap: 12px;
  overflow: auto;
  box-shadow: 0 28px 90px rgba(0,0,0,.46), 0 0 0 1px rgba(0,213,255,.2);
}

.plan-editor-modal,
.order-action-modal,
.coupon-editor-modal,
.coupon-usage-modal,
.user-detail-modal,
.knowledge-editor-modal,
.ticket-detail-modal {
  position: fixed;
  z-index: 32;
  top: clamp(16px, 6vh, 58px);
  left: 50%;
  width: min(980px, calc(100vw - 36px));
  max-height: min(86vh, 820px);
  transform: translateX(-50%);
  display: block;
  overflow: auto;
  box-shadow: 0 30px 92px rgba(0,0,0,.54), 0 0 0 1px rgba(0,213,255,.22);
}

.coupon-editor-modal,
.coupon-usage-modal,
.knowledge-editor-modal,
.order-action-modal {
  width: min(860px, calc(100vw - 36px));
}

.user-detail-modal {
  width: min(1080px, calc(100vw - 36px));
}

.plan-editor-modal::before,
.order-action-modal::before,
.coupon-editor-modal::before,
.coupon-usage-modal::before,
.user-detail-modal::before,
.knowledge-editor-modal::before,
.ticket-detail-modal::before {
  content: "";
  position: fixed;
  inset: -120vh -120vw;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 16%, rgba(0,213,255,.12), transparent 34%),
    rgba(2, 8, 18, .72);
  pointer-events: none;
}

.plan-editor-modal .panel-head,
.order-action-modal .panel-head,
.coupon-editor-modal .panel-head,
.coupon-usage-modal .panel-head,
.user-detail-modal .panel-head,
.knowledge-editor-modal .panel-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(18,42,78,.98), rgba(14,33,61,.96));
}

.node-editor::before {
  content: "";
  position: fixed;
  inset: -120vh -120vw;
  z-index: -1;
  background: rgba(2, 8, 18, .68);
  pointer-events: none;
}

.node-editor .card-title {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -13px -13px 0;
  padding: 13px;
  background: linear-gradient(180deg, rgba(18,42,78,.98), rgba(14,33,61,.96));
  border-bottom: 1px solid rgba(84,151,218,.22);
}

.node-editor .card-title .btn {
  margin-left: auto;
}

.admin-create-modal,
.payment-config-modal,
.agent-editor-modal,
.agent-ledger-modal,
.agent-recharge-modal,
.ticket-detail-modal {
  position: fixed;
  z-index: 31;
  top: clamp(18px, 7vh, 72px);
  left: 50%;
  width: min(640px, calc(100vw - 36px));
  max-height: min(84vh, 680px);
  transform: translateX(-50%);
  display: grid;
  gap: 12px;
  overflow: auto;
  box-shadow: 0 28px 90px rgba(0,0,0,.5), 0 0 0 1px rgba(0,213,255,.25);
}

.payment-config-modal {
  width: min(760px, calc(100vw - 36px));
}

.agent-editor-modal {
  width: min(760px, calc(100vw - 36px));
}

.agent-ledger-modal {
  width: min(980px, calc(100vw - 36px));
}

.agent-recharge-modal {
  width: min(620px, calc(100vw - 36px));
}

.ticket-detail-modal {
  width: min(920px, calc(100vw - 36px));
}

.admin-create-modal::before,
.payment-config-modal::before,
.agent-editor-modal::before,
.agent-ledger-modal::before,
.agent-recharge-modal::before,
.ticket-detail-modal::before {
  content: "";
  position: fixed;
  inset: -120vh -120vw;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 18%, rgba(0,213,255,.12), transparent 34%),
    rgba(2, 8, 18, .7);
  pointer-events: none;
}

.admin-create-modal .card-title,
.payment-config-modal .card-title,
.agent-editor-modal .card-title,
.agent-ledger-modal .card-title,
.agent-recharge-modal .card-title,
.ticket-detail-modal .card-title {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: -13px -13px 0;
  padding: 13px;
  background: linear-gradient(180deg, rgba(18,42,78,.98), rgba(14,33,61,.96));
  border-bottom: 1px solid rgba(84,151,218,.22);
}

.admin-create-modal .card-title .btn,
.payment-config-modal .card-title .btn,
.agent-editor-modal .card-title .btn,
.agent-ledger-modal .card-title .btn,
.agent-recharge-modal .card-title .btn,
.ticket-detail-modal .card-title .btn {
  margin-left: auto;
}

.ticket-admin-row { grid-template-columns: 1.05fr 1.1fr .72fr .72fr .9fr .9fr .72fr; }
.coupon-usage-row { grid-template-columns: 1fr .85fr .72fr .82fr .82fr .72fr; }
.agent-recharge-row { grid-template-columns: 1fr .62fr .72fr .62fr .9fr .82fr; }
.tr.agent-ledger-admin-row { grid-template-columns: 1fr .78fr .72fr .78fr .95fr 1.15fr; }
.tr.commission-row { grid-template-columns: minmax(160px, 1.05fr) minmax(140px, .92fr) minmax(170px, 1fr) minmax(70px, .42fr) minmax(90px, .52fr) minmax(92px, .52fr); }
.ticket-message-list { display: grid; gap: 8px; margin: 10px 0; }
.ticket-message { border: 1px solid rgba(84,151,218,.24); border-radius: 10px; background: rgba(8,22,42,.48); padding: 10px; display: grid; gap: 6px; }
.ticket-message b { font-size: 12px; }
.ticket-message small { color: var(--muted); }
.ticket-detail-body { display: grid; gap: 12px; }

.node-ops-strip {
  order: 3;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.detail-list {
  display: grid;
  gap: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.detail-list p {
  margin: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.node-table {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(84,151,218,.3);
  border-radius: 12px;
  background: rgba(8,22,42,.48);
  overflow: hidden;
}

.reference-node-table {
  order: 2;
  overflow-x: auto;
  overflow-y: hidden;
}

.node-ref-row {
  min-width: 1080px;
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px 88px 74px 94px minmax(160px, 1fr) minmax(180px, 1.1fr) 66px 54px 102px 48px 154px;
  gap: 0;
  align-items: stretch;
  border-bottom: 1px solid rgba(120,170,220,.12);
  font-size: 12px;
}

.node-ref-row:last-child { border-bottom: 0; }

.node-ref-row > span {
  min-width: 0;
  padding: 9px 10px;
  display: grid;
  align-content: center;
  border-right: 1px solid rgba(120,170,220,.1);
  overflow-wrap: anywhere;
}

.node-ref-row > span:last-child { border-right: 0; }

.node-ref-head {
  min-height: 44px;
  background: rgba(19,52,92,.82);
  color: #b8cce4;
  font-weight: 900;
}

.node-ref-item:nth-child(odd) {
  background: rgba(255,255,255,.018);
}

.node-ref-item.risk {
  box-shadow: inset 4px 0 0 rgba(255,97,117,.9);
  background: linear-gradient(90deg, rgba(255,97,117,.13), rgba(8,22,42,.46) 22%);
}

.node-ref-item.warn {
  box-shadow: inset 4px 0 0 rgba(255,209,102,.86);
  background: linear-gradient(90deg, rgba(255,209,102,.11), rgba(8,22,42,.46) 22%);
}

.node-ref-row b,
.node-ref-row small {
  display: block;
  min-width: 0;
}

.node-ref-row b { color: #fff; }
.node-ref-row small { color: var(--muted); margin-top: 3px; font-size: 11px; }

.node-ref-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  gap: 6px;
}

.node-ref-actions .btn {
  min-height: 28px;
  padding-inline: 8px;
}

.switch {
  width: 44px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(120,170,220,.28);
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.switch i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d7e8f6;
  box-shadow: 0 4px 12px rgba(0,0,0,.22);
}

.switch.on {
  justify-content: flex-end;
  background: #17c6a3;
}

.rate-pill {
  width: max-content;
  border-radius: 4px;
  background: #35405f;
  padding: 4px 8px;
  font-size: 11px;
}

.node-table-item {
  min-width: 0;
  border-bottom: 1px solid rgba(120,170,220,.14);
  background: rgba(8,22,42,.42);
}

.node-table-item:last-child { border-bottom: 0; }

.node-table-item.risk {
  background: linear-gradient(90deg, rgba(255,97,117,.14), rgba(8,22,42,.42) 28%);
  box-shadow: inset 4px 0 0 rgba(255,97,117,.85);
}

.node-table-item.warn {
  background: linear-gradient(90deg, rgba(255,209,102,.12), rgba(8,22,42,.42) 28%);
  box-shadow: inset 4px 0 0 rgba(255,209,102,.78);
}

.node-table-row {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(210px, 1.14fr) 92px minmax(160px, .82fr) minmax(130px, .66fr) minmax(140px, .72fr) minmax(95px, .48fr) minmax(210px, .95fr);
  gap: 12px;
  align-items: center;
  padding: 11px 14px 8px;
}

.node-table-head {
  min-height: 42px;
  background: rgba(19,52,92,.72);
  color: #a8bed8;
  font-size: 12px;
  font-weight: 900;
  padding-block: 10px;
  border-bottom: 1px solid rgba(120,170,220,.18);
}

.node-table-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.node-table-row b,
.node-table-row small {
  display: block;
  min-width: 0;
}

.node-table-row b {
  color: #fff;
  font-size: 16px;
}

.node-table-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.node-table-name {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.node-table-load {
  display: grid;
  gap: 6px;
}

.node-table-load .load {
  width: 100%;
}

.node-table .capacity-advice {
  display: block;
  width: 100%;
  padding: 7px 9px;
}

.node-row-actions {
  min-width: 0;
  padding: 0 14px 12px 316px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

.node-row-actions > span {
  color: #a8bed8;
  font-size: 12px;
  font-weight: 800;
}

.node-row-actions .btn {
  min-height: 30px;
  padding-inline: 12px;
}
.load { height: 8px; border-radius: 999px; background: rgba(84,151,218,.18); overflow: hidden; }
.load i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), var(--cyan)); }
.load.warn i { background: linear-gradient(90deg, var(--yellow), #ff9f43); }
.load.risk i { background: linear-gradient(90deg, var(--red), #ff9aaa); }
.capacity-advice { border: 1px solid rgba(40,230,162,.28); border-radius: 10px; background: rgba(40,230,162,.1); color: #aaffdf; padding: 8px 10px; font-size: 12px; line-height: 1.45; }
.capacity-advice.warn { border-color: rgba(255,209,102,.36); background: rgba(255,209,102,.12); color: #ffe1a3; }
.capacity-advice.risk { border-color: rgba(255,101,122,.42); background: rgba(255,101,122,.13); color: #ffc0ca; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 10; max-width: 460px; border: 1px solid rgba(0,213,255,.42); border-radius: 12px; background: rgba(6,16,30,.96); box-shadow: 0 18px 48px rgba(0,0,0,.28); padding: 12px 14px; font-size: 13px; line-height: 1.5; opacity: 0; transform: translateY(16px); pointer-events: none; transition: .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

.form-feedback {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(84,151,218,.28);
  border-radius: 10px;
  background: rgba(8,22,42,.54);
  font-size: 12px;
  line-height: 1.55;
}
.hidden { display: none !important; }
.mono { font-family: Consolas, "Courier New", monospace; }
.muted { color: var(--muted); }
.ok-text { color: var(--green); }
.warn-text { color: var(--yellow); }
.risk-text { color: var(--red); }
pre { white-space: pre-wrap; margin: 0; color: #d9f7ff; font: 12px/1.6 Consolas, monospace; }

body.agent-page {
  min-height: 100vh;
  overflow: hidden;
}

.agent-shell {
  width: 100%;
  min-height: 100vh;
}

.agent-login {
  margin-top: clamp(16px, 8vh, 82px);
}

.agent-login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
  gap: 16px;
  align-items: stretch;
}

.agent-login-copy {
  min-height: 320px;
  border: 1px solid rgba(0,213,255,.24);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0,213,255,.12), transparent 46%),
    rgba(8,22,42,.54);
  padding: 24px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.agent-login-copy h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.15;
}

.agent-login-copy p {
  margin: 0;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.7;
}

.agent-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-proof span {
  border: 1px solid rgba(84,151,218,.38);
  border-radius: 999px;
  background: rgba(8,22,42,.68);
  padding: 6px 10px;
  font-size: 12px;
  color: #dff7ff;
}

.agent-app {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  background:
    radial-gradient(circle at 88% 8%, rgba(37,230,155,.12), transparent 28%),
    linear-gradient(135deg, rgba(0,213,255,.08), transparent 38%);
}

.agent-side {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid rgba(84,151,218,.22);
  background: linear-gradient(180deg, rgba(8,18,34,.98), rgba(10,23,42,.94));
  padding: 18px 14px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.agent-brand {
  display: flex;
  gap: 11px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(84,151,218,.2);
}

.agent-brand h1 {
  margin: 0;
  font-size: 19px;
}

.agent-brand p,
.agent-side-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.agent-side-card {
  border: 1px solid rgba(84,151,218,.26);
  border-radius: 12px;
  background: rgba(8,22,42,.58);
  padding: 12px;
}

.agent-side-card h2 {
  margin: 9px 0 0;
  font-size: 18px;
}

.agent-nav {
  display: grid;
  gap: 8px;
}

.agent-nav button {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(84,151,218,.24);
  border-radius: 10px;
  background: rgba(8,22,42,.34);
  color: #cbdaf0;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
}

.agent-nav button:hover,
.agent-nav button.active {
  color: #fff;
  border-color: rgba(0,213,255,.6);
  background: linear-gradient(90deg, rgba(0,213,255,.2), rgba(37,230,155,.08));
  box-shadow: inset 3px 0 0 rgba(0,213,255,.82), 0 10px 22px rgba(0,0,0,.18);
}

.agent-side-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.agent-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.agent-main-head {
  padding: 16px;
}

.agent-main-head h2 {
  margin: 8px 0 4px;
  font-size: 24px;
}

.agent-main-head p {
  margin: 0;
  color: var(--muted);
}

.agent-section {
  display: none;
  min-width: 0;
}

.agent-section.active {
  display: grid;
  gap: 14px;
}

.agent-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.agent-mini-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.agent-mini-flow span {
  min-height: 56px;
  border: 1px solid rgba(84,151,218,.26);
  border-radius: 10px;
  background: rgba(8,22,42,.5);
  display: grid;
  place-items: center;
  color: #dff7ff;
  font-weight: 800;
  text-align: center;
  padding: 8px;
}

.agent-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.agent-identity {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.agent-identity h2 {
  margin: 5px 0 4px;
  font-size: 22px;
}

.agent-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.agent-work-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 14px;
  align-items: start;
}

.agent-link-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(0,213,255,.24);
  border-radius: 12px;
  background: rgba(8,22,42,.52);
  padding: 13px;
}

.agent-link-box.compact {
  min-height: 76px;
}

.agent-link-box b {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.agent-link-box small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.agent-plan-list {
  display: grid;
  gap: 9px;
}

.agent-plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(190px, .7fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(84,151,218,.28);
  border-radius: 12px;
  background: rgba(8,22,42,.5);
  padding: 12px;
}

.agent-plan-card b,
.agent-plan-card small {
  display: block;
}

.agent-plan-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.agent-plan-price {
  text-align: right;
}

.agent-plan-price span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.agent-plan-price b {
  color: #dff7ff;
}

.agent-result {
  border: 1px solid rgba(37,230,155,.34);
  border-radius: 12px;
  background: rgba(37,230,155,.09);
  padding: 12px;
  display: grid;
  gap: 7px;
}

.agent-result p {
  margin: 0;
  color: #d9f7ff;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.tr.agent-portal-order-row {
  grid-template-columns: minmax(160px, 1.1fr) minmax(150px, .8fr) minmax(120px, .65fr) minmax(90px, .45fr) minmax(150px, .7fr);
}

.tr.agent-ledger-row {
  grid-template-columns: minmax(90px, .45fr) minmax(90px, .45fr) minmax(100px, .5fr) minmax(170px, 1fr) minmax(150px, .7fr);
}

@media (max-width: 1100px) {
  body.admin-page:not(.auth-locked),
  body.admin-page:not(.auth-locked) .shell,
  body.admin-page:not(.auth-locked) .main,
  #adminApp:not(.hidden) {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .admin-section.active {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .shell { display: block; }
  .side { min-height: auto; height: auto; width: auto; position: static; overflow: visible; }
  .main { margin-left: 0; }
  .layout, .layout.wide-left, .grid4, .grid5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .node-ops-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runtime-region-head {
    grid-template-columns: 1fr;
  }
  .runtime-region-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .runtime-region-toggle {
    justify-self: start;
  }
  .node-runtime-row {
    grid-template-columns: 1fr;
  }
  .node-table-row {
    grid-template-columns: minmax(220px, 1fr) 92px minmax(160px, .8fr) minmax(130px, .7fr);
  }
  .node-table-head span:nth-child(5),
  .node-table-head span:nth-child(6),
  .node-table-head span:nth-child(7),
  .node-table-row > span:nth-child(5),
  .node-table-row > span:nth-child(6),
  .node-table-row > span:nth-child(7) {
    grid-column: auto;
  }
  .node-table-row > span:nth-child(7) {
    grid-column: 1 / -1;
  }
  .node-row-actions {
    padding: 0 14px 12px;
    justify-content: flex-start;
  }
  .reference-node-table {
    display: block;
    overflow-x: auto;
  }
  .reference-node-table .node-ref-row {
    min-width: 1080px;
  }
  .sticky-panel { position: static; }
  .agent-work-grid,
  .agent-login-grid {
    grid-template-columns: 1fr;
  }
  .agent-top {
    align-items: flex-start;
    flex-direction: column;
  }
  .agent-app {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .agent-side {
    position: static;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(84,151,218,.22);
  }
  .agent-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .agent-nav button {
    justify-content: center;
    text-align: center;
  }
  .agent-side-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .agent-main {
    overflow: visible;
  }
  .agent-dashboard-grid,
  .agent-mini-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  html, body { background: linear-gradient(180deg, #07111f, #0a1b31); }
  .shell { display: block; width: 100%; min-width: 0; }
  .side { padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding-bottom: 12px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 10px; font-size: 19px; }
  .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .nav a, .nav button { min-height: 38px; padding: 7px 8px; font-size: 12px; justify-content: center; text-align: center; }
  .nav .mini-icon { display: none; }
  .side-card { display: none; }
  .main { width: 100%; min-width: 0; padding: 12px 10px 86px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .actions { justify-content: flex-start; }
  .layout, .layout.wide-left, .grid2, .grid3, .grid4, .grid5, .steps { grid-template-columns: 1fr; }
  .ops-strip { grid-template-columns: 1fr; }
  .runtime-region-head {
    padding: 10px;
  }

  .runtime-region-stats {
    grid-template-columns: 1fr;
  }

  .runtime-region-body {
    padding: 8px;
  }

  .runtime-bar-line,
  .runtime-kpis {
    grid-template-columns: 1fr;
  }

  .runtime-bar-line b {
    text-align: left;
    white-space: normal;
  }

  .node-table {
    border: 0;
    background: transparent;
    display: grid;
    gap: 10px;
    overflow: visible;
  }

  .reference-node-table {
    border: 1px solid rgba(84,151,218,.3);
    border-radius: 12px;
    background: rgba(8,22,42,.48);
    display: block;
    overflow-x: auto;
  }

  .reference-node-table .node-ref-row {
    min-width: 1040px;
  }

  .node-table-head {
    display: none;
  }

  .reference-node-table .node-ref-head {
    display: grid;
  }

  .node-table-item {
    border: 1px solid rgba(84,151,218,.28);
    border-radius: 12px;
    overflow: hidden;
  }

  .node-table-row {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .node-table-row > span:nth-child(7) {
    grid-column: auto;
  }

  .node-row-actions {
    padding: 0 11px 11px;
    justify-content: flex-start;
  }

  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-body { padding: 11px; }
  .card { border-radius: 10px; }
  .icon-card { min-height: 76px; grid-template-columns: auto minmax(0, 1fr); }
  .icon-card b { overflow-wrap: anywhere; }
  .metric b { font-size: 22px; }
  .mobile-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  .mobile-quick a { min-height: 86px; border: 1px solid rgba(84,151,218,.34); border-radius: 14px; background: rgba(8,22,42,.6); display: grid; place-items: center; text-align: center; padding: 9px 4px; }
  .mobile-quick .tile-icon { width: 36px; height: 36px; }
  .mobile-quick b { font-size: 12px; }
  .mobile-quick small { color: var(--muted); font-size: 10px; }
  .step { min-height: 88px; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center; }
  .tr.plan-row { grid-template-columns: 1fr; }
  .step > span:last-child { grid-column: 2; }
  .phone-frame { min-height: auto; border-width: 7px; border-radius: 28px; padding: 12px; }
  .input.compact, select.compact { width: 100%; }
  .tr, .tr.cols4, .tr.cols6, .tr.user-row, .tr.admin-row, .tr.payment-row, .tr.agent-row, .tr.agent-ledger-admin-row { grid-template-columns: 1fr; gap: 5px; align-items: start; }
  .tr.head { display: none; }
  .tr { padding: 10px; border-bottom-color: rgba(120,170,220,.18); }
  .user-table .tr, .admin-table .tr, .agent-table .tr, .agent-ledger-table .tr { border-radius: 10px; margin: 8px; border: 1px solid rgba(84,151,218,.22); background: rgba(8,22,42,.48); }
  .user-table .tr.head, .admin-table .tr.head, .agent-table .tr.head, .agent-ledger-table .tr.head { display: none; }
  .detail-hero { align-items: start; }
  .login-panel { margin-top: 12px; }
  .agent-shell {
    width: 100%;
    padding: 0;
  }
  .agent-login {
    margin-top: 4px;
  }
  .agent-login-copy {
    min-height: 220px;
    padding: 16px;
  }
  .agent-login-copy h1 {
    font-size: 26px;
  }
  .agent-plan-card {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .agent-plan-price {
    text-align: left;
  }
  .tr.agent-portal-order-row,
  .tr.agent-ledger-row {
    grid-template-columns: 1fr;
  }
  body.agent-page {
    overflow-y: auto;
  }
  .agent-side,
  .agent-main {
    padding: 12px 10px;
  }
  .agent-brand,
  .agent-side-card {
    display: none;
  }
  .agent-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .agent-nav button {
    min-height: 40px;
    font-size: 12px;
  }
  .agent-nav .mini-icon {
    display: none;
  }
  .agent-main-head h2 {
    font-size: 21px;
  }
  .agent-dashboard-grid,
  .agent-mini-flow {
    grid-template-columns: 1fr;
  }
  .agent-side-actions {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
