:root {
  --bg: #070a0f;
  --bg-2: #0a0f16;
  --panel: #0e141c;
  --panel-2: #111a24;
  --line: #1a2531;
  --line-2: #243345;
  --text: #e8eef6;
  --muted: #8fa1b5;
  --dim: #5f7186;
  --blue: #5b8cff;
  --blue-2: #3f6fe8;
  --teal: #3ddc97;
  --red: #ff5c5c;
  --green: #2ecc8f;
  --amber: #f0b429;
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(900px 520px at 88% -12%, rgba(91, 140, 255, 0.12), transparent 62%),
    radial-gradient(720px 420px at -8% 24%, rgba(61, 220, 151, 0.055), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, black, transparent 72%);
  z-index: 0;
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #1c2936; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ boot */
.boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.boot-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), #23408f);
  box-shadow: 0 0 40px rgba(91, 140, 255, 0.35);
  animation: bootPulse 1.6s ease-in-out infinite;
}
.boot-text { letter-spacing: 0.28em; font-size: 12px; color: var(--muted); }
.boot-sub { font-size: 12px; color: var(--dim); }
@keyframes bootPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.6; }
}

/* ------------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.78);
  backdrop-filter: blur(16px);
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 24px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #6b98ff, #2d55c9);
  position: relative;
  box-shadow: 0 8px 22px rgba(91, 140, 255, 0.28);
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  top: 5px;
  right: 5px;
  box-shadow: 0 0 10px rgba(61, 220, 151, 0.8);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 13px; letter-spacing: 0.16em; font-weight: 650; }
.brand-text span { font-size: 10px; letter-spacing: 0.3em; color: var(--dim); margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.nav-item svg { width: 18px; height: 18px; opacity: 0.9; flex: 0 0 18px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.03); color: var(--text); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(91, 140, 255, 0.16), rgba(91, 140, 255, 0.02));
  border-color: rgba(91, 140, 255, 0.22);
}
.nav-item.active svg { color: var(--blue); }
.sidebar-spacer { flex: 1; }

.conn-card {
  margin: 14px 4px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 20, 28, 0.7);
  font-size: 12px;
}
.conn-row { display: flex; align-items: center; gap: 8px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conn-row + .conn-row { margin-top: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: 0 0 7px; }
.dot.on { background: var(--teal); box-shadow: 0 0 9px rgba(61, 220, 151, 0.75); }
.dot.off { background: var(--red); box-shadow: 0 0 9px rgba(255, 92, 92, 0.5); }
.conn-card .mono { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 28, 0.7);
  cursor: pointer;
}
.user-box:hover { border-color: var(--line-2); }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: #0b1118;
  background: linear-gradient(135deg, #9db8ff, #5b8cff);
  flex: 0 0 30px;
}
.user-meta { min-width: 0; }
.user-meta b { display: block; font-size: 12px; font-weight: 600; color: var(--text); }
.user-meta span { display: block; font-size: 10.5px; color: var(--dim); }

.main {
  margin-left: 236px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 15, 0.72);
  backdrop-filter: blur(14px);
  z-index: 15;
}
.page-title { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.page-sub { font-size: 12px; color: var(--dim); margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.account-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 20, 28, 0.8);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.account-chip:hover { border-color: var(--line-2); }
.account-chip b { color: var(--text); font-weight: 600; }
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 28, 0.8);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 17px; height: 17px; }

.content { padding: 24px 30px 64px; max-width: 1560px; width: 100%; }
.view { animation: fadeUp 0.22s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ cards */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(17, 26, 36, 0.82), rgba(11, 17, 24, 0.86));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px 0;
}
.card-title { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.card-sub { font-size: 11px; color: var(--dim); margin-top: 3px; }
.card-body { padding: 18px 20px 20px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kpi {
  position: relative;
  padding: 18px 20px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(17, 26, 36, 0.86), rgba(10, 16, 23, 0.92));
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 140, 255, 0.45), transparent);
}
.kpi .k-label { font-size: 11px; color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase; }
.kpi .k-value {
  margin-top: 9px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.kpi .k-value small { font-size: 12px; color: var(--dim); font-weight: 500; margin-left: 4px; }
.kpi .k-foot { margin-top: 7px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--dim); }
.delta { font-variant-numeric: tabular-nums; font-weight: 600; }
.up { color: var(--red); }
.down { color: var(--green); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }

/* ------------------------------------------------------------------ chart */
.chart-wrap { position: relative; height: 260px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--dim);
  font-size: 12px;
}

