:root {
  --bg: #F8F8F8;
  --primary: #B91C24;
  --primary-dark: #9B1521;
  --primary-soft: #FFF1F2;
  --primary-border: #FECDD3;
  --dark: #111111;
  --border: #E5E7EB;
  --success: #16A34A;
  --success-soft: #F0FDF4;
  --success-border: #BBF7D0;
  --error: #EF4444;
  --error-soft: #FEF2F2;
  --error-border: #FECACA;
  --text: #1F2937;
  --muted: #6B7280;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(17,17,17,.07), 0 1px 2px rgba(17,17,17,.05);
  --shadow-md: 0 4px 16px rgba(17,17,17,.07), 0 2px 6px rgba(17,17,17,.04);
  --shadow-lg: 0 20px 60px rgba(17,17,17,.10), 0 8px 20px rgba(17,17,17,.06);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* =====================
   LAYOUT
   ===================== */

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

/* =====================
   TOPBAR
   ===================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-box {
  width: 100px;
  height: 68px;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
  padding: 6px;
}

/* Logo ratio is 1.275 (1701×1334). Fix height; width resolves to ~74px. */
.logo-box img { height: 58px; width: auto; display: block; }

.brand-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22,163,74,.2);
  flex: 0 0 auto;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, color .15s, box-shadow .15s;
}

.btn-logout:hover {
  border-color: #D1D5DB;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* =====================
   HERO
   ===================== */

.hero {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 32px;
  align-items: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(185,28,36,.05) 0%, transparent 70%);
  pointer-events: none;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(26px, 3.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--dark);
}

.hero h1 span { color: var(--primary); }

.hero p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  max-width: 560px;
}

.hero-art {
  min-height: 200px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--dark) 0%, #7F1D1D 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.hero-art::before {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(185,28,36,.35);
  top: -40px;
  right: -40px;
}

.hero-card {
  width: 78%;
  background: rgba(255,255,255,.97);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  position: relative;
  z-index: 2;
}

.hero-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hero-card-title { font-weight: 700; font-size: 14px; color: var(--dark); }
.card-chip {
  background: var(--success-soft);
  color: var(--success);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--success-border);
}

.card-line { height: 10px; background: var(--bg); border-radius: 999px; margin: 10px 0; }
.card-line.wide { width: 82%; }
.card-line.small { width: 50%; background: var(--primary-soft); }

/* =====================
   CONTENT GRID
   ===================== */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

/* =====================
   PANEL
   ===================== */

.panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--primary-border);
}

.panel-head h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.panel-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 3px;
}

/* =====================
   FORM
   ===================== */

.form-area { padding: 28px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}

.field.full { grid-column: 1 / -1; }

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark);
}

.hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 0 13px;
  transition: border-color .18s, box-shadow .18s;
}

.input-wrap svg { color: #9CA3AF; flex: 0 0 auto; }

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(185,28,36,.10);
}

input, textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 13px 0;
  min-width: 0;
}

select {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  padding: 13px 0 13px 12px;
  min-width: 0;
  border-left: 1.5px solid var(--border);
  flex: 0 0 auto;
  width: auto;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
  padding-top: 13px;
}

input::placeholder,
textarea::placeholder { color: #9CA3AF; }

.help-text {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* =====================
   BUTTONS
   ===================== */

.actions { margin-top: 22px; display: grid; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-md);
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  min-height: 48px;
  transition: transform .15s, box-shadow .15s, background .15s, opacity .15s;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(185,28,36,.28);
}

.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 20px rgba(185,28,36,.36); }

.btn-direct-pay {
  background: var(--dark);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(17,17,17,.22);
}

.btn-direct-pay:hover { background: #2A2A2A; box-shadow: 0 6px 20px rgba(17,17,17,.28); }


.btn-full { width: 100%; }

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, background .15s, box-shadow .15s;
  white-space: nowrap;
  flex: 0 0 auto;
  min-height: 40px;
}

.btn-copy:hover { border-color: #D1D5DB; background: var(--bg); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
  white-space: nowrap;
  flex: 1 1 0;
  min-height: 44px;
}

.btn-ghost:hover { border-color: #D1D5DB; background: var(--bg); transform: translateY(-1px); }

.btn-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(185,28,36,.28);
  transition: background .15s, box-shadow .15s, transform .15s;
  white-space: nowrap;
  flex: 1 1 0;
  min-height: 44px;
}

