/* Partner app owners' portal (/salmin): PARTNERS.md. Phone first, then desktop. */
:root {
  --bg: #0b0b0f; --panel: #15151c; --panel2: #1c1c26; --line: #2a2a36; --line2: #353544;
  --text: #f5f2ef; --muted: #a9a2aa; --faint: #7d7781;
  --brand: #d9381e; --brand2: #ff7a1a; --amber: #ffc24a; --deep: #a3122a;
  --ok: #2fbf71; --ok-bg: rgba(47,191,113,.12); --warn: #f5a524; --warn-bg: rgba(245,165,36,.12);
  --bad: #ef5350; --bad-bg: rgba(239,83,80,.12); --info: #6aa8ff; --info-bg: rgba(106,168,255,.12);
  --r: 16px; --r2: 12px;
  --grad: linear-gradient(135deg, #ffc24a 0%, #ff7a1a 42%, #e23b1e 72%, #a3122a 100%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 750; }
h3 { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok); } .neg { color: var(--bad); }

/* ── top bar and navigation ── */
.top { position: sticky; top: 0; z-index: 20; background: rgba(11,11,15,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand b { font-size: 19px; font-weight: 850; letter-spacing: -.03em; }
.brand b span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand i { font-style: normal; font-size: 11px; color: var(--muted); border: 1px solid var(--line2); border-radius: 99px; padding: 1px 8px; margin-left: 2px; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.who form { margin: 0; }
.nav { display: none; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
.nav a.on { color: var(--text); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--brand); }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: rgba(21,21,28,.97); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--faint); font-size: 11px; font-weight: 600; padding: 4px 0; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--brand2); }
.tabbar a:hover { text-decoration: none; }
main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 96px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; }

@media (min-width: 900px) {
  .nav { display: flex; gap: 4px; margin-left: 18px; }
  .tabbar { display: none; }
  main { padding: 24px 20px 48px; }
  h1 { font-size: 26px; }
}

/* ── cards, grids ── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 14px; }
.card h2 { margin-bottom: 10px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h2 { margin: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr; } .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .g4 { grid-template-columns: repeat(4, 1fr); } .wide-left { grid-template-columns: 1.6fr 1fr; } }

/* ── the balance ── */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 20px; background:
  radial-gradient(120% 140% at 0% 0%, rgba(255,122,26,.22) 0%, rgba(217,56,30,.10) 35%, transparent 65%), var(--panel);
  border: 1px solid rgba(255,122,26,.35); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--grad); opacity: .12; filter: blur(2px); }
.hero .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.hero .big { font-size: 36px; font-weight: 850; letter-spacing: -.02em; margin: 2px 0 2px; }
.hero .big small { font-size: 16px; font-weight: 700; color: var(--muted); margin-right: 4px; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
@media (min-width: 700px) { .hero-stats { grid-template-columns: repeat(4, 1fr); } .hero .big { font-size: 44px; } }
.hs { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: var(--r2); padding: 10px 12px; }
.hs b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.hs span { color: var(--muted); font-size: 12px; }

/* ── numbers ── */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.kpi .k { color: var(--muted); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.kpi .v { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--faint); font-size: 12px; margin-top: 2px; }
.kpi.accent { border-color: rgba(255,122,26,.35); }
.bar { height: 8px; background: var(--panel2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

/* ── buttons and forms ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font: 700 15px var(--font);
  color: #fff; background: var(--brand); cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.grad { background: var(--grad); color: #1a0a05; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line2); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; color: var(--muted); font: 600 13px var(--font); cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--text); }
label { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line2); border-radius: 12px; padding: 11px 12px; font: 15px var(--font); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(255,122,26,.55); outline-offset: 0; border-color: transparent; }
textarea { min-height: 70px; resize: vertical; }
.row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice label { margin: 0; display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--line2); border-radius: 12px; color: var(--text); cursor: pointer; }
.choice input { width: auto; }
.choice label:has(input:checked) { border-color: var(--brand2); background: rgba(255,122,26,.08); }
.hint { font-size: 12px; color: var(--faint); margin-top: 6px; }
.amount-wrap { position: relative; }
.amount-wrap span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.amount-wrap input { padding-left: 52px; font-size: 20px; font-weight: 800; }

/* ── messages ── */
.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: var(--ok-bg); color: #9be7bd; border: 1px solid rgba(47,191,113,.35); }
.flash.bad { background: var(--bad-bg); color: #ffb4b2; border: 1px solid rgba(239,83,80,.35); }
.note { background: var(--panel2); border: 1px dashed var(--line2); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-size: 13px; }
.note b { color: var(--text); }

/* ── status pills ── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok, .pill.paid, .pill.completed { color: var(--ok); background: var(--ok-bg); }
.pill.pending, .pill.waiting, .pill.processing { color: var(--warn); background: var(--warn-bg); }
.pill.approved { color: var(--info); background: var(--info-bg); }
.pill.bad, .pill.rejected, .pill.failed { color: var(--bad); background: var(--bad-bg); }
.pill.cancelled { color: var(--faint); background: var(--panel2); }

/* ── tables (cards on phones) ── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; background: var(--panel2); }
  .table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td::before { content: attr(data-l); color: var(--faint); font-size: 12px; font-weight: 600; text-align: left; }
  .table td.r { text-align: right; }
  .table td[data-l=""]::before { content: none; }
}
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters > div { flex: 1 1 140px; }
.filters label { margin-top: 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line2); color: var(--muted); font-size: 13px; font-weight: 650; }
.chips a.on { border-color: var(--brand2); color: var(--text); background: rgba(255,122,26,.10); }
.chips a:hover { text-decoration: none; color: var(--text); }

/* ── charts ── */
.chart { position: relative; height: 230px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ── timeline for a withdrawal ── */
.steps { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--faint); }
.steps b { color: var(--text); font-weight: 650; }
.steps .arrow { opacity: .5; }

/* ── sign-in ── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(70% 60% at 50% 0%, rgba(217,56,30,.25), transparent 70%), var(--bg); }
.auth .box { width: 100%; max-width: 400px; }
.auth .logo { text-align: center; margin-bottom: 18px; }
.auth .logo img { width: 72px; height: 72px; }
.auth .logo b { display: block; font-size: 28px; font-weight: 850; letter-spacing: -.03em; margin-top: 6px; }
.auth .logo b span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth .card { padding: 22px; }
.foot { text-align: center; color: var(--faint); font-size: 12px; margin-top: 18px; }

@media (max-width: 600px) { .hide-sm { display: none; } }
