:root {
  --green: #2c6239;
  --green-soft: #e8efe6;
  --cream: #f8f5eb;
  --clay: #b4512c;
  --ink: #23261f;
  --muted: #7a7f72;
  --line: #e3e0d4;
  --card: #fffdf7;
  --danger: #b3352b;
  --warn: #a8721c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.serif { font-family: Georgia, "Songti SC", "SimSun", serif; letter-spacing: .5px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: var(--green); color: #f6f2e4;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 38px; height: 38px; border-radius: 10px; background: #f6f2e4; color: var(--green);
  display: grid; place-items: center; font-size: 20px; font-family: Georgia, serif;
}
.brand-name { font-size: 17px; }
.brand-sub { font-size: 12px; opacity: .75; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.badge {
  padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.16);
  font-size: 12px; letter-spacing: .3px;
}
.link { color: #f6f2e4; font-size: 13px; text-decoration: none; opacity: .85; }
.link:hover { opacity: 1; text-decoration: underline; }

.wrap { max-width: 1080px; margin: 22px auto 60px; padding: 0 18px; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 16px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.panel-tools { display: flex; gap: 8px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-val { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }

.row { display: flex; gap: 10px; margin-top: 12px; }
input[type="password"] {
  flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 14px; outline: none;
}
input[type="password"]:focus { border-color: var(--green); }

button {
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--green);
  background: var(--green); color: #fff; font-size: 13px; cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--green); }
button.warn { background: transparent; border-color: var(--warn); color: var(--warn); }
button.small-btn { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; }

.err { color: var(--danger); font-size: 13px; min-height: 18px; }
.hint { font-size: 12px; color: var(--warn); min-height: 18px; margin: 4px 0 8px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
tbody tr:hover { background: #fbf8ee; }
td.num { font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); text-align: center; padding: 18px 0; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.pill.created { background: #f3efe0; color: #8a7a45; }
.pill.paid { background: var(--green-soft); color: var(--green); }
.pill.refunded { background: #f7e8e4; color: var(--danger); }
.pill.failed { background: #f2f2ee; color: var(--muted); }
.pill.closed { background: #f2f2ee; color: var(--muted); }

.logs { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.logs li {
  display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line);
  font-size: 12.5px; align-items: baseline;
}
.logs .t { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 118px; }
.logs .type { min-width: 96px; font-weight: 600; }
.logs .type.ok { color: var(--green); }
.logs .type.no { color: var(--danger); }
.logs .note { color: var(--ink); }

.ordered { margin: 8px 0 10px; padding-left: 20px; }
.ordered li { margin-bottom: 6px; }
code {
  background: #f1eee2; padding: 1px 5px; border-radius: 5px;
  font-family: Consolas, "Courier New", monospace; font-size: 12px;
}
.note { background: #fbf9f0; }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-direction: column; gap: 10px; align-items: flex-start; }
}
