/* Withdraw — compact fintech UI */
.withdraw-page {
  --wd-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --wd-ink: #0f172a;
  --wd-muted: #64748b;
  --wd-line: #e2e8f0;
  --wd-radius: 16px;
  --wd-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
  --wd-green: #16a34a;
  font-family: var(--wd-font);
  background: #eef2f6;
  -webkit-font-smoothing: antialiased;
}

.withdraw-page .top-bar {
  background: #fff;
  color: var(--wd-ink);
  border-bottom: 1px solid var(--wd-line);
}

.withdraw-page .top-bar .top-back,
.withdraw-page .top-bar .top-title,
.withdraw-page .top-bar .top-right { color: var(--wd-ink); }

.withdraw-page .lang-btn-sm {
  background: #f8fafc;
  border-color: var(--wd-line);
  color: var(--wd-ink);
}

.withdraw-page .top-brand-logo {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
}

.withdraw-page .footer,
.withdraw-page #site-footer { display: none; }

.withdraw-page #site-main { padding: 0; }

.wd-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 10px 14px calc(88px + env(safe-area-inset-bottom, 0));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Panels ── */
.wd-panel {
  background: #fff;
  border-radius: var(--wd-radius);
  border: 1px solid var(--wd-line);
  box-shadow: var(--wd-shadow);
}

.wd-panel--hero {
  padding: 16px 16px 14px;
}

.wd-panel--status {
  padding: 0;
  overflow: hidden;
}

/* ── Balance ── */
.wd-balance {
  text-align: center;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 14px;
}

.wd-balance__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wd-muted);
}

.wd-balance__amount {
  margin-top: 4px;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--wd-ink);
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.wd-balance__amount .cur {
  font-size: 18px;
  font-weight: 700;
  color: var(--wd-green);
}

.wd-balance__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--wd-muted);
}

.wd-balance__stat em {
  font-style: normal;
  font-weight: 500;
  margin-right: 3px;
}

.wd-balance__stat b {
  font-weight: 800;
  color: var(--wd-ink);
  font-variant-numeric: tabular-nums;
}

.wd-balance__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}

/* ── Amount block ── */
.wd-amount-block { margin-bottom: 12px; }

.wd-amount__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--wd-muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.amount-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1.5px solid var(--wd-line);
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.amount-box:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 192, 30, 0.08);
}

.amt-prefix {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}

.amt-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 22px;
  font-weight: 800;
  color: var(--wd-ink);
  font-variant-numeric: tabular-nums;
  min-width: 0;
  padding: 0;
  font-family: var(--wd-font);
}

.amt-input::placeholder { color: #cbd5e1; font-weight: 600; }

.amt-max {
  padding: 5px 10px;
  border: 1px solid var(--wd-line);
  background: #fff;
  color: var(--wd-ink);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--wd-font);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: 0.15s;
}

.amt-max:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: #f0fdf4;
}

.amt-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.amt-quick button {
  padding: 7px 2px;
  border: 1px solid var(--wd-line);
  background: #fff;
  border-radius: 8px;
  font-family: var(--wd-font);
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: 0.15s;
}

.amt-quick button:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: #f0fdf4;
}

.amt-hint {
  font-size: 11px;
  color: var(--wd-muted);
  margin-top: 6px;
  font-weight: 500;
}

