:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #dfe3ea;
  --text: #1f2933;
  --muted: #667085;
  --brand: #d83b2d;
  --brand-dark: #b92c21;
  --ok: #1f8a4c;
  --bad: #c62828;
  --wait: #9a6700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: #1f2933;
  color: #fff;
}

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

.topbar p {
  margin: 6px 0 0;
  color: #cbd5e1;
}

main {
  max-width: 1180px;
  margin: 24px auto;
  padding: 0 18px 32px;
}

.panel,
.listing {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-panel {
  max-width: 420px;
  padding: 22px;
}

.hidden {
  display: none;
}

label {
  display: block;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--text);
}

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

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

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

button.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

button.danger {
  background: var(--bad);
}

.message {
  color: var(--bad);
}

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

.stats div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

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

.stats span {
  color: var(--muted);
}

.toolbar {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

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

.listing {
  padding: 18px;
}

.listing-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.listing h3 {
  margin: 0;
  font-size: 18px;
}

.listing p {
  margin: 5px 0 0;
  color: var(--muted);
}

.status {
  align-self: flex-start;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.status.pending {
  color: var(--wait);
  background: #fff6d8;
}

.status.approved {
  color: var(--ok);
  background: #ddf7e8;
}

.status.rejected {
  color: var(--bad);
  background: #ffe1e1;
}

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

.edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 14px 0;
}

.edit-grid label {
  margin: 0;
}

.edit-grid input,
.edit-grid select {
  min-height: 40px;
}

.amount {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  color: var(--brand);
  font-weight: 700;
}

.item {
  min-width: 0;
}

.item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.item b {
  display: block;
  margin-top: 3px;
  word-break: break-word;
}

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

@media (max-width: 760px) {
  .stats,
  .toolbar,
  .grid,
  .edit-grid {
    grid-template-columns: 1fr;
  }

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