/* RegularPython Marketing Hub: single stylesheet, tokens first. */
:root {
  color-scheme: light;
  --bg: #f6f5f1; --surface: #fff; --surface-2: #f0efea; --line: #e3e1d9; --line-strong: #c3c2b7;
  --ink: #17191c; --ink-2: #52514e; --ink-3: #6f6d68;
  --brand: #1f5f93; --brand-ink: #174a73; --brand-soft: #e3eef7; --accent: #ffd43b;
  --side: #10263a; --side-2: #1a3650; --side-ink: #b9c8d6;
  --good: #006300; --good-soft: #e2f1e2; --warn: #8a5a00; --warn-soft: #fbf0d3;
  --bad: #b42323; --bad-soft: #fae5e4; --info-soft: #e3eef7;
  --series-1: #2a78d6; --grid: #e1e0d9; --axis: #c3c2b7;
  --r1: #86b6ef; --r2: #6da7ec; --r3: #3987e5; --r4: #2a78d6; --r5: #1c5cab; --r6: #184f95;
  --shadow: 0 1px 2px rgba(16, 38, 58, .06);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #111314; --surface: #1a1c1d; --surface-2: #25282a; --line: #2f3234; --line-strong: #484c4e;
    --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #9d9b93;
    --brand: #6daee3; --brand-ink: #a3cdf0; --brand-soft: #1b3347;
    --side: #0c1a26; --side-2: #18303f; --good: #4cc54c; --good-soft: #15301a; --warn: #f0be55; --warn-soft: #3a2e12;
    --bad: #ef8080; --bad-soft: #3d1c1c; --info-soft: #1b3347;
    --series-1: #3987e5; --grid: #2c2c2a; --axis: #484c4e;
    --r1: #184f95; --r2: #1c5cab; --r3: #2a78d6; --r4: #3987e5; --r5: #6da7ec; --r6: #9ec5f4;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111314; --surface: #1a1c1d; --surface-2: #25282a; --line: #2f3234; --line-strong: #484c4e;
  --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #9d9b93;
  --brand: #6daee3; --brand-ink: #a3cdf0; --brand-soft: #1b3347;
  --side: #0c1a26; --side-2: #18303f; --good: #4cc54c; --good-soft: #15301a; --warn: #f0be55; --warn-soft: #3a2e12;
  --bad: #ef8080; --bad-soft: #3d1c1c; --info-soft: #1b3347;
  --series-1: #3987e5; --grid: #2c2c2a; --axis: #484c4e;
  --r1: #184f95; --r2: #1c5cab; --r3: #2a78d6; --r4: #3987e5; --r5: #6da7ec; --r6: #9ec5f4;
  --shadow: none;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 650; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }

