:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1a1a1a; --muted: #6b7280;
  --brand: #ee4d2d; --brand-dark: #d73211; --ok: #16a34a; --warn: #d97706;
  --line: #e5e7eb; --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
}
a { color: var(--brand); }
.container { max-width: 640px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1000px; }
header.top {
  background: var(--brand); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
header.top .brand { font-weight: 800; font-size: 18px; }
header.top a, header.top button { color: #fff; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 12px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
h1 { font-size: 20px; margin: 6px 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, textarea, select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--ink);
}
button {
  cursor: pointer; border: 0; border-radius: 10px; padding: 11px 16px;
  font-size: 15px; font-weight: 600; background: #eef0f3; color: var(--ink);
}
button.primary { background: var(--brand); color: #fff; }
button.primary:hover { background: var(--brand-dark); }
button.ghost { background: transparent; border: 1px solid var(--line); }
button:disabled { opacity: .55; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.big { font-size: 26px; font-weight: 800; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.pending { background: #fef3c7; color: #92400e; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.cancel { background: #fee2e2; color: #991b1b; }
.pill.paid { background: #e0e7ff; color: #3730a3; }
.stat { display: flex; gap: 12px; flex-wrap: wrap; }
.stat .box { flex: 1; min-width: 130px; background: #fafafa; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.product { display: flex; gap: 12px; align-items: center; }
.product img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: #eee; }
.cashback-badge { background: #fff7ed; border: 1px dashed var(--brand); color: var(--brand); border-radius: 12px; padding: 12px; text-align: center; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.err { color: #b91c1c; font-size: 14px; margin: 8px 0; min-height: 18px; }
.ok-msg { color: var(--ok); font-size: 14px; margin: 8px 0; }
.tabs { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.tabs button { background: #eef0f3; }
.tabs button.active { background: var(--brand); color: #fff; }
.tips { margin-top: 12px; font-size: 13px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.tips ul { margin: 6px 0; padding-left: 18px; }
.notice { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 14px; margin: 12px 0 4px; }
label.check input { width: auto; margin-top: 3px; }
.qr-box { text-align: center; }
.qr-box img { width: 240px; height: 240px; image-rendering: pixelated; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 12px; z-index: 50; }
.modal { background: var(--card); border-radius: var(--radius); max-width: 860px; width: 100%; padding: 18px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: 14px; }
.kv div:nth-child(odd) { color: var(--muted); }
button.danger { background: #fee2e2; color: #991b1b; }
.hidden { display: none !important; }
.center { text-align: center; }
.small { font-size: 12px; }
.scroll { overflow-x: auto; }
