:root {
  color-scheme: dark;
  --bg-body: #0a0b0e;
  --bg-sidebar: #0d0f15;
  --bg-card: #101218;
  --bg-hover: #1a1e27;
  --bg-elevated: #161922;
  --surface: #101218;
  --surface-2: #161922;
  --surface-3: #1c2029;
  --border: #23272f;
  --border-soft: #191c23;
  --border-strong: #2c313b;
  --text: #e9ebf0;
  --text-dim: #9aa1af;
  --text-faint: #646b7a;
  --text-ghost: #444b58;
  --accent: #6d7cff;
  --accent-hover: #5a67e8;
  --accent-bright: #8b93ff;
  --accent-bg: #6d7cff21;
  --accent-shadow: #6d7cff4d;
  --green: #3ddc97;
  --green-bg: #3ddc971f;
  --amber: #f5b945;
  --amber-bg: #f5b9451f;
  --red: #fb6f6f;
  --red-bg: #fb6f6f1f;
  --cyan: #49c7f0;
  --violet: #b07bf5;
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --shadow-md: 0 8px 24px -8px #0000008c;
  --shadow-lg: 0 20px 48px -12px #000000a6;
  --bg-code: #0d1017;
  --text-code: #e2e8f0;
  --grid-color: #ffffff05;
  --sidebar: 248px;
  --muted: var(--text-dim);
  --card: var(--bg-card);
  --card-2: var(--surface-2);
  --line: var(--border);
  --copper: var(--accent);
  --copper-ink: #fff;
  --font: var(--sans);
  --shadow: var(--shadow-md);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--bg-body);
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 56px 56px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px 14px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 14px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px #6d7cff1a;
}
.brand-mark svg { width: 16px; height: 16px; display: block; }
.brand strong { font-size: 0.98rem; font-weight: 650; letter-spacing: -0.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  margin: 14px 10px 6px;
  color: var(--text-ghost);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
}
.nav a svg { width: 16px; height: 16px; flex: none; }
.nav a:hover { background: var(--bg-hover); color: var(--text); }
.nav a.active { background: #171b28; color: var(--text); }
.nav a.active svg { color: var(--accent-bright); }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; padding: 8px 4px 0; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: #12151d; border: 1px solid var(--border-soft); }
.avatar {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--accent-bg); color: var(--accent-bright);
  font-size: 0.82rem; font-weight: 700;
}
.user-meta { display: grid; min-width: 0; }
.user-meta strong { font-size: 0.86rem; font-weight: 600; }
.user-meta small { color: var(--green); font-size: 0.72rem; }
.user-meta small::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--green); }

.main { min-width: 0; position: relative; }
.page-loader {
  position: absolute;
  inset: 0;
  z-index: 30;
  border-radius: var(--radius-lg);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  background: color-mix(in srgb, var(--bg-body) 78%, transparent);
  backdrop-filter: blur(3px);
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.page-loader[hidden] { display: none; }
.page-loader.out { opacity: 0; transition: opacity 180ms ease; }
.spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent-bright);
  animation: spin 0.7s linear infinite;
}
.spinner-dots { display: flex; gap: 6px; }
.spinner-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: bounce 0.9s ease-in-out infinite;
}
.spinner-dots i:nth-child(2) { animation-delay: 0.12s; }
.spinner-dots i:nth-child(3) { animation-delay: 0.24s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-5px); opacity: 1; }
}
.topbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 18px 28px 4px;
}
.topbar h1 { margin: 0; font-size: 1.2rem; font-weight: 650; letter-spacing: -0.02em; }
.topbar p { margin: 3px 0 0; color: var(--text-dim); font-size: 0.88rem; }
.grow { flex: 1; }
.menu-btn, .backdrop { display: none; }
.content { padding: 14px 28px 40px; display: grid; gap: 14px; }
.content:has(> .page-loader) { position: relative; }
.content:has(> .page-loader:not([hidden])) { min-height: 380px; }