/* Shell */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 10px 20px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: #fff; font-weight: 650; line-height: 1.15; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: 11.5px; color: var(--side-ink); }
.logo { width: 32px; height: 32px; flex: none; border-radius: 7px; display: grid; place-items: center; font-weight: 750; font-size: 13px; color: #10263a; background: linear-gradient(135deg, #6daee3 50%, var(--accent) 50%); }
.nav-label { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding: 12px 10px 4px; color: #86a0b5; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--side-ink); }
.nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav a.on { background: var(--side-2); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav .badge { margin-left: auto; background: var(--accent); color: #10263a; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 0 6px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-search { flex: 1; max-width: 340px; position: relative; }
.top-search i { position: absolute; left: 10px; top: 9px; color: var(--ink-3); }
.top-search input { padding-left: 32px; }
.top .spacer { flex: 1; }
.btn.menu-btn { display: none; }
.chip-sample { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.user { display: flex; align-items: center; gap: 8px; }
#toast[hidden] { display: none; }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 650; font-size: 12px; }
.content { padding: 20px 24px 40px; max-width: 1360px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head p { color: var(--ink-2); margin-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: #1f5f93; border-color: #1f5f93; color: #fff; }
.btn-primary:hover { background: #174a73; }
.btn-sm { min-height: 28px; padding: 3px 8px; font-size: 12.5px; }
.btn-wa { color: #0b6b3a; border-color: #8cc9a6; }
.btn-danger { color: var(--bad); }
input, select, textarea { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
textarea { min-height: 76px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 16px; min-height: 16px; height: 16px; padding: 0; accent-color: #1f5f93; }
label.field { display: block; margin-bottom: 12px; font-weight: 550; }
label.field > input, label.field > select, label.field > textarea { margin-top: 4px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters > * { width: auto; flex: 1 1 150px; max-width: 220px; }
.filters .grow { flex: 2 1 220px; max-width: 340px; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; }

/* Cards and grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-head p { color: var(--ink-3); font-size: 12.5px; }
.card-body { padding: 14px 16px; }
.grid { display: grid; gap: 14px; margin-bottom: 14px; align-items: start; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stretch { align-items: stretch; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .label { color: var(--ink-2); font-size: 12.5px; }
.kpi .value { font-size: 25px; font-weight: 650; line-height: 1.3; }
.kpi .delta { font-size: 12.5px; color: var(--ink-3); }
.up { color: var(--good); font-weight: 600; }
.down { color: var(--bad); font-weight: 600; }

/* Attention list */
.attn { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); color: var(--ink); }
.attn:last-child { border-bottom: 0; }
.attn:hover { background: var(--surface-2); text-decoration: none; }
.attn .n { min-width: 32px; font-size: 18px; font-weight: 650; text-align: right; }
.attn .t { flex: 1; min-width: 0; }
.attn .t > span { display: block; color: var(--ink-3); font-size: 12.5px; }
.attn i { color: var(--ink-3); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; background: var(--surface); }
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .right, .tbl th.right { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.person b { font-weight: 600; display: block; line-height: 1.25; }
.person span { font-size: 12px; color: var(--ink-3); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; }
.bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 16px; background: var(--brand-soft); border-bottom: 1px solid var(--line); }
.bulk select { width: auto; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 550; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.st-new, .st-contacted { background: var(--info-soft); color: var(--brand-ink); }
.st-interested, .st-demo-booked, .st-payment-pending, .st-warn { background: var(--warn-soft); color: var(--warn); }
.st-bought, .st-good { background: var(--good-soft); color: var(--good); }
.st-not-interested, .st-no-response { background: var(--surface-2); color: var(--ink-2); }
.st-do-not-contact, .st-bad { background: var(--bad-soft); color: var(--bad); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; color: var(--ink-2); padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
.tab-link { padding: 8px 12px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tab-link.on { color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }
@media print { .side, .top, .actions, .tabs { display: none !important; } .app { display: block; } }

/* Charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--ink-3); font-size: 12px; font-family: inherit; }
.chart .val { fill: var(--ink); font-weight: 600; }
.chart .gl { stroke: var(--grid); }
.chart .ax { stroke: var(--axis); }
.chart .bar { fill: var(--series-1); }
.chart .hit { fill: transparent; }
.chart g.b:hover .bar, .chart g.b:focus .bar { opacity: .75; }
.chart g.b:focus { outline: none; }
.hb { display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 3px 0; }
.hb .lab { overflow-wrap: anywhere; }
.hb .track { height: 10px; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.hb .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.hb .val { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; min-width: 44px; }
.r1 { background: var(--r1) !important; } .r2 { background: var(--r2) !important; } .r3 { background: var(--r3) !important; }
.r4 { background: var(--r4) !important; } .r5 { background: var(--r5) !important; } .r6 { background: var(--r6) !important; }
details.twin { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
details.twin summary { cursor: pointer; }
#tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--surface); padding: 5px 9px; border-radius: 6px; font-size: 12.5px; max-width: 240px; }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress > div { height: 100%; background: var(--series-1); }

/* Kanban */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-2); border-radius: 8px; padding: 8px; min-height: 340px; }
.col.over { outline: 2px dashed var(--brand); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; font-weight: 600; }
.k-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 7px; cursor: grab; color: var(--ink); }
.k-card:hover { border-color: var(--line-strong); text-decoration: none; }
.k-card b { display: block; font-weight: 600; }
.k-card .meta { font-size: 12px; color: var(--ink-3); }
.k-card b a { color: inherit; }
.k-assign { min-height: 28px; padding: 2px 6px; margin-top: 5px; font-size: 12.5px; }
.k-card .log { display: block; font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.k-card .foot { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; margin-top: 4px; color: var(--ink-2); }

/* Timeline and stepper */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; }
.timeline i { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; }
.stepper { display: flex; gap: 3px; overflow-x: auto; margin-bottom: 14px; }
.stepper div { flex: 1 0 auto; text-align: center; padding: 6px 12px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.stepper div:first-child { border-radius: 6px 0 0 6px; }
.stepper div:last-child { border-radius: 0 6px 6px 0; }
.stepper div.done { background: var(--brand-soft); color: var(--brand-ink); }
.stepper div.now { background: #1f5f93; color: #fff; font-weight: 600; }
.dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 14px; margin: 0; }
.dl dt { color: var(--ink-3); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* Wizard */
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.steps button { flex: 1 1 140px; display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 8px 10px; font: inherit; color: var(--ink-2); cursor: pointer; text-align: left; }
.steps button b { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; }
.steps button.on { border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.steps button.on b { background: #1f5f93; color: #fff; }
.option { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; cursor: pointer; }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.option i { color: var(--brand-ink); font-size: 18px; }
.option span { display: block; color: var(--ink-2); font-size: 12.5px; }
.drop { border: 1.5px dashed var(--line-strong); border-radius: 8px; padding: 26px 16px; text-align: center; color: var(--ink-2); }

/* Lead search in the commission form */
.picker-list { margin-top: 4px; border: 1px solid var(--line-strong); border-radius: 6px; max-height: 230px; overflow-y: auto; }
.picker-list p { padding: 8px 10px; }
.picker-list button { display: block; width: 100%; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.picker-list button:hover, .picker-list button:focus { background: var(--surface-2); }
.picker-list button:last-child { border-bottom: 0; }
.picker-list b { display: block; font-weight: 600; }
.picker-list span { display: block; font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.picker-list span.down { color: var(--bad); }

/* Member earnings */
.earn-hero { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; padding: 16px 20px; margin-bottom: 14px; border-radius: 8px; background: #10263a; color: #fff; }
.earn-hero .earn-label { font-size: 13px; color: #b9c8d6; }
.earn-hero .earn-rate { font-size: 40px; line-height: 1.15; font-weight: 700; color: #ffd43b; }
.earn-hero .earn-text { flex: 1 1 280px; }
.earn-hero .earn-text p { margin-bottom: 6px; }
.earn-hero .small { color: #b9c8d6; margin: 6px 0 0; }
.earn-hero .progress { background: rgba(255, 255, 255, .18); }
.earn-hero .progress > div { background: #ffd43b; }

/* Strategy */
.play { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: start; }
.play:last-child { border-bottom: 0; }
.play .big { font-size: 24px; font-weight: 650; text-align: center; line-height: 1.1; }
.play .big small { display: block; font-size: 11px; font-weight: 400; color: var(--ink-3); }
.play p { color: var(--ink-2); }
.msg { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; margin-top: 6px; font-size: 13px; color: var(--ink); }
.callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: 6px; background: var(--info-soft); color: var(--ink); margin-bottom: 14px; }
.callout i { color: var(--brand-ink); }
.callout.warn { background: var(--warn-soft); }
.callout.warn i { color: var(--warn); }

/* Modal and toast */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(10, 20, 30, .45); display: grid; place-items: center; padding: 16px; }
.modal-box { background: var(--surface); border-radius: 10px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-box .card-head button { border: 0; background: none; font-size: 18px; color: var(--ink-2); cursor: pointer; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
#toast { position: fixed; right: 16px; bottom: 16px; z-index: 95; background: var(--ink); color: var(--surface); padding: 9px 14px; border-radius: 6px; max-width: min(340px, calc(100vw - 32px)); }

/* Login and map */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: var(--side); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.login-side h1 { font-size: 28px; }
.login-side li { color: var(--side-ink); margin-bottom: 6px; }
.login-form { display: grid; place-items: center; padding: 32px 16px; }
.login-form form { width: min(340px, 100%); }
.map { padding: 28px 16px; max-width: 1040px; margin: 0 auto; }
.map-item { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.map-item:hover { border-color: var(--brand); text-decoration: none; }
.map-item b { display: block; }
.map-item span { font-size: 12.5px; color: var(--ink-2); }

@media (max-width: 1080px) { .g-21, .g-12, .g-3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; width: 240px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 4px 0 20px rgba(0, 0, 0, .3); }
  .btn.menu-btn { display: inline-flex; }
  .top { padding: 8px 16px; }
  .content { padding: 16px 16px 32px; }
  .g-2 { grid-template-columns: minmax(0, 1fr); }
  .top-search, .user-name { display: none; }
  .top .spacer { flex: 1; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-side { padding: 24px 16px; }
  .filters > *, .filters .grow { max-width: none; flex-basis: 45%; }
  .play { grid-template-columns: 48px minmax(0, 1fr); }
  .play .play-act { grid-column: 2; }
}