/* ------------------------------------------------------------------ table */
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 10.5px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
  text-align: right;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(26, 37, 49, 0.6);
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(91, 140, 255, 0.035); }
.sym { display: flex; flex-direction: column; gap: 1px; }
.sym b { font-weight: 600; font-size: 12.5px; }
.sym span { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.empty-row td { text-align: center; color: var(--dim); padding: 34px 14px; font-size: 12px; }

/* ------------------------------------------------------------------ watchlist */
.watch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(26, 37, 49, 0.6);
}
.watch-row:last-child { border-bottom: 0; }
.watch-name { min-width: 0; }
.watch-name b { display: block; font-size: 12.5px; font-weight: 600; }
.watch-name span { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--dim); margin-top: 1px; }
.watch-price { text-align: right; }
.watch-price b { display: block; font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.watch-price span { display: block; font-family: var(--mono); font-size: 11px; margin-top: 1px; }

/* ------------------------------------------------------------------ pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  border: 1px solid var(--line-2);
  color: var(--muted);
  white-space: nowrap;
}
.pill .pdot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill.running { color: var(--teal); border-color: rgba(61, 220, 151, 0.28); background: rgba(61, 220, 151, 0.07); }
.pill.running .pdot { animation: pulse 1.6s infinite; box-shadow: 0 0 8px rgba(61, 220, 151, 0.8); }
.pill.stopped { color: var(--dim); }
.pill.draft { color: var(--blue); border-color: rgba(91, 140, 255, 0.25); background: rgba(91, 140, 255, 0.06); }
.pill.error { color: var(--red); border-color: rgba(255, 92, 92, 0.3); background: rgba(255, 92, 92, 0.07); }
.pill.buy { color: var(--red); border-color: rgba(255, 92, 92, 0.3); background: rgba(255, 92, 92, 0.07); }
.pill.sell { color: var(--green); border-color: rgba(46, 204, 143, 0.3); background: rgba(46, 204, 143, 0.07); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #111a24;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { background: #14202c; border-color: #33506e; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(180deg, #6b98ff, var(--blue-2));
  border-color: rgba(120, 160, 255, 0.8);
  color: #fff;
  box-shadow: 0 8px 22px rgba(91, 140, 255, 0.24);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: #ffb3b3; border-color: rgba(255, 92, 92, 0.3); background: rgba(255, 92, 92, 0.06); }
.btn.danger:hover { background: rgba(255, 92, 92, 0.12); }
.btn.ghost { background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11.5px; color: var(--muted); }
.field .hint { font-size: 10.5px; color: var(--dim); }
.input, select.input, textarea.input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #080c12;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input { height: auto; padding: 10px 11px; resize: vertical; line-height: 1.6; }
.input:focus { border-color: rgba(91, 140, 255, 0.55); box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.1); }
.input.mono { font-family: var(--mono); font-size: 12px; }
select.input { cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #1b2733;
  border: 1px solid var(--line-2);
  position: relative;
  transition: background 0.15s;
}
.switch .track::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8fa1b5;
  top: 2px;
  left: 2px;
  transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .track { background: rgba(61, 220, 151, 0.2); border-color: rgba(61, 220, 151, 0.45); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--teal); }

/* ------------------------------------------------------------------ strategies */
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.strategy-card { padding: 18px 18px 15px; display: flex; flex-direction: column; gap: 12px; }
.strategy-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.strategy-name { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.strategy-desc { font-size: 11.5px; color: var(--dim); margin-top: 3px; min-height: 16px; }
.strategy-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--muted); }
.strategy-meta .mono { color: var(--muted); }
.strategy-actions { display: flex; gap: 7px; padding-top: 4px; border-top: 1px solid rgba(26, 37, 49, 0.7); margin-top: 2px; padding-top: 12px; }
.strategy-actions .grow { flex: 1; }
.code-editor {
  width: 100%;
  min-height: 430px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #070b10;
  color: #c9d6e5;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  resize: vertical;
  tab-size: 4;
  outline: none;
}
.code-editor:focus { border-color: rgba(91, 140, 255, 0.5); }
.deploy-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr); gap: 14px; margin-top: 14px; }
.tpl-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  cursor: pointer;
  margin-bottom: 9px;
  background: rgba(8, 12, 18, 0.6);
}
.tpl-card:hover { border-color: rgba(91, 140, 255, 0.35); background: rgba(91, 140, 255, 0.04); }
.tpl-card b { font-size: 12.5px; display: block; }
.tpl-card span { font-size: 11px; color: var(--dim); display: block; margin-top: 3px; }

