:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-subtle: #f8faf9;
  --border: #dfe7e4;
  --border-strong: #c5d3ce;
  --text: #0f1f1a;
  --text-muted: #52655e;
  --text-soft: #748880;
  --brand: #0c6b58;
  --brand-hover: #095445;
  --brand-soft: #e6f4f0;
  --brand-border: #b5dfd3;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --amber-border: #fde68a;
  --green: #047857;
  --green-bg: #d1fae5;
  --green-border: #a7f3d0;
  --red: #b91c1c;
  --red-bg: #fee2e2;
  --red-border: #fecaca;
  --slate-bg: #f1f5f9;
  --slate-text: #475569;
  --indigo-bg: #e0e7ff;
  --indigo-text: #3730a3;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 12px 32px -10px rgba(12, 38, 30, 0.08), 0 2px 6px rgba(12, 38, 30, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(12, 107, 88, 0.08), transparent 52%),
    var(--bg);
  line-height: 1.5;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Public Shell */
.public-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #0c6b58 0%, #074438 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(12, 107, 88, 0.24);
  flex-shrink: 0;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 20px;
}

@media (min-width: 540px) {
  .public-shell {
    padding: 34px 20px 64px;
  }
  .card {
    padding: 28px 26px;
  }
}

.page-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Mode B Locked Request Summary Box */
.locked-box {
  background: linear-gradient(180deg, #f3faf8 0%, #ebf5f2 100%);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand);
  margin-bottom: 8px;
}

.locked-amount {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 6px;
}

.locked-reason {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--brand-border);
  font-size: 12.5px;
}

.meta-item span {
  display: block;
  color: var(--text-muted);
  font-size: 11.5px;
}

.meta-item strong {
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

/* Form Elements */
.field {
  margin-bottom: 16px;
}

.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.field label .opt {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-soft);
}

.amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.amount-input {
  width: 100%;
  height: 56px;
  padding: 12px 92px 12px 16px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.amount-input:focus {
  background: #ffffff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12, 107, 88, 0.14);
}

.currency-pill {
  position: absolute;
  right: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid var(--brand-border);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  pointer-events: none;
}

.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.chip-btn {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.chip-btn:hover, .chip-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.textarea {
  min-height: 76px;
  resize: vertical;
}

.input:focus, .select:focus, .textarea:focus {
  background: #ffffff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12, 107, 88, 0.12);
}

.methods-panel {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  margin-top: 8px;
}

.methods-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.method-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.method-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 9px;
  border-radius: 6px;
}

.method-tag.crypto {
  background: #f8fafc;
  color: #334155;
}

.helper-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Alerts & Banners */
.alert {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-error {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red);
}

.alert-warn {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber);
}

.alert-success {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green);
}

/* Primary & Secondary Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background-color 0.15s, transform 0.08s, opacity 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  width: 100%;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(12, 107, 88, 0.22);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-hover);
}

.btn-secondary {
  background: var(--surface-subtle);
  color: var(--text);
  border: 1px solid var(--border-strong);
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 14px;
}

.btn-secondary:hover:not(:disabled) {
  background: #edf2f0;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 8px;
}

.security-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-paid {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.status-pending {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.status-failed {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.status-cancelled, .status-expired {
  background: var(--slate-bg);
  color: var(--slate-text);
  border: 1px solid #cbd5e1;
}

.status-refunded {
  background: var(--indigo-bg);
  color: var(--indigo-text);
  border: 1px solid #c7d2fe;
}

/* Status Receipt View */
.status-hero {
  text-align: center;
  padding: 10px 0 18px;
}

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

.receipt-list {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  margin: 14px 0 18px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  font-size: 13.5px;
}

.receipt-row span {
  color: var(--text-muted);
}

.receipt-row strong {
  color: var(--text);
  text-align: right;
  word-break: break-word;
}

/* ==========================================================================
   Admin Dashboard Layout (Mobile-First + Wide Desktop)
   ========================================================================== */
.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px 64px;
}

.admin-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-card);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 860px) {
  .kpi-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  box-shadow: 0 2px 8px rgba(12, 38, 30, 0.03);
}

.kpi-card.highlight {
  background: linear-gradient(135deg, #0c6b58 0%, #074438 100%);
  color: #ffffff;
  border-color: transparent;
  grid-column: span 2;
}

@media (min-width: 860px) {
  .kpi-card.highlight {
    grid-column: span 1;
  }
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.kpi-card.highlight .kpi-label {
  color: rgba(255, 255, 255, 0.82);
}

.kpi-value {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-soft);
  margin-top: 4px;
}

.kpi-card.highlight .kpi-sub {
  color: rgba(255, 255, 255, 0.78);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
}

.tab-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.tab-btn.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 20px;
}

@media (min-width: 920px) {
  .admin-grid-2 {
    grid-template-columns: 380px 1fr;
    align-items: start;
  }
}

.section-title {
  margin: 0 0 14px;
  font-size: 16.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
  background: var(--surface-subtle);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

@media (min-width: 780px) {
  .filter-bar {
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr auto;
    align-items: end;
  }
}

.filter-bar label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.filter-bar .input, .filter-bar .select {
  min-height: 40px;
  padding: 7px 10px;
  font-size: 14px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 10px 10px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.share-box {
  background: var(--brand-soft);
  border: 1.5px solid var(--brand-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 14px;
}

.share-url-code {
  display: block;
  background: #ffffff;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  padding: 9px 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  word-break: break-all;
  margin: 8px 0 10px;
  color: var(--text);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: 20px;
  max-width: 360px;
  margin: 0 auto;
  background: #0f1f1a;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.22);
  z-index: 1000;
  text-align: center;
}
