:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #16202b;
  --muted: #65727f;
  --primary: #0b7a5b;
  --primary-dark: #075c44;
  --accent: #f2a900;
  --danger: #c0392b;
  --ok: #1e8e5a;
  --line: #e2e7ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
header.top {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 5;
}
header.top .brand { font-weight: 800; font-size: 1.25rem; letter-spacing: .3px; display:flex; align-items:center; gap:8px; }
header.top .brand svg { width: 26px; height: 26px; }
header.top a { color: #fff; text-decoration: none; font-size: .9rem; opacity: .9; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 1.35rem; margin: 6px 0 4px; }
h2 { font-size: 1.1rem; margin: 18px 0 8px; }
p.lead { color: var(--muted); margin: 0 0 14px; }

.steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.steps span.done { background: var(--primary); }

.list { display: grid; gap: 10px; }
.item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; width: 100%; text-align: right;
  font: inherit; color: inherit; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: transform .08s ease, border-color .1s;
}
.item:active { transform: scale(.985); }
.item:hover { border-color: var(--primary); }
.item .t { font-weight: 700; font-size: 1.05rem; }
.item .s { color: var(--muted); font-size: .88rem; }
.item .price { font-weight: 800; color: var(--primary); font-size: 1.15rem; white-space: nowrap; }
.item[disabled] { opacity: .5; cursor: not-allowed; }
.badge { font-size: .75rem; background: #e7f5ef; color: var(--ok); padding: 2px 8px; border-radius: 999px; }
.badge.out { background: #fdecea; color: var(--danger); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--muted); }
.row .v { font-weight: 700; }
.big { font-size: 1.6rem; font-weight: 900; color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 16px; border-radius: 12px; border: 0;
  background: var(--primary); color: #fff; font: inherit; font-weight: 700; font-size: 1.05rem; cursor: pointer;
  margin-top: 10px;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.whatsapp { background: #25d366; }
.btn.small { width: auto; padding: 8px 12px; font-size: .9rem; margin: 0; }
.btn.danger { background: var(--danger); }

label { display: block; font-weight: 700; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; font: inherit; font-size: 1.05rem;
  background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input.ltr { direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; }
small.help { color: var(--muted); display: block; margin-top: 4px; }

.wallet {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fbfcfd;
}
.wallet .n { font-weight: 700; }
.wallet .num { direction: ltr; font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; font-weight: 700; }
.copy { background: #eef2f5; border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; font-size: .85rem; }

.alert { padding: 12px 14px; border-radius: 10px; margin: 10px 0; font-weight: 600; }
.alert.err { background: #fdecea; color: var(--danger); }
.alert.ok { background: #e7f5ef; color: var(--ok); }
.alert.info { background: #fff6dd; color: #7a5a00; }

.code-box {
  background: #0f1c17; color: #c9ffe8; border-radius: 12px; padding: 18px; text-align: center;
  font-family: ui-monospace, Consolas, monospace; font-size: 1.7rem; font-weight: 800; letter-spacing: 3px; direction: ltr;
  word-break: break-all; margin: 12px 0;
}
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.st-awaiting_payment { background: #fff6dd; color: #7a5a00; }
.st-pending_verification { background: #e3f0ff; color: #1b4f99; }
.st-paid { background: #e7f5ef; color: var(--ok); }
.st-rejected, .st-expired { background: #fdecea; color: var(--danger); }

.timer { font-weight: 800; color: var(--danger); direction: ltr; display: inline-block; }
.loading { text-align: center; color: var(--muted); padding: 30px 0; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px 0 0; }
.back { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; padding: 0; margin-bottom: 8px; }
.hidden { display: none !important; }