/* ------------------------------------------------------------------ modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 10, 0.72);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 80;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(780px, 94vw);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: linear-gradient(180deg, #111a24, #0b1118);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  animation: modalIn 0.18s ease;
}
@keyframes modalIn { from { transform: translateY(10px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 15px; font-weight: 650; }
.modal-body { padding: 20px 22px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 22px 19px;
  border-top: 1px solid var(--line);
}
.close-x {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.close-x:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

/* ------------------------------------------------------------------ drawer */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(3, 6, 10, 0.6); z-index: 70; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(760px, 94vw);
  background: #0a0f16;
  border-left: 1px solid var(--line-2);
  z-index: 71;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px; }
pre.logs {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: #b9c8d8;
  white-space: pre-wrap;
  word-break: break-word;
}
pre.logs .err { color: #ff8f8f; }

/* ------------------------------------------------------------------ toast */
#toast-root { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 120; }
.toast {
  min-width: 220px;
  max-width: 380px;
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #101923;
  color: var(--text);
  font-size: 12.5px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.2s ease;
}
.toast.ok { border-color: rgba(61, 220, 151, 0.35); }
.toast.err { border-color: rgba(255, 92, 92, 0.4); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ------------------------------------------------------------------ login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 26px;
  position: relative;
  z-index: 1;
}
.login-card {
  width: min(410px, 100%);
  padding: 30px 30px 26px;
  border: 1px solid var(--line-2);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 26, 36, 0.95), rgba(9, 14, 20, 0.97));
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
.login-title { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.login-sub { font-size: 12px; color: var(--dim); margin: 4px 0 24px; }
.login-foot { margin-top: 18px; text-align: center; font-size: 11px; color: var(--dim); }
.login-err {
  margin-bottom: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 92, 92, 0.3);
  background: rgba(255, 92, 92, 0.06);
  color: #ffb3b3;
  font-size: 12px;
  display: none;
}
.login-err.show { display: block; }

/* ------------------------------------------------------------------ misc */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; font-size: 12px; color: var(--dim); }
.stat-inline { display: flex; gap: 18px; font-size: 12px; color: var(--muted); }
.stat-inline b { color: var(--text); font-family: var(--mono); }
.section-gap { height: 14px; }
.hr { height: 1px; background: var(--line); margin: 18px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tag { font-family: var(--mono); font-size: 10.5px; color: var(--dim); border: 1px solid var(--line); padding: 2px 7px; border-radius: 999px; }
.notice {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(240, 180, 41, 0.25);
  background: rgba(240, 180, 41, 0.05);
  color: #e8c46a;
  font-size: 11.5px;
  line-height: 1.6;
}
.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--dim);
  font-size: 12.5px;
}
.empty b { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; font-weight: 600; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .deploy-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { width: 68px; flex-basis: 68px; padding: 16px 10px; }
  .brand { padding: 2px 2px 18px; justify-content: center; }
  .brand-text, .nav-label, .conn-card, .user-meta { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .user-box { justify-content: center; padding: 8px; }
  .main { margin-left: 68px; }
  .topbar { padding: 0 16px; height: 68px; }
  .content { padding: 18px 16px 50px; }
  .page-title { font-size: 17px; }
  .account-chip b { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ multi-user */
.login-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.6);
}
.login-tabs button {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
}
.login-tabs button.active {
  background: rgba(91, 140, 255, 0.14);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(91, 140, 255, 0.2);
}

.account-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 20, 28, 0.8);
  max-width: 330px;
}
.account-picker .dot { flex: 0 0 7px; }
.account-select {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  max-width: 290px;
  cursor: pointer;
}
.account-select option { background: #0e141c; color: var(--text); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.captcha-box {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080c12;
}
.captcha-img {
  height: 52px;
  border-radius: 7px;
  border: 1px solid var(--line-2);
  background: #fff;
}

.bind-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.bind-steps span {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--dim);
  text-align: center;
}
.bind-steps span.active {
  color: var(--blue);
  border-color: rgba(91, 140, 255, 0.35);
  background: rgba(91, 140, 255, 0.06);
}
.bind-steps span.done {
  color: var(--teal);
  border-color: rgba(61, 220, 151, 0.25);
  background: rgba(61, 220, 151, 0.05);
}

.invite-code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--teal);
  background: rgba(61, 220, 151, 0.06);
  border: 1px solid rgba(61, 220, 151, 0.18);
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
}
.invite-form { max-width: 560px; }
