:root {
  --bg: #fffdf9;
  --surface: #ffffff;
  --surface-soft: #fff6e8;
  --ink: #172033;
  --muted: #617083;
  --line: #d7e0eb;
  --orange: #f5820b;
  --orange-dark: #d96d00;
  --red: #dc2626;
  --green: #0a8f54;
  --blue: #2563eb;
  --shadow: 0 14px 34px rgba(25, 35, 50, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.page-shell {
  min-height: 100vh;
}

.checkout-shell {
  width: min(100%, 592px);
  margin: 0 auto;
  padding: 20px 16px 34px;
}

.checkout-banner {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  border: 1px solid #27374d;
  border-radius: 8px;
  background: #233246;
  box-shadow: var(--shadow);
}

.checkout-banner img {
  display: block;
  width: 100%;
  height: 236px;
  object-fit: cover;
}

.checkout-copy {
  margin: 16px 0 14px;
  text-align: center;
  overflow-wrap: anywhere;
}

.checkout-copy h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
}

.checkout-copy p {
  width: min(100%, 500px);
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  margin-left: auto;
  margin-right: auto;
}

.offer-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  margin: 0 0 30px;
  padding: 12px 18px;
  border: 1px solid #ffb15e;
  border-radius: 8px;
  background: #fff2dd;
  color: #1b2637;
  text-align: center;
  line-height: 1.35;
  flex-wrap: wrap;
}

.offer-bar strong {
  color: var(--orange-dark);
}

.timer {
  color: var(--red);
  font-weight: 800;
}

.section-title {
  margin: 0 0 14px;
  color: #435066;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.wallet-option {
  display: grid;
  place-items: center;
  min-height: 110px;
  padding: 16px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.wallet-option.is-selected {
  border-color: var(--orange);
  background: #fff4e5;
  box-shadow: inset 0 0 0 1px rgba(245, 130, 11, 0.08);
}

.wallet-mark {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
  border-radius: 14px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.wallet-mark.emola {
  background: #ff7f2a;
}

.wallet-mark.mpesa {
  background: #ef233c;
}

.payee-box,
.form-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(25, 35, 50, 0.06);
}

.payee-box {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px;
}

.agent-photo,
.agent-initials {
  width: 96px;
  height: 112px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8edf3;
}

.agent-initials {
  display: grid;
  place-items: center;
  color: #3b4758;
  font-size: 34px;
  font-weight: 900;
}

.payee-meta {
  min-width: 0;
}

.payee-wallet {
  color: var(--orange-dark);
  font-size: 13px;
  font-weight: 800;
}

.payee-name {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

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

.copy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid #ffb15e;
  border-radius: 8px;
  background: #fff9f1;
}

.copy-row strong {
  color: var(--orange-dark);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.copy-row button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.notice {
  margin: 16px 0 24px;
  padding: 18px;
  border: 1px solid #ffb15e;
  border-radius: 8px;
  background: #fff2dd;
  line-height: 1.5;
  text-align: center;
}

.notice strong {
  color: var(--orange-dark);
}

.notice .green {
  color: var(--green);
  font-weight: 800;
}

.form-box {
  padding: 20px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  color: #445166;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #ccd7e4;
  border-radius: 8px;
  background: #f9fbfd;
  color: var(--ink);
  outline: 0;
}

.field input,
.field select {
  min-height: 48px;
  padding: 0 14px;
}

.field textarea {
  min-height: 138px;
  resize: vertical;
  padding: 14px;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(245, 130, 11, 0.14);
}

.hint {
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  text-decoration: none;
  white-space: normal;
  text-align: center;
}

.primary-button {
  width: 100%;
  min-height: 50px;
  background: var(--orange);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--orange-dark);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.88;
}

.primary-button.is-processing {
  gap: 10px;
}

.button-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.48);
  border-top-color: #ffffff;
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

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

.secondary-button {
  background: #eef4ff;
  color: #1c4b9b;
  border-color: #c9dbff;
}

.danger-button {
  background: #fff1f1;
  color: #b91c1c;
  border-color: #fecaca;
}

.ghost-button {
  background: #ffffff;
  color: #334155;
  border-color: var(--line);
}

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

.alert {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
}

.alert.error {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.alert.success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.alert.processing {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.loading,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 60vh;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.admin-shell {
  min-height: 100vh;
  background: #f5f7fa;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  font-weight: 900;
  letter-spacing: 0;
}

.admin-main {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 18px;
  width: min(100%, 1320px);
  margin: 0 auto;
  padding: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(25, 35, 50, 0.04);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 17px;
}

.panel-body {
  padding: 16px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-form-grid .span-2 {
  grid-column: span 2;
}

.wallet-settings {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.wallet-settings h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: #3b4758;
  font-weight: 700;
}

.checkout-list {
  display: grid;
  gap: 10px;
}

.checkout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.checkout-row:last-child {
  border-bottom: 0;
}

.row-title {
  font-weight: 900;
  overflow-wrap: anywhere;
}

.row-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf7f1;
  color: #0f7a46;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.inactive {
  background: #f1f5f9;
  color: #64748b;
}

.submissions-panel {
  grid-column: span 2;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

td {
  min-width: 140px;
}

.proof-message {
  width: min(360px, 46vw);
  max-height: 88px;
  overflow: auto;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.login-panel {
  width: min(100%, 420px);
  margin: 12vh auto 0;
}

.config-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 860px) {
  .admin-main {
    grid-template-columns: 1fr;
  }

  .submissions-panel {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .checkout-shell {
    padding: 12px 10px 28px;
  }

  .checkout-banner {
    min-height: 152px;
  }

  .checkout-banner img {
    height: 190px;
  }

  .checkout-copy {
    margin: 14px 0 12px;
  }

  .checkout-copy h1 {
    font-size: 23px;
  }

  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .payee-box {
    grid-template-columns: 78px minmax(0, 1fr);
    padding: 14px;
  }

  .agent-photo,
  .agent-initials {
    width: 78px;
    height: 92px;
  }

  .copy-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .admin-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-main {
    padding: 10px;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-grid .span-2 {
    grid-column: auto;
  }

  .checkout-row {
    grid-template-columns: 1fr;
  }

  .proof-message {
    width: 260px;
  }
}
