/* Private stats dashboard (owner/admin only) */
.page-stats { background: #070b12; }
.st { max-width: 1180px; margin: 0 auto; padding: 28px 18px 80px; color: #eef2f7; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.st h1 { font-size: clamp(34px, 6vw, 52px); margin: 10px 0 6px; }
.st h2 { font-size: 22px; margin: 0; letter-spacing: .02em; }
.st h2 small { font-size: 14px; color: var(--muted, #8d99ab); font-family: system-ui, sans-serif; text-transform: none; }
.st-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.st-sub { color: var(--muted, #8d99ab); margin: 0; font-size: 15px; line-height: 1.45; }
.st-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.st-range { display: inline-flex; border: 1px solid var(--line, #1e2a3c); background: var(--card, #0d1420); }
.st-range button, .st-refresh { appearance: none; background: transparent; color: #cfd6e0; border: 0; padding: 9px 14px; font: 600 15px/1 system-ui, sans-serif; cursor: pointer; min-height: 40px; }
.st-range button + button { border-left: 1px solid var(--line, #1e2a3c); }
.st-range button.is-on { background: var(--red, #d71f2b); color: #fff; }
.st-refresh { border: 1px solid var(--line, #1e2a3c); background: var(--card, #0d1420); }
.st-range button:focus-visible, .st-refresh:focus-visible, .st-ballot-tabs button:focus-visible { outline: 2px solid var(--gold, #c9a227); outline-offset: 2px; }
.st-loading { color: var(--muted, #8d99ab); }
.st-lock { border: 1px solid var(--line, #1e2a3c); background: var(--card, #0d1420); padding: 22px; max-width: 560px; }
.st-lock p { color: #cfd6e0; line-height: 1.5; }
.st-lock-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; align-items: center; }
.st-lock input { flex: 1 1 200px; min-width: 0; padding: 12px 14px; background: #070b12; color: #eef2f7; border: 1px solid var(--line, #1e2a3c); font: 16px/1.3 system-ui, sans-serif; }
.st-msg { min-height: 1.3em; color: var(--red, #d71f2b); font-size: 15px; }
.st-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.st-kpi { background: var(--card, #0d1420); border: 1px solid var(--line, #1e2a3c); padding: 14px 16px; }
.st-kpi b { display: block; font-size: 30px; line-height: 1.05; font-variant-numeric: tabular-nums; color: #fff; }
.st-kpi span { display: block; color: var(--muted, #8d99ab); font-size: 13px; margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }
.st-kpi.is-gold b { color: var(--gold, #c9a227); }
.st-kpi.is-live b { color: #4ade80; }
.st-card { background: var(--card, #0d1420); border: 1px solid var(--line, #1e2a3c); padding: 16px; margin-bottom: 14px; min-width: 0; }
.st-card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.st-card-h small { color: var(--muted, #8d99ab); font-size: 13px; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.st-grid .st-card { margin-bottom: 0; }
.st-grid + .st-card, .st-grid + .st-grid { margin-top: 14px; }
.st-legend { color: var(--muted, #8d99ab); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.st-legend i { display: inline-block; width: 12px; height: 12px; margin-left: 6px; }
.lg-v { background: var(--red, #d71f2b); }
.lg-u { background: var(--gold, #c9a227); }
.st-chart { width: 100%; position: relative; }
.st-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.st-chart .ax { fill: #8d99ab; font: 11px system-ui, sans-serif; }
.st-chart .grid { stroke: #1e2a3c; stroke-width: 1; }
.st-chart .bar-v { fill: var(--red, #d71f2b); }
.st-chart .bar-u { fill: var(--gold, #c9a227); }
.st-chart .bar-v:hover, .st-chart .bar-u:hover { opacity: .8; }
.st-chart .line-u { fill: none; stroke: var(--gold, #c9a227); stroke-width: 2.5; }
.st-chart .dot-u { fill: var(--gold, #c9a227); }
.st-empty { color: var(--muted, #8d99ab); font-size: 15px; padding: 10px 0; }
.st-note { color: #cfd6e0; font-size: 14px; line-height: 1.5; margin: 0 0 12px; border-left: 3px solid var(--gold, #c9a227); padding: 6px 10px; background: rgba(201,162,39,.06); }
.st-bars { list-style: none; margin: 0; padding: 0; }
.st-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 7px 0; border-bottom: 1px solid #141e2d; font-size: 15px; }
.st-bars li:last-child { border-bottom: 0; }
.st-bars .k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-bars .k small { color: var(--muted, #8d99ab); }
.st-bars .n { font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }
.st-bars .n small { color: var(--muted, #8d99ab); font-weight: 400; margin-left: 4px; }
.st-bars .b { grid-column: 1 / -1; height: 6px; background: #141e2d; }
.st-bars .b i { display: block; height: 100%; background: var(--red, #d71f2b); min-width: 2px; }
.st-bars.is-gold .b i { background: var(--gold, #c9a227); }
.st-bars li.is-lead .k { color: var(--gold, #c9a227); font-weight: 700; }
.st-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.st-donut svg { width: 140px; height: 140px; flex: 0 0 auto; }
.st-donut ul { list-style: none; margin: 0; padding: 0; flex: 1 1 140px; }
.st-donut li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 15px; }
.st-donut li i { width: 12px; height: 12px; display: inline-block; flex: 0 0 auto; }
.st-donut li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.st-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.st-mini div { border: 1px solid #141e2d; padding: 10px 12px; }
.st-mini b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.st-mini span { color: var(--muted, #8d99ab); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.st-ballot-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0 10px; }
.st-ballot-tabs button { appearance: none; border: 1px solid var(--line, #1e2a3c); background: #070b12; color: #cfd6e0; padding: 8px 12px; font: 600 14px/1.2 system-ui, sans-serif; cursor: pointer; min-height: 38px; text-align: left; }
.st-ballot-tabs button.is-on { border-color: var(--gold, #c9a227); color: var(--gold, #c9a227); }
.st-ballot-tabs button em { font-style: normal; font-weight: 400; color: var(--muted, #8d99ab); margin-left: 6px; font-size: 12px; }
.st-ballot-meta { color: var(--muted, #8d99ab); font-size: 14px; margin: 0 0 8px; }
.st-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 7px; border: 1px solid currentColor; text-transform: uppercase; margin-left: 6px; vertical-align: middle; }
.st-pill.open { color: #4ade80; } .st-pill.closed { color: #8d99ab; } .st-pill.upcoming { color: #60a5fa; }
.st-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.st-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-table th, .st-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #141e2d; white-space: nowrap; }
.st-table th { color: var(--muted, #8d99ab); font-weight: 600; text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
.st-table td.is-ev { color: var(--gold, #c9a227); }
.st-coverage ul { margin: 6px 0 12px; padding-left: 20px; color: #cfd6e0; line-height: 1.55; font-size: 14px; }
.st-coverage p { color: #cfd6e0; font-size: 14px; line-height: 1.55; }
.st-coverage h3 { font-size: 15px; font-family: system-ui, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #8d99ab); margin-top: 8px; }
.st-foot { color: var(--muted, #8d99ab); font-size: 14px; margin-top: 18px; }
.st-tip { position: absolute; pointer-events: none; background: #000; border: 1px solid var(--line, #1e2a3c); color: #fff; padding: 6px 8px; font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; }
@media (max-width: 760px) {
  .st { padding: 18px 12px 60px; }
  .st-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .st-kpi { padding: 12px; }
  .st-kpi b { font-size: 24px; }
  .st-card { padding: 12px; }
  .st-controls { width: 100%; }
  .st-range { flex: 1 1 auto; }
  .st-range button { flex: 1 1 0; padding: 9px 6px; }
}

/* Goals-first KPIs (v2) */
.st-kpi.is-primary { border-color: rgba(201,162,39,.45); background: #0f1622; }
.st-kpi.is-primary span { color: #e3c25a; }
.st-goal-note { color: #cfd6e0; font-size: 14px; line-height: 1.45; margin: 0 0 14px; }
#sec-signups, #sec-gold-goal { border-color: rgba(201,162,39,.28); }


/* Focused owner dashboard */
.page-stats .st-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.page-stats .st-kpi { padding: 22px; background: #111b2b; border-color: #344354; }
.page-stats .st-kpi b { font-size: clamp(34px,6vw,54px); line-height: 1.1; }
.page-stats .st-kpi span { font-size: 15px; text-transform: none; letter-spacing: 0; margin-top: 9px; color: #d5dce6; }
.page-stats .st-kpi.is-primary { border-top: 3px solid var(--red,#d71f2b); }
.page-stats .st-kpi.is-gold { border-top-color: var(--gold,#c9a227); }
.page-stats .st-kpi.is-gold b { color: #edcc64; }
.page-stats #sec-signups, .page-stats #sec-gold-goal { padding: 22px; }
.page-stats #sec-gold-goal .st-note { font-size: 15px; }
.page-stats details > summary { cursor: pointer; font-size: 21px; font-weight: 700; padding: 3px 0; }
.page-stats details > summary + * { margin-top: 20px; }
.page-stats details .st-grid { gap: 30px; margin: 22px 0; }
@media(max-width:700px) { .page-stats .st-kpi { padding:16px 12px; } .page-stats .st-kpi b { font-size:38px; } .page-stats .st-kpi span { font-size:13px; } }

/* Compact finance strip: horizontal on desktop, tight 2-col on phone */
.st-finstrip { margin: 0 0 10px; padding: 0; border: 0; background: transparent; }
.st-finstrip-row { display: flex; flex-wrap: nowrap; gap: 8px; align-items: stretch; }
.st-finstrip-row > div { flex: 1 1 0; min-width: 0; border: 1px solid #2a384c; background: #0f1622; padding: 6px 8px; }
.st-finstrip-row b { display: block; font-size: 16px; line-height: 1.1; font-variant-numeric: tabular-nums; color: #fff; }
.st-finstrip-row span { display: block; margin-top: 2px; color: #9aa6b8; font-size: 11px; letter-spacing: .02em; text-transform: uppercase; }
.st-finstrip-row .is-gold b { color: #edcc64; }
.st-finstrip-row .is-gift b { color: #7dd3a7; }
.st-finstrip-period { margin: 6px 0 0; color: #8d99ab; font-size: 12px; line-height: 1.35; }
@media (max-width: 700px) {
  .st-finstrip-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .st-finstrip-row > div { padding: 7px 8px; }
  .st-finstrip-row b { font-size: 16px; }
  .st-finstrip-row span { font-size: 10px; }
}
