:root {
  color-scheme: dark;
  --bg: #10131a;
  --surface: #191e28;
  --surface-raised: #202735;
  --border: #303a4b;
  --text: #f4f6fa;
  --muted: #aab4c4;
  --accent: #7b9cff;
  --green: #52d39a;
  --red: #ff737d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 15% 0%, #253550 0, transparent 38%), var(--bg);
}

button, input { font: inherit; }

.shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid rgba(170, 180, 196, .16);
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 750; letter-spacing: .04em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #10131a; background: var(--accent); font-weight: 900; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.button, .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-raised);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
}

.button:hover, .link-button:hover { border-color: var(--accent); transform: translateY(-1px); }
.button.primary { border-color: var(--accent); color: #10131a; background: var(--accent); font-weight: 750; }
.button.danger { border-color: rgba(255, 115, 125, .45); color: #ffdce0; }
.button:disabled { opacity: .55; cursor: wait; transform: none; }

.content { padding: 48px 0 72px; }
.heading { margin: 0; font-size: clamp(28px, 5vw, 42px); letter-spacing: -.04em; }
.subheading { margin: 10px 0 28px; color: var(--muted); }

.card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(25, 30, 40, .94);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .2);
}

.login-card { width: min(440px, 100%); margin: 38px auto 0; }
.login-card h1 { margin: 0 0 8px; font-size: 27px; }
.login-card > p { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.field { display: grid; gap: 8px; margin: 16px 0; color: #dce3ee; font-size: 14px; font-weight: 650; }
.field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: #111620;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 156, 255, .15); }
.field input.code { letter-spacing: .35em; font-size: 20px; }
.wide { width: 100%; margin-top: 8px; }
.message { min-height: 22px; margin: 12px 0 0; color: var(--red); font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.55; }
.secret {
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: #dbe5ff;
  background: #111620;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  user-select: all;
}

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); letter-spacing: -.04em; }
.section-heading p { margin: 8px 0 0; color: var(--muted); }
.server-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.server-card { padding: 22px; }
.server-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.server-title h2 { margin: 0; font-size: 20px; }
.server-address { margin: 6px 0 20px; color: var(--muted); font-size: 14px; }
.state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.state::before { width: 8px; height: 8px; border-radius: 50%; background: #7c8797; content: ""; }
.state.online { color: var(--green); }
.state.online::before { background: var(--green); box-shadow: 0 0 12px rgba(82, 211, 154, .5); }
.state.offline { color: var(--red); }
.state.offline::before { background: var(--red); }
.server-meta { min-height: 22px; margin: 0 0 17px; color: var(--muted); font-size: 14px; }
.server-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.server-actions .button { min-height: 36px; font-size: 13px; }
.dashboard-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.footnote { margin-top: 24px; color: var(--muted); font-size: 12px; }

[hidden] { display: none !important; }

@media (max-width: 680px) {
  .topbar { min-height: 66px; }
  .top-actions .link-button { display: none; }
  .content { padding-top: 32px; }
  .server-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; }
  .server-card { padding: 18px; }
}