.amt-hint span {
  color: var(--wd-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wd-note-fold {
  margin-top: 8px;
}

.wd-note-fold summary {
  font-size: 11px;
  font-weight: 600;
  color: var(--wd-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wd-note-fold summary::-webkit-details-marker { display: none; }

.wd-note-fold summary::before {
  content: "+";
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

.wd-note-fold[open] summary::before { content: "−"; }

.wd-note-input {
  margin-top: 8px !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
}

/* ── CTA ── */
.wd-btn {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 12px;
  background: var(--wd-ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--wd-font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, opacity 0.15s;
  letter-spacing: 0.01em;
}

.wd-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  opacity: 0.92;
}

.wd-btn:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

/* ── Status strip ── */
.wd-status-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.wd-status-item {
  padding: 10px 12px;
  border-right: 1px solid #f1f5f9;
  min-width: 0;
}

.wd-status-item:last-child { border-right: none; }

.wd-status-k {
  display: block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--wd-muted);
  margin-bottom: 3px;
}

.wd-status-v {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--wd-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wd-status-item--chip .wd-status-v {
  display: flex;
  justify-content: flex-start;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  background: #f1f5f9;
  color: #475569;
}

.status-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-chip.ok {
  background: #ecfdf5;
  color: #047857;
}

.status-chip.ok::before { background: #10b981; }

.status-chip.warn {
  background: #fffbeb;
  color: #b45309;
}

.status-chip.warn::before { background: #f59e0b; }

/* ── Gate ── */
.wd-panel--hero #gate-box:not(:empty) {
  margin-bottom: 12px;
}

.wd-gate {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 12px;
  color: #78350f;
  font-size: 12px;
  line-height: 1.45;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.wd-gate i {
  color: #d97706;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.wd-gate.ready {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.wd-gate.ready i { color: var(--wd-green); }

.wd-gate b { color: inherit; font-weight: 700; }

/* ── Content / folds ── */
.wd-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wd-fold {
  overflow: hidden;
}

.wd-fold__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--wd-ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.wd-fold__head::-webkit-details-marker { display: none; }

.wd-fold__head i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.wd-fold__head::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 10px;
  color: #94a3b8;
  margin-left: auto;
  transition: transform 0.2s;
}

.wd-fold[open] > .wd-fold__head::after {
  transform: rotate(180deg);
}

.wd-fold__body {
  padding: 0 14px 14px;
  border-top: 1px solid #f1f5f9;
}

.wd-support-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  margin-top: 2px;
  border: 1px solid var(--wd-line);
  border-radius: var(--wd-radius);
  background: #fff;
  color: var(--wd-ink);
  font-family: var(--wd-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--wd-shadow);
  transition: 0.15s;
}

.wd-support-link i:first-child {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #475569;
}

.wd-support-link span { flex: 1; text-align: left; }

.wd-support-link .fa-chevron-right {
  font-size: 10px;
  color: #94a3b8;
}

.wd-support-link:hover {
  border-color: #cbd5e1;
}

/* ── Bank ── */
.bank-display {
  background: #f8fafc;
  border: 1px solid var(--wd-line);
  border-radius: 12px;
  padding: 12px;
}

.bank-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  border: 1px solid var(--wd-line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  margin-right: 10px;
  flex-shrink: 0;
}

.bank-top { display: flex; align-items: center; margin-bottom: 10px; }

.bank-top .bn { font-weight: 700; color: var(--wd-ink); font-size: 14px; }

.bank-top .bs {
  font-size: 10px;
  color: var(--wd-muted);
  margin-top: 1px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bank-acc-num {
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--wd-ink);
  font-weight: 800;
}

.bank-acc-name {
  font-size: 12px;
  color: var(--wd-muted);
  margin-top: 4px;
}

.bank-edit-btn {
  margin-top: 10px;
  padding: 7px 12px;
  border: 1px solid var(--wd-line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  color: var(--wd-ink);
  font-family: var(--wd-font);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: 0.15s;
}

.bank-edit-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* ── Forms ── */
.form-label {
  font-size: 11px;
  color: var(--wd-muted);
  display: block;
  margin-top: 10px;
  font-weight: 600;
}

.form-label:first-child { margin-top: 0; }

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--wd-line);
  border-radius: 10px;
  font-family: var(--wd-font);
  font-size: 13px;
  margin-top: 5px;
  color: var(--wd-ink);
  background: #fafbfc;
  box-sizing: border-box;
  transition: 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 192, 30, 0.08);
}

select.form-input { cursor: pointer; }

.btn-primary-sm {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: var(--wd-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--wd-font);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary {
  padding: 10px 16px;
  border: 1px solid var(--wd-line);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--wd-font);
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

/* ── QR ── */
.qr-dropzone {
  border: 1.5px dashed var(--wd-line);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: 0.15s;
}

.qr-dropzone:hover,
.qr-dropzone.is-drag {
  border-color: var(--primary);
  background: #f0fdf4;
}

.qr-saved-box {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.qr-tip {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fffbeb;
  border-radius: 10px;
  font-size: 11px;
  color: #92400e;
  line-height: 1.45;
  border: 1px solid #fde68a;
}

/* ── History ── */
.wd-list { display: grid; gap: 6px; }

.wd-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--wd-line);
  font-size: 12px;
}

.wd-item .l b {
  color: var(--wd-ink);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.wd-item .l small {
  color: var(--wd-muted);
  display: block;
  font-size: 10px;
  margin-top: 2px;
  line-height: 1.35;
}

.wd-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 100px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.wd-badge.pending { background: #fffbeb; color: #b45309; }
.wd-badge.approved { background: #ecfdf5; color: #047857; }
.wd-badge.paid { background: #dbeafe; color: #1d4ed8; }
.wd-badge.rejected { background: #ffe4e6; color: #be123c; }

.empty-state {
  text-align: center;
  color: var(--wd-muted);
  padding: 20px 12px;
  font-size: 12px;
}

.empty-state i {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
  color: #cbd5e1;
}

/* ── Modal (unchanged structure, tighter) ── */
.wd-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: wd-modalFade 0.2s ease;
}

@media (min-width: 500px) {
  .wd-modal { align-items: center; padding: 20px; }
}

@keyframes wd-modalFade { from { opacity: 0; } to { opacity: 1; } }

@keyframes wd-modalPop {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

body.wd-modal-open {
  overflow: hidden;
  touch-action: none;
}

.wd-modal-box {
  background: #fff;
  border-radius: 20px 20px 0 0;
  max-width: 440px;
  width: 100%;
  max-height: min(92dvh, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.2);
  animation: wd-modalPop 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

@media (min-width: 500px) {
  .wd-modal-box { border-radius: 20px; }
}

.wd-modal-head {
  text-align: center;
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--wd-line);
  flex-shrink: 0;
}

.wd-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.wd-modal-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.wd-modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--wd-ink);
}

.wd-modal-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--wd-muted);
}

.wd-modal-amt {
  text-align: center;
  padding: 18px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.wd-modal-lbl {
  font-size: 10px;
  color: var(--wd-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wd-modal-val {
  font-size: 32px;
  font-weight: 800;
  color: var(--wd-ink);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.wd-modal-val .cur {
  font-size: 18px;
  color: var(--wd-green);
  font-weight: 700;
}

.wd-modal-rows { padding: 12px 20px; }

.wd-modal-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
  color: var(--wd-muted);
  border-bottom: 1px solid #f1f5f9;
}

.wd-modal-row:last-child { border-bottom: none; }

.wd-modal-row b {
  color: var(--wd-ink);
  font-weight: 700;
  text-align: right;
  max-width: 55%;
}

.wd-modal-note {
  margin: 0 20px 14px;
  padding: 10px 12px;
  background: #f0fdf4;
  border-radius: 10px;
  font-size: 11px;
  color: #166534;
  line-height: 1.45;
  display: flex;
  gap: 8px;
  border: 1px solid #bbf7d0;
}

.wd-modal-note i { color: var(--primary); }

.wd-modal-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0));
  flex-shrink: 0;
  border-top: 1px solid var(--wd-line);
}

.wd-modal-actions .btn-secondary { flex: 1; justify-content: center; }
.wd-modal-actions .btn-primary-sm { flex: 1.4; justify-content: center; }

.wd-modal-qr {
  margin: 0 20px 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--wd-line);
}

.wd-modal-qr-lbl {
  font-size: 9px;
  color: var(--wd-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.wd-modal-qr img,
#cm-qr-img,
#qr-image,
#qr-preview-img {
  max-width: min(130px, 100%);
  max-height: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}