.metrics, .split { display: grid; gap: 14px; }
.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { grid-template-columns: 1.4fr 0.8fr; }
.card, .panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card { padding: 16px 16px 14px; min-height: 112px; }
.label { margin: 0; color: var(--text-dim); font-size: 0.82rem; font-weight: 500; }
.value { margin: 12px 0 0; font-size: 1.65rem; font-weight: 650; letter-spacing: -0.04em; }
.value-good { color: var(--green); }
.value-bad { color: var(--red); }
.foot { margin: 8px 0 0; color: var(--text-faint); font-size: 0.82rem; }
.bar { margin-top: 16px; height: 4px; border-radius: 99px; background: #1a1e27; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; }
.w-0 { width: 0%; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; }
.w-20 { width: 20%; } .w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; }
.w-40 { width: 40%; } .w-45 { width: 45%; } .w-50 { width: 50%; } .w-55 { width: 55%; }
.w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; } .w-75 { width: 75%; }
.w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; }
.w-100 { width: 100%; }
.field-inline { min-width: 220px; margin: 0; }
.spaced { margin-top: 16px; }

.panel { padding: 16px 18px; }
.panel h2 { margin: 0 0 14px; font-size: 0.98rem; font-weight: 650; }
.action-row, .toolbar, .bot-actions, .modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}
.toolbar .field, .field-inline { margin-bottom: 0; }
.toolbar .check { height: 36px; margin: 0; }
.output, .terminal {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-code);
  border: 1px solid var(--border-soft);
  color: var(--text-code);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
  max-height: 360px;
}
.terminal { min-height: 280px; max-height: 60vh; }
.terminal mark { background: var(--accent); color: #fff; border-radius: 3px; padding: 0 2px; }

.btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  color: var(--text);
  font-weight: 550;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px -10px var(--accent-shadow);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-warn { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.btn-block { width: 100%; height: 42px; min-height: 42px; max-height: 42px; margin-top: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 9px;
  font-size: 0.75rem; font-weight: 650; letter-spacing: 0.02em;
  border: 0; color: var(--text-dim); background: var(--surface-3);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-online { color: var(--green); background: var(--green-bg); }
.badge-offline { color: var(--text-faint); }
.badge-failed { color: var(--red); background: var(--red-bg); }
.badge-starting, .badge-unknown { color: var(--amber); background: var(--amber-bg); }

.bot-list { display: grid; gap: 8px; align-content: start; }
.bot-block { display: grid; gap: 8px; }
.bot-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; color: var(--text);
}
.bot-row.active { border-color: var(--accent); background: #141824; }
.bot-main {
  flex: 1; min-width: 0; background: none; border: 0; color: inherit;
  text-align: left; padding: 0; display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.bot-row .bot-avatar { width: 36px; height: 36px; flex: none; }
.bot-main strong, .bot-main .meta { display: block; }
.bot-main .meta { color: var(--text-dim); font-size: 0.86rem; }
.bot-row .bot-actions { margin-left: auto; flex: none; }
.icon-btn { width: 36px; padding: 0; display: inline-grid; place-items: center; }
.icon-btn img, .icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn.danger { color: var(--red); border-color: #fb6f6f55; }
.bot-detail {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: grid; gap: 14px; animation: detail-in 320ms cubic-bezier(.2, .7, .2, 1);
}
.bot-stats { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-dim); font-size: 0.86rem; }
.secret-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.secret-token {
  font-family: var(--mono); background: #0c0e14; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); height: 36px; padding: 0 12px;
  max-width: min(520px, 100%); overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.bot-stats b { color: var(--text); font-weight: 650; }
.edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.edit-card {
  background: #0c0e14; border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 14px; display: grid; gap: 12px; align-content: start;
}
.edit-card.wide { grid-column: 1 / -1; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.template-page { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.template-card {
  display: grid; gap: 8px; align-content: start; text-align: left; text-decoration: none;
  background: #0c0e14; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; color: var(--text); min-height: 150px;
}
button.template-card { cursor: pointer; width: 100%; font: inherit; }
.template-card.on { border-color: var(--accent); background: #141824; }
.template-card strong, .template-card h2 { margin: 0; font-size: 1rem; }
.template-card p, button.template-card span { margin: 0; color: var(--text-dim); font-size: 0.84rem; }
.command-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.cmd-chip {
  font-family: var(--mono); font-size: 0.74rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 999px; padding: 4px 8px;
}
.feature-row { display: flex; flex-wrap: wrap; gap: 6px; }
.feature-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  background: #1a2036; color: #b7c0ff; font-size: 0.72rem; font-weight: 650;
}
.edit-card header h3 { margin: 0; font-size: 0.92rem; font-weight: 650; }
.edit-card header .meta { margin: 2px 0 0; color: var(--text-dim); font-size: 0.82rem; }
.edit-card .field { margin-bottom: 0; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
.counter { font-size: 0.74rem; color: var(--text-faint); }
.card-actions { display: flex; justify-content: flex-end; }
.profile-pick { display: flex; align-items: center; gap: 14px; }
.profile-pick-text { display: grid; gap: 6px; justify-items: start; }
.profile-pick-text .meta { color: var(--text-dim); font-size: 0.8rem; }
.avatar-frame.small { width: 64px; height: 64px; }
.presence-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.presence-choice {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-dim); font-weight: 550; cursor: pointer;
}
.presence-choice:hover { border-color: var(--border-strong); color: var(--text); }
.presence-choice.on { border-color: var(--accent); color: var(--text); background: #141824; }
.presence-choice i, .presence-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.presence-choice.online i, .presence-dot.online { background: var(--green); }
.presence-choice.idle i, .presence-dot.idle { background: var(--amber); }
.presence-choice.dnd i, .presence-dot.dnd { background: var(--red); }
.presence-choice.invisible i, .presence-dot.invisible { background: transparent; border: 2px solid var(--text-faint); }
.presence-row { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 10px; }
.presence-preview {
  margin: 0; display: flex; align-items: center; gap: 8px; color: var(--text-dim);
  font-size: 0.84rem; padding: 8px 10px; border-radius: 8px; background: var(--surface-2);
}
.token-row { display: flex; gap: 8px; }
.token-row input { flex: 1; min-width: 0; }
.short-text { min-height: 72px; height: 72px; }
.bot-console { min-height: 160px; max-height: 240px; margin: 0; }
.bot-detail .table-wrap { max-height: 360px; overflow: auto; }
.bot-detail .crumbs { font-family: var(--mono); font-size: 0.84rem; }
.bot-detail .empty { margin: 0; }
@media (max-width: 900px) {
  .edit-grid, .presence-row, .template-grid, .template-page { grid-template-columns: 1fr; }
  .bot-row { flex-wrap: wrap; }
  .bot-main { flex-basis: 100%; }
  .bot-row .bot-actions { margin-left: 0; }
}
.status-pill.starting { color: var(--amber); }
.bot-card h3 { margin: 0; font-size: 1.02rem; }
.bot-card .meta { color: var(--text-dim); margin: 8px 0 0; }
.bot-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.bot-identity { display: flex; gap: 12px; align-items: center; }
.bot-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.picture-step { display: flex; align-items: center; gap: 18px; }
.picture-pick { display: grid; gap: 8px; justify-items: start; }
.avatar-frame {
  width: 96px; height: 96px; border-radius: 50%; overflow: hidden; flex: none;
  border: 1px solid var(--border); background: #0c0e14;
  display: grid; place-items: center;
}
.avatar-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-frame img[hidden] { display: none; }
.file-name-label { color: var(--text-dim); font-size: 0.84rem; word-break: break-all; }
.sr-file {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.wizard-steps { display: flex; gap: 8px; margin-bottom: 14px; }
.wizard-steps span {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--text-faint); font-size: 0.78rem;
}
.setup-steps { margin: 0 0 14px; padding-left: 18px; color: var(--text-dim, var(--text-faint)); }
.setup-steps li { margin: 6px 0; }
.wizard-steps span.on { background: var(--accent); color: #fff; border-color: transparent; }
.wizard-steps span.done { color: var(--accent-bright); border-color: var(--accent); }
.stats-line { display: flex; gap: 14px; color: var(--text-faint); font-size: 0.88rem; margin: 12px 0; }

.callout {
  border: 1px solid #6d7cff55;
  background: var(--accent-bg);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
th { color: var(--text-faint); font-weight: 650; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--text-dim); }
.crumbs button { background: none; border: 0; color: var(--accent-bright); padding: 0; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field span { color: var(--text-dim); font-size: 0.84rem; }
input:not([type]),
input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%;
  background-color: #0c0e14;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
  outline: none;
}
select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, #9aa3b5 50%), linear-gradient(135deg, #9aa3b5 50%, transparent 50%);
  background-position: calc(100% - 18px) 15px, calc(100% - 12px) 15px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
input::placeholder { color: var(--text-ghost); }
textarea { height: auto; min-height: 240px; padding: 10px 12px; resize: vertical; font-family: var(--mono); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.check { display: flex; gap: 8px; align-items: center; color: var(--text-dim); }

.modal[hidden] { display: none !important; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); }
.modal-card {
  position: relative;
  width: min(480px, 100%);
  background: #12151c;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}
.modal-card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.modal-actions { justify-content: flex-end; margin-top: 8px; }
#server-detail { display: grid; gap: 14px; }
#server-detail[hidden] { display: none; }
#server-detail.open { animation: detail-in 320ms cubic-bezier(.2, .7, .2, 1); }
#server-detail.swap { animation: detail-swap 280ms ease; }
#server-detail.closing { animation: detail-out 240ms ease forwards; }
@keyframes detail-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}
@keyframes detail-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}
@keyframes detail-swap {
  from { opacity: 0.15; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.table-wrap.file-in { animation: file-in 240ms ease; }
@keyframes file-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.modal-card.wide { width: min(860px, 100%); }
.file-name { background: none; border: 0; color: var(--text); padding: 0; text-align: left; cursor: pointer; }
.file-name.dir { color: var(--accent-bright); }
.server-list { display: grid; gap: 8px; }
.server-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; color: var(--text);
}
.server-row strong { font-weight: 650; }
.server-row .meta { color: var(--text-dim); font-size: 0.86rem; }
.server-row.active { border-color: var(--accent); background: #141824; }
.server-main { flex: 1; min-width: 0; background: none; border: 0; color: inherit; text-align: left; padding: 0; display: flex; align-items: center; gap: 12px; }
.server-main strong, .server-main .meta { display: block; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; min-width: 74px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; }
.status-pill i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.status-pill.online { color: var(--green); }
.status-pill.offline { color: var(--red); }
.server-meters { display: flex; gap: 14px; color: var(--text-dim); font-size: 0.82rem; white-space: nowrap; }
.server-meters b { color: var(--text); font-weight: 650; }
.days-left { font-size: 0.82rem; color: var(--text-dim); min-width: 92px; text-align: right; }
.days-left.warn { color: var(--amber); }
.days-left.bad { color: var(--red); }
.server-actions { display: flex; gap: 6px; }

.toast-stack { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; width: min(360px, calc(100% - 32px)); }
.toast { background: #161922; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-md); }
.toast.error { border-color: #fb6f6f66; }
.toast.ok { border-color: #3ddc9766; }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background-image: none;
  background-color: #07080b;
}
.login-card {
  width: min(400px, 100%);
  padding: 32px 28px 26px;
  background: #12141b;
  border: 1px solid #232838;
  border-radius: 18px;
  box-shadow: 0 30px 80px -24px #000;
  text-align: center;
}
.login-logo {
  width: 48px; height: 48px; margin: 0 auto 14px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: #1a1e33;
  color: var(--accent-bright);
  box-shadow: 0 0 0 6px #6d7cff14, 0 0 28px #6d7cff33;
}
.login-logo svg { width: 22px; height: 22px; }
.login-card h1 { margin: 0; font-size: 1.45rem; font-weight: 680; letter-spacing: -0.03em; }
.login-card .lead { color: var(--text-dim); margin: 6px 0 20px; font-size: 0.92rem; }
.login-card .field { text-align: left; }
.steps { margin: 0; padding-left: 18px; color: var(--text-dim); }
.steps li { margin: 6px 0; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }
.empty { color: var(--text-dim); padding: 18px 4px; }

.status-grid { display: grid; grid-template-columns: 160px 1fr; gap: 10px 12px; }
.status-grid dt { color: var(--text-faint); }
.status-grid dd { margin: 0; }

.menu-btn {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
}

@media (max-width: 1100px) {
  .metrics, .bot-grid, .split { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 30; transform: translateX(-105%);
    transition: transform 160ms ease; width: min(84vw, 280px);
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-grid; place-items: center; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 25; }
  .backdrop[hidden] { display: none !important; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .metrics, .bot-grid, .split, .status-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  #server-detail.open, #server-detail.swap, #server-detail.closing, .table-wrap.file-in { animation: none; }
}
