:root {
  --bg: #f3efe7;
  --ink: #231c16;
  --muted: #6f645a;
  --line: #e3d9cc;
  --card: #fffdf9;
  --accent: #e23b12;
  --accent-dark: #b42d0d;
  --side: #241c17;
  --side-text: #f6efe6;
  --ok: #1d6b45;
  --warn: #8a5a00;
  --bad: #9d2b24;
  --shadow: 0 12px 30px rgba(48, 32, 18, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-weight: 650; letter-spacing: 0; }
h1 { margin: 0; font-size: 26px; }
h2 { margin: 0; font-size: 16px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.shell { display: flex; min-height: 100vh; }
.side {
  width: 220px;
  flex: none;
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
}
.brand, .brand-light {
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.brand strong, .brand-light strong { display: block; font-size: 15px; }
.brand small, .brand-light small { color: #cbbbaa; }
.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-weight: 700;
}
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; }
.nav a {
  color: #f3e8dc;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 8px;
}
.nav a.active, .nav a:hover { background: rgba(255, 255, 255, 0.08); }
.nav a.active { box-shadow: inset 3px 0 0 var(--accent); }
.side-logout { margin-top: auto; }
.side-logout button {
  width: 100%;
  background: transparent;
  color: #d9cbbd;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}

.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.top p, .lead { margin: 6px 0 0; color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card-head, .actions, .filters, .pager, .top-meta { display: flex; gap: 10px; align-items: center; }
.card-head { justify-content: space-between; margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat span, .stat em { display: block; color: var(--muted); font-style: normal; }
.stat strong { display: block; margin: 6px 0 2px; font-size: 32px; font-variant-numeric: tabular-nums; }
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; }
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 860px; }
.table-wrap th, .table-wrap td { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 10px 8px; }
td { border-top: 1px solid var(--line); padding: 12px 10px; vertical-align: top; }
.money { font-variant-numeric: tabular-nums; }
.id, .err, .hint { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.err { color: var(--bad); }
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  background: #efe8df;
  color: var(--ink);
  white-space: nowrap;
}
.st-wait { background: #fff1d6; color: var(--warn); }
.st-paid { background: #e7f0ff; color: #1d4e89; }
.st-sent { background: #ece7ff; color: #5338a5; }
.st-recv { background: #e5f6f4; color: #0f6e68; }
.st-ok { background: #e5f6ea; color: var(--ok); }
.st-off, .st-unknown { background: #f0ebe6; color: #65594f; }
.tag { border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.tag-ok { background: #e5f6ea; color: var(--ok); }
.tag-warn { background: #fff1d6; color: var(--warn); }
.banner {
  background: #fff7e8;
  border: 1px solid #f0dfb8;
  color: #6d4e12;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.banner-ok { background: #eef8f1; border-color: #cfe6d6; color: var(--ok); }
.banner-bad { background: #fdeceb; border-color: #f0c8c4; color: var(--bad); }
.btn, button.btn, a.btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-primary, a.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn:disabled, .btn-disabled { opacity: 0.45; cursor: not-allowed; }
.filters { flex-wrap: wrap; align-items: end; }
.filters label, .auth-card label, .remark { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.grow { flex: 1; min-width: 180px; }
input, select {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
  font: inherit;
}
.remark { flex-direction: row; align-items: center; margin-top: 8px; }
.remark input { width: 180px; }
.shop-actions { min-width: 220px; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 88px 1fr 36px 72px; gap: 8px; align-items: center; margin: 8px 0; }
.track { height: 8px; background: #f3ebe3; border-radius: 99px; overflow: hidden; }
.track span { display: block; height: 100%; background: var(--accent); }
.plain { margin: 0; padding-left: 18px; }
.empty { color: var(--muted); margin: 8px 0; }
.pager { justify-content: flex-end; margin-top: 12px; color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 2px 0 0; }
.back { margin-top: 0; }
.raw summary { cursor: pointer; font-weight: 650; }
.raw pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f3ed;
  border-radius: 8px;
  padding: 12px;
  max-height: 360px;
  overflow: auto;
}
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-card h1 { font-size: 28px; }
.auth-card .btn { justify-content: center; }

.board-scroll { overflow-x: auto; padding-bottom: 6px; }
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
}
.lane {
  background: #ebe4da;
  border-radius: 14px;
  padding: 12px;
  min-height: 180px;
}
.lane h2 { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.lane h2 span { color: var(--muted); font-size: 13px; font-weight: 500; }
.store-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}
.store-title { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.store-title a { font-weight: 650; }
.store-meta { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.move { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btn-tiny { padding: 3px 8px; font-size: 12px; }
.store-card details { margin-top: 8px; }
.store-card summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.store-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.store-edit .btn { align-self: flex-start; }

@media (max-width: 900px) {
  .shell { display: block; }
  .side { width: auto; }
  .nav { flex-direction: row; margin-top: 16px; }
  .side-logout { margin-top: 16px; }
  .stats, .split, .facts { grid-template-columns: 1fr; }
  .main { padding: 18px 14px 32px; }
  .bars li { grid-template-columns: 76px 1fr 28px; }
  .bars em { display: none; }
}