.btn-preview:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  flex: 0 0 auto;
}
.spinner.hidden { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================
   ALERT
   ===================== */

.alert {
  display: none;
  margin-top: 16px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
}

.alert.show { display: block; }
.alert.error { background: var(--error-soft); color: #B91C1C; border: 1px solid var(--error-border); }
.alert.success { background: var(--success-soft); color: #14532D; border: 1px solid var(--success-border); }


/* =====================
   DIRECT CARD PAYMENT
   ===================== */

.direct-payment-card {
  display: none;
  margin-top: 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.direct-payment-card.show { display: block; }

.direct-payment-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.direct-payment-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--primary-border);
}

.direct-payment-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.direct-payment-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.5;
}

.payment-element {
  margin-top: 10px;
  margin-bottom: 14px;
}

.save-card-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.save-card-note input {
  width: auto;
  margin-top: 3px;
  accent-color: var(--primary);
}

/* =====================
   RESULT CARD
   ===================== */

.result-card {
  display: none;
  margin-top: 20px;
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--success-soft), #F7FFF9);
  padding: 20px;
}

.result-card.show { display: block; }

.result-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.result-check {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--success);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(22,163,74,.3);
}

.result-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #14532D;
  line-height: 1.2;
}

.result-card-sub {
  font-size: 13px;
  color: #166534;
  margin-top: 3px;
}

.result-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.result-link-input {
  flex: 1 1 180px;
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--white);
  color: var(--text);
  font-size: 13px;
  min-width: 0;
  outline: none;
}

.result-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* =====================
   SIDEBAR
   ===================== */

.side-stack { display: grid; gap: 18px; }

.info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.info-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  border: 1px solid var(--primary-border);
}

.info-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.info-card p, .info-card-desc {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.check-list {
  list-style: none;
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text);
}

.check-list span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--success-border);
}

.recent-list { margin-top: 14px; display: grid; gap: 10px; max-height: 340px; overflow: auto; }
.recent-empty { font-size: 13px; color: #9CA3AF; font-style: italic; margin-top: 4px; }
.recent-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--bg); }
.recent-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--dark); }
.recent-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }

.status-badge { border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.status-badge.created { background: #F3F4F6; color: #4B5563; }
.status-badge.paid { background: var(--success-soft); color: #14532D; border: 1px solid var(--success-border); }
.status-badge.failed { background: var(--error-soft); color: #B91C1C; border: 1px solid var(--error-border); }
.status-badge.expired { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.status-badge.processing,
.status-badge.requires_payment_method,
.status-badge.requires_action { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }

/* =====================
   FOOTER
   ===================== */

.footer {
  text-align: center;
  color: #9CA3AF;
  font-size: 13px;
  margin-top: 28px;
}

.footer strong { color: var(--primary); font-weight: 600; }

/* =====================
   LOGIN PAGE
   ===================== */

.login-body {
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.login-card {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 32px 80px rgba(0,0,0,.45);
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

/* Logo ratio 1.275 → at 80px height width resolves to ~102px, fits login card well */
.login-logo-img {
  height: 80px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.login-header { text-align: center; margin-bottom: 28px; }

.login-lock {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.login-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.login-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
}

.login-form { display: grid; gap: 16px; }

.login-form .field { display: grid; gap: 7px; }
.login-form label { font-size: 13.5px; font-weight: 600; color: var(--dark); }

.login-footer {
  font-size: 12px;
  color: rgba(255,255,255,.3);
  text-align: center;
}

/* =====================
   STATUS PAGES (success / cancel)
   ===================== */

.status-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg);
}

.status-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 460px;
}

.status-card {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.success-card { border: 1.5px solid var(--success-border); }
.cancel-card { border: 1.5px solid var(--error-border); }

.status-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-icon { background: var(--success); color: var(--white); box-shadow: 0 8px 24px rgba(22,163,74,.3); }
.cancel-icon { background: var(--error-soft); color: var(--error); border: 1.5px solid var(--error-border); }

.status-card h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.status-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: 20px;
}

.status-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
}

.status-footer {
  font-size: 13px;
  color: #9CA3AF;
}

.status-footer strong { color: var(--primary); font-weight: 600; }

/* =====================
   RESPONSIVE
   ===================== */

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .page-shell { width: calc(100% - 28px); padding-top: 20px; }
  .topbar { gap: 12px; }
  .status-pill { display: none; }
  .hero { padding: 26px; }
  .panel-head { padding: 20px 22px; }
  .form-area { padding: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .result-link-row { flex-direction: column; }
  .result-link-input { width: 100%; }
  .btn-copy { width: 100%; justify-content: center; }
  .result-action-row { grid-template-columns: 1fr; }
  .login-card { padding: 28px 24px; }
  .status-card { padding: 30px 24px; }
  .side-stack { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .brand-title { font-size: 15px; }
  .hero h1 { font-size: 26px; }
}

/* ============================================
   PUBLIC PAYMENT PAGE
   ============================================ */
.payment-page-body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.payment-page-shell {
  width: 100%;
  max-width: 620px;
}

.payment-page-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 34px;
}

.payment-page-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.payment-page-brand img {
  display: block;
  max-width: 190px;
  max-height: 62px;
  object-fit: contain;
}

.payment-page-loading {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 600;
}

.payment-page-heading {
  text-align: center;
  margin-bottom: 22px;
}

.payment-page-kicker {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.payment-page-heading h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.payment-page-heading > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.payment-page-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
}

.payment-page-total span {
  color: var(--muted);
  font-weight: 600;
}

.payment-page-total strong {
  font-size: 20px;
}

.public-payment-element {
  margin-bottom: 18px;
}

.payment-page-security {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 600px) {
  .payment-page-card {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .payment-page-heading h1 {
    font-size: 24px;
  }
}


/* =====================
   ADMIN TABS + PAYMENTS
   ===================== */
.admin-tabs { display:flex; align-items:center; gap:8px; margin:0 0 20px; padding:6px; width:max-content; max-width:100%; background:var(--white); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow-sm); }
.admin-tab { display:inline-flex; align-items:center; gap:8px; min-height:42px; padding:9px 15px; border-radius:10px; color:var(--muted); font-size:13.5px; font-weight:700; transition:.15s ease; }
.admin-tab:hover { background:var(--bg); color:var(--dark); }
.admin-tab.active { background:var(--dark); color:var(--white); box-shadow:0 4px 12px rgba(17,17,17,.16); }
.tab-count { min-width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; padding:0 6px; border-radius:999px; background:rgba(255,255,255,.14); font-size:11px; }
.admin-tab:not(.active) .tab-count { background:var(--primary-soft); color:var(--primary); }
.admin-view { display:none; }
.admin-view.active { display:block; }

.payments-panel { background:var(--white); border:1px solid var(--border); border-radius:var(--radius-xl); box-shadow:var(--shadow-md); overflow:hidden; }
.payments-head { padding:28px; display:flex; align-items:flex-start; justify-content:space-between; gap:20px; border-bottom:1px solid var(--border); }
.payments-head .kicker { margin-bottom:10px; }
.payments-head h2 { font-size:28px; line-height:1.15; color:var(--dark); letter-spacing:-.035em; }
.payments-head p { margin-top:7px; color:var(--muted); font-size:14px; }
.payments-refresh { flex:0 0 auto; max-width:160px; }
.payment-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; padding:20px 28px 0; }
.stat-card { padding:16px 18px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--bg); }
.stat-card span { display:block; color:var(--muted); font-size:12px; font-weight:600; }
.stat-card strong { display:block; margin-top:4px; color:var(--dark); font-size:24px; line-height:1; }
.payments-toolbar { display:flex; gap:12px; align-items:center; padding:20px 28px; }
.payments-search-wrap { flex:1; display:flex; align-items:center; gap:9px; border:1.5px solid var(--border); border-radius:var(--radius-md); padding:0 13px; background:var(--white); }
.payments-search-wrap:focus-within { border-color:var(--primary); box-shadow:0 0 0 3px rgba(185,28,36,.08); }
.payments-search-wrap svg { color:#9CA3AF; flex:0 0 auto; }
.payments-search-wrap input { padding:11px 0; }
.payments-filter { min-width:180px; border:1.5px solid var(--border); border-radius:var(--radius-md); padding:11px 36px 11px 13px; background:var(--white); }
.payments-table-wrap { width:100%; overflow:auto; border-top:1px solid var(--border); }
.payments-table { width:100%; min-width:1020px; border-collapse:collapse; }
.payments-table th { padding:12px 16px; background:#FAFAFA; color:#6B7280; font-size:11px; text-transform:uppercase; letter-spacing:.045em; font-weight:700; text-align:left; white-space:nowrap; border-bottom:1px solid var(--border); }
.payments-table td { padding:15px 16px; color:var(--text); font-size:13px; vertical-align:middle; border-bottom:1px solid var(--border); }
.payments-table tbody tr:hover { background:#FCFCFC; }
.payment-person strong { display:block; color:var(--dark); font-size:13.5px; }
.payment-person small { display:block; max-width:230px; margin-top:3px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.payment-email, .payment-date { color:var(--muted); white-space:nowrap; }
.card-summary { display:grid; grid-template-columns:auto auto; column-gap:7px; align-items:center; white-space:nowrap; }
.card-summary strong { font-size:11px; color:var(--dark); }
.card-summary span { font-size:12px; color:var(--text); }
.card-summary small { grid-column:1 / -1; color:var(--muted); font-size:10px; margin-top:1px; }
.muted-dash { color:#9CA3AF; }
.payment-mode-chip { display:inline-flex; padding:4px 8px; border-radius:999px; background:#F3F4F6; color:#4B5563; font-size:11px; font-weight:600; white-space:nowrap; }
.payments-empty { text-align:center !important; padding:32px !important; color:var(--muted) !important; }
.error-text { color:#B91C1C !important; }
.payments-footnote { padding:14px 28px 20px; color:var(--muted); font-size:11.5px; line-height:1.55; }
.status-badge.canceled { background:var(--error-soft); color:#B91C1C; border:1px solid var(--error-border); }
.status-badge.requires_confirmation { background:#FFF7ED; color:#9A3412; border:1px solid #FED7AA; }
.status-badge.refunded { background:#F3E8FF; color:#6B21A8; border:1px solid #E9D5FF; }
.status-badge.partially_refunded { background:#F3E8FF; color:#6B21A8; border:1px solid #E9D5FF; }

.payment-row { cursor:pointer; }
.payment-row:hover { background:var(--primary-soft) !important; }
.payment-row:focus-visible { outline:2px solid var(--primary); outline-offset:-2px; }

/* =====================
   PAYMENT DETAIL MODAL
   ===================== */

.modal-backdrop {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(17,17,17,.55);
  z-index:100;
  align-items:flex-start;
  justify-content:center;
  padding:40px 16px;
  overflow-y:auto;
}

.modal-backdrop.show { display:flex; }

.modal-card {
  width:100%;
  max-width:560px;
  background:var(--white);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}

.modal-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:20px 24px;
  border-bottom:1px solid var(--border);
}

.modal-head h3 { font-size:17px; font-weight:700; color:var(--dark); }

.modal-close {
  width:32px;
  height:32px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  transition:background .15s, color .15s;
}

.modal-close:hover { background:var(--bg); color:var(--dark); }

.modal-body { padding:24px; max-height:76vh; overflow-y:auto; }

.modal-section { margin-bottom:22px; }
.modal-section:last-child { margin-bottom:0; }
.modal-section h4 { font-size:13.5px; font-weight:700; color:var(--dark); margin-bottom:12px; }

.modal-detail-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px 16px;
}

.modal-detail-grid .span-2 { grid-column:1 / -1; }
.modal-detail-grid span { display:block; font-size:11.5px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-bottom:3px; }
.modal-detail-grid strong { font-size:14px; font-weight:600; color:var(--text); word-break:break-word; }

.modal-form-row {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-bottom:12px;
}

.modal-form-row .field { display:grid; gap:6px; }
.modal-form-row label { font-size:12.5px; font-weight:600; color:var(--dark); }
.modal-form-row input {
  border:1.5px solid var(--border);
  border-radius:var(--radius-sm);
  padding:10px 12px;
  outline:none;
  transition:border-color .15s, box-shadow .15s;
}
.modal-form-row input:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(185,28,36,.10); }

.modal-refund-btn { color:var(--primary); border-color:var(--primary-border); }
.modal-refund-btn:hover { background:var(--primary-soft); }

.modal-related-list { display:grid; gap:8px; }
.modal-related-item {
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--bg);
  font-size:12.5px;
  color:var(--text);
}

@media (max-width:600px) {
  .modal-detail-grid { grid-template-columns:1fr; }
  .modal-form-row { grid-template-columns:1fr; }
  .modal-body { padding:20px; }
}

@media (max-width: 760px) {
  .admin-tabs { width:100%; }
  .admin-tab { flex:1; justify-content:center; padding:9px 10px; }
  .payments-head { padding:22px 18px; flex-direction:column; }
  .payments-refresh { width:100%; max-width:none; }
  .payment-stats { grid-template-columns:1fr 1fr; padding:16px 18px 0; }
  .payments-toolbar { padding:16px 18px; flex-direction:column; align-items:stretch; }
  .payments-filter { width:100%; }
  .payments-footnote { padding:12px 18px 18px; }
}
