:root {
  color: #edf3ff;
  background: #070b13;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  --panel: #0e1625;
  --panel2: #111c2e;
  --line: #22314a;
  --muted: #8fa1bd;
  --accent: #8b5cf6;
  --accent2: #5b5cf6;
  --green: #34e1b2;
  --red: #ff6b7a;
  --amber: #f4bd50;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 70% -20%, #192547 0, transparent 36%), #070b13;
}
.hidden { display: none !important; }
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }

aside {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 20px;
  background: #09101c;
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 750; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(145deg, #a77bff, #5c45ea);
  border-radius: 12px;
  font-size: 24px;
}
.eyebrow {
  margin: 12px 0 6px;
  color: #7894bd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}
.muted { margin: .35rem 0; color: var(--muted); }
.error { min-height: 1.25rem; color: var(--red); }
.warning {
  padding: 12px;
  color: #f7cc70;
  background: #302715;
  border: 1px solid #604f25;
  border-radius: 10px;
}
nav { display: grid; gap: 8px; margin-top: 36px; }
.nav, .secondary, .primary, .icon { color: #eef3ff; border: 0; font: inherit; cursor: pointer; }
.nav { padding: 12px 14px; background: transparent; border-radius: 10px; text-align: left; }
.nav:hover, .nav.active { background: #16233a; }
.aside-foot {
  margin-top: auto;
  padding: 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  background: #5b677a;
  border-radius: 50%;
}
.dot.online { background: var(--green); box-shadow: 0 0 10px #34e1b288; }
.dot.degraded { background: var(--amber); }

main { min-width: 0; padding: 34px clamp(24px, 4vw, 64px); }
header, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
h1 { margin: 5px 0; font-size: 31px; }
h2 { margin: 4px 0; font-size: 23px; }
.header-actions, .dialog-actions { display: flex; align-items: center; gap: 10px; }
.primary, .secondary { padding: 10px 16px; border-radius: 10px; font-weight: 650; }
.primary { background: linear-gradient(120deg, var(--accent), var(--accent2)); }
.secondary { background: #162238; border: 1px solid #263753; }

.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 32px 0; }
.metrics article, .server-card, .table-wrap {
  background: linear-gradient(150deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
}
.metrics article { padding: 18px; }
.metrics span, .metrics small { display: block; color: var(--muted); }
.metrics strong { display: block; margin: 8px 0; font-size: 29px; }
.section { margin-top: 35px; scroll-margin-top: 24px; }
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.server-card { padding: 18px; }
.server-title { display: flex; align-items: center; justify-content: space-between; }
.health {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  background: #17243a;
  border-radius: 99px;
  font-size: 12px;
}
.health.online { color: var(--green); }
.health.degraded { color: var(--amber); }
.health.offline { color: var(--red); }
.server-address { margin: 7px 0 15px; color: #a9bad3; font: 13px "Cascadia Mono", monospace; }
.capacity-row { display: flex; justify-content: space-between; margin: 8px 0; font-size: 13px; }
progress {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  background: #202d42;
  border: 0;
  border-radius: 10px;
}
progress::-webkit-progress-bar { background: #202d42; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--green), #55a9ff); }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--green), #55a9ff); }
.server-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.server-stats div { padding: 10px; background: #0b1321; border-radius: 10px; }
.server-stats span { display: block; color: var(--muted); font-size: 11px; }
.server-stats b { display: block; margin-top: 5px; font-size: 14px; }
.server-controls { display: grid; grid-template-columns: minmax(150px, 1fr) 90px; gap: 8px; }
.server-controls button { font-size: 12px; }
select, input, textarea {
  width: 100%;
  padding: 10px;
  color: #eef3ff;
  background: #0b1321;
  border: 1px solid #2a3a55;
  border-radius: 9px;
  font: inherit;
}
textarea { resize: vertical; min-height: 90px; }
.tier-badge { display: inline-flex; padding: 4px 9px; border-radius: 99px; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.tier-badge.free { color: #8fd7ff; background: #12304a; }
.tier-badge.premium { color: #d7bdff; background: #302358; }
.unread-badge { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: 6px; padding: 0 5px; color: #07121a; background: var(--green); border-radius: 99px; font-size: 11px; font-weight: 800; }
.support-dialog { width: min(760px, calc(100% - 30px)); }
.support-messages { display: grid; gap: 10px; max-height: 52vh; margin-bottom: 16px; overflow: auto; }
.support-message { max-width: 86%; padding: 12px 14px; background: #17243a; border: 1px solid #283a57; border-radius: 13px; }
.support-message.admin { justify-self: end; background: #202052; border-color: #45458a; }
.support-message b, .support-message small { display: block; }
.support-message small { margin-top: 7px; color: var(--muted); }
label { display: grid; gap: 7px; color: #aebcd1; font-size: 13px; }
.table-wrap { margin-top: 16px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid #1f2c42; font-size: 13px; text-align: left; }
th { color: #8295b2; font-size: 11px; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
code { color: #9eb5d8; font-family: "Cascadia Mono", Consolas, monospace; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { padding: 4px 8px; background: #17243a; border-radius: 99px; }
.empty { padding: 34px; color: var(--muted); text-align: center; }

.login-shell { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card {
  width: min(420px, 100%);
  padding: 32px;
  background: linear-gradient(150deg, #121d31, #0b1321);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 25px 80px #0008;
}
.login-card label { margin: 24px 0 14px; }
.login-card .primary { width: 100%; }
#password-form label + label { margin-top: 12px; }

dialog {
  width: min(650px, calc(100% - 30px));
  padding: 22px;
  color: #eef3ff;
  background: #101a2b;
  border: 1px solid #2b3c59;
  border-radius: 18px;
  box-shadow: 0 24px 100px #000b;
}
dialog::backdrop { background: #03060dc9; backdrop-filter: blur(5px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.icon { width: 34px; height: 34px; background: #1b2940; border-radius: 9px; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wide { grid-column: 1 / -1; }
.dialog-actions { justify-content: flex-end; margin-top: 18px; }
pre {
  padding: 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: #a8f3dc;
  background: #070c15;
  border: 1px solid #293a56;
  border-radius: 10px;
}

@media (max-width: 950px) {
  .app { grid-template-columns: 1fr; }
  aside { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  aside nav { display: flex; flex-wrap: wrap; margin-top: 18px; }
  aside .nav { flex: 1 1 120px; text-align: center; }
  .aside-foot { display: none; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 620px) {
  main { padding: 22px 14px; }
  header, .section-head { align-items: flex-start; flex-direction: column; }
  .header-actions { flex-wrap: wrap; }
  .metrics { grid-template-columns: 1fr; }
  .server-grid { grid-template-columns: 1fr; }
  .server-controls { grid-template-columns: 1fr 100px; }
  .form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
}
