:root {
  color-scheme: light;
  --bg: #f3f5f1;
  --surface: #ffffff;
  --text: #17201b;
  --muted: #68736d;
  --line: #dce2dd;
  --accent: #167451;
  --accent-dark: #0f5c40;
  --accent-soft: #e5f2eb;
  --danger: #a63232;
  --radius: 14px;
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.topbar { min-height: 68px; padding: 0 max(24px, calc((100vw - 1280px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-size: 14px; font-weight: 760; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: var(--text); border-radius: 10px; font-size: 11px; letter-spacing: -.04em; }
.account { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; }
.page-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 90px; }
.login-layout { min-height: calc(100dvh - 190px); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .65fr); align-items: center; gap: clamp(60px, 10vw, 140px); }
.login-copy { max-width: 690px; }
.eyebrow, .panel-label { margin: 0 0 14px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 20px; font-size: clamp(44px, 6vw, 78px); line-height: .96; letter-spacing: -.065em; }
h2 { margin-bottom: 6px; font-size: 23px; letter-spacing: -.035em; }
.login-copy > p:not(.eyebrow) { max-width: 590px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.terms-line { margin-top: 42px; padding: 22px 0; display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: baseline; gap: 10px 18px; border-block: 1px solid var(--line); }
.terms-line strong { font-size: 27px; letter-spacing: -.05em; }
.terms-line span { color: var(--muted); font-size: 12px; }
.login-stack { max-width: 430px; justify-self: end; width: 100%; }
.panel, .section-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.auth-panel { padding: 30px; display: grid; gap: 20px; box-shadow: 0 22px 70px rgba(27, 48, 36, .09); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, textarea, select { width: 100%; padding: 12px 13px; color: var(--text); background: #fff; border: 1px solid #bfc8c1; border-radius: 9px; outline: none; }
input { min-height: 47px; }
select { min-height: 47px; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,116,81,.13); }
.primary-button { min-height: 46px; padding: 0 18px; color: #fff; background: var(--accent); border: 0; border-radius: 9px; font-size: 13px; font-weight: 780; white-space: nowrap; transition: background-color 150ms ease, transform 120ms ease; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:active { transform: scale(.98); }
.primary-button:disabled { opacity: .55; cursor: wait; }
.primary-button.compact { min-height: 40px; }
.link-button { padding: 0; color: var(--accent); background: transparent; border: 0; font-size: 12px; font-weight: 750; }
.align-left { justify-self: start; }
.muted { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.form-status { min-height: 18px; margin: -5px 0 0; color: var(--muted); font-size: 12px; }
.form-status.error, .notice.error { color: var(--danger); }
.form-status.success { color: var(--accent); }
.workspace { display: grid; gap: 28px; }
.workspace-header { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 36px; padding: 18px 0 34px; border-bottom: 1px solid var(--line); }
.workspace-header h1 { margin-bottom: 9px; font-size: clamp(38px, 5vw, 64px); }
.workspace-header p:last-child { margin-bottom: 0; color: var(--muted); }
.referral-box { min-width: 230px; padding: 20px; display: grid; gap: 5px; background: var(--text); border-radius: var(--radius); }
.referral-box span { color: #a9b5ae; font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.referral-box strong { color: #fff; font-size: 21px; letter-spacing: .04em; }
.referral-box .link-button { width: fit-content; margin-top: 6px; color: #79d5ad; }
.notice { padding: 13px 15px; background: #f9eaea; border: 1px solid #edcaca; border-radius: 10px; font-size: 13px; }
.legal-acceptance { min-height: calc(100dvh - 190px); display: grid; grid-template-columns: minmax(0, .9fr) minmax(400px, .72fr); align-items: start; gap: clamp(48px, 8vw, 110px); }
.legal-intro { padding-top: 26px; }
.legal-intro h1 { max-width: 680px; font-size: clamp(42px, 5.8vw, 70px); }
.legal-intro > p:not(.eyebrow) { max-width: 610px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.legal-proof { margin-top: 38px; padding-block: 20px; display: grid; gap: 10px; border-block: 1px solid var(--line); }
.legal-proof strong { margin-bottom: 3px; font-size: 13px; }
.legal-proof span { color: var(--muted); font-size: 12px; }
.legal-proof span::before { content: "✓"; margin-right: 9px; color: var(--accent); font-weight: 800; }
.legal-panel { padding: 30px; display: grid; gap: 18px; box-shadow: 0 22px 70px rgba(27, 48, 36, .09); }
.legal-documents { display: grid; border-block: 1px solid var(--line); }
.legal-document { padding: 13px 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; }
.legal-document + .legal-document { border-top: 1px solid var(--line); }
.legal-document strong, .legal-document span { display: block; }
.legal-document strong { font-size: 12px; line-height: 1.35; }
.legal-document span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.legal-document a { color: var(--accent); font-size: 11px; font-weight: 750; text-decoration: none; }
.check-row { grid-template-columns: 18px 1fr; align-items: start; gap: 10px; font-weight: 600; line-height: 1.5; }
.check-row input { width: 17px; min-height: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); }
.check-row a { color: var(--accent); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metrics article { min-height: 138px; padding: 23px; display: flex; flex-direction: column; background: var(--surface); }
.metrics article + article { border-left: 1px solid var(--line); }
.metrics span { color: var(--muted); font-size: 11px; font-weight: 700; }
.metrics strong { margin: auto 0 3px; font-size: 30px; letter-spacing: -.055em; }
.metrics small { color: var(--muted); font-size: 11px; }
.metrics .metric-accent { background: var(--accent-soft); }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); align-items: start; gap: 20px; }
.main-column, .side-column { display: grid; gap: 20px; }
.section-block { padding: 25px; }
.section-heading { margin-bottom: 18px; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 11px 12px; color: var(--muted); background: #f6f8f5; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 15px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.client-cell strong, .client-cell span { display: block; }
.client-cell span { margin-top: 3px; color: var(--muted); }
.status { display: inline-flex; padding: 5px 8px; color: #5e5541; background: #f4efe3; border-radius: 7px; font-size: 10px; font-weight: 800; }
.status.connected, .status.active, .status.available, .status.paid { color: var(--accent-dark); background: var(--accent-soft); }
.status.lost, .status.blocked { color: var(--danger); background: #f9eaea; }
.connection-row { padding: 15px 0; display: grid; grid-template-columns: 1fr auto; gap: 18px; border-bottom: 1px solid var(--line); }
.connection-row:last-child { border-bottom: 0; padding-bottom: 0; }
.connection-row strong, .connection-row span { display: block; }
.connection-row span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.connection-meta { text-align: right; }
.ledger-item, .payout-item { padding: 13px 0; display: grid; grid-template-columns: 1fr auto; gap: 14px; border-bottom: 1px solid var(--line); }
.ledger-item:last-child, .payout-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ledger-item strong, .payout-item strong { font-size: 13px; }
.ledger-item span, .payout-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.amount { text-align: right; }
.amount b { display: block; font-size: 13px; }
.empty-state { padding: 34px 12px 16px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }
.empty-state strong { color: var(--text); }
.empty-state p { margin: 7px 0 0; font-size: 12px; }
.document-links a { display: block; padding: 10px 0; color: var(--text); border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; text-decoration: none; }
.document-links a:hover { color: var(--accent); }
.compact-empty { padding-top: 20px; }
.lead-dialog { width: min(590px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 28px 90px rgba(20,35,27,.24); }
.lead-dialog::backdrop { background: rgba(19,29,23,.6); backdrop-filter: blur(3px); }
.dialog-panel { position: relative; padding: 28px; display: grid; gap: 18px; }
.dialog-close { position: absolute; top: 13px; right: 15px; width: 34px; height: 34px; color: var(--muted); background: transparent; border: 0; font-size: 25px; }
.field-grid { display: grid; grid-template-columns: .65fr 1.35fr; gap: 12px; }
@media (max-width: 900px) {
  .login-layout, .legal-acceptance, .content-grid { grid-template-columns: 1fr; }
  .login-layout { padding: 28px 0; gap: 42px; }
  .legal-acceptance { gap: 38px; }
  .login-stack { max-width: none; justify-self: stretch; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metrics article:nth-child(4) { border-top: 1px solid var(--line); }
}
@media (max-width: 620px) {
  .topbar { padding-inline: 16px; }
  .page-shell { width: min(100% - 28px, 1280px); padding-top: 34px; }
  h1 { font-size: 43px; }
  .terms-line { grid-template-columns: auto 1fr; }
  .workspace-header { grid-template-columns: 1fr; }
  .referral-box { width: 100%; }
  .metrics { grid-template-columns: 1fr; }
  .metrics article + article { border-left: 0; border-top: 1px solid var(--line); }
  .section-block { padding: 19px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .field-grid { grid-template-columns: 1fr; }
  .legal-panel { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
