:root {
  color-scheme: light;
  --bg: #eef3f8;
  --sidebar: #111827;
  --sidebar-2: #1f2937;
  --panel: #ffffff;
  --ink: #182230;
  --muted: #667085;
  --line: #d7dde8;
  --soft: #f4f7fb;
  --brand: #007bfc;
  --brand-dark: #0068d7;
  --danger: #d92d20;
  --danger-dark: #b42318;
  --good: #067647;
  --warn: #b54708;
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: var(--sidebar);
  color: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand);
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #aeb8c7;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 8px;
  padding-top: 22px;
}

.nav-item {
  padding: 11px 12px;
  border-radius: 8px;
  color: #c9d4e4;
  font-size: 14px;
  font-weight: 700;
}

.nav-item.active {
  background: var(--sidebar-2);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--brand);
}

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

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.hidden {
  display: none;
}

.login-wrap {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
}

.login-card,
.panel-card,
.server-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(440px, 100%);
  padding: 28px;
}

form {
  display: grid;
  gap: 16px;
}

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

label {
  display: grid;
  gap: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input {
  padding: 12px 13px;
}

select {
  min-width: 130px;
  padding: 9px 30px 9px 10px;
}

input:focus,
select:focus {
  outline: 3px solid rgba(0, 123, 252, 0.14);
  border-color: var(--brand);
}

button {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--brand);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

button:hover {
  background: var(--brand-dark);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ghost {
  min-width: 88px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost:hover {
  background: var(--soft);
}

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

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

.account-chip,
.sort-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 11px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-chip span,
.sort-control span,
.muted {
  color: var(--muted);
}

.account-chip span,
.sort-control span {
  font-size: 13px;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.server-card {
  display: grid;
  gap: 18px;
  min-height: 240px;
  padding: 20px;
}

.server-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.server-card h2 {
  margin-bottom: 8px;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.server-card p {
  margin-bottom: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-active {
  background: #ecfdf3;
  color: var(--good);
}

.status-pending {
  background: #fffaeb;
  color: var(--warn);
}

.status-muted {
  background: #f2f4f7;
  color: var(--muted);
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meta-grid div {
  min-width: 0;
  padding: 12px;
  background: var(--soft);
  border: 1px solid #e8edf5;
  border-radius: 8px;
}

.meta-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.reboot-button {
  align-self: end;
  width: 100%;
  background: var(--danger);
}

.reboot-button:hover {
  background: var(--danger-dark);
}

.message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.message.error {
  color: var(--danger);
}

.admin-panel {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.panel-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkline input {
  width: auto;
}

.admin-user-list {
  display: grid;
  gap: 10px;
}

.admin-user {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--soft);
  border: 1px solid #e8edf5;
  border-radius: 8px;
}

.admin-user span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.danger-lite {
  background: #fff1f0;
  color: var(--danger);
  border: 1px solid #f4c7c3;
}

.danger-lite:hover {
  background: #ffe4e1;
}

.empty {
  grid-column: 1 / -1;
  padding: 32px;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  .brand {
    padding-bottom: 14px;
  }

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

  .nav-item {
    text-align: center;
  }

  .workspace {
    padding: 18px;
  }

  .section-head,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 14px;
  }

  .nav {
    display: none;
  }

  h1 {
    font-size: 25px;
  }

  .server-grid,
  .meta-grid,
  .admin-user {
    grid-template-columns: 1fr;
  }

  .ghost {
    width: 100%;
  }
}
