:root {
  --bg: #0f1115; --surface: #171a21; --surface-alt: #1f232c; --border: #2a2f3a;
  --text: #f2f3f5; --text-dim: #9aa1ac; --accent: #6c8bff; --accent-dim: #2c3550;
  --danger: #ff4757; --success: #4cd97b; --gold: #f5b942;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.hidden { display: none !important; }

#screen-login, #screen-unauthorized { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; text-align: center; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 20px; }
.logo.small { font-size: 18px; margin: 0; }
.badge { font-size: 11px; font-weight: 700; background: var(--accent-dim); color: var(--accent);
  padding: 3px 8px; border-radius: 6px; vertical-align: middle; margin-left: 4px; }
.login-card input { width: 100%; background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 10px; padding: 13px; color: var(--text); font-size: 15px; outline: none; margin-bottom: 10px; }
.primary-btn { width: 100%; background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 13px; font-size: 15px; font-weight: 600; cursor: pointer; }
.secondary-btn { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer; }
.secondary-btn.small { padding: 8px 14px; font-size: 13px; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 10px; }
.fine-print { color: var(--text-dim); font-size: 12px; margin-top: 18px; line-height: 1.6; }

#screen-dashboard { max-width: 900px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }

.tabs { display: flex; gap: 4px; padding: 12px 20px 0; border-bottom: 1px solid var(--border); }
.tab-btn { background: none; border: none; color: var(--text-dim); font-size: 14px; font-weight: 600;
  padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px; }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.count-pill { background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }

.main-content { flex: 1; padding: 20px; }
.tab-panel.hidden { display: none; }
.card-list { display: flex; flex-direction: column; gap: 10px; }
.empty-state { color: var(--text-dim); font-size: 14px; text-align: center; padding: 40px 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-info { flex: 1; min-width: 200px; }
.card-title { font-weight: 700; font-size: 15px; }
.card-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.card-meta { font-size: 12px; color: var(--text-dim); margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.status-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 8px; border-radius: 5px; }
.status-tag.requested, .status-tag.matched { background: var(--accent-dim); color: var(--accent); }
.status-tag.accepted, .status-tag.in_progress { background: #1f2e1f; color: var(--success); }
.status-tag.paid { background: #1f2e1f; color: var(--success); }
.status-tag.pending, .status-tag.blocked_no_linked_account { background: #3a2f0f; color: var(--gold); }
.status-tag.failed { background: #3a1f24; color: var(--danger); }
.status-tag.suspended { background: #3a1f24; color: var(--danger); }
.status-tag.approved { background: #1f2e1f; color: var(--success); }
.status-tag.rejected { background: #3a1f24; color: var(--danger); }

.search-input { width: 100%; background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px; color: var(--text); font-size: 14px; outline: none;
  margin-bottom: 14px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat-label { font-size: 12px; color: var(--text-dim); }
.stat-value { font-size: 20px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }

.card-actions { display: flex; gap: 8px; }
.approve-btn { background: var(--success); color: #0f1115; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
.reject-btn { background: var(--surface-alt); color: var(--danger); border: 1px solid var(--danger);
  border-radius: 8px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); padding: 10px 18px;
  border-radius: 999px; font-size: 14px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); z-index: 50;
  transition: opacity 0.2s ease, transform 0.2s ease; }
.toast.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(8px); }

/* Approval card: flag a helper whose payout details are incomplete */
.card-meta .warn { color: #f5b942; }
