/* Partner — dark, airy, flat. No borders, no gradients, one accent. */
:root {
  --bg: #171717;
  --surface: #212121;
  --surface-2: #2a2a2a;
  --surface-3: #333333;
  --text: #ececec;
  --muted: #9b9b9b;
  --faint: #6b6b6b;
  --accent: #44f48c;
  --accent-ink: #072214;
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 14px;
  --font: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; font-size: 17px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; border: 0; outline: 0; background: none; }
svg { display: block; flex-shrink: 0; }

/* ---------- shared bits ---------- */
.logo { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 22px; letter-spacing: -0.02em; }
.logo-mark { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 60px; padding: 0 32px; border-radius: var(--r-md); font-size: 17px; font-weight: 500; cursor: pointer; transition: background .15s, transform .15s, opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #6ff7a8; }
.btn-soft { background: var(--surface-2); color: var(--text); }
.btn-soft:hover { background: var(--surface-3); }
.btn-sm { height: 48px; padding: 0 22px; font-size: 16px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

/* ---------- landing ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 24px 40px; max-width: 1360px; margin: 0 auto; }
.top-actions { display: flex; gap: 12px; }

.hero { max-width: 1360px; margin: 0 auto; padding: 96px 40px 64px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.hero h1 { font-size: clamp(44px, 5.6vw, 80px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; }
.hero p { margin-top: 28px; font-size: 21px; color: var(--muted); max-width: 520px; }
.hero-cta { margin-top: 44px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cta .btn { min-width: 220px; }

/* preview card on the right */
.preview { background: var(--surface); border-radius: var(--r-xl); padding: 32px; display: grid; gap: 16px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 15px; }
.preview-big { font-size: 56px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.preview-big small { font-size: 24px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(68, 244, 140, .12); color: var(--accent); font-size: 14px; font-weight: 500; }
.preview-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.preview-cell { background: var(--surface-2); border-radius: var(--r-md); padding: 18px; }
.preview-cell b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.preview-cell span { color: var(--muted); font-size: 14px; }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 8px; }
.bars i { flex: 1; background: var(--surface-3); border-radius: 8px; }
.bars i.on { background: var(--accent); }

.features { max-width: 1360px; margin: 0 auto; padding: 0 40px 80px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { background: var(--surface); border-radius: var(--r-lg); padding: 28px; display: flex; justify-content: space-between; gap: 16px; }
.feature h3 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.feature p { color: var(--muted); font-size: 16px; margin-top: 6px; }
.feature svg { color: var(--text); opacity: .9; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth .top { width: 100%; }
.auth-main { flex: 1; display: grid; place-items: center; padding: 24px 20px 80px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin-top: 10px; }
.form { margin-top: 40px; display: grid; gap: 12px; }
.field { position: relative; }
.input { width: 100%; height: 64px; padding: 0 24px; border-radius: var(--r-md); background: var(--surface-2); font-size: 17px; transition: background .15s, box-shadow .15s; }
.input::placeholder { color: var(--faint); }
.input:hover { background: var(--surface-3); }
.input:focus { background: var(--surface-3); box-shadow: 0 0 0 2px var(--accent); }
.eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.eye:hover { background: var(--surface); color: var(--text); }
.form .btn { margin-top: 8px; height: 64px; }
.auth-foot { margin-top: 28px; text-align: center; color: var(--muted); font-size: 15px; }
.auth-foot a { color: var(--text); font-weight: 500; }

/* ---------- dashboard ---------- */
.app { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.side { background: var(--bg); padding: 24px 16px; display: flex; flex-direction: column; gap: 32px; position: sticky; top: 0; height: 100vh; }
.side .logo { padding: 4px 12px; }
.nav { display: grid; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 14px; height: 52px; padding: 0 16px; border-radius: var(--r-sm); color: var(--muted); font-size: 16px; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); }
.side-bottom { margin-top: auto; display: grid; gap: 12px; }
.me { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--surface); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 600; font-size: 15px; }
.me b { display: block; font-size: 15px; font-weight: 500; }
.me span { display: block; font-size: 13px; color: var(--muted); }

.main { background: var(--surface); margin: 12px 12px 12px 0; border-radius: var(--r-xl); padding: 40px 48px 56px; min-width: 0; }
.main-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.main-head h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.03em; }
.main-head p { color: var(--muted); margin-top: 4px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--r-sm); padding: 4px; gap: 4px; }
.seg button { height: 40px; padding: 0 18px; border-radius: 10px; color: var(--muted); font-size: 15px; font-weight: 500; cursor: pointer; }
.seg button.on { background: var(--surface-3); color: var(--text); }

.grid { display: grid; gap: 16px; margin-top: 32px; }
.balance { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.card { background: var(--surface-2); border-radius: var(--r-lg); padding: 28px; }
.card-label { color: var(--muted); font-size: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.money { font-size: 64px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; margin-top: 14px; }
.money small { font-size: 28px; color: var(--muted); font-weight: 500; }
.balance-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.next-pay { display: flex; flex-direction: column; justify-content: space-between; }
.next-pay .big { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; margin-top: 14px; }
.next-pay .hint { color: var(--muted); font-size: 15px; margin-top: 4px; }
.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 24px; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat b { display: block; font-size: 40px; font-weight: 600; letter-spacing: -0.03em; margin-top: 10px; line-height: 1.1; }
.delta { font-size: 14px; font-weight: 500; color: var(--accent); margin-top: 6px; display: block; }
.delta.down { color: var(--muted); }

.chart-card .card-label { margin-bottom: 24px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 240px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; height: 100%; justify-content: flex-end; }
.chart .col i { width: 100%; max-width: 44px; background: var(--surface-3); border-radius: 10px; transition: background .15s; position: relative; }
.chart .col:hover i { background: var(--accent); }
.chart .col.today i { background: var(--accent); }
.chart .col span { font-size: 13px; color: var(--faint); }
.chart .col i::after { content: attr(data-v); position: absolute; left: 50%; top: -34px; transform: translateX(-50%); background: var(--bg); color: var(--text); font-size: 13px; font-style: normal; padding: 4px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; }
.chart .col:hover i::after { opacity: 1; }

.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.list { display: grid; gap: 8px; margin-top: 20px; }
.row { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-3); }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-weight: 500; font-size: 16px; }
.row-main span { display: block; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-num { text-align: right; }
.row-num b { display: block; font-weight: 600; font-size: 17px; }
.row-num span { display: block; color: var(--muted); font-size: 13px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); cursor: pointer; transition: color .15s, background .15s; }
.icon-btn:hover { color: var(--text); background: var(--bg); }
.icon-btn.done { color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.dot.off { background: var(--faint); }

.status { font-size: 13px; font-weight: 500; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.status.ok { background: rgba(68, 244, 140, .12); color: var(--accent); }

.menu-btn { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .balance, .two { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 12px; }
  .side .nav, .side-bottom { display: none; }
  .menu-btn { display: grid; }
  .main { margin: 0 8px 8px; padding: 28px 20px 40px; border-radius: var(--r-lg); }
  .money { font-size: 48px; }
}
@media (max-width: 720px) {
  .top { padding: 18px 20px; }
  .top-actions .btn-soft { display: none; }
  .hero { padding: 40px 20px 40px; gap: 40px; }
  .hero p { font-size: 18px; }
  .hero-cta .btn { width: 100%; }
  .features { grid-template-columns: 1fr; padding: 0 20px 48px; }
  .preview { padding: 22px; }
  .preview-big { font-size: 44px; }
  .stats { gap: 10px; }
  .stat b { font-size: 30px; }
  .card { padding: 22px; }
  .chart { gap: 6px; height: 200px; }
  .chart .col span { font-size: 11px; }
  .auth-card h1 { font-size: 32px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .preview-row { grid-template-columns: 1fr 1fr; }
  .preview-row .preview-cell:last-child { display: none; }
  .main-head h1 { font-size: 28px; }
  .row { padding: 14px; gap: 12px; }
}

/* soft buttons inside cards sit one step lighter */
.card .btn-soft { background: var(--surface-3); }
.card .btn-soft:hover { background: #3d3d3d; }
.row .icon-btn { background: var(--surface-2); }

/* mobile overflow guards */
.app > *, .grid > *, .balance > *, .two > *, .stats > * { min-width: 0; }
.card-label { flex-wrap: wrap; }
@media (max-width: 1180px) { .balance, .two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .app { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .balance-actions .btn { flex: 1; }
  .row .status { display: none; }
  .chart .col:nth-child(-n+4) { display: none; }
}

/* form errors + logout */
.input.is-invalid { box-shadow: 0 0 0 2px #e0645c; }
.form-error { color: #e0645c; font-size: 14px; padding: 2px 8px 0; }
.check { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; padding: 4px 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.me { width: 100%; text-align: left; }
.me-out { margin-left: auto; color: var(--muted); }
.me-out:hover { color: var(--text); }
.me .row-main b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .row-main span { font-size: 13px; }
.me-out { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.me-out:hover { background: var(--surface-2); }

/* ---------- streams ---------- */
.select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 56px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%239b9b9b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 22px center; }
.select option { background: var(--surface-2); color: var(--text); }
.card .input { background-color: var(--surface-3); }
.card .input:hover, .card .input:focus { background-color: #3a3a3a; }
.stream-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 12px; margin-top: 18px; align-items: start; }
.stream-form .btn { height: 64px; min-width: 160px; }
.empty-note { color: var(--muted); margin-top: 14px; }

.stream { display: grid; gap: 20px; transition: opacity .15s; }
.stream.is-off { opacity: .6; }
.stream.is-new { box-shadow: 0 0 0 2px var(--accent); }
.stream-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stream-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.stream-title b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.stream-title span { display: block; color: var(--muted); font-size: 15px; }
.link-box { display: flex; align-items: center; gap: 12px; background: var(--surface-3); border-radius: var(--r-md); padding: 10px 10px 10px 22px; }
.link-text { flex: 1; min-width: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.stream-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stream-nums div { background: var(--surface-3); border-radius: var(--r-md); padding: 16px 18px; }
.stream-nums b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.stream-nums span { color: var(--muted); font-size: 14px; }
.empty { text-align: center; padding: 48px 28px; }
.empty b { font-size: 22px; font-weight: 600; }
.empty p { color: var(--muted); margin-top: 6px; }

@media (max-width: 900px) {
  .stream-form { grid-template-columns: minmax(0, 1fr); }
  .stream-form .btn { width: 100%; }
  .stream-nums { grid-template-columns: repeat(2, 1fr); }
}
select { font: inherit; color: var(--text); border: 0; outline: 0; }
.side { min-width: 0; }
.side-bottom { grid-template-columns: minmax(0, 1fr); }
.me .row-main { min-width: 0; }

/* ---------- stage 4: live dashboard ---------- */
.seg a { height: 40px; padding: 0 18px; border-radius: 10px; color: var(--muted); font-size: 15px; font-weight: 500; display: inline-flex; align-items: center; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface-3); color: var(--text); }
.btn.is-disabled { opacity: .45; cursor: not-allowed; }
.money.is-negative { color: var(--muted); }
.minus { color: var(--muted); }
.chart.is-dense { gap: 4px; }
.chart.is-dense .col span { font-size: 11px; }
.chart.is-dense .col:nth-child(even) span { visibility: hidden; }
.empty-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-radius: var(--r-md); background: var(--surface-3); color: var(--muted); flex-wrap: wrap; }

/* ---------- stage 5: payouts & settings ---------- */
.notice { margin-top: 24px; padding: 18px 22px; border-radius: var(--r-md); background: rgba(68, 244, 140, .12); color: var(--accent); font-weight: 500; }
.lead-note { color: var(--muted); margin-top: 12px; max-width: 520px; }
.payout-cta { margin-top: 24px; }
.payout-form { display: grid; gap: 12px; margin-top: 18px; }
.amount-input { font-size: 22px; font-weight: 600; padding-right: 96px; }
.fill-all { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); height: 44px; padding: 0 16px; border-radius: 12px; background: var(--surface-2); color: var(--text); font-weight: 500; cursor: pointer; }
.fill-all:hover { background: var(--bg); }
.method-pills { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pill-option { cursor: pointer; }
.pill-option input { position: absolute; opacity: 0; pointer-events: none; }
.pill-option span { display: block; padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-3); font-weight: 500; transition: box-shadow .15s, background .15s; }
.pill-option span small { display: block; color: var(--muted); font-weight: 400; font-size: 14px; margin-top: 2px; }
.pill-option:hover span { background: #3a3a3a; }
.pill-option input:checked + span { box-shadow: 0 0 0 2px var(--accent); }
.pill-option input:focus-visible + span { box-shadow: 0 0 0 2px var(--text); }
.settings-card { max-width: 640px; }
.settings-form { margin-top: 24px; gap: 10px; }
.field-label { color: var(--muted); font-size: 15px; padding: 8px 4px 0; }
.settings-form .btn { justify-self: start; min-width: 200px; }

/* ---------- 2FA ---------- */
.code-input { font-size: 22px; letter-spacing: .12em; text-align: center; }
.settings-form .code-input { text-align: left; }
.tfa-setup { display: grid; grid-template-columns: 236px 1fr; gap: 28px; margin-top: 20px; align-items: start; }
.qr { background: #fff; border-radius: var(--r-md); padding: 8px; width: 236px; }
.qr svg { width: 220px; height: 220px; }
.steps { color: var(--muted); padding-left: 20px; display: grid; gap: 6px; }
.secret { display: inline-block; margin-top: 12px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-3); font-size: 16px; letter-spacing: .06em; user-select: all; word-break: break-all; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; }
.settings-form .button-row .btn { min-width: 0; }
.recovery { margin-top: 18px; padding: 20px; border-radius: var(--r-md); background: rgba(68, 244, 140, .1); }
.recovery b { color: var(--accent); }
.recovery p { color: var(--muted); margin-top: 4px; font-size: 15px; }
.recovery-codes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.recovery-codes code { background: var(--surface-3); border-radius: 10px; padding: 10px; text-align: center; font-size: 15px; user-select: all; }
@media (max-width: 720px) {
  .tfa-setup, .two-col { grid-template-columns: 1fr; }
  .recovery-codes { grid-template-columns: 1fr 1fr; }
}

/* ---------- reports ---------- */
.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.select-sm { height: 48px; width: auto; min-width: 200px; padding-left: 18px; font-size: 15px; border-radius: var(--r-sm); background-color: var(--surface-2); background-position: right 16px center; }
.table-card { padding: 8px; overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 15px; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 14px; padding: 12px 16px 4px; white-space: nowrap; }
.table td { padding: 14px 16px; background: var(--surface-3); white-space: nowrap; }
.table td:first-child { border-radius: 14px 0 0 14px; }
.table td:last-child { border-radius: 0 14px 14px 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .muted { color: var(--muted); }
.table tr.total td { background: var(--surface); font-weight: 600; }
.table .wrap { white-space: normal; }
.table-empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; }
.pager-info { color: var(--muted); font-size: 15px; }
.summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.summary-row .card b { display: block; font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin-top: 8px; }
@media (max-width: 900px) { .summary-row { grid-template-columns: 1fr 1fr; } }
.group-seg { margin-top: 12px; flex-wrap: wrap; }
.table-note { color: var(--faint); font-size: 14px; padding: 0 8px; }
.offer-card { display: grid; gap: 20px; }
.offer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.offer-top h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.offer-top .lead-note { margin-top: 6px; }
.promo-notes { color: var(--muted); line-height: 1.6; background: var(--surface-3); border-radius: var(--r-md); padding: 18px 22px; }
.textarea { height: auto; padding: 18px 24px; resize: vertical; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 10px 16px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 15px; font-weight: 500; transition: background .15s, color .15s; }
.chip input:checked + span { background: rgba(68, 244, 140, .14); color: var(--accent); }
.chip input:focus-visible + span { box-shadow: 0 0 0 2px var(--text); }
.postback-form { margin-top: 18px; }
.postback-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.postback-row .btn { height: 64px; min-width: 160px; }
.macros { margin-top: 18px; }
.macros summary { cursor: pointer; color: var(--muted); font-size: 15px; }
.macro-list { display: grid; gap: 6px; margin-top: 12px; }
.macro-list div { display: flex; gap: 14px; font-size: 15px; }
.macro-list code { min-width: 120px; color: var(--accent); }
.macro-list span { color: var(--muted); }
.table-title { padding: 12px 16px 0; }
@media (max-width: 720px) { .postback-row { grid-template-columns: 1fr; } }
.chat { display: grid; gap: 20px; }
.chat-thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px; }
.bubble { max-width: 78%; align-self: flex-end; background: rgba(68, 244, 140, .14); border-radius: 20px 20px 6px 20px; padding: 14px 18px; }
.bubble.from-admin { align-self: flex-start; background: var(--surface-3); border-radius: 20px 20px 20px 6px; }
.bubble-body { line-height: 1.5; overflow-wrap: anywhere; }
.bubble-meta { color: var(--muted); font-size: 13px; margin-top: 6px; }
.chat-form { display: grid; gap: 12px; }
.chat-form .btn { justify-self: end; min-width: 180px; }
.side { overflow-y: auto; gap: 24px; }
.nav a { height: 46px; }
.btn.is-current { background: var(--surface-3); }
.table-card { padding: 8px 8px 8px 8px; }
.table td:last-child, .table th:last-child { padding-right: 20px; }

/* ---------- custom dropdown ---------- */
.dd { position: relative; }
.dd-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; cursor: pointer; }
.dd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-value.is-placeholder { color: var(--faint); }
.dd-chevron { color: var(--muted); transition: transform .15s; }
.dd.is-open .dd-chevron { transform: rotate(180deg); }
.dd.is-open .dd-toggle { background-color: #3a3a3a; }
.dd-menu { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40; list-style: none; margin: 0; padding: 6px; background: var(--surface-3); border-radius: var(--r-md); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); max-height: 320px; overflow-y: auto; outline: 0; }
.dd.is-up .dd-menu { top: auto; bottom: calc(100% + 8px); }
.dd-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; cursor: pointer; color: var(--text); font-size: 16px; }
.dd-option.is-active { background: #424242; }
.dd-check { color: var(--accent); visibility: hidden; flex-shrink: 0; }
.dd-option[aria-selected="true"] .dd-check { visibility: visible; }
.dd-sm .dd-toggle { height: 48px; min-width: 200px; padding: 0 16px 0 18px; font-size: 15px; border-radius: var(--r-sm); background-color: var(--surface-2); }
.dd-sm .dd-option { font-size: 15px; padding: 10px 12px; }
.card .dd-toggle { background-color: var(--surface-3); }
.card .dd-menu { background: #333; }
.card .dd-option.is-active { background: #484848; }

/* ---------- statistics v2 ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi .card-label svg { color: var(--muted); }
.kpi b { display: block; margin-top: 14px; font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.kpi sup { font-size: 17px; font-weight: 500; color: var(--accent); margin-left: 6px; vertical-align: super; letter-spacing: 0; }
.filter-card { padding: 0; }
.filter-summary { list-style: none; cursor: pointer; padding: 24px 28px; font-size: 17px; color: var(--text); font-weight: 500; }
.filter-summary::-webkit-details-marker { display: none; }
.filter-card:not([open]) .filter-summary .dd-chevron { transform: rotate(180deg); }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 14px; padding: 0 28px 28px; }
.filter-field { display: grid; gap: 8px; min-width: 0; }
.filter-field > span { color: var(--muted); font-size: 14px; padding-left: 4px; }
.filter-field .input { height: 52px; font-size: 16px; padding: 0 18px; border-radius: var(--r-sm); }
.filter-field .dd-toggle { height: 52px; }
.filter-actions { display: flex; gap: 12px; align-items: end; grid-column: span 3; }
.filter-actions .btn { height: 52px; }
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 16px 8px; }
.table-title-big { font-size: 20px; font-weight: 600; }
.table-title-big span { color: var(--accent); }
.table-title-big small { color: var(--muted); font-size: 14px; font-weight: 400; margin-left: 8px; }
.table-scroll { overflow-x: auto; }
.stats-table th, .stats-table td { padding-left: 12px; padding-right: 12px; }
.stats-table .group-head { text-align: center; border-bottom: 2px solid transparent; }
.stats-table .group-head.is-plus { box-shadow: inset 0 -2px 0 var(--accent); }
.stats-table .group-head.is-minus { box-shadow: inset 0 -2px 0 #8a8a8a; }
.stats-table .sub-head th { font-size: 13px; padding-top: 6px; }
.cell-link { color: var(--accent); }
.cell-link:hover { text-decoration: underline; }
/* date range */
.dr { position: relative; }
.dr-toggle svg { color: var(--muted); }
.dr-pop { position: absolute; z-index: 45; top: calc(100% + 8px); left: 0; width: 360px; background: #333; border-radius: var(--r-md); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); padding: 8px; display: grid; gap: 8px; }
.dr-pop[hidden] { display: none; }
.dr-presets { display: grid; gap: 2px; }
.dr-preset { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; cursor: pointer; text-align: left; font-size: 15px; }
.dr-preset small { color: var(--muted); font-size: 13px; }
.dr-preset:hover { background: #424242; }
.dr-preset[aria-pressed="true"] { background: rgba(68, 244, 140, .14); color: var(--accent); }
.dr-custom { display: grid; gap: 8px; padding: 10px 6px 6px; }
.dr-inputs { display: flex; align-items: center; gap: 8px; }
.dr-inputs .input { height: 46px; font-size: 15px; padding: 0 14px; background: var(--surface-3); }
.dr-dash { color: var(--muted); }
.dr-apply { justify-self: start; }
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: span 2; }
}
@media (max-width: 720px) {
  .kpis, .filter-grid { grid-template-columns: 1fr; }
  .filter-actions { grid-column: span 1; flex-wrap: wrap; }
  .dr-pop { width: min(360px, calc(100vw - 48px)); }
  .kpi b { font-size: 32px; }
}
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 14px; }
.chip-static { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text); }
.active-filters a { color: var(--accent); }

/* ---------- modal (email verification) ---------- */
.modal-screen { min-height: 100vh; display: flex; flex-direction: column; }
.modal-screen .top { width: 100%; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 10, 10, .72); display: grid; place-items: center; padding: 20px; z-index: 50; backdrop-filter: blur(6px); }
.modal { width: 100%; max-width: 460px; background: var(--surface); border-radius: var(--r-xl); padding: 36px; text-align: center; }
.modal h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin-top: 18px; }
.modal .sub { color: var(--muted); margin-top: 10px; }
.modal .sub b { color: var(--text); font-weight: 500; }
.modal .form { margin-top: 28px; text-align: left; }
.modal-icon { width: 64px; height: 64px; border-radius: 20px; background: rgba(68, 244, 140, .14); color: var(--accent); display: grid; place-items: center; margin: 0 auto; }
.modal-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.link-button { color: var(--accent); font-size: 15px; font-weight: 500; cursor: pointer; padding: 6px 2px; }
.link-button:disabled { color: var(--faint); cursor: default; }
.link-button.muted { color: var(--muted); }
.notice-sm { margin-top: 18px; padding: 12px 16px; font-size: 15px; }
.kpi sup.is-muted { color: var(--muted); }
.stats-table { font-size: 14px; }
.stats-table th, .stats-table td { padding: 12px 9px; }
.stats-table th:first-child, .stats-table td:first-child { padding-left: 14px; }
.dr-pop .dr-inputs .input { background: #404040; }
.dr-pop .dr-inputs .input:focus { background: #464646; box-shadow: 0 0 0 2px var(--accent); }
.dr-pop .dr-apply { background: #464646; }
.dr-pop .dr-apply:hover { background: #505050; }

/* ---------- docs ---------- */
.docs { max-width: 980px; margin: 0 auto; padding: 24px 40px 80px; }
.prose { padding: 40px 48px; line-height: 1.65; }
.prose h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.prose h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 40px 0 12px; }
.prose h3 { font-size: 19px; font-weight: 600; margin: 28px 0 10px; }
.prose p, .prose ul, .prose ol { margin: 12px 0; color: #d6d6d6; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; background: var(--surface-3); border-radius: 8px; padding: 2px 7px; color: var(--text); }
.prose pre { background: var(--bg); border-radius: var(--r-md); padding: 18px 20px; overflow-x: auto; margin: 14px 0; }
.prose pre code { background: none; padding: 0; font-size: 14px; line-height: 1.6; color: #cfe9d6; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 15px; margin: 14px 0; }
.prose th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 12px; }
.prose td { background: var(--surface-2); padding: 10px 12px; vertical-align: top; }
.prose td:first-child { border-radius: 12px 0 0 12px; }
.prose td:last-child { border-radius: 0 12px 12px 0; }
.prose strong { color: var(--text); }
.prose a { color: var(--accent); }
@media (max-width: 720px) { .docs { padding: 12px 12px 48px; } .prose { padding: 24px 18px; } .prose table { display: block; overflow-x: auto; } }

/* ---------- postback dialog ---------- */
.pb-dialog { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 48px); margin: auto; padding: 0; border: 0; border-radius: var(--r-xl); background: var(--surface); color: var(--text); overflow-y: auto; }
.pb-dialog::backdrop { background: rgba(10, 10, 10, .72); backdrop-filter: blur(6px); }
.pb-dialog form { padding: 28px 32px 32px; display: grid; gap: 22px; }
.pb-head { display: flex; justify-content: space-between; align-items: center; }
.pb-head h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.pb-head .icon-btn { background: var(--surface-2); }
.pb-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 28px; }
.pb-main, .pb-side { display: grid; gap: 14px; align-content: start; }
.pb-dialog .input, .pb-dialog .dd-toggle { background-color: var(--surface-2); }
.pb-dialog .input:hover, .pb-dialog .input:focus { background-color: var(--surface-3); }
.pb-dialog .textarea { height: auto; min-height: 120px; padding: 16px 18px; font-size: 14px; }
.pb-dialog .dd-menu { background: var(--surface-3); }
.macro-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.macro-chip { padding: 8px 12px; border-radius: 10px; background: var(--surface-3); color: var(--text); font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; cursor: pointer; transition: background .15s, color .15s; }
.macro-chip:hover { background: rgba(68, 244, 140, .16); color: var(--accent); }
.check-list { display: grid; gap: 4px; }
.check-row { display: flex; align-items: flex-start; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.check-row:hover { background: var(--surface-2); }
.check-row input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 22px; height: 22px; border-radius: 7px; background: var(--surface-3); display: grid; place-items: center; color: transparent; flex-shrink: 0; margin-top: 1px; transition: background .15s, color .15s; }
.check-row input:checked + .check-box { background: var(--accent); color: var(--accent-ink); }
.check-row input:focus-visible + .check-box { box-shadow: 0 0 0 2px var(--text); }
.check-text { font-size: 16px; }
.check-text small { display: block; color: var(--muted); font-size: 13px; }
.pb-actions { display: flex; justify-content: flex-end; }
.pb-actions .btn { min-width: 180px; }
.pb-macros h3 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.macro-table { display: grid; gap: 4px; }
.macro-row { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 15px; }
.macro-row code { color: var(--accent); font-size: 14px; }
.macro-row span { color: #cfcfcf; }
.method-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; vertical-align: middle; }
@media (max-width: 860px) {
  .pb-grid { grid-template-columns: 1fr; }
  .macro-row { grid-template-columns: 1fr; gap: 4px; }
  .pb-dialog form { padding: 22px 18px; }
}

/* ---------- brand logo ---------- */
.logo img { display: block; height: 41px; width: auto; }
.side .logo img { height: 36px; }
.side .logo { padding: 6px 12px; }
@media (max-width: 720px) { .logo img { height: 34px; } }


/* "Доступно к выводу" card — glass: frosted green tint over soft brand-green light (a negative balance keeps the regular card) */
.card-glass { position: relative; overflow: hidden; isolation: isolate; background: rgba(68, 244, 140, .07);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px rgba(255, 255, 255, .03); }
.card-glass::before { content: ""; position: absolute; z-index: -1; inset: -40%; pointer-events: none;
  background: radial-gradient(circle at 18% 30%, rgba(68, 244, 140, .30), transparent 38%),
              radial-gradient(circle at 85% 85%, rgba(68, 244, 140, .16), transparent 40%);
  filter: blur(30px); }
.card-glass::after { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .07), transparent 45%); }
.card-glass .card-label, .card-glass .hint { color: rgba(236, 236, 236, .72); }
.card-glass .money, .card-glass .big { color: var(--text); }
.card-glass .money small { color: var(--accent); }
.card-glass .btn-soft { background: rgba(255, 255, 255, .08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.card-glass .btn-soft:hover { background: rgba(255, 255, 255, .14); }
/* glass KPI cards on Statistics: light spot shifts card to card so the row doesn't look stamped */
.kpi.card-glass .card-label svg { color: rgba(236, 236, 236, .6); }
.kpi.card-glass:nth-child(2)::before { background: radial-gradient(circle at 70% 20%, rgba(68, 244, 140, .26), transparent 38%), radial-gradient(circle at 15% 90%, rgba(68, 244, 140, .14), transparent 40%); }
.kpi.card-glass:nth-child(3)::before { background: radial-gradient(circle at 35% 80%, rgba(68, 244, 140, .24), transparent 38%), radial-gradient(circle at 90% 15%, rgba(68, 244, 140, .14), transparent 40%); }
.kpi.card-glass:nth-child(4)::before { background: radial-gradient(circle at 85% 40%, rgba(68, 244, 140, .28), transparent 38%), radial-gradient(circle at 10% 10%, rgba(68, 244, 140, .14), transparent 40%); }

/* ---------- admin ---------- */
.admin-brand { display: grid; gap: 8px; }
.admin-tag { justify-self: start; margin-left: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(68, 244, 140, .14); color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.nav-badge { margin-left: auto; min-width: 24px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; display: inline-grid; place-items: center; }
.notice-top { margin: 0 0 24px; }
.admin-row-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .input { height: 40px; font-size: 14px; padding: 0 12px; border-radius: 10px; min-width: 180px; background: var(--surface-2); }
.reject-box summary { list-style: none; cursor: pointer; }
.reject-box summary::-webkit-details-marker { display: none; }
.reject-box[open] summary { display: none; }
.requisites { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.copy-mini { color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.copy-mini:hover { color: var(--text); background: var(--surface-2); }
.key-box { padding: 20px 22px; border-radius: var(--r-md); background: rgba(68, 244, 140, .1); display: grid; gap: 10px; }
.key-box b { color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-top: 18px; }
.form-grid .span-2 { grid-column: span 2; }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .15s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(18px); background: var(--accent-ink); }
.switch-row input:focus-visible + .switch { box-shadow: 0 0 0 2px var(--text); }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }
.payout-actions { display: grid; gap: 8px; justify-items: end; }
.payout-actions .inline-form .input { min-width: 0; width: 170px; }
.payout-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.payout-actions details[open] { flex-basis: 100%; display: flex; justify-content: flex-end; }
.payout-actions .inline-form .input { width: 220px; }
.payout-actions details[open] .inline-form { display: grid; gap: 8px; justify-items: end; }
.payout-actions .inline-form .input { width: 230px; }
