/* Saarthi CRM — matches the Saarthi design canvas (light style) */
:root {
  --bg: #EEF1F5;
  --panel: #F7F8FA;
  --card: #FFFFFF;
  --line: #E8EBF0;
  --line-2: #E1E5EC;
  --soft: #EEF0F4;
  --ink: #1A1D24;
  --ink-2: #3A404B;
  --muted: #5F6672;
  --blue: #2F62D6;
  --blue-dark: #1E3F8F;
  --blue-soft: #EAF0FC;
  --lime: #B9DE6A;
  --lime-soft: #EEF7DC;
  --lime-ink: #4F7A12;
  --green: #1E7A4C;
  --red: #C7343A;
  --red-soft: #FBE1E1;
  --red-bg: #FDF0F0;
  --amber: #8A5200;
  --amber-soft: #FCEBD3;
  --radius: 14px;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.ic { flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.text-danger { color: var(--red); }
.text-ok { color: var(--green); }

/* ---------- Shell ---------- */
.shell { display: flex; gap: 12px; padding: 12px; min-height: 100vh; }
.sidebar { width: 236px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 8px 4px; }
.main { flex: 1; min-width: 0; background: var(--panel); border: 1px solid #E4E7ED; border-radius: 20px; padding: 20px 22px 32px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 18px; font-weight: 800; }
.brand-text small { font-size: 11px; color: var(--muted); font-weight: 600; }
.brand-text small.text-danger { color: var(--red); text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.workspace { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; margin-bottom: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); font-weight: 700; }
.ws-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; }
.ws-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; width: 100%; }
.nav-link:hover { background: rgba(255,255,255,.6); color: var(--ink); }
.nav-link.active { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(26,29,36,.06); }
.nav-link span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: none !important; }
.nav-badge-red { background: #E5484D; }
.nav-button { border: 0; background: transparent; font: inherit; cursor: pointer; text-align: left; }
.nav-section { padding: 16px 12px 6px; font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.sidebar-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 2px; }
.promo { background: var(--blue); color: #fff; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; margin: 0 4px 10px; }
.promo span { font-size: 12px; color: #E3EAFB; line-height: 1.45; }
.topbar-mobile { display: none; }
.scrim { display: none; }

/* ---------- Page parts ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 .pill { vertical-align: middle; margin-left: 6px; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head a { font-size: 13px; font-weight: 700; }
.card-title { margin-bottom: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.grow-1 { flex: 1 1 280px; min-width: 0; }
.grow-2 { flex: 2 1 460px; min-width: 0; }
.grow { flex: 1; }
.empty { padding: 24px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--ink-2); }
.notice { background: #FFF7E8; border: 1px solid #F6DDAE; color: #5A3A00; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpis-5 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 8px; }
.kpi-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--soft); }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.kpi-value.small { font-size: 20px; }
.kpi-sub { font-size: 12px; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #2752B8; color: #fff; }
.btn-ghost { background: var(--card); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--panel); color: var(--ink); }
.btn-light { background: #fff; color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-danger { background: var(--red-bg); border-color: #F4C9CA; color: var(--red); }
.btn-wa { background: var(--green); color: #fff; }
.btn-wa:hover { background: #17633D; color: #fff; }
.btn-link-danger { background: transparent; border: 0; color: var(--red); padding: 0 4px; }
.btn-sm { min-height: 34px; padding: 0 10px; font-size: 12px; }
.btn-lg { min-height: 50px; font-size: 15px; padding: 0 20px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn-wa { background: var(--green); border-color: var(--green); color: #fff; }
.icon-btn-wa:hover { color: #fff; }

/* Pills and tags */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--soft); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill-red { color: var(--red); background: var(--red-soft); }
.pill-blue { color: var(--blue); background: var(--blue-soft); }
.pill-lime { color: var(--ink); background: var(--lime); }
.pill-amber { color: var(--amber); background: var(--amber-soft); }
.stage { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 3px 8px; white-space: nowrap; background: var(--soft); color: var(--ink-2); }
.stage-new { background: var(--blue-soft); color: var(--blue); }
.stage-won { background: var(--lime-soft); color: var(--lime-ink); }
.stage-lost { background: var(--red-soft); color: var(--red); }
.stage-negotiation { background: var(--ink); color: #fff; }
.tag { font-size: 11px; font-weight: 700; color: var(--ink-2); background: var(--soft); border-radius: 6px; padding: 2px 7px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 12px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.field.inline input { width: 80px; }
input, select, textarea { font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; min-height: 42px; width: 100%; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47,98,214,.35); outline-offset: 1px; border-color: var(--blue); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin-bottom: 14px; }
.check input { width: 18px; height: 18px; min-height: 0; margin: 1px 0 0; accent-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
fieldset.subtle { border: 1px dashed var(--line-2); border-radius: 12px; padding: 12px 14px 2px; margin: 4px 0 12px; }
fieldset.subtle legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.form-card { max-width: 860px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-actions.start { justify-content: flex-start; margin-top: 8px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { min-height: 36px; padding: 6px 10px; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; min-height: 40px; color: var(--muted); min-width: 240px; }
.search input { border: 0; padding: 0; min-height: 38px; outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; }
.filters select { width: auto; min-height: 40px; padding: 8px 10px; }
.seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 8px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg span { display: inline-block; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(26,29,36,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--blue); }

/* Tables and lists */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 640px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); background: #F4F6F9; padding: 9px 10px; white-space: nowrap; }
.table th:first-child { border-radius: 8px 0 0 8px; }
.table th:last-child { border-radius: 0 8px 8px 0; }
.table td { padding: 10px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.row-off td { opacity: .55; }
.row-warn td { background: #FFF7E8; }
.cell-main { display: flex; flex-direction: column; color: var(--ink); }
.cell-main small { color: var(--muted); font-size: 12px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.list { display: flex; flex-direction: column; gap: 2px; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border-bottom: 1px solid var(--soft); }
.list-row-late { background: var(--red-bg); border-bottom-color: transparent; }
.list-main { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.list-main small { color: var(--muted); font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar-red { background: var(--red-soft); color: var(--red); }
.avatar-blue { background: var(--blue-soft); color: var(--blue); }
.avatar-green { background: var(--lime-soft); color: var(--lime-ink); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding-top: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--soft); border-radius: 12px; padding: 4px; align-self: flex-start; }
.tabs a { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; }
.tabs a span { font-weight: 700; margin-left: 4px; }
.tabs a.active { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(26,29,36,.08); }
.tabs a.tab-danger span { color: var(--red); }

/* Bars */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.bar-label span { font-weight: 600; }
.bar-track { height: 10px; border-radius: 5px; background: repeating-linear-gradient(135deg, #E6EAF1 0 2px, transparent 2px 7px); }
.bar-fill { height: 10px; border-radius: 5px; background: var(--blue); min-width: 2px; }
.bar-grey { background: #C9D1DE; }
.bar-lime { background: var(--lime); }
.segbar { display: flex; height: 18px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--soft); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; margin-top: 12px; }
.legend a { color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.seg-blue { background: var(--blue); } .seg-lime { background: var(--lime); } .seg-amber { background: #F5A524; }
.seg-red { background: #E5484D; } .seg-grey { background: #C9D1DE; } .seg-dark { background: var(--ink); }

/* Lead page */
.details { display: grid; grid-template-columns: 80px 1fr; gap: 9px 10px; margin: 0; font-size: 13px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.details-3 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.details-3 div { display: flex; flex-direction: column; gap: 2px; }
.note-box { margin-top: 12px; background: var(--panel); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); }
.stage-track { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.stage-track li { height: 8px; border-radius: 4px; background: repeating-linear-gradient(135deg, #DDE2EA 0 2px, transparent 2px 6px); }
.stage-track li.done { background: var(--blue); }
.stage-track li.lost { background: var(--red-soft); }
.note-form { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--soft); }
.note-form textarea { margin-bottom: 8px; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.timeline p { margin-bottom: 2px; }
.tl-type { flex: none; width: 74px; font-size: 11px; font-weight: 700; text-align: center; border-radius: 6px; padding: 3px 6px; background: var(--soft); color: var(--ink-2); text-transform: capitalize; }
.tl-call { background: var(--blue-soft); color: var(--blue); }
.tl-whatsapp { background: #E6F4EC; color: var(--green); }
.tl-status { background: var(--lime-soft); color: var(--lime-ink); }
.fu { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--soft); color: var(--ink); }
.fu div { display: flex; flex-direction: column; min-width: 0; }
.fu-done { opacity: .6; }
.fu-form { margin-top: 14px; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: 40px; z-index: 5; width: 240px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 8px 24px rgba(26,29,36,.12); }
.control { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.control form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Pipeline */
.board-wrap { overflow-x: auto; padding-bottom: 6px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; min-width: 1150px; }
.column { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.column-head { padding: 2px 2px 10px; border-bottom: 1px solid var(--soft); }
.column-title { display: flex; align-items: center; gap: 8px; }
.column-title h2 { font-size: 14px; flex: 1; }
.column-value { font-size: 20px; font-weight: 700; margin-top: 6px; }
.count { font-size: 12px; font-weight: 700; background: var(--soft); border-radius: 999px; padding: 2px 8px; }
.dot { width: 10px; height: 10px; border-radius: 3px; background: #C9D1DE; }
.dot-new { background: var(--blue); } .dot-qualified { background: #9AB3EC; } .dot-negotiation { background: var(--ink); } .dot-won { background: var(--lime); }
.deal { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--soft); border-radius: 10px; padding: 12px; color: var(--ink); }
.deal:hover { border-color: #C6D5F5; color: var(--ink); }
.deal-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.deal small { color: var(--muted); font-size: 12px; }
.more { font-size: 12px; font-weight: 700; }

/* Flash and banners */
.flash { border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.flash-success { background: var(--lime-soft); color: #34500A; border: 1px solid #D5EBA9; }
.flash-error { background: var(--red-bg); color: var(--red); border: 1px solid #F4C9CA; }
.flash-info { background: var(--blue-soft); color: var(--blue-dark); border: 1px solid #D3DFF7; }
.banner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-radius: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.banner a { font-weight: 800; }
.banner-warning { background: #FFF7E8; color: #5A3A00; border: 1px solid #F6DDAE; }
.banner-danger { background: var(--red-bg); color: var(--red); border: 1px solid #F4C9CA; }
.banner-info, .banner-ok { background: var(--blue-soft); color: var(--blue-dark); border: 1px solid #D3DFF7; }

/* Pricing */
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.price-card { position: relative; display: flex; flex-direction: column; gap: 6px; }
.price-featured { border: 2px solid var(--blue); background: #F5F8FE; }
.price-tag { position: absolute; top: -11px; right: 14px; }
.price { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.price span { font-size: 14px; font-weight: 600; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.checks li { position: relative; padding-left: 28px; font-size: 14px; }
.checks li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--lime); color: var(--ink); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.checks-light li { color: #fff; }

/* Public pages */
body.public { background: var(--bg); }
.public-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 4vw, 48px); }
.public-nav { display: flex; align-items: center; gap: 16px; font-weight: 700; }
.public-nav a:not(.btn) { color: var(--ink-2); }
.public-flash { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.public-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 24px clamp(16px, 4vw, 48px); color: var(--muted); font-size: 13px; }
.hero { max-width: 1100px; margin: 24px auto; padding: 0 16px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.hero-copy { flex: 1 1 420px; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.hero-copy h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; }
.hero-copy p { font-size: 17px; color: var(--ink-2); max-width: 520px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero-card { flex: 1 1 340px; display: flex; flex-direction: column; gap: 10px; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.mini-row span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.mini-row small { color: var(--muted); }
.features { max-width: 1100px; margin: 24px auto; padding: 0 16px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.feature { display: flex; flex-direction: column; gap: 8px; }
.feature .ic { color: var(--blue); width: 24px; height: 24px; }
.feature p { color: var(--ink-2); }
.pricing { max-width: 760px; margin: 40px auto; padding: 0 16px; }
.pricing h2 { font-size: 26px; text-align: center; margin-bottom: 8px; }
.auth-wrap { max-width: 1100px; margin: 16px auto 40px; padding: 0 16px; display: flex; flex-wrap: wrap; gap: 12px; }
.auth-side { flex: 1 1 340px; background: var(--blue); color: #fff; border-radius: 20px; padding: 36px; display: flex; flex-direction: column; gap: 18px; }
.auth-side h1 { font-size: 34px; line-height: 1.12; font-weight: 800; }
.auth-side p { color: #E3EAFB; font-size: 15px; }
.auth-card { flex: 1 1 460px; padding: 28px; display: flex; flex-direction: column; }
.auth-card h2 { font-size: 22px; margin-bottom: 16px; }
.auth-card .muted.center { margin-top: 14px; }
.auth-single { max-width: 460px; margin: 32px auto 60px; padding: 0 16px; }
.error-code { font-size: 48px; font-weight: 800; color: var(--blue); }
.pay-error { margin-top: 8px; font-weight: 600; }

/* ---------- v2: pipelines, WhatsApp, tasks, calendar ---------- */
.stage { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); color: var(--ink-2); }
.stage .dot { width: 8px; height: 8px; border-radius: 50%; }
.color-select { padding-left: 10px; }
.preset { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--soft); }
.preset div { display: flex; flex-direction: column; gap: 2px; }
.tpl { padding: 12px 0; border-bottom: 1px solid var(--soft); display: flex; flex-direction: column; gap: 6px; }
.tpl-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tpl-body { color: var(--ink-2); font-size: 13px; background: var(--panel); border-radius: 10px; padding: 10px 12px; }
.row-actions.start { justify-content: flex-start; }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.wa-card { border-color: #CFE9DA; }
.wa-templates { display: flex; flex-direction: column; gap: 8px; }
.wa-template { display: flex; gap: 12px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.wa-template p { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.wa-template > div { min-width: 0; }
.wa-suggested { border-color: #9CD3B4; background: #F3FAF6; }
.wa-custom { display: flex; gap: 8px; margin-top: 10px; }
.outcome-card .seg { margin-bottom: 10px; }
.outcome-card form > .btn { margin-right: 8px; }
.mini-form { margin-top: 10px; }
.mini-form summary { list-style: none; }
.mini-form summary::-webkit-details-marker { display: none; }
.mini-form[open] summary { margin-bottom: 10px; }
.prio { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; white-space: nowrap; background: var(--soft); color: var(--ink-2); }
.prio-high { background: var(--red-soft); color: var(--red); }
.prio-low { background: var(--lime-soft); color: var(--lime-ink); }
.struck { text-decoration: line-through; }
.tag-red { background: var(--red-soft); color: var(--red); }
.deal-late { border-color: #F4C9CA; background: var(--red-bg); }
.column-cards { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.drop-over { outline: 2px dashed var(--blue); outline-offset: -4px; background: #F5F8FE; }
.dragging { opacity: .45; }
.empty-col { padding: 6px 2px; }
.dot-todo { background: #C9D1DE; } .dot-doing { background: var(--blue); } .dot-done { background: var(--lime); }
.add-task { padding: 0; }
.add-task-summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 14px 18px; cursor: pointer; color: var(--blue); }
.add-task-summary::-webkit-details-marker { display: none; }
.add-task form { padding: 0 18px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.span-2 { grid-column: span 2; }
.check-row { margin: 0; }
.check-btn { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; padding: 8px 0; cursor: pointer; border-bottom: 1px solid var(--soft); }
.check-btn .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }
.check-btn.checked .box { background: var(--blue); border-color: var(--blue); color: #fff; }
.cal .card-head h2 { flex: 1; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 92px; border: 1px solid var(--soft); border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); overflow: hidden; }
.cal-day:hover { border-color: #C6D5F5; color: var(--ink); }
.cal-out { opacity: .45; }
.cal-today .cal-num { background: var(--blue); color: #fff; border-radius: 6px; padding: 0 6px; }
.cal-selected { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.cal-num { font-size: 12px; font-weight: 700; align-self: flex-start; }
.cal-dots { display: flex; flex-direction: column; gap: 2px; }
.cal-ev { font-size: 10.5px; line-height: 1.3; border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-followup { background: var(--blue-soft); color: var(--blue-dark); }
.cal-task { background: var(--amber-soft); color: var(--amber); }
.cal-appointment { background: var(--lime-soft); color: var(--lime-ink); }
.cal-invoice { background: var(--red-soft); color: var(--red); }
.swatch.cal-followup { background: var(--blue); } .swatch.cal-task { background: #F5A524; } .swatch.cal-appointment { background: var(--lime); } .swatch.cal-invoice { background: #E5484D; }
.cal-done { opacity: .5; text-decoration: line-through; }
.cal-more { font-size: 10.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.agenda { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--soft); }
.agenda > a { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--ink); }
.agenda-time { font-size: 12px; font-weight: 700; width: 64px; flex: none; color: var(--ink-2); }
.agenda-appointment { border-left: 3px solid var(--lime); padding-left: 8px; }
.agenda-invoice { border-left: 3px solid #E5484D; padding-left: 8px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px dashed var(--line-2); border-radius: 14px; padding: 28px 16px; text-align: center; margin-bottom: 12px; color: var(--ink-2); }
.dropzone .ic { width: 28px; height: 28px; color: var(--blue); }
.dropzone input { max-width: 320px; margin-top: 8px; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--ink-2); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.upload-preview { max-height: 64px; max-width: 200px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; align-self: flex-start; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filter-pills a.pill { color: var(--ink-2); }
.items-table { min-width: 860px; }
.items-table td { padding: 6px 4px; }
.items-table input, .items-table select { min-height: 38px; padding: 7px 8px; font-size: 13px; }
.w-xs { width: 70px; } .w-sm { width: 100px; }
.totals-box { margin: 14px 0 0 auto; max-width: 340px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.totals-box div { display: flex; justify-content: space-between; }
.totals-box .grand { border-top: 1px solid var(--line); padding-top: 8px; font-size: 18px; }
.new-customer { border-top: 1px dashed var(--line-2); padding-top: 12px; }
.month-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 200px; align-items: end; padding-top: 8px; }
.month-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.month-bars { flex: 1; width: 100%; display: flex; gap: 3px; align-items: flex-end; justify-content: center; }
.bar-v { width: 40%; max-width: 18px; border-radius: 4px 4px 0 0; min-height: 2px; }
.month-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.won-strip { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; text-align: center; }
.won-strip div { display: flex; flex-direction: column; background: var(--panel); border-radius: 8px; padding: 8px 0; }
.design-switch { display: inline-flex; gap: 4px; background: var(--soft); border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.design-switch a { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.design-switch a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(26,29,36,.08); }

/* ---------- Invoice sheet (3 designs) ---------- */
.sheet { position: relative; background: #fff; color: #111; border: 1px solid var(--line); border-radius: 12px; padding: 32px; font-size: 13px; line-height: 1.45; max-width: 860px; overflow: hidden; }
.sheet p { margin: 0; }
.sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid #111; }
.sheet-from { display: flex; gap: 14px; align-items: flex-start; max-width: 60%; }
.sheet-logo { max-height: 64px; max-width: 140px; object-fit: contain; }
.sheet-biz { font-size: 18px; margin-bottom: 4px; }
.sheet-title { font-size: 22px; letter-spacing: .02em; text-align: right; margin-bottom: 8px; }
.sheet-meta table { border-collapse: collapse; margin-left: auto; }
.sheet-meta th { text-align: left; font-weight: 600; color: #555; padding: 2px 12px 2px 0; }
.sheet-meta td { text-align: right; font-weight: 700; padding: 2px 0; }
.sheet-to { padding: 16px 0; }
.sheet-label { font-size: 11px; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 2px !important; }
.sheet-to .sheet-label { margin-top: 0 !important; }
.sheet-cust { font-size: 15px; font-weight: 700; }
.sheet-items { width: 100%; border-collapse: collapse; margin-top: 4px; }
.sheet-items th { background: #F1F3F6; text-align: left; font-size: 11.5px; padding: 8px 6px; border-top: 1px solid #DDD; border-bottom: 1px solid #DDD; }
.sheet-items td { padding: 8px 6px; border-bottom: 1px solid #EEE; vertical-align: top; }
.sheet-items .num { text-align: right; white-space: nowrap; }
.sheet-items .desc { width: 36%; }
.sheet-bottom { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; margin-top: 16px; }
.sheet-left { flex: 1 1 280px; }
.sheet-right { flex: 0 1 300px; }
.sheet-words { font-weight: 600; }
.sheet-upi { display: flex; gap: 12px; align-items: center; margin-top: 12px; border: 1px solid #E3E6EC; border-radius: 10px; padding: 10px; }
.qr { width: 110px; height: 110px; flex: none; }
.qr svg { width: 100%; height: 100%; }
.pre { white-space: pre-line; }
.sheet-totals { width: 100%; border-collapse: collapse; }
.sheet-totals th { text-align: left; font-weight: 500; color: #444; padding: 4px 0; }
.sheet-totals td { text-align: right; padding: 4px 0; font-weight: 600; }
.sheet-totals .grand th, .sheet-totals .grand td { border-top: 1.5px solid #111; font-size: 15px; font-weight: 800; color: #111; padding-top: 8px; }
.sheet-sign { margin-top: 26px; text-align: right; }
.sheet-sign img { max-height: 56px; max-width: 180px; object-fit: contain; display: block; margin-left: auto; }
.sheet-foot { margin-top: 24px; font-size: 11px; color: #888; text-align: center; }
.sheet-items-wrap { overflow-x: auto; }
.sheet-items-wrap .sheet-items { min-width: 560px; }
.stamp { position: absolute; bottom: 150px; left: 38%; transform: rotate(-14deg); font-size: 34px; font-weight: 800; letter-spacing: .1em; border: 4px solid; border-radius: 10px; padding: 2px 14px; opacity: .22; }
.stamp-paid { color: #1E7A4C; } .stamp-cancelled { color: #C7343A; }
.sheet-modern .sheet-head { border-bottom: 0; background: var(--blue); color: #fff; margin: -32px -32px 0; padding: 28px 32px; }
.sheet-modern .sheet-meta th { color: #DCE6FB; }
.sheet-modern .sheet-items th { background: var(--blue-soft); color: var(--blue-dark); border-color: #D3DFF7; }
.sheet-modern .sheet-totals .grand th, .sheet-modern .sheet-totals .grand td { border-color: var(--blue); color: var(--blue); }
.sheet-minimal { border-color: #eee; }
.sheet-minimal .sheet-head { border-bottom: 1px solid #ddd; }
.sheet-minimal .sheet-title { font-weight: 500; text-transform: uppercase; letter-spacing: .12em; font-size: 18px; }
.sheet-minimal .sheet-items th { background: transparent; border-top: 0; text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; color: #777; }
.sheet-page { background: #EEF1F5; padding: 16px; }
.sheet-page .sheet { margin: 0 auto; }
.sheet-actions { max-width: 860px; margin: 0 auto 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.receipt-body { padding: 18px 0; text-align: center; }
.receipt-amount { font-size: 32px; font-weight: 800; margin: 8px 0 !important; }
.receipt-table { max-width: 420px; margin: 16px auto 0; }

@media print {
  @page { size: A4; margin: 12mm; }
  body, .sheet-page { background: #fff !important; padding: 0 !important; }
  .sidebar, .topbar-mobile, .no-print, .flash, .banner, .scrim, .page-head .head-actions, .design-switch, .sheet-actions { display: none !important; }
  .shell { padding: 0; display: block; }
  .main { border: 0; padding: 0; background: #fff; }
  .row { display: block; }
  .sheet { border: 0; border-radius: 0; padding: 0; max-width: none; }
  .sheet-modern .sheet-head { margin: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-items th, .stamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-items-wrap { overflow: visible; }
  .sheet-items-wrap .sheet-items { min-width: 0; }
  .card { border: 0; padding: 0; }
  a { color: inherit; }
}

/* ---------- Phone ---------- */
@media (max-width: 860px) {
  .shell { padding: 0; gap: 0; }
  .main { border-radius: 0; border: 0; padding: 14px 14px 32px; }
  .sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; background: var(--bg); padding: 12px; transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(26,29,36,.35); }
  .topbar-mobile { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .search { min-width: 0; width: 100%; }
  .head-actions { width: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .cal-day { min-height: 54px; padding: 4px; }
  .cal-ev { display: none; }
  .cal-day .cal-dots::after { content: ''; }
  .cal-day:has(.cal-ev) .cal-num::after { content: ' •'; color: var(--blue); }
  .sheet { padding: 18px; }
  .sheet-modern .sheet-head { margin: -18px -18px 0; padding: 18px; }
  .sheet-from { max-width: 100%; }
  .sheet-title { text-align: left; }
  .sheet-meta table { margin-left: 0; }
  .wa-template { flex-direction: column; align-items: stretch; }
  .kpis, .kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; gap: 6px; }
  .kpi-head { font-size: 12px; padding-bottom: 8px; }
  .kpi-head .ic { display: none; }
  .kpi-value { font-size: 22px; }
  .auth-side { padding: 24px; }
  .auth-card { padding: 20px; }
}

/* ===== v3: WhatsApp API, inbox, automations, broadcasts, pipeline KPIs ===== */
.text-warn { color: var(--amber); }
.text-ok { color: var(--green); }
.notice-warn ul { margin-top: 6px; }
.notice .btn { margin-left: 8px; }
.wa-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wa-status-main { display: flex; gap: 12px; align-items: center; }
.wa-status-main > div { display: flex; flex-direction: column; gap: 2px; }
.wa-dot { width: 42px; height: 42px; border-radius: 50%; background: #DDF4E6; color: var(--green); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.setup-steps { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--ink-2); }
.setup-steps .field { margin-top: 6px; }
.mini-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--soft); font-size: 13px; }
.mini-row.strong { border-bottom: 0; font-size: 14px; }

/* Inbox */
.inbox { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 12px; height: calc(100vh - 170px); min-height: 520px; }
.inbox-list { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.inbox-list .search { min-width: 0; }
.inbox-list .filter-pills { margin: 0; }
.chat-list { list-style: none; margin: 0 -8px; padding: 0; overflow-y: auto; flex: 1; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; color: var(--ink); }
.chat-item:hover { background: var(--panel); color: var(--ink); }
.chat-item.active { background: var(--blue-soft); }
.chat-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-top { display: flex; justify-content: space-between; gap: 6px; font-size: 13px; }
.chat-top small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.chat-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-chat { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.inbox-chat > .empty { margin: auto; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-head .stage { font-size: 12px; }
.chat-back { display: none; }
.chat-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: #EFEAE2; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; }
.chat-day { text-align: center; margin: 8px 0; }
.chat-day span { background: #fff; color: var(--muted); font-size: 11px; font-weight: 700; border-radius: 8px; padding: 3px 10px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bubble { max-width: min(560px, 80%); padding: 7px 10px 5px; border-radius: 10px; font-size: 14px; box-shadow: 0 1px 1px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 2px; }
.bubble p { margin: 0; white-space: normal; overflow-wrap: anywhere; }
.bubble-in { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.bubble-out { align-self: flex-end; background: #D9FDD3; border-top-right-radius: 2px; }
.bubble-failed { background: var(--red-bg); border: 1px solid #F4C9CA; }
.bubble-tag { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--green); }
.bubble-meta { align-self: flex-end; font-size: 11px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.bubble-error { font-size: 12px; color: var(--red); font-weight: 600; }
.tick { font-weight: 800; letter-spacing: -2px; }
.tick-read { color: #2B9FE6; }
.tick-failed { color: var(--red); letter-spacing: 0; }
.composer { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--card); max-height: 55%; overflow-y: auto; }
.composer-text { display: flex; gap: 8px; align-items: flex-end; }
.composer-text textarea { flex: 1; resize: none; min-height: 44px; }
.composer details summary, .quick-replies summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--blue); padding: 4px 0; }
.composer-template form { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.composer-template form .btn { align-self: flex-start; }
.quick-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.tpl-preview { background: #D9FDD3; border-radius: 10px; padding: 8px 10px; margin: 4px 0 8px; white-space: pre-wrap; color: var(--ink); }
.tpl-preview:empty { display: none; }
.wa-api-open { margin-bottom: 6px; }

/* Switch (Live toggle) */
.switch { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 4px 12px 4px 4px; font: inherit; font-size: 12px; font-weight: 800; color: var(--muted); cursor: pointer; }
.switch span { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch.on { color: var(--green); border-color: #BFE6CC; background: #F1FBF4; }
.switch.on span { background: var(--green); }
.switch.on span::after { transform: translateX(14px); }
.switch-lg { padding: 6px 16px 6px 6px; font-size: 13px; }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* Automations */
.auto-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.auto-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.auto-main { display: flex; gap: 12px; align-items: center; color: var(--ink); min-width: 0; }
.auto-main > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auto-icon, .flow-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.flow-icon-trigger { background: var(--lime-soft); color: var(--lime-ink); }
.field-set { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.field-set legend { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 10px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.radio-card input { margin-top: 3px; }
.radio-card span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.flow { display: flex; flex-direction: column; align-items: stretch; max-width: 720px; }
.flow-line { width: 2px; height: 22px; background: var(--line-2); margin: 0 auto; }
.flow-node { position: relative; }
.flow-trigger { border: 1.5px solid var(--lime); }
.flow-editing { border: 1.5px solid var(--blue); }
.flow-node-head { display: flex; gap: 12px; align-items: flex-start; }
.flow-node-head .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.flow-node-head strong { overflow-wrap: anywhere; }
.flow-trigger .flow-node-head { margin-bottom: 10px; }
.flow-trigger .flow-node-head > div { display: flex; flex-direction: column; }
.flow-kicker { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.flow-note { font-size: 12px; font-weight: 600; }
.flow-note.ok { color: var(--green); }
.flow-note.warn { color: var(--amber); }
.flow-tools { display: flex; gap: 4px; flex: none; }
.flow-tools .icon-btn { width: 32px; height: 32px; }
.flow-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--soft); }
.flow-form code { background: var(--soft); border-radius: 4px; padding: 1px 4px; font-size: 11px; }
.flow-group { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 6px; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.palette form { display: contents; }
.palette-item { display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line-2); background: var(--card); border-radius: 10px; padding: 8px 10px; font: inherit; cursor: pointer; color: var(--ink); }
.palette-item:hover { border-color: var(--blue); background: var(--blue-soft); }
.palette-item > span:last-child { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.palette-item small { font-size: 11px; }
.run-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.run-list summary { display: flex; justify-content: space-between; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--soft); }
.run-list summary > span:first-child { display: flex; flex-direction: column; }
.run-log { margin: 6px 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; gap: 3px; }

/* Broadcasts */
.filters .field { margin: 0; }
.audience { background: var(--blue-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.bc-list { list-style: none; padding: 0; }
.bc-list li { display: flex; flex-direction: column; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--soft); }
.bc-top { display: flex; justify-content: space-between; gap: 8px; }

/* Pipeline (v3) */
.pipe-kpis { margin-bottom: 12px; }
.pipe-kpis .kpi-value { font-size: 22px; }
.kpi-won .kpi-head { color: var(--lime-ink); }
.kpi-lost .kpi-head { color: var(--red); }
.pipe-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pipe-filters .search { min-width: 200px; }
.pipe-filters select { min-height: 40px; width: auto; }
.tag-src { background: var(--blue-soft); color: var(--blue); font-size: 10px; white-space: nowrap; }
.deal-phone { display: inline-flex; align-items: center; gap: 4px; }
.deal-phone .ic { width: 13px; height: 13px; }
.wa-unread { background: var(--green); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 800; padding: 0 6px; margin-left: 4px; }
.deal-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.deal-figs > span { display: flex; flex-direction: column; }
.deal-figs small { font-size: 11px !important; }
.deal-figs strong { font-size: 13px; }
.deal-bar { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; display: block; }
.deal-bar span { display: block; height: 100%; border-radius: 999px; transition: width .2s; }
.empty-col { color: var(--muted); font-size: 12px; text-align: center; padding: 16px 0; margin: 0; }

/* Public lead form */
.lead-form-page { background: var(--bg); min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 16px; }
.lead-form-card { width: 100%; max-width: 440px; }
.lead-form-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.lead-form-head h1 { font-size: 20px; margin: 0; }
.lead-form-head p { margin: 2px 0 0; }
.lead-form-logo { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.lead-form-done { display: flex; gap: 12px; align-items: center; background: #F1FBF4; border-radius: 12px; padding: 14px; }
.lead-form-done p { margin: 0; }
.lead-form-foot { margin: 14px 0 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .inbox-has-chat .inbox-list { display: none; }
  .inbox:not(.inbox-has-chat) .inbox-chat { display: none; }
  .inbox-chat { height: calc(100vh - 120px); min-height: 480px; }
  .chat-back { display: inline-flex; }
  .chat-head .pill { display: none; }
  .bubble { max-width: 88%; }
  .pipe-filters, .pipe-filters .search { width: 100%; }
  .flow-tools { flex-wrap: wrap; justify-content: flex-end; max-width: 72px; }
  .auto-row { flex-direction: column; align-items: flex-start; }
}

[hidden] { display: none !important; }
.radio-card input { width: auto; min-height: 0; flex: none; margin: 3px 0 0; padding: 0; }

/* ===== Home page (landing) ===== */
.public-head { position: sticky; top: 0; z-index: 20; background: rgba(238,241,245,.92); backdrop-filter: blur(8px); }
.public-foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.public-foot nav a { color: var(--ink-2); font-weight: 600; }
.lp-hero { max-width: 1200px; margin: 0 auto; padding: 40px 16px 24px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center; }
.lp-hero-copy { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.lp-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 6px 12px; }
.lp-eyebrow .ic { width: 15px; height: 15px; }
.lp-hero h1 { margin: 0; font-size: clamp(34px, 4.6vw, 54px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; }
.lp-hl { background: linear-gradient(transparent 62%, var(--lime) 62%); }
.lp-lead { margin: 0; font-size: 18px; color: var(--ink-2); max-width: 540px; }
.lp-compare { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.lp-compare-old { color: var(--muted); text-decoration: line-through; }
.lp-compare-new strong { color: var(--green); font-size: 17px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.lp-assure { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); font-weight: 600; }
.lp-assure li, .lp-checks li { display: flex; gap: 6px; align-items: flex-start; }
.lp-assure .ic { width: 16px; height: 16px; color: var(--green); }
.lp-hero-visual { position: relative; padding-bottom: 40px; }
.lp-browser { margin: 0; background: #fff; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px -24px rgba(26,29,36,.35); }
.lp-browser img { display: block; width: 100%; height: auto; }
.lp-dots { display: flex; gap: 6px; padding: 9px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.lp-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.lp-dots i:first-child { background: #F2A7A9; } .lp-dots i:nth-child(2) { background: #F6D58E; } .lp-dots i:nth-child(3) { background: #BFE3A0; }
.lp-phone { position: absolute; right: -10px; bottom: 0; width: 28%; margin: 0; border: 6px solid var(--ink); border-radius: 26px; overflow: hidden; box-shadow: 0 24px 50px -18px rgba(26,29,36,.5); background: #fff; }
.lp-phone img { display: block; width: 100%; height: auto; }
.lp-strip { max-width: 1200px; margin: 8px auto 0; padding: 0 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lp-strip > div { background: var(--ink); color: #fff; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.lp-strip strong { font-size: 17px; }
.lp-strip span { font-size: 13px; color: #C9CED8; }
.lp-section { max-width: 1200px; margin: 0 auto; padding: 64px 16px 0; }
.lp-narrow { max-width: 820px; }
.lp-head { text-align: center; max-width: 760px; margin: 0 auto 28px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.lp-head h2, .lp-final h2 { margin: 0; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 800; }
.lp-kicker { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); }
.lp-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.lp-tabs button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.lp-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.lp-tabs .ic { width: 16px; height: 16px; }
.lp-caption { text-align: center; color: var(--ink-2); margin: 0 0 14px; font-size: 16px; }
.lp-pane .lp-browser { max-width: 1040px; margin: 0 auto; }
.lp-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }
.lp-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lp-vs-card { border-radius: 16px; padding: 24px; }
.lp-vs-card h3 { margin: 0 0 12px; font-size: 20px; }
.lp-vs-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.lp-vs-card li { display: flex; gap: 10px; }
.lp-vs-card li::before { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.lp-vs-bad { background: var(--red-bg); border: 1px solid #F4C9CA; }
.lp-vs-bad li::before { content: '✕'; background: var(--red-soft); color: var(--red); }
.lp-vs-good { background: #F1FBF4; border: 1px solid #BFE6CC; }
.lp-vs-good li::before { content: '✓'; background: #CDEFD9; color: var(--green); }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lp-grid-4 { grid-template-columns: repeat(4, 1fr); }
.lp-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.lp-card h3 { margin: 4px 0 0; font-size: 17px; }
.lp-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.lp-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
.lp-row { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 40px; align-items: center; margin-bottom: 48px; }
.lp-row-rev .lp-row-copy { order: 2; }
.lp-row-copy { display: flex; flex-direction: column; gap: 10px; }
.lp-row-copy h3 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.02em; line-height: 1.15; }
.lp-checks { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--ink-2); }
.lp-checks .ic { flex: none; width: 20px; height: 20px; color: var(--green); }
.lp-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: none; }
.lp-flow li { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.lp-flow li span { width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--ink); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.lp-flow small { color: var(--muted); font-size: 13px; }
.lp-industries { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: 24px; }
.lp-chip { background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 14px; }
.lp-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 340px)); gap: 16px; justify-content: center; }
.lp-price { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px; display: flex; flex-direction: column; gap: 6px; }
.lp-price h3 { margin: 0; }
.lp-price-best { border: 2px solid var(--blue); background: #F5F8FE; }
.lp-badge { position: absolute; top: -12px; right: 18px; background: var(--lime); color: var(--ink); font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 10px; }
.lp-amount { margin: 0; font-size: 42px; font-weight: 800; letter-spacing: -0.03em; }
.lp-amount span { font-size: 15px; font-weight: 600; color: var(--muted); }
.lp-price .btn { margin-top: 10px; }
.lp-included { max-width: 700px; margin: 24px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.lp-faq { display: flex; flex-direction: column; gap: 10px; }
.lp-faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 18px; }
.lp-faq summary { cursor: pointer; font-weight: 700; font-size: 16px; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: '+'; font-size: 20px; color: var(--blue); line-height: 1; }
.lp-faq details[open] summary::after { content: '–'; }
.lp-faq p { margin: 0 0 16px; color: var(--ink-2); }
.lp-final { max-width: 1200px; margin: 64px auto 24px; padding: 48px 24px; background: var(--ink); color: #fff; border-radius: 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.lp-final p { margin: 0; color: #C9CED8; font-size: 17px; }
.lp-final .lp-cta { justify-content: center; }
.lp-final-link { color: #fff; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.lp-final-link:hover { color: var(--lime); }
.lp-sticky { display: none; }
@media (max-width: 960px) {
  .lp-hero { grid-template-columns: 1fr; padding-top: 24px; gap: 28px; }
  .lp-strip, .lp-grid-4 { grid-template-columns: 1fr 1fr; }
  .lp-grid { grid-template-columns: 1fr 1fr; }
  .lp-row, .lp-vs { grid-template-columns: 1fr; gap: 18px; }
  .lp-row-rev .lp-row-copy { order: 0; }
  .lp-flow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .public-nav { gap: 12px; }
  .public-nav .btn { min-height: 38px; padding: 0 12px; }
  .lp-section { padding-top: 48px; }
  .lp-grid, .lp-grid-4, .lp-flow, .lp-included, .lp-prices { grid-template-columns: 1fr; }
  .lp-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lp-strip > div { padding: 12px; }
  .lp-strip strong { font-size: 15px; }
  .lp-phone { width: 34%; right: -4px; border-width: 4px; border-radius: 18px; }
  .lp-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin: 0 -16px 14px; padding: 0 16px 4px; }
  .lp-tabs button { flex: none; }
  .lp-final { margin: 48px 16px 24px; padding: 36px 18px; }
  .lp-sticky { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(26,29,36,.08); }
  .lp-sticky span { display: flex; flex-direction: column; line-height: 1.2; }
  .lp-sticky small { color: var(--muted); font-size: 12px; }
  body.public .public-foot { padding-bottom: 90px; }
}
@media (max-width: 640px) {
  .public-head { flex-wrap: nowrap; padding: 10px 16px; }
  .public-head .brand-text small { display: none; }
  .public-head .brand-mark { width: 34px; height: 34px; }
  .public-nav a:not(.btn) { font-size: 14px; }
}
