* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f3ed;
  --surface: #ffffff;
  --surface-2: #f7f6f1;
  --ink: #14160f;
  --dim: #70756a;
  --line: #e4e1d8;
  --green: #10a95e;
  --green-soft: #e4f6ec;
  --blue: #2e73d8;
  --blue-soft: #e5eefb;
  --orange: #c9821b;
  --orange-soft: #fbf0dc;
  --red: #d8412f;
  --red-soft: #fbe6e2;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
  border: 0;
}

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

.aside {
  max-height: 100vh;
  overflow-y: auto;
  background: #11140f;
  color: #fff;
  padding: 20px 12px;
}

.brand {
  padding: 6px 10px 18px;
}

.brand strong {
  display: block;
  font-size: 19px;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: #aeb5a6;
  font-size: 12px;
  font-weight: 800;
}

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

.nav button {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: transparent;
  color: #aeb5a6;
  text-align: left;
  font-weight: 850;
}

.nav button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.main {
  min-width: 0;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar strong {
  font-size: 18px;
}

.topbar span {
  color: var(--dim);
  font-size: 13px;
  font-weight: 800;
}

.content {
  padding: 24px;
}

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

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

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

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

.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.panel {
  padding: 16px;
}

.metric {
  padding: 15px;
}

.metric span {
  display: block;
  color: var(--dim);
  font-size: 12px;
  font-weight: 850;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
}

.section h2 {
  margin: 0;
  font-size: 20px;
}

.table {
  overflow: hidden;
}

.row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1fr 0.9fr 0.9fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  font-weight: 760;
}

.row:first-child {
  border-top: 0;
}

.head {
  color: var(--dim);
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 900;
}

.status {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.ok {
  color: #0a6e3d;
  background: var(--green-soft);
}

.warn {
  color: var(--orange);
  background: var(--orange-soft);
}

.bad {
  color: var(--red);
  background: var(--red-soft);
}

.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

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

.btn {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 900;
}

.btn.primary {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.btn.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f2c1ba;
}

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

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.item strong {
  display: block;
  font-size: 14px;
}

.item span {
  display: block;
  margin-top: 5px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 750;
}

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

.field label {
  color: var(--dim);
  font-size: 12px;
  font-weight: 900;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  outline: 0;
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field textarea.pool-editor {
  min-height: 220px;
  line-height: 1.55;
}

.field small {
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.checkline {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  padding: 9px 11px;
}

.checkline input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.hint {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
  padding: 11px;
}

.audit {
  color: var(--dim);
  font-size: 12px;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  padding: 13px 16px;
  border-radius: 14px;
  background: #11140f;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 40px rgba(20, 22, 15, 0.22);
}

.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
}

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

  .aside {
    display: block;
  }

  .nav {
    display: flex;
    overflow-x: auto;
  }

  .nav button {
    white-space: nowrap;
  }

  .grid.four,
  .grid.three,
  .grid.two {
    grid-template-columns: 1fr;
  }

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