:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --text: #10201b;
  --muted: #5b6b65;
  --line: #d8e1dd;
  --green: #04a777;
  --green-dark: #05805e;
  --white: #ffffff;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
a {
  font: inherit;
}

.app {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 22px 16px 28px;
}

.centered {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: 0;
}

.status {
  flex: 0 0 auto;
  min-width: 88px;
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.status.error {
  color: var(--danger);
  border-color: #f2b8b5;
}

.status.wide {
  max-width: none;
}

.tariffs {
  display: grid;
  gap: 10px;
}

.tariff {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

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

.tariff strong,
.tariff small {
  display: block;
}

.tariff strong {
  margin-bottom: 5px;
  font-size: 18px;
  line-height: 1.2;
}

.tariff small {
  color: var(--muted);
  font-size: 15px;
}

.chevron {
  flex: 0 0 auto;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 750;
}

.payment-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.payment-panel p,
.muted {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.pay-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.pay-button:active {
  background: var(--green-dark);
}

.secondary-button {
  margin-top: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--green-dark);
}

.secondary-button:active {
  background: #e8efec;
}

.link-button {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #e8efec;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.copy-link {
  margin-top: 14px;
}

.loader {
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border: 3px solid #d8e1dd;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.admin-app {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 22px 16px 28px;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-refresh {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-table small {
  color: var(--muted);
}

.badge {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.badge.paid {
  background: #ddf8ec;
  color: #047857;
}

.badge.pending {
  background: #fff4d6;
  color: #8a5a00;
}

.badge.failed {
  background: #ffe1df;
  color: var(--danger);
}

.empty {
  color: var(--muted);
  text-align: center;
}

.receipt dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 12px;
  margin: 18px 0;
}

.receipt dt {
  color: var(--muted);
}

.receipt dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.raw-json {
  max-height: 360px;
  overflow: auto;
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #10201b;
  color: #dff7ed;
  font-size: 12px;
}

.qr-panel {
  text-align: center;
}

.qr-image {
  width: min(100%, 320px);
  height: auto;
  margin: 4px auto 14px;
  border-radius: 8px;
  background: #fff;
}

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

@media (max-width: 360px) {
  .topbar {
    display: grid;
  }

  .status {
    max-width: none;
    width: 100%;
  }

  .receipt dl {
    grid-template-columns: 1fr;
  }
}
