:root {
  --ink: #2f2926;
  --paper: #fff8e7;
  --cyan: #cfe7f4;
  --mint: #bfe8d2;
  --pink: #f7b5c8;
  --yellow: #ffe66d;
  --lilac: #c9c4ff;
  --red: #e85d5d;
  --muted: #746a64;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: ui-monospace, "Alibaba PuHuiTi", "PingFang SC", monospace;
  background:
    linear-gradient(rgba(207, 231, 244, .48) 1px, transparent 1px),
    linear-gradient(90deg, rgba(207, 231, 244, .48) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
}

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

button,
a {
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

button.secondary {
  background: var(--paper);
}

input,
select,
textarea {
  width: 100%;
  border: 1.2px solid var(--ink);
  border-radius: 8px;
  background: white;
  padding: 10px 11px;
  outline: none;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border-bottom: 1px solid rgba(47, 41, 38, .14);
  padding: 11px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 11px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 18px;
  background: rgba(255, 248, 231, .92);
  border-right: 1.5px solid var(--ink);
  backdrop-filter: blur(10px);
}

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

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--pink);
  font-weight: 900;
}

.brand small,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

nav {
  display: grid;
  gap: 10px;
}

.nav-item {
  width: 100%;
  background: white;
  text-align: left;
}

.nav-item.active {
  background: var(--cyan);
}

.server-card {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--mint);
  padding: 12px;
}

.main {
  margin-left: 260px;
  padding: 24px;
}

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

.topbar h1 {
  margin: 4px 0 0;
  font-size: 30px;
}

.actions {
  display: flex;
  gap: 10px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card,
.window {
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 2px 2px 0 rgba(47, 41, 38, .22);
}

.stat-card {
  padding: 16px;
}

.stat-card strong {
  display: block;
  font-size: 28px;
}

.window {
  overflow: hidden;
}

.window-title {
  border-bottom: 1.5px solid var(--ink);
  background: var(--cyan);
  padding: 10px 14px;
  font-weight: 900;
}

.window > .list,
.window > .form,
.window > .toggles,
.table-tools,
.table-wrap {
  padding: 14px;
}

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

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

.product-layout {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .85fr);
}

.table-tools,
.form-row,
.form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid rgba(47, 41, 38, .22);
  border-radius: 10px;
  background: rgba(255, 248, 231, .8);
  padding: 11px;
}

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

.item small {
  color: var(--muted);
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  padding: 7px 10px;
}

.danger {
  background: var(--red);
  color: white;
}

.toggles {
  display: grid;
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(47, 41, 38, .2);
  border-radius: 10px;
  padding: 12px;
}

.toggle-row input {
  width: auto;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: none;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--mint);
  padding: 12px 16px;
  font-weight: 900;
}

.toast.show {
  display: block;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: auto;
    border-right: 0;
    border-bottom: 1.5px solid var(--ink);
  }

  .server-card {
    position: static;
    margin-top: 14px;
  }

  .main {
    margin-left: 0;
  }

  .stats,
  .grid.two,
  .product-layout {
    grid-template-columns: 1fr;
  }

  .topbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }
}
