:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef3f4;
  --text: #1d2433;
  --muted: #657184;
  --line: #d8dee7;
  --accent: #0f8b8d;
  --accent-2: #34699a;
  --warn: #b87900;
  --danger: #c7462b;
  --good: #27815d;
  --shadow: 0 16px 45px rgba(29, 36, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.boot-screen,
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-screen {
  gap: 12px;
  align-content: center;
  color: var(--muted);
}

.boot-mark,
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.login-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.login-brand h1 {
  margin: 0;
  font-size: 1.35rem;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: #202735;
  color: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  background: #f2b705;
  color: #202735;
}

.brand h1 {
  margin: 0;
  font-size: 1.08rem;
}

.brand span,
.user-block span {
  display: block;
  color: #b8c2d4;
  font-size: 0.83rem;
}

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

.nav button,
.logout-button {
  width: 100%;
  text-align: left;
  color: #dce6f5;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.nav button.active,
.nav button:hover,
.logout-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.user-block strong {
  display: block;
  word-break: break-word;
}

.content {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h2 {
  margin: 0 0 4px;
  font-size: 1.45rem;
}

.topbar p,
.panel-title p,
.muted {
  margin: 0;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.status-pill.good {
  background: #e4f4ec;
  color: var(--good);
}

.status-pill.warn {
  background: #fff3cf;
  color: var(--warn);
}

.status-pill.danger {
  background: #fde8e2;
  color: var(--danger);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.detail-surface {
  min-width: 0;
}

.server-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
  padding: 18px;
  border-radius: 8px;
  background: #202735;
  color: #fff;
}

.server-hero h3 {
  margin: 4px 0 6px;
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.server-hero p {
  margin: 0;
  color: #c7d2e4;
  overflow-wrap: anywhere;
}

.eyebrow {
  color: #f2b705;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-title h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.form-row {
  display: grid;
  gap: 6px;
}

label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  padding: 9px 10px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 139, 141, 0.2);
  border-color: var(--accent);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn.secondary {
  background: #e8edf3;
  color: var(--text);
}

.btn.blue {
  background: var(--accent-2);
}

.btn.warn {
  background: var(--warn);
}

.btn.danger {
  background: var(--danger);
}

.btn.ghost {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid var(--line);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: #fff;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.92rem;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fbfcfd;
}

tr:last-child td {
  border-bottom: 0;
}

.server-layout {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 18px;
}

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

.server-item {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
}

.server-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.12);
}

.server-item strong {
  display: block;
  margin-bottom: 4px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.metric strong {
  display: block;
  margin-top: 4px;
  word-break: break-word;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kv-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.kv-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.kv-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list span,
.sensitive-value {
  display: inline-flex;
  max-width: 100%;
  min-height: 30px;
  align-items: center;
  border-radius: 8px;
  padding: 5px 9px;
  background: #edf1f6;
  color: var(--text);
  overflow-wrap: anywhere;
}

.sensitive-value {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  background: #fff3cf;
  color: #5f4300;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.tab {
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 12px;
  background: #edf1f6;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  color: #fff;
  background: var(--accent-2);
}

.output {
  overflow: auto;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101621;
  color: #dce6f5;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.raw-block {
  margin-top: 12px;
}

.raw-block summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 800;
}

.table-wrap.compact table {
  min-width: 560px;
}

.table-wrap.compact th,
.table-wrap.compact td {
  font-size: 0.84rem;
}

.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-2);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--muted);
}

.notice.warn {
  border-left-color: var(--warn);
}

.notice.danger {
  border-left-color: var(--danger);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  background: #202735;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 10;
}

.toast.error {
  background: var(--danger);
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 14px;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-footer {
    display: none;
  }

  .grid.two,
  .form-grid.two,
  .server-layout,
  .metric-grid,
  .summary-grid,
  .kv-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 18px;
  }

  .topbar,
  .detail-head,
  .panel-title,
  .server-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .login-card {
    padding: 20px;
  }

  .nav {
    grid-template-columns: 1fr;
  }

  .button-row .btn,
  .button-row select {
    width: 100%;
  }
}

/* Dark VPS-management shell */
:root {
  color-scheme: dark;
  --bg: #070d1b;
  --surface: #0d1526;
  --surface-2: #121e33;
  --text: #e7edf8;
  --muted: #7f8da7;
  --line: #202b42;
  --accent: #2f7dff;
  --accent-2: #3b82f6;
  --warn: #f59e0b;
  --danger: #f43f5e;
  --good: #10b981;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.32);
}

body {
  background: var(--bg);
}

.app-shell {
  grid-template-columns: 190px minmax(0, 1fr);
}

.sidebar {
  background: #0b1220;
  border-right: 1px solid var(--line);
}

.brand-mark {
  background: #4169ff;
  color: #fff;
}

.nav button.active,
.nav button:hover,
.logout-button:hover {
  background: rgba(47, 125, 255, 0.18);
  border-color: rgba(47, 125, 255, 0.28);
  color: #82b4ff;
}

.content {
  padding: 26px 42px;
  background: radial-gradient(circle at 52% 0%, rgba(47, 125, 255, 0.08), transparent 34%), var(--bg);
}

.panel,
.login-card,
.metric,
.kv-grid div,
.server-item,
.notice,
.empty {
  background: var(--surface);
  border-color: var(--line);
}

input,
select,
textarea {
  background: #0b1324;
  border-color: var(--line);
  color: var(--text);
}

.btn.secondary {
  background: #1b2940;
  color: #dbe7ff;
}

table {
  background: var(--surface);
}

th {
  background: #101a2c;
}

.server-item {
  color: var(--text);
}

.server-hero {
  padding-left: 0;
  padding-right: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.eyebrow {
  color: #8aa6d6;
}

.back-symbol {
  color: var(--muted);
  font-weight: 600;
}

.server-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.server-chips span,
.chip-list span {
  border-radius: 6px;
  background: #1b2940;
  color: #b5c4dc;
  padding: 3px 7px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tab {
  border-radius: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  font-weight: 800;
}

.tab.active {
  color: #7eb2ff;
  background: rgba(47, 125, 255, 0.16);
  border-color: rgba(47, 125, 255, 0.22);
}

.sensitive-value {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}

.install-panel {
  width: min(520px, 100%);
  margin: 26px auto 0;
  padding: 22px;
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: 8px;
  background: rgba(14, 19, 35, 0.92);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.06), var(--shadow);
}

.compact-center {
  max-width: 760px;
}

@media (max-width: 980px) {
  .app-shell,
  .server-layout,
  .metric-grid,
  .summary-grid,
  .kv-grid {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 18px;
  }
}
