:root {
  --brand: #0f766e; --brand-dark: #115e59; --accent: #f97316;
  --ink: #17212b; --muted: #667085; --line: #e4e7ec; --surface: #fff;
  --background: #f4f7f6; --success: #16a34a; --danger: #dc2626; --warning: #d97706;
  --shadow: 0 12px 32px rgba(15, 76, 70, .09); --radius: 20px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--background); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.shell { max-width: 1320px; margin: auto; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: #fff; font-weight: 900; background: linear-gradient(140deg, var(--brand), #14b8a6); box-shadow: var(--shadow); }
.brand h1 { font-size: 20px; margin: 0; }
.brand p, .subtle { color: var(--muted); font-size: 13px; margin: 3px 0 0; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); border-radius: 12px; padding: 10px 15px; color: var(--ink); background: #fff; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); border-color: #b7c2c0; }
.btn.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn.accent { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.small { padding: 7px 10px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.card { background: var(--surface); border: 1px solid rgba(228, 231, 236, .8); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 5px 9px; font-size: 12px; background: #edf2f2; color: #48605e; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.online, .badge.succeeded { color: var(--success); background: #ecfdf3; }
.badge.offline, .badge.failed, .badge.refunded { color: var(--danger); background: #fff1f2; }
.badge.queued, .badge.dispensing, .badge.created, .badge.paid { color: var(--warning); background: #fff7ed; }
.badge.partially_refunded { color: #7c3aed; background: #f5f3ff; }
.metric { padding: 18px; }
.metric strong { display: block; font-size: 28px; margin-top: 7px; }
.metric span { color: var(--muted); font-size: 13px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 14px; }
.section-title h2 { font-size: 18px; margin: 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; background: #fafbfb; }
tr:last-child td { border-bottom: 0; }
.field { display: grid; gap: 6px; margin-bottom: 13px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; background: #fff; color: var(--ink); outline: none; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #5eead4; box-shadow: 0 0 0 3px #ccfbf1; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(15, 23, 42, .5); backdrop-filter: blur(5px); }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .22); }
.modal h3 { margin: 0 0 18px; }
.toast { position: fixed; z-index: 100; top: 24px; left: 50%; transform: translateX(-50%); border-radius: 12px; color: #fff; background: #17212b; padding: 11px 18px; box-shadow: var(--shadow); font-size: 13px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 20%, #ccfbf1, transparent 38%), radial-gradient(circle at 85% 15%, #ffedd5, transparent 32%), var(--background); }
.login-card { width: min(430px, 100%); padding: 32px; }
.login-card .brand { margin-bottom: 24px; }
.empty { color: var(--muted); text-align: center; padding: 40px; }
@media (max-width: 800px) {
  .shell { padding: 15px; } .topbar { align-items: flex-start; } .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .desktop-only { display: none !important; } .topbar .brand p { display: none; }
}
