/* WinCustomersBack application styles — same palette & type as the marketing site. */
:root {
  --ink: #04070f; --ink-2: #1f2430; --muted: #6b7280; --muted-2: #9aa1ad; --line: #e4e5ea; --paper: #f5f4f8; --white: #fff;
  --blue: #1c3ee6; --blue-2: #2f7cf6; --blue-3: #2e9bff; --lime: #b6f13a; --plum: #241c3a; --lilac: #d7d1f2;
  --green: #138a4c; --green-bg: #e3f6ec; --amber: #9a5b00; --amber-bg: #fff2d9; --red: #b42318; --red-bg: #fde8e7; --blue-bg: #e8edff;
  --radius: 16px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(4,7,15,.06), 0 8px 24px rgba(4,7,15,.04);
}
* { box-sizing: border-box; margin: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: "Mulish", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); line-height: 1.5; }
a { color: var(--blue); }
a:hover { color: var(--ink); }
h1 { font-size: 1.875rem; font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: .75rem; }
h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: .75rem; }
h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
p + p { margin-top: .5rem; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
pre { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem; overflow-x: auto; white-space: pre-wrap; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 100; }
:focus-visible { outline: 2px solid var(--blue-3); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.lede { font-size: 1.05rem; color: var(--ink-2); margin-bottom: 1.25rem; max-width: 46rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: 9999px; padding: .6rem 1.2rem; font: inherit; font-weight: 600; font-size: .9rem; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn-primary { background: var(--ink); color: #fff; } .btn-primary:hover { background: var(--blue); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: rgba(0,0,0,.2); } .btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; } .btn-danger:hover { background: #8c1a12; color: #fff; }
.btn-danger-ghost { background: #fff; color: var(--red); border-color: rgba(180,35,24,.35); margin-top: .5rem; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; } .btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline; cursor: pointer; }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.25rem; }
.actions form { display: inline-flex; }

/* Forms */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .filters input, .filters select, .inline-form input, .inline-form select {
  width: 100%; font: inherit; font-size: .95rem; padding: .6rem .75rem; border: 1px solid #cfd2da; border-radius: var(--radius-sm); background: #fff; color: var(--ink); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(28,62,230,.15); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.field .error, .error { font-size: .82rem; color: var(--red); margin-top: .3rem; }
.error-text { color: var(--red); font-size: .82rem; }
.field.check label { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.field.check input { margin-top: .25rem; }
.req { color: var(--red); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 1rem; }
fieldset[disabled] { opacity: .55; }
legend { font-weight: 600; font-size: .9rem; padding: 0 .35rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr 2fr; } }
.inline-form, .filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0 1rem; }
.inline-form input, .filters input { flex: 1 1 14rem; width: auto; }
.inline-form select, .filters select { flex: 0 1 auto; width: auto; }

/* Alerts & badges */
.alert { border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .92rem; }
.alert ul { margin: .35rem 0 0 1.1rem; }
.alert-success { background: var(--green-bg); color: #0b5a31; } .alert-error { background: var(--red-bg); color: #7a150e; }
.alert-warning { background: var(--amber-bg); color: #6b3f00; } .alert-info { background: var(--blue-bg); color: #1b2d8f; }
.alert form.inline button { color: inherit; }
.secret { background: #fff; padding: .15rem .4rem; border-radius: 6px; word-break: break-all; user-select: all; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: capitalize; padding: .15rem .55rem; border-radius: 9999px; vertical-align: middle; letter-spacing: .01em; }
.badge-green { background: var(--green-bg); color: var(--green); } .badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: var(--amber); } .badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: #eceef2; color: #4b5260; }

/* App shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--ink); color: #fff; padding: 1.25rem 1rem; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; font-weight: 600; font-size: 1.02rem; }
.sidebar .brand { color: #fff; }
.org-name { color: var(--muted-2); font-size: .82rem; margin: .5rem 0 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar ul { list-style: none; padding: 0; display: grid; gap: 2px; }
.sidebar nav a { display: block; color: rgba(255,255,255,.78); text-decoration: none; padding: .5rem .75rem; border-radius: 9999px; font-size: .9rem; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a[aria-current="page"] { background: #fff; color: var(--plum); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; display: grid; gap: .5rem; font-size: .88rem; }
.sidebar-foot a, .sidebar-foot .linkish { color: rgba(255,255,255,.75); }
.count { background: var(--lime); color: #000; border-radius: 9999px; padding: 0 .45rem; font-size: .75rem; font-weight: 700; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: .75rem; padding: .75rem 1rem; background: var(--ink); color: #fff; }
.menu-btn { background: none; border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 9999px; width: 40px; height: 40px; font-size: 1.1rem; cursor: pointer; }
.topbar-title { font-weight: 600; flex: 1; } .topbar-user { font-size: .8rem; color: var(--muted-2); }
.content { padding: 2rem; max-width: 1180px; width: 100%; }
.banner { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .65rem 2rem; font-size: .9rem; }
.banner a, .banner .linkish { font-weight: 700; color: inherit; }
.banner-warn { background: var(--amber-bg); color: #6b3f00; } .banner-danger { background: var(--red-bg); color: #7a150e; } .banner-info { background: var(--blue-bg); color: #1b2d8f; }
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s; height: 100%; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .topbar { display: flex; }
  .content { padding: 1.25rem 1rem; }
  .banner { padding: .65rem 1rem; }
}

/* Cards, stats, tables */
.card { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.page-head h1 { margin-bottom: 0; }
.section-title { margin: 1.5rem 0 .75rem; }
.two-col { display: grid; gap: 1.25rem; grid-template-columns: 1fr; } .two-col > .card { margin-bottom: 0; } .two-col > * { min-width: 0; } .two-col { margin-bottom: 1.25rem; }
@media (min-width: 980px) { .two-col { grid-template-columns: 1fr 1fr; } }
.hero-metrics { display: grid; gap: 1.25rem; grid-template-columns: 1fr; margin-bottom: 1.25rem; }
@media (min-width: 720px) { .hero-metrics { grid-template-columns: 1.4fr 1fr; } }
.hero-metric { border-radius: 1.5rem; padding: 1.75rem; background: var(--ink); color: #fff; }
.hero-metric.primary { background: linear-gradient(135deg, #1c3ee6, #2f7cf6 60%, #2e9bff); }
.hero-metric .stat-label { color: rgba(255,255,255,.75); } .hero-metric .stat-sub { color: rgba(255,255,255,.75); }
.hero-value { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1.05; margin: .35rem 0; }
.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1.25rem; }
.stat { background: #fff; border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stat.warn { background: var(--amber-bg); }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.6rem; font-weight: 300; letter-spacing: -0.02em; margin-top: .2rem; }
.stat-sub { font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
.card .table-wrap { box-shadow: none; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #fafafc; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
.list { list-style: none; padding: 0; display: grid; gap: .6rem; }
.list li { padding-bottom: .6rem; border-bottom: 1px solid var(--line); } .list li:last-child { border-bottom: 0; }
.note-critical strong { color: var(--red); } .note-warning strong { color: var(--amber); }
.kv { display: grid; gap: .45rem; }
.kv > div { display: grid; grid-template-columns: 9rem 1fr; gap: .75rem; font-size: .92rem; }
.kv dt { color: var(--muted); }
.empty { background: #fff; border: 1px dashed #cfd2da; border-radius: var(--radius); padding: 2rem; text-align: center; margin-bottom: 1.25rem; }
.empty-title { font-weight: 700; font-size: 1.05rem; } .empty-body { color: var(--muted); margin: .4rem auto 1rem; max-width: 34rem; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
.meter { margin: .75rem 0; }
.meter-bar { height: 10px; background: #eceef2; border-radius: 9999px; overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--blue); border-radius: 9999px; }
.meter-bar span.warn { background: #e6a100; } .meter-bar span.full { background: var(--red); }
.meter-text { font-size: .85rem; margin-top: .35rem; color: var(--ink-2); }
.chart { margin: .5rem 0 0; } .chart-svg { width: 100%; display: block; } .chart-svg rect { fill: var(--blue-2); } .chart-svg rect:hover { fill: var(--blue); }
.chart-labels { display: flex; justify-content: space-around; font-size: .72rem; color: var(--muted); margin-top: .35rem; }
.timeline { list-style: none; padding: 0; display: grid; gap: .8rem; }
.timeline li { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding-left: .9rem; border-left: 3px solid var(--line); font-size: .9rem; }
.timeline time { color: var(--muted); font-size: .82rem; }
.timeline .t-win { border-left-color: var(--green); } .timeline .t-message { border-left-color: var(--blue-2); } .timeline .t-activity { border-left-color: var(--lime); }
@media (max-width: 640px) { .timeline li { grid-template-columns: 1fr; gap: .1rem; } .kv > div { grid-template-columns: 1fr; gap: 0; } }
.danger-zone { border: 1px solid rgba(180,35,24,.25); }
.count-callout { background: var(--blue-bg); border-radius: var(--radius-sm); padding: .75rem 1rem; color: #1b2d8f; margin: 1rem 0; }
.prose { max-width: 48rem; } .prose h2 { margin-top: 1.5rem; } .prose ul { margin: .5rem 0 .5rem 1.25rem; } .prose li { margin-bottom: .3rem; }

/* Onboarding */
.onboarding { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 1080px) { .onboarding { grid-template-columns: 230px 1fr; align-items: start; } }
.stepper { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
@media (min-width: 1080px) { .stepper { flex-direction: column; position: sticky; top: 1.5rem; } }
.stepper li a, .stepper li span { display: block; padding: .45rem .8rem; border-radius: 9999px; font-size: .85rem; text-decoration: none; color: var(--muted); }
.stepper li.done a { color: var(--green); } .stepper li.current a { background: var(--ink); color: #fff; font-weight: 600; }
.ob-card { padding: 2rem; } @media (max-width: 640px) { .ob-card { padding: 1.25rem; } }
.choice-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choice { display: flex; gap: .5rem; align-items: center; border: 1px solid #cfd2da; border-radius: var(--radius-sm); padding: .8rem 1rem; cursor: pointer; background: #fff; }
.choice:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,62,230,.12); }
.map-grid { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.sentence { font-size: 1.25rem; font-weight: 300; line-height: 2.2; }
.sentence select, .inline-num { font: inherit; font-size: 1.1rem; padding: .25rem .5rem; border: 1px solid #cfd2da; border-radius: var(--radius-sm); }
.inline-num { width: 6rem; }
.presets { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.chip { border: 1px solid #cfd2da; background: #fff; border-radius: 9999px; padding: .35rem .9rem; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.days { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.chip-check { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid #cfd2da; border-radius: 9999px; padding: .3rem .75rem; font-size: .85rem; }
.callout { margin-top: 1.5rem; background: var(--paper); border-radius: var(--radius-sm); padding: 1rem 1.25rem; }
.summary { display: grid; gap: .6rem; margin-bottom: 1.25rem; }
.summary > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--muted); font-weight: 600; font-size: .88rem; }
@media (max-width: 640px) { .summary > div { grid-template-columns: 1fr; gap: .1rem; } }
.seq { display: inline-block; background: var(--paper); border-radius: 9999px; padding: .1rem .6rem; margin: 0 .3rem .3rem 0; font-size: .82rem; }
.email-preview { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; background: #fff; }
.email-subject { font-weight: 700; margin-bottom: .5rem; }
.email-preview pre { background: none; border: 0; padding: 0; font-family: inherit; font-size: .9rem; }
details { margin: .75rem 0; } summary { cursor: pointer; font-weight: 600; }
.steps { list-style: none; padding: 0; display: grid; gap: 1rem; }
.step { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; }
.step-blank { border-style: dashed; background: #fbfbfd; }

/* Plans */
.plan-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin: 1rem 0; }
@media (min-width: 900px) { .plan-grid { grid-template-columns: repeat(3, 1fr); } }
.plan-card { position: relative; display: flex; flex-direction: column; gap: .35rem; border: 1px solid #d9dbe2; border-radius: 1.5rem; padding: 1.5rem; background: #fff; cursor: pointer; }
.plan-card.static { cursor: default; } .plan-card.current { border-color: var(--green); }
.plan-card.popular { border: 2px solid var(--blue); }
.plan-card:has(input:checked) { box-shadow: 0 0 0 4px rgba(28,62,230,.18); border-color: var(--blue); }
.plan-card input[type=radio] { position: absolute; top: 1.4rem; right: 1.4rem; width: 1.1rem; height: 1.1rem; }
.plan-flag { position: absolute; top: -.75rem; left: 1.5rem; background: var(--lime); color: #000; font-size: .72rem; font-weight: 800; padding: .2rem .7rem; border-radius: 9999px; text-transform: uppercase; letter-spacing: .05em; }
.plan-name { font-weight: 700; font-size: 1.1rem; }
.plan-price { font-size: 2rem; font-weight: 300; letter-spacing: -0.02em; }
.plan-annual { font-size: .82rem; color: var(--muted); }
.plan-limits, .plan-bullets { list-style: none; padding: 0; margin-top: .6rem; display: grid; gap: .35rem; font-size: .88rem; }
.plan-bullets li::before { content: "✓ "; color: var(--blue); font-weight: 700; }
.plan-card form { margin-top: auto; padding-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.interval-pick { display: flex; gap: 1rem; flex-wrap: wrap; margin: .5rem 0; }
.interval-pick.big label { border: 1px solid #cfd2da; border-radius: 9999px; padding: .4rem 1rem; background: #fff; }
.interval-pick em { font-style: normal; color: var(--green); font-weight: 700; font-size: .82rem; }
.value-points { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-weight: 600; margin: .5rem 0 1rem; }
.value-points li::before { content: "● "; color: var(--lime); }
.plan-pick { border: 0; padding: 0; }
.plan-option { display: grid; grid-template-columns: auto 1fr; gap: 0 .6rem; border: 1px solid #cfd2da; border-radius: var(--radius-sm); padding: .7rem .9rem; margin-bottom: .5rem; cursor: pointer; background: #fff; }
.plan-option input { grid-row: span 3; margin-top: .3rem; }
.plan-option:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(28,62,230,.12); }
.plan-option-name { font-weight: 700; } .plan-option-name em { font-style: normal; font-size: .72rem; background: var(--lime); padding: .05rem .45rem; border-radius: 9999px; margin-left: .3rem; }
.plan-option-price, .plan-option-detail { font-size: .85rem; color: var(--muted); }

/* Public / auth pages */
body.public { background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
.public-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.5rem; background: var(--ink); color: #fff; }
.public-nav .brand { color: #fff; }
.public-nav nav { display: flex; gap: 1rem; align-items: center; }
.public-nav nav a { color: rgba(255,255,255,.85); text-decoration: none; font-size: .9rem; }
.public-nav nav .btn-primary { background: #fff; color: var(--plum); }
.public-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 2.5rem 1rem; }
.public-main.narrow { max-width: 760px; }
.public-foot { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; padding: 1.5rem; font-size: .85rem; color: var(--muted); }
.public-foot a { color: var(--muted); }
.auth-card { background: #fff; border-radius: 1.5rem; padding: 2rem; box-shadow: var(--shadow); max-width: 30rem; margin: 0 auto; }
.auth-card.wide { max-width: 40rem; }
@media (max-width: 640px) { .auth-card { padding: 1.4rem; } .public-nav { padding: .75rem 1rem; } .public-nav nav .btn { display: none; } }
.narrow-input { max-width: 8rem; }
.sms-terms { margin: .75rem 0 1rem 1.1rem; display: grid; gap: .35rem; }
.integration { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.integration .actions { margin-top: 0; }
.org-switch select { width: 100%; background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 9999px; padding: .35rem .6rem; font: inherit; font-size: .82rem; }
