:root {
  --ink: #111111;
  --muted: #666666;
  --line: #e5e5e5;
  --paper: #ffffff;
  --soft: #f5f5f3;
  --accent: #111111;
  --success: #147d42;
  --danger: #b42318;
  --warning: #8a5a00;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--soft); }
a { color: inherit; }
button, input, select { font: inherit; }
.brand-mark { font-weight: 900; letter-spacing: .12em; font-size: 14px; }
.eyebrow { margin: 0 0 8px; font-size: 11px; letter-spacing: .16em; font-weight: 800; color: var(--muted); }
.muted { color: var(--muted); }
.checkout-page, .admin-login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #efefec, #ffffff); }
.payment-card, .login-card { width: min(440px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 34px; box-shadow: 0 20px 60px rgba(0,0,0,.08); text-align: center; }
.payment-card h1, .login-card h1 { margin: 14px 0 8px; }
.price { font-size: 42px; font-weight: 900; margin: 20px 0; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 10px; padding: 0 18px; text-decoration: none; font-weight: 800; cursor: pointer; }
.primary-button { width: 100%; border: 1px solid var(--ink); background: var(--ink); color: white; }
.secondary-button { border: 1px solid var(--ink); background: white; color: var(--ink); }
.method-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.method-row span { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; }
.status-icon { width: 74px; height: 74px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: 38px; font-weight: 900; }
.status-icon.success { background: var(--success); }
.status-icon.failed { background: var(--danger); }
.result-message { font-size: 18px; }
.receipt-box { margin-top: 24px; border-top: 1px solid var(--line); }
.receipt-box div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); text-align: left; }
.receipt-box span { color: var(--muted); }
.stack-form { display: grid; gap: 16px; text-align: left; margin-top: 24px; }
.stack-form label, .filter-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
input, select { width: 100%; border: 1px solid #cfcfcf; border-radius: 9px; min-height: 44px; padding: 0 12px; background: white; }
.alert { padding: 12px; border-radius: 8px; margin-top: 16px; }
.alert.error { background: #fff0ef; color: var(--danger); }
.admin-page { min-height: 100vh; }
.admin-header { min-height: 68px; padding: 0 32px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 5; }
.admin-header > div { display: flex; gap: 12px; align-items: baseline; }
.admin-header > div span { color: var(--muted); font-size: 13px; }
.admin-header nav { display: flex; align-items: center; gap: 18px; }
.admin-header a, .link-button { border: 0; background: none; text-decoration: none; color: var(--muted); cursor: pointer; padding: 0; }
.admin-header a:hover, .link-button:hover { color: var(--ink); }
.admin-header form { margin: 0; }
.admin-main { width: min(1180px, calc(100% - 36px)); margin: 34px auto 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 34px; }
.mode-badge { border: 1px solid var(--line); background: white; border-radius: 999px; padding: 8px 12px; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card, .panel { background: white; border: 1px solid var(--line); border-radius: 16px; }
.stat-card { padding: 22px; display: grid; gap: 8px; }
.stat-card span, .stat-card small { color: var(--muted); }
.stat-card strong { font-size: 34px; }
.warning-card { border-color: #e7b953; background: #fffaf0; }
.two-column { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 16px; }
.panel { padding: 22px; }
.panel h2 { margin: 0 0 8px; font-size: 20px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-title a { color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.empty { text-align: center; color: var(--muted); padding: 34px; }
.status-pill { display: inline-block; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 900; }
.status-pill.captured { background: #e7f6ec; color: var(--success); }
.status-pill.pending, .status-pill.initiated { background: #fff5db; color: var(--warning); }
.status-pill.failed, .status-pill.declined, .status-pill.abandoned { background: #fdebea; color: var(--danger); }
.compact-form { max-width: 360px; }
.export-panel { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 16px; }
.small-button { width: auto; min-width: 110px; }
.report-buttons { margin-bottom: 12px; justify-content: flex-end; }
.mono { font-family: Consolas, monospace; font-size: 11px; }
.qr-panel { display: grid; grid-template-columns: minmax(300px, 480px) 1fr; gap: 34px; align-items: center; }
.qr-print-card { text-align: center; border: 2px solid var(--ink); padding: 28px; background: white; }
.qr-print-card h2 { font-size: 28px; }
.qr-print-card img { width: min(340px, 100%); }
.qr-price { font-size: 40px; font-weight: 900; margin-top: 6px; }
.qr-actions { display: grid; gap: 14px; }
.qr-actions code { display: block; background: var(--soft); padding: 14px; border-radius: 8px; overflow-wrap: anywhere; }
@media (max-width: 850px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .two-column, .qr-panel { grid-template-columns: 1fr; }
  .admin-header { align-items: flex-start; padding: 18px; flex-direction: column; }
  .admin-header nav { flex-wrap: wrap; }
  .filter-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .stats-grid, .filter-form { grid-template-columns: 1fr; }
  .export-panel { align-items: stretch; flex-direction: column; }
  .button-row { flex-direction: column; }
  .secondary-button { width: 100%; }
  .payment-card, .login-card { padding: 26px 20px; }
  .price { font-size: 36px; }
}
@media print {
  .admin-header, .page-heading, .qr-actions { display: none !important; }
  body, .admin-page, .admin-main, .panel { background: white; border: 0; margin: 0; padding: 0; }
  .qr-panel { display: block; }
  .qr-print-card { width: 150mm; margin: 10mm auto; }
}
