/* Purplead — base styles */
:root {
    --paper: #f5f3ee;
    --card: #ffffff;
    --ink: #15171c;
    --ink-2: #4a4f5a;
    --ink-3: #868b95;
    --line: #e4e1d8;
    --line-2: #efece5;
    --side: #15171c;
    --side-ink: #c9ccd3;
    --accent: #1d5c4a;
    --accent-ink: #ffffff;
    --accent-soft: #e3efe9;
    --amber: #e5a336;
    --amber-soft: #fbf1de;
    --red: #b4322a;
    --red-soft: #fbe9e7;
    --blue-soft: #e8eef9;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(21, 23, 28, .04), 0 4px 16px rgba(21, 23, 28, .04);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 12px; }
a { color: inherit; }
code { font-size: 13px; background: var(--line-2); padding: 1px 6px; border-radius: 5px; }

.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ---------- Shell ---------- */
.shell > * { min-width: 0; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--side) 240px, transparent 240px); }
.side {
    background: var(--side);
    color: var(--side-ink);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; padding: 0 6px; }
.brand-mark {
    display: inline-grid; place-items: center;
    width: 30px; height: 30px; border-radius: 8px;
    background: var(--amber); color: var(--ink);
    font-weight: 800; font-size: 16px;
}
.workspace { padding: 12px; border-radius: 10px; background: rgba(255, 255, 255, .05); display: flex; flex-direction: column; gap: 2px; }
.workspace-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.workspace-name { color: #fff; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--side-ink); }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.is-active { background: #fff; color: var(--ink); }
.nav-link.is-disabled { opacity: .45; cursor: default; }
.nav-link em { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid rgba(255, 255, 255, .25); border-radius: 4px; padding: 0 5px; }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.me { display: flex; flex-direction: column; min-width: 0; }
.me-name { color: #fff; font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { font-size: 12px; color: var(--ink-3); }
.side .link-btn { color: var(--side-ink); }

.main { padding: 32px 40px 64px; max-width: 1200px; width: 100%; min-width: 0; }

.support-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 20px; background: var(--amber); color: var(--ink); font-size: 14px;
    position: sticky; top: 0; z-index: 10;
}
.support-bar form { margin: 0; }
.support-bar + .shell .side { top: 52px; height: calc(100vh - 52px); }

/* ---------- Page parts ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-highlight { border-color: var(--accent); background: var(--accent-soft); }
.card.narrow { max-width: 680px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; min-width: 0; }
.grid-wide-left { grid-template-columns: 1.6fr 1fr; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-num { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.stat-label { font-size: 13px; color: var(--ink-2); }
.stat-muted { background: transparent; border-style: dashed; }
.stat-muted .stat-num { color: var(--ink-3); }

.empty { text-align: center; padding: 28px 12px; }
.empty h2, .empty h3 { margin-bottom: 8px; }

.details { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0 0 16px; font-size: 14px; }
.details dt { color: var(--ink-3); }
.details dd { margin: 0; font-weight: 600; word-break: break-word; }

.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checklist li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.checklist li:first-child { border-top: 0; padding-top: 4px; }
.checklist p { margin: 2px 0 8px; font-size: 14px; }
.tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); margin-top: 1px; }
.checklist li.done .tick { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 0 7px #fff; }
.checklist li.done strong { color: var(--ink-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-off td { color: var(--ink-3); }
.table .actions { white-space: nowrap; text-align: right; }
.table select { padding: 6px 8px; font-size: 13px; min-width: 120px; }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.badge-active { background: var(--accent-soft); color: var(--accent); }
.badge-inactive { background: var(--line-2); color: var(--ink-3); }

/* ---------- Forms & buttons ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: block; font-size: 13px; font-weight: 700; }
.form label > input, .form label > select, .form label > textarea { display: block; margin-top: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.form-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.hint { font-weight: 500; color: var(--ink-3); }
input, select, textarea {
    font: inherit; font-size: 15px; font-weight: 500; color: var(--ink);
    padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
form.inline { display: inline; margin: 0; }
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input { flex: 1 1 240px; width: auto; }
.filters select { flex: 0 0 160px; width: auto; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer;
    padding: 10px 16px; border-radius: 9px; border: 1px solid var(--accent);
    background: var(--accent); color: var(--accent-ink); white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-2); filter: none; }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.link { color: var(--accent); font-weight: 700; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link-btn { background: none; border: 0; padding: 4px 6px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.link-btn:hover { color: var(--ink); text-decoration: underline; }
.link-btn.danger { color: var(--red); }

.alert { padding: 11px 14px; border-radius: 9px; font-size: 14px; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--accent-soft); color: var(--accent); border-color: #c7dfd3; }
.alert-error { background: var(--red-soft); color: var(--red); border-color: #f2cbc6; }
.alert-info { background: var(--amber-soft); color: #7a5414; border-color: #f1dcb3; }

.code { margin: 0; padding: 14px; background: var(--ink); color: #e9ebef; border-radius: 9px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; user-select: all; }

.pager { display: flex; justify-content: center; align-items: center; gap: 16px; padding-top: 14px; }

/* ---------- Login / install ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 20% 0%, #e9e4d6 0, transparent 50%), var(--paper); }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 20px; margin-bottom: 20px; }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .form { margin: 18px 0 14px; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; background: none; }
    .side { position: static; height: auto; padding: 14px 16px; gap: 12px; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .support-bar + .shell .side { top: auto; height: auto; }
    .workspace { display: none; }
    .nav { order: 3; width: 100%; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
    .nav-link { flex: none; padding: 7px 12px; }
    .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
    .me { display: none; }
    .main { padding: 20px 16px 48px; }
    .grid-2, .grid-wide-left, .form-row { grid-template-columns: 1fr; }
    .page-head { align-items: flex-start; flex-direction: column; }
    h1 { font-size: 24px; }
    .support-bar { flex-direction: column; align-items: flex-start; padding: 10px 16px; position: static; }
}

/* ==========================================================
   Module 2: leads
   ========================================================== */
:root {
    --won: #1d5c4a;
    --won-soft: #e3efe9;
    --lost-soft: #efece5;
    --open-soft: #e8eef9;
    --open-ink: #2d4a7c;
    --wa: #128c4b;
}
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn-wa { background: var(--wa); border-color: var(--wa); }
.btn[disabled], .icon-btn[disabled], .link-btn[disabled] { opacity: .35; cursor: not-allowed; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stack > .card { margin-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.warn-text { color: #9a6410; font-weight: 700; }
.alert-text { color: var(--red); font-weight: 700; }
.plain-list { margin: 8px 0 14px; padding-left: 18px; }
.steps-list { margin: 0 0 18px; padding-left: 20px; font-size: 14px; }
.steps-list li { margin-bottom: 4px; }
.list-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 6px 0 4px; }

/* stage tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.tab { flex: none; padding: 7px 12px; border-radius: 999px; text-decoration: none; font-size: 13px; font-weight: 700; color: var(--ink-2); border: 1px solid transparent; }
.tab b { font-weight: 800; color: var(--ink-3); margin-left: 2px; }
.tab:hover { background: var(--line-2); }
.tab.is-active { background: var(--ink); color: #fff; }
.tab.is-active b { color: rgba(255,255,255,.7); }
.tab-sub { font-weight: 600; }

/* chips, temperature */
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 6px; background: var(--open-soft); color: var(--open-ink); white-space: nowrap; }
.chip-won { background: var(--won-soft); color: var(--won); }
.chip-lost { background: var(--lost-soft); color: var(--ink-3); }
.temp { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
.temp-hot { background: #fde4e1; color: var(--red); }
.temp-warm { background: var(--amber-soft); color: #8a5a0f; }
.temp-cold { background: var(--open-soft); color: var(--open-ink); }
.fu-overdue { color: var(--red); font-weight: 700; }
.fu-today { color: #9a6410; font-weight: 700; }
.fu-later { color: var(--ink-2); }

/* leads table */
.leads-table .check { width: 28px; padding-right: 0; }
.leads-table input[type=checkbox] { width: 16px; height: 16px; }
.lead-name { font-weight: 700; text-decoration: none; }
.lead-name:hover { color: var(--accent); text-decoration: underline; }
.icon-btn { display: inline-block; font: inherit; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; }
.icon-btn:hover { background: var(--line-2); }
.icon-wa { color: var(--wa); border-color: #bfe3cd; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line-2); }
.bulk-bar select { width: auto; padding: 6px 8px; font-size: 13px; }

/* lead page */
.lead-head h1 { margin-bottom: 8px; }
.lead-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.lead-meta .temp { margin-left: 0; }
.quick-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-btn { font: inherit; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
.inline-form { display: flex; gap: 8px; }
.inline-form select { flex: 1; }
.danger-zone { text-align: right; padding: 0 4px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--line-2); }
.timeline li:last-child::before { display: none; }
.tl-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--line); margin-top: 4px; position: relative; z-index: 1; }
.tl-call .tl-dot { background: var(--accent); }
.tl-note .tl-dot { background: var(--amber); }
.tl-stage .tl-dot { background: var(--open-ink); }
.tl-assigned .tl-dot, .tl-followup .tl-dot { background: var(--ink-3); }
.tl-meta .tl-dot { background: #1877f2; }
.tl-body { margin: 0 0 2px; font-size: 14px; word-break: break-word; }
.timeline .small { margin: 0; }

/* import, settings */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 14px; }
.form label.check-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.check-label input { width: 16px; height: 16px; margin: 0; flex: none; }
.form label.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 500; font-size: 14px; cursor: pointer; }
.radio-card input { width: 16px; height: 16px; margin: 3px 0 0; flex: none; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
details summary { cursor: pointer; margin-bottom: 8px; }
.stage-list { list-style: none; margin: 0 0 16px; padding: 0; }
.stage-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.stage-move { display: flex; gap: 2px; }
.stage-move .icon-btn { padding: 3px 7px; }
.stage-form { display: flex; gap: 8px; flex: 1; min-width: 0; }
.stage-form input { flex: 1; min-width: 0; padding: 7px 10px; font-size: 14px; }
.stage-form select { width: 150px; flex: none; padding: 7px 8px; font-size: 13px; }
.stage-add { padding-top: 4px; }

/* dashboard */
.stat-link { text-decoration: none; color: inherit; transition: border-color .15s; }
.stat-link:hover { border-color: var(--ink-3); }
.stat-warn { border-color: #efd49e; background: var(--amber-soft); }
.stat-alert { border-color: #f2cbc6; background: var(--red-soft); }
.stat-alert .stat-num { color: var(--red); }
.todo { list-style: none; margin: 0 0 12px; padding: 0; }
.todo li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.todo li > a:first-child { text-decoration: none; margin-right: auto; flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo li > a:first-child:hover { color: var(--accent); }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr 34px; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--open-ink); }
.bar-won { background: var(--won); }
.bar-lost { background: var(--ink-3); }
.bar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
    .stage-row { flex-wrap: wrap; }
    .stage-form { flex-basis: 100%; order: 3; }
    .stage-form select { width: 120px; }
    .head-actions { width: 100%; }
}
[hidden] { display: none !important; }

/* Module 3: integrations */
.btn-fb { background: #1877f2; border-color: #1877f2; }
.sub-details { margin-top: 14px; }
.code-block { font-size: 12px; max-height: 260px; overflow: auto; }
.api-grid { margin-top: 14px; }
.rule-form select { width: auto; flex: none; }
@media (max-width: 900px) { .rule-form { flex-wrap: wrap; } .rule-form input { flex-basis: 100%; } }

/* ==========================================================
   Module 4: business features
   ========================================================== */
.btn { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-light { background: #fff; border-color: #fff; color: var(--ink); }
.btn-wa { background: var(--wa); border-color: var(--wa); }
.btn-fb { background: #1877f2; border-color: #1877f2; }
.link, .eyebrow { color: var(--accent); }
.danger-btn { color: var(--red); }
.good-text { color: var(--won); font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.grid-3 > .card { margin-bottom: 0; }
.grid-3 h3 { margin-bottom: 6px; }

/* sidebar groups, logo */
.nav-group { display: block; margin: 12px 12px 4px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #6c717c; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; background: #fff; }
.side { overflow-y: auto; }
.logo-preview { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; vertical-align: middle; border: 1px solid var(--line); }

/* top bar + bell */
.topbar { display: flex; justify-content: flex-end; margin: -12px 0 8px; }
.bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2); border: 1px solid var(--line); background: var(--card); }
.bell:hover { color: var(--ink); border-color: var(--ink-3); }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.plan-banner { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* notifications */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li a { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; border-bottom: 1px solid var(--line-2); text-decoration: none; border-radius: 8px; }
.notif-list li a:hover { background: var(--paper); }
.notif-list li.is-unread a { background: var(--accent-soft); }
.notif-list li.is-unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }

/* tags, flags, progress */
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); margin-left: 4px; vertical-align: 1px; }
.lead-meta .tag { margin-left: 0; }
.flag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flag { padding: 8px 12px 8px 30px; border-radius: 8px; font-size: 14px; position: relative; }
.flag::before { content: ""; position: absolute; left: 12px; top: 14px; width: 8px; height: 8px; border-radius: 50%; }
.flag-alert { background: var(--red-soft); }
.flag-alert::before { background: var(--red); }
.flag-warn { background: var(--amber-soft); }
.flag-warn::before { background: var(--amber); }
.progress { height: 12px; background: var(--line-2); border-radius: 6px; overflow: hidden; margin: 4px 0 8px; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.target-form input { width: 64px; padding: 5px 8px; font-size: 13px; display: inline-block; }

/* WhatsApp quick bar */
.wa-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; }
.wa-bar .chip-btn { text-decoration: none; color: var(--wa); border-color: #bfe3cd; background: #f1faf4; }
.tpl-form { padding: 12px 0; border-bottom: 1px solid var(--line-2); gap: 8px; }

/* billing */
.plan-now { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.plan-now h2 { font-size: 22px; margin-bottom: 4px; }
.plan-ended { border-color: #f2cbc6; background: var(--red-soft); }
.plan-perks { max-width: 320px; text-align: right; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.plan-card input { position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; }
.plan-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plan-name { font-weight: 800; }
.plan-price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.plan-save { align-self: flex-start; font-size: 12px; font-weight: 800; color: var(--won); background: #d6ebe1; padding: 2px 8px; border-radius: 6px; }
.coupon-row { max-width: 320px; }
.coupon-row label { display: block; font-size: 13px; font-weight: 700; }
.coupon-row input { margin-top: 6px; }
.details .total { font-size: 20px; font-weight: 800; }

/* board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-col { flex: 0 0 250px; background: var(--line-2); border-radius: 12px; padding: 8px; min-height: 120px; transition: background .15s; }
.board-col.is-over { background: var(--accent-soft); outline: 2px dashed var(--accent); }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 8px; font-weight: 800; font-size: 13px; }
.board-head b { color: var(--ink-3); }
.board-won .board-head span { color: var(--won); }
.board-lost .board-head span { color: var(--ink-3); }
.board-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.board-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; cursor: grab; box-shadow: var(--shadow); }
.board-card a { text-decoration: none; }
.board-card .temp { margin-left: 0; align-self: flex-start; }
.board-card.is-dragging { opacity: .4; }
.dialog { border: 0; border-radius: 14px; padding: 22px; width: min(380px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(21,23,28,.4); }

/* follow-up calendar */
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.cal-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.cal-day > header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.cal-overdue { border-color: #f2cbc6; background: var(--red-soft); }
.cal-empty { opacity: .6; }

/* reports */
.range-bar { align-items: center; }
.range-bar .tab { flex: none; }
.range-bar input[type=date] { width: auto; flex: 0 0 150px; padding: 7px 10px; font-size: 14px; }
.day-chart { width: 100%; height: auto; display: block; }
.day-chart .grid { stroke: var(--line); stroke-width: 1; }
.day-chart .axis { font-size: 11px; fill: var(--ink-3); font-family: inherit; }
.day-chart .bar-day { fill: var(--accent); }
.day-chart .hit { fill: transparent; }
.day-chart .bar-g:hover .bar-day { fill: var(--ink); }
.day-chart .bar-g:hover .hit { fill: rgba(0,0,0,.03); }
.tabs-sm .tab { padding: 5px 10px; font-size: 12px; }

/* tickets & help */
.thread { display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: 85%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.bubble p { margin: 0 0 4px; }
.bubble-client { align-self: flex-start; background: var(--paper); }
.bubble-agency { align-self: flex-end; background: var(--accent-soft); border-color: #c7dfd3; }
.bubble-body { white-space: normal; word-break: break-word; font-size: 14px; }
.reply-form { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 4px; }
.help-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.help-toc { position: sticky; top: 20px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.help-toc a { padding: 6px 10px; border-radius: 7px; text-decoration: none; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.help-toc a:hover { background: var(--line-2); color: var(--ink); }
.help-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.help-section h2 { margin-bottom: 10px; }
.help-section h3, .help-section h4 { margin: 12px 0 6px; }
.help-section ol, .help-section ul { padding-left: 22px; margin: 0 0 10px; }
.help-section li { margin-bottom: 4px; }

/* help assistant */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font: inherit; font-weight: 800; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.chat-fab:hover { background: var(--accent); }
.chat { position: fixed; right: 20px; bottom: 20px; z-index: 41; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 40px)); background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--ink); color: #fff; }
.chat-x { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper); }
.msg { max-width: 90%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.msg p { margin: 0 0 6px; }
.msg p:last-child { margin-bottom: 0; }
.msg ol, .msg ul { margin: 4px 0 6px; padding-left: 20px; }
.msg-bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.msg-me { align-self: flex-end; background: var(--accent); color: #fff; }
.msg-wait { color: var(--ink-3); font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; padding: 9px 12px; }
.chat-foot { padding: 0 12px 10px; font-size: 12px; text-align: center; }
.chat-foot a { color: var(--ink-2); }

/* agency */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 14px; margin: 6px 0 10px; }
.staff-row { padding: 12px 0; border-bottom: 1px solid var(--line-2); gap: 6px; }
.staff-row h3 { font-size: 15px; }
.health { border-color: #f1dcb3; }

/* public & auth pages */
.auth-links { text-align: center; font-size: 12px; margin-top: 14px; color: var(--ink-3); }
.auth-links a { color: var(--ink-3); }
.public-body { background: var(--paper); }
.public-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; max-width: 1000px; margin: 0 auto; }
.public-head nav { display: flex; gap: 14px; align-items: center; }
.brand-dark { color: var(--ink); }
.public-main { max-width: 820px; margin: 0 auto; padding: 8px 24px 40px; }
.public-foot { text-align: center; font-size: 13px; color: var(--ink-3); padding: 24px; }
.public-foot a { color: var(--ink-2); }
.legal { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.legal h1 { margin: 16px 0 14px; }
.legal h2 { margin: 22px 0 8px; font-size: 18px; }
.legal p { color: var(--ink-2); line-height: 1.7; }

@media (max-width: 900px) {
    .grid-3, .help-layout { grid-template-columns: 1fr; }
    .help-toc { position: static; flex-direction: row; flex-wrap: wrap; }
    .nav-group { display: none; }
    .topbar { margin: 0 0 8px; }
    .plan-perks { text-align: left; }
    .chat-fab span { display: none; }
    .chat-fab { padding: 14px; }
    .board-col { flex-basis: 78vw; }
    .range-bar input[type=date] { flex: 1 1 130px; }
}

/* ===================== Module 5: lead sources ===================== */
.back-link { margin: 0 0 10px; font-size: 14px; }
.section-title { font-size: 15px; font-weight: 800; margin: 26px 0 12px; color: var(--ink-2); }
.section-title:first-of-type { margin-top: 6px; }
.text-red { color: var(--red); font-weight: 700; }
.right { text-align: right; }
.strong { font-weight: 700; }
.alert-warn { background: var(--amber-soft); color: #7a5414; border-color: #f1dcb3; }
.stat-num-sm { font-size: 20px; }
.danger-zone { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.source-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.source-pill { display: inline-flex; gap: 6px; align-items: baseline; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink-2); text-decoration: none; background: var(--paper); }
.source-pill strong { color: var(--ink); font-size: 15px; }
.source-pill:hover { border-color: var(--accent); }
.source-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.source-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.source-card:hover { border-color: var(--ink-3); box-shadow: var(--shadow); }
.source-card > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.source-card strong { font-size: 15px; }
.source-state { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.source-card.is-on .source-state { color: var(--accent); }
.source-card.is-error { border-color: #f2cbc6; }
.source-card.is-error .source-state { color: var(--red); }
.source-logo { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -0.02em; color: #fff; background: var(--ink-2); }
.sl-meta { background: #1877f2; font-size: 22px; font-family: Georgia, serif; }
.sl-web { background: #2f3a4a; font-size: 11px; }
.sl-google { background: #fff; color: #4285f4; border: 1px solid var(--line); font-size: 20px; }
.sl-im { background: #2e3192; }
.sl-jd { background: #ff6d00; }
.sl-ti { background: #0b6fb3; }
.sl-su { background: #e8463a; font-size: 18px; }
.sl-99 { background: #0078db; }
.sl-mb { background: #d8232a; }
.sl-ho { background: #6a33c2; font-size: 18px; }
.sl-ivr { background: #1d5c4a; font-size: 18px; }
.sl-qr { background: #15171c; }
.sl-mail { background: #8a5a0f; font-size: 18px; }
.sl-hook { background: #5b6170; font-size: 12px; }
.sl-xls { background: #1f7a44; font-size: 11px; }
.sl-man { background: var(--paper); color: var(--ink); border: 1px dashed var(--ink-3); font-size: 20px; }
.log-new { color: var(--accent); font-weight: 700; }
.log-duplicate, .log-repeat { color: var(--ink-2); font-weight: 700; }
.log-invalid, .log-error { color: var(--red); font-weight: 700; }
.log-test { color: #7a5414; font-weight: 700; }
.log-ignored { color: var(--ink-3); }
.qr-wrap { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; margin-bottom: 14px; }
.qr-box { width: 180px; height: 180px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qr-box svg { width: 100%; height: 100%; display: block; }
@media (max-width: 640px) { .qr-wrap { grid-template-columns: 1fr; } .qr-box { margin: 0 auto; } }

/* Public QR form */
.qr-body { min-height: 100vh; display: grid; place-items: start center; padding: 28px 16px; background: var(--paper); }
.qr-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.qr-card h1 { font-size: 22px; margin: 0 0 16px; letter-spacing: -0.02em; }
.qr-biz { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.qr-biz div { display: flex; flex-direction: column; }
.qr-initial { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 20px; }
.qr-done { text-align: center; padding: 20px 0 8px; }
.qr-tick { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; background: var(--accent-soft); color: var(--accent); font-size: 28px; font-weight: 800; }

/* ===================== Module 5: ads report, quality, dashboards ===================== */
.block { display: block; }
.link-plain { color: inherit; text-decoration: none; }
.link-plain:hover { text-decoration: underline; }
.empty-state { text-align: center; padding: 36px 24px; }
.empty-state p { max-width: 560px; margin: 8px auto 18px; }
.ads-tabs { margin-bottom: 12px; }
.tabs-sm .tab { font-size: 13px; padding: 6px 12px; }
.q-badge { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: .01em; }
.q-good { background: #dff3e7; color: #17663f; }
.q-average { background: var(--amber-soft); color: #7a5414; }
.q-poor { background: var(--red-soft); color: var(--red); }
.q-few { background: var(--line-2); color: var(--ink-3); }
.q-good-t { color: #17663f; } .q-poor-t { color: var(--red); }
.ads-table th { white-space: nowrap; font-size: 11.5px; }
.ads-table td { font-size: 13.5px; }
.ads-table .col-crm { border-left: 2px solid var(--line); }
.ads-name { display: flex; gap: 10px; align-items: flex-start; min-width: 220px; max-width: 340px; }
.q-thumb { flex: none; width: 56px; height: 56px; border-radius: 8px; background: var(--line-2); overflow: hidden; display: block; }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-thumb-sm { width: 40px; height: 40px; border-radius: 6px; }
.ads-chart { width: 100%; height: 230px; display: block; }
.ads-chart .bar-spend { fill: #d9dde3; }
.ads-chart .bar-spend:hover { fill: #b9bfc8; }
.ads-chart .line-leads { stroke: var(--accent); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ads-chart .axis { font-size: 11px; fill: var(--ink-3); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: -1px; }
.key-spend { background: #d9dde3; } .key-leads { background: var(--accent); }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 56px; gap: 10px; align-items: center; font-size: 14px; }
.funnel-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.funnel-bar { height: 12px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.quality-intro .q-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 14px; font-size: 13px; color: var(--ink-2); }
.q-legend .seg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.seg-q { background: #2f9461; } .seg-u { background: #cfd3da; } .seg-o { background: #8fb8a4; } .seg-n { background: #e5a336; } .seg-j { background: #c8463d; }
.q-list { display: flex; flex-direction: column; }
.q-row { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-2); }
.q-row:first-child { border-top: 0; padding-top: 0; }
.q-row:not(:has(.q-thumb)) { grid-template-columns: 1fr auto; }
.q-main { min-width: 0; }
.q-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.q-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line-2); margin-top: 8px; }
.q-bar i { display: block; height: 100%; }
.q-nums { display: grid; grid-template-columns: repeat(4, auto); gap: 2px 14px; font-size: 13px; color: var(--ink-2); text-align: right; }
.q-nums span:last-child:nth-child(5) { grid-column: 1 / -1; }
.q-callout h3 { margin: 4px 0 6px; font-size: 16px; }
.q-callout p { margin: 0; font-size: 14px; color: var(--ink-2); }
.q-callout-good { border-left: 4px solid #2f9461; }
.q-callout-poor { border-left: 4px solid #c8463d; }
.grid-2 > .q-callout { margin-bottom: 20px; }
@media (max-width: 760px) {
    .q-row, .q-row:not(:has(.q-thumb)) { grid-template-columns: 1fr; }
    .q-row .q-thumb { display: none; }
    .q-nums { text-align: left; grid-template-columns: repeat(2, auto); justify-content: start; }
    .funnel-row { grid-template-columns: 96px 1fr 44px; }
}

/* Dashboard additions */
.big-num { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 2px 0 10px; }
.big-num .muted { font-size: 16px; font-weight: 600; letter-spacing: 0; }
.mini-form { margin-top: 10px; }
.mini-form summary { cursor: pointer; list-style: none; display: inline-block; }
.mini-form summary::-webkit-details-marker { display: none; }
.mini-form form { margin-top: 10px; }
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color .15s; }
.card-link:hover { border-color: var(--ink-3); }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 4px 0 10px; }
.mini-stats div { display: flex; flex-direction: column; gap: 2px; }
.mini-stats strong { font-size: 19px; letter-spacing: -0.02em; }
.mini-stats span { font-size: 12px; color: var(--ink-2); }
@media (max-width: 640px) { .mini-stats { grid-template-columns: repeat(2, 1fr); } }
.count-pill { display: inline-block; min-width: 22px; padding: 1px 8px; margin-left: 4px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12px; text-align: center; vertical-align: 2px; }
.fu-icon { flex: none; width: 22px; text-align: center; font-size: 14px; }
.todo li.fu-visit { background: var(--blue-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.row-behind td { background: #fdf6f5; }
.reassign-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 10px; align-items: end; margin-top: 10px; }
.reassign-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
@media (max-width: 760px) { .reassign-form { grid-template-columns: 1fr; } }
.leaderboard { list-style: none; margin: 0; padding: 0; }
.leaderboard li { display: grid; grid-template-columns: 30px 1fr auto auto auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.leaderboard li:first-child { border-top: 0; }
.lb-rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--line-2); color: var(--ink-2); }
.lb-1 { background: #f3d36b; color: #5b4300; } .lb-2 { background: #dcdfe4; color: #3d424b; } .lb-3 { background: #e9c3a0; color: #5a3517; }
.lb-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stat { font-size: 13px; text-align: right; white-space: nowrap; }
@media (max-width: 520px) { .leaderboard li { grid-template-columns: 30px 1fr auto; } .leaderboard .lb-stat:nth-child(n+4) { display: none; } }
.bar-warn { background: var(--amber); }
.filter-note { margin: -6px 0 12px; padding: 8px 12px; background: var(--amber-soft); border-radius: 8px; color: #7a5414; }
.fu-row { grid-template-columns: 1.4fr 1fr; }
.grid-2 { margin-bottom: 20px; }
.todo li a { text-decoration: none; color: inherit; }
.todo li a:hover strong { text-decoration: underline; }
.todo li > .fu-icon + a { margin-right: auto; flex: 1 1 140px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.grid-2 > .q-callout { margin-bottom: 0; }

/* =====================================================================
   v6 — premium design layer (overrides the base above)
   Mist surface · indigo night sidebar · marigold for "needs action"
   Type: Bricolage Grotesque (headings, numbers) + Onest (interface)
   ===================================================================== */
:root {
    --paper: #f3f5f9;
    --card: #ffffff;
    --ink: #171b34;
    --ink-2: #4b5170;
    --ink-3: #8a90a8;
    --line: #e3e7f0;
    --line-2: #eef1f6;
    --side: #161a3a;
    --side-2: #1f2450;
    --side-ink: #b9bedb;
    --accent-soft: color-mix(in srgb, var(--accent) 10%, #fff);
    --accent-line: color-mix(in srgb, var(--accent) 28%, #fff);
    --marigold: #f4a62a;
    --marigold-soft: #fff4de;
    --amber: #f4a62a;
    --amber-soft: #fff4de;
    --green: #12946a;
    --green-soft: #e3f6ee;
    --red: #d0453b;
    --red-soft: #fdecea;
    --blue-soft: #eceffd;
    --won: #12946a;
    --won-soft: #e3f6ee;
    --open-soft: #eceffd;
    --open-ink: #3b4aa8;
    --lost-soft: #eef1f6;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(23, 27, 52, .04), 0 6px 24px -12px rgba(23, 27, 52, .12);
    --shadow-lg: 0 18px 50px -20px rgba(23, 27, 52, .35);
    --display: "Bricolage Grotesque", "Onest", system-ui, sans-serif;
}
body { font-family: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14.5px; background: var(--paper); color: var(--ink); }
h1, h2, h3, .stat-num, .big-num, .plan-price { font-family: var(--display); }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { flex: none; display: block; }

/* ---------- Shell ---------- */
.shell { grid-template-columns: 256px minmax(0, 1fr); background: none; }
.side {
    background: var(--side); color: var(--side-ink); padding: 18px 14px 14px; gap: 16px; overflow-y: auto;
    background-image: radial-gradient(120% 60% at 0% 0%, rgba(122, 128, 255, .16), transparent 60%);
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.side-top { display: flex; align-items: center; justify-content: space-between; }
.brand { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; padding: 2px 6px; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--marigold); color: var(--side); font-family: var(--display); }
.brand-logo { width: 32px; height: 32px; border-radius: 10px; }
.side-close { display: none; background: none; border: 0; color: var(--side-ink); cursor: pointer; padding: 6px; border-radius: 8px; }
.workspace { flex-direction: row; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); }
.ws-mark { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); }
.ws-text { display: flex; flex-direction: column; min-width: 0; }
.workspace-name { font-size: 14px; }
.workspace-label { font-size: 12px; text-transform: none; letter-spacing: 0; color: #8b90b5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { gap: 1px; }
.nav-group { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: #767bab; }
.nav-link { justify-content: flex-start; gap: 11px; padding: 8px 10px; border-radius: 9px; font-weight: 500; font-size: 14px; color: var(--side-ink); position: relative; }
.nav-link .ic { opacity: .8; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.nav-link.is-active .ic { opacity: 1; color: var(--marigold); }
.nav-link.is-active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--marigold); }
.side-foot { padding: 12px 4px 0; border-top: 1px solid rgba(255,255,255,.08); }
.me { flex-direction: row; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-role { color: #8b90b5; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: var(--side); background: #e6e8ff; text-decoration: none; }
.icon-only { background: none; border: 0; padding: 7px; border-radius: 9px; cursor: pointer; color: inherit; display: inline-grid; place-items: center; }
.side .icon-only { color: var(--side-ink); }
.side .icon-only:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-scrim { display: none; }

.frame { min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
    margin: 0; padding: 12px 32px; background: color-mix(in srgb, var(--paper) 82%, transparent);
    backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.support-bar + .shell .topbar { top: 44px; }
.menu-btn { display: none; color: var(--ink); }
.search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--ink-3); }
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { border: 0; padding: 0; height: 100%; background: none; font-size: 14px; outline: none; }
.search input:focus { outline: none; }
.search kbd { font: inherit; font-size: 11px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; }
.search-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; max-height: 70vh; overflow: auto; }
.sp-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); }
.sp-item:hover, .sp-item.is-active { background: var(--paper); }
.sp-type { flex: none; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.sp-text { display: flex; flex-direction: column; min-width: 0; }
.sp-text span { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-all, .sp-empty { display: block; padding: 9px 10px; font-size: 13px; color: var(--ink-2); text-decoration: none; border-top: 1px solid var(--line-2); margin-top: 4px; }
.sp-all:hover { color: var(--accent); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.bell { width: 40px; height: 40px; border-radius: 11px; border-color: var(--line); }
.avatar-top { background: var(--ink); color: #fff; width: 38px; height: 38px; }
.duty { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.duty-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 3px var(--line-2); }
.duty.is-on { color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, #fff); background: var(--green-soft); }
.duty.is-on .duty-dot { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, #fff); }

.main { padding: 26px 32px 72px; max-width: 1320px; }
.page-head { align-items: flex-end; margin-bottom: 22px; }
.eyebrow { text-transform: none; letter-spacing: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.page-head .muted { margin: 6px 0 0; max-width: 70ch; }

/* ---------- Surfaces ---------- */
.card { border-radius: var(--radius); border-color: var(--line); padding: 20px 22px; box-shadow: var(--shadow); }
.card-head { margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.table-wrap { margin: 0 -22px; padding: 0 22px; }
.stats { gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat { border: 0; border-radius: 0; padding: 18px 20px; gap: 6px; background: var(--card); }
.stat-num { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.stat-label { font-size: 13px; }
.stat-link:hover { background: color-mix(in srgb, var(--accent) 3%, #fff); }
.stat-warn { background: var(--marigold-soft); }
.stat-alert { background: var(--red-soft); }

/* ---------- Tables ---------- */
.table { font-size: 14px; }
.table th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--ink-3); padding: 10px 12px; background: color-mix(in srgb, var(--paper) 60%, #fff); border-bottom: 1px solid var(--line); }
.table td { padding: 13px 12px; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--paper) 45%, #fff); }

/* ---------- Controls ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: 10px 16px; box-shadow: 0 1px 2px rgba(23,27,52,.12), inset 0 1px 0 rgba(255,255,255,.14); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 2px rgba(23,27,52,.05); }
.btn-ghost:hover { background: var(--paper); }
.btn .ic { margin: 0 -2px; }
input, select, textarea { border-radius: 10px; border-color: var(--line); font-size: 14.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form label { font-weight: 600; }
.form-section { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); font-weight: 700; }
.list-title { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }
.tab { font-weight: 600; border-radius: 9px; }
.tab.is-active { background: var(--ink); }
.chip { border-radius: 999px; font-weight: 600; }
.temp { text-transform: none; letter-spacing: 0; border-radius: 999px; padding: 1px 8px; }
.icon-btn { border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.alert { border-radius: 12px; }
.alert-success { background: var(--green-soft); color: #0d6b4d; border-color: color-mix(in srgb, var(--green) 25%, #fff); }
.alert-info, .alert-warn { background: var(--marigold-soft); color: #7a5414; border-color: #f7dcaa; }
.code { background: var(--side); border-radius: 12px; }
.support-bar { background: var(--marigold); }

/* ---------- Hero band (top of each dashboard) ---------- */
.hero {
    position: relative; overflow: hidden; color: #fff; border-radius: 22px; padding: 26px 28px; margin-bottom: 20px;
    background: var(--side);
    background-image:
        radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 60%),
        radial-gradient(60% 90% at 0% 100%, rgba(244, 166, 42, .18), transparent 60%);
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: end;
}
.hero-hello { margin: 0 0 4px; color: #b9bedb; font-size: 14px; }
.hero h1 { color: #fff; font-size: 32px; margin: 0 0 10px; }
.hero-focus { font-size: 16px; color: #e3e6fa; margin: 0 0 16px; max-width: 62ch; }
.hero-focus strong { color: #fff; }
.focus-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.focus-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: #fff; text-decoration: none; font-size: 13.5px; font-weight: 500; }
.focus-pill b { font-family: var(--display); font-size: 16px; font-weight: 700; }
.focus-pill:hover { background: rgba(255,255,255,.18); }
.focus-pill.is-hot { background: var(--marigold); border-color: var(--marigold); color: var(--side); }
.focus-pill.is-calm { opacity: .75; }
.hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.hero-side .btn { background: #fff; color: var(--side); border-color: #fff; }
.hero-side .btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); box-shadow: none; }
.hero-metric { text-align: right; }
.hero-metric strong { display: block; font-family: var(--display); font-size: 34px; letter-spacing: -0.03em; line-height: 1; }
.hero-metric span { font-size: 13px; color: #b9bedb; }

/* ---------- KPI with trend ---------- */
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.kpi-up { color: var(--green); background: var(--green-soft); }
.kpi-down { color: var(--red); background: var(--red-soft); }
.kpi-flat { color: var(--ink-3); background: var(--line-2); }
.stat .spark { margin-top: 4px; width: 100%; height: 28px; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark .area { fill: var(--accent-soft); stroke: none; }

/* ---------- Module launcher ---------- */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.app-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; min-width: 0; }
.app-tile:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.app-ic { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.app-tile strong { display: block; font-size: 14.5px; }
.app-tile .muted { display: block; font-size: 12.5px; margin-top: 1px; }
.app-count { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.app-count.is-hot { background: var(--marigold-soft); color: #8a5a0f; }

/* ---------- Charts (trend line) ---------- */
.trend { width: 100%; height: 210px; display: block; }
.trend .grid { stroke: var(--line-2); }
.trend .area { fill: url(#trendFill); }
.trend .line { fill: none; stroke: var(--accent); stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.trend .line-2 { fill: none; stroke: var(--marigold); stroke-width: 2; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.trend .axis { font-size: 11px; fill: var(--ink-3); }
.legend-row { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.legend-row i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 6px; background: var(--accent); }
.legend-row i.l2 { background: var(--marigold); }

/* Money at risk */
.risk { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.risk-amt { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: var(--red); line-height: 1; }
.risk-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.risk-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 9px; background: var(--paper); }
.risk-list a { text-decoration: none; }
.pipe-stages { display: flex; flex-direction: column; gap: 8px; }
.pipe-row { display: grid; grid-template-columns: minmax(100px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.pipe-row .bar-track { height: 10px; border-radius: 999px; }
.pipe-row .bar { border-radius: 999px; background: var(--accent); }
.pipe-row strong { font-variant-numeric: tabular-nums; text-align: right; }

/* Personal stats (sales rep) */
.mine { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mine div { padding: 12px; border-radius: 12px; background: var(--paper); }
.mine strong { display: block; font-family: var(--display); font-size: 22px; letter-spacing: -0.02em; }
.mine span { font-size: 12.5px; color: var(--ink-2); }

/* Settings with side tabs */
.settings-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.settings-nav a:hover { background: var(--paper); color: var(--ink); }
.settings-nav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-body > .card:last-child { margin-bottom: 0; }
.setting-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line-2); }
.setting-row:first-of-type { border-top: 0; padding-top: 0; }
.setting-row p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.switch { position: relative; flex: none; width: 42px; height: 24px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Lead page contact actions */
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-mail { background: #fff; color: #b0341f; border-color: #f2cfc7; }
.btn-mail:hover { background: #fff6f4; filter: none; }
.icon-mail { color: #b0341f; border-color: #f2cfc7; }
.mail-bar .chip-btn { text-decoration: none; color: #b0341f; border-color: #f2cfc7; background: #fff8f6; }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) {
    .settings-shell { grid-template-columns: 1fr; }
    .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
    .settings-nav a { flex: none; }
}
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .side {
        position: fixed; inset: 0 auto 0 0; width: 280px; height: 100vh; z-index: 60; flex-direction: column; flex-wrap: nowrap; align-items: stretch;
        padding: 18px 14px; gap: 16px; transform: translateX(-100%); transition: transform .2s ease;
    }
    .support-bar + .shell .side { top: 0; height: 100vh; }
    body.side-open .side { transform: none; box-shadow: var(--shadow-lg); }
    .side-scrim { display: block; position: fixed; inset: 0; background: rgba(22, 26, 58, .45); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
    body.side-open .side-scrim { opacity: 1; pointer-events: auto; }
    .side-close { display: inline-grid; }
    .workspace { display: flex; }
    .nav { order: 0; width: auto; flex-direction: column; overflow: visible; }
    .nav-group { display: block; }
    .nav-link { padding: 10px; }
    .side-foot { margin: auto 0 0; padding: 12px 4px 0; border-top: 1px solid rgba(255,255,255,.08); }
    .me { display: flex; }
    .topbar { padding: 10px 14px; gap: 8px; }
    .menu-btn { display: inline-grid; }
    .search kbd { display: none; }
    .top-add span, .duty span[data-duty-text] { display: none; }
    .duty { padding: 0 10px; }
    .top-add { padding: 8px 10px; }
    .avatar-top { display: none; }
    .main { padding: 18px 14px 56px; }
    .hero { grid-template-columns: 1fr; padding: 22px 20px; border-radius: 18px; }
    .hero h1 { font-size: 26px; }
    .hero-side { align-items: flex-start; }
    .hero-metric { text-align: left; }
    .mine { grid-template-columns: repeat(2, 1fr); }
    .table-wrap { margin: 0 -22px; }
}
@media (prefers-reduced-motion: reduce) { .side, .side-scrim, .app-tile { transition: none; } }
@media (min-width: 901px) { .shell { background: linear-gradient(to right, var(--side) 256px, transparent 256px); } }
.search input { flex: 1; min-width: 0; width: auto; }
.search input::placeholder { color: var(--ink-3); }
.stat .kpi-delta { align-self: flex-start; }
.stat-label .kpi-delta { margin-left: 4px; vertical-align: 1px; }
@media (max-width: 1200px) { .leads-table .hide-sm { display: none; } }
.board-value { display: block; font-weight: 600; font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.grid-2 > :only-child { grid-column: 1 / -1; }
.reason-row { display: flex; align-items: center; gap: 12px; } .reason-row input:not([type=checkbox]) { flex: 1; } .reason-row .check-label { flex: none; }
.form > .btn:not(.btn-block) { align-self: flex-start; }
.duty-mini { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-right: 7px; vertical-align: 1px; }
.duty-mini.is-on { background: var(--green); }
/* Login & signup */
.auth-body { background: var(--side); background-image: radial-gradient(80% 60% at 100% 0%, color-mix(in srgb, var(--accent) 65%, transparent), transparent 60%), radial-gradient(60% 50% at 0% 100%, rgba(244,166,42,.18), transparent 60%); }
.auth-brand { color: #fff; font-family: var(--display); font-weight: 700; }
.auth-card { border: 0; border-radius: 20px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); padding: 30px; }
.auth-card h1 { font-size: 26px; }
.auth-links, .auth-links a { color: #b9bedb; }
.auth-body .muted.small.center a.link { color: var(--accent); }
@media (max-width: 900px) { .fu-row { grid-template-columns: 1fr; } }

/* =====================================================================
   v7 — Purplead brand: black · white · purple (#b86bf8)
   Deep purple (--accent, default #8b3dff) carries white text; light purple
   (--violet) is for highlights on black. Amber stays only for warnings.
   ===================================================================== */
:root {
    --paper: #f6f5f9;
    --ink: #15111d;
    --ink-2: #4d4759;
    --ink-3: #8b8597;
    --line: #e7e4ee;
    --line-2: #f0eef5;
    --side: #0f0b16;
    --side-2: #1b1426;
    --side-ink: #c3bccf;
    --violet: #b86bf8;
    --violet-soft: #f4eafe;
    --marigold: #b86bf8;
    --open-soft: #f1ebfd;
    --open-ink: #6a2bd9;
    --blue-soft: #f1ebfd;
    --shadow: 0 1px 2px rgba(21, 17, 29, .04), 0 6px 24px -12px rgba(21, 17, 29, .14);
    --shadow-lg: 0 18px 50px -20px rgba(21, 17, 29, .4);
}
.side { background-image: radial-gradient(120% 50% at 0% 0%, rgba(184, 107, 248, .16), transparent 60%); }
.brand-mark { background: var(--violet); color: var(--side); }
img.brand-mark-img { width: 32px; height: 32px; border-radius: 9px; display: block; flex: none; }
.workspace-label, .me-role { color: #9a91aa; }
.nav-group { color: #857c96; }
.avatar { background: var(--violet-soft); color: #4b1d8f; }
.hero { background-image: radial-gradient(90% 140% at 100% 0%, color-mix(in srgb, var(--accent) 75%, transparent), transparent 60%), radial-gradient(60% 90% at 0% 100%, rgba(184, 107, 248, .2), transparent 60%); }
.hero-hello, .auth-links, .auth-links a { color: #c3bccf; }
.hero-focus { color: #ece6f7; }
.focus-pill.is-hot { background: var(--violet); border-color: var(--violet); color: var(--side); }
.app-count.is-hot { background: var(--violet-soft); color: #5b21b6; }
.side-scrim { background: rgba(15, 11, 22, .5); }
.auth-body { background-image: radial-gradient(80% 60% at 100% 0%, color-mix(in srgb, var(--accent) 60%, transparent), transparent 60%), radial-gradient(60% 50% at 0% 100%, rgba(184, 107, 248, .18), transparent 60%); }
/* warnings keep amber so "needs action" still reads as a warning */
.stat-warn { background: var(--amber-soft); }
.alert-info, .alert-warn { background: var(--amber-soft); }
.support-bar { background: var(--violet); }

/* ---------- Lead quality (one tap) ---------- */
.qbtns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.q-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s; }
.q-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.q-btn.q-qualified.is-on { background: var(--green-soft); border-color: var(--green); color: #0b6b4c; }
.q-btn.q-not_qualified.is-on { background: var(--amber-soft); border-color: #e0a63c; color: #7a5414; }
.q-btn.q-junk.is-on { background: var(--red-soft); border-color: var(--red); color: #9b2a22; }
.q-btn.q-dead.is-on { background: #ecebef; border-color: #8b8597; color: #3b3645; }
.q-mini { display: inline-flex; gap: 4px; }
.q-mini .q-btn { padding: 4px 8px; font-size: 12px; }
.q-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.q-tag.q-qualified { background: var(--green-soft); color: #0b6b4c; }
.q-tag.q-not_qualified { background: var(--amber-soft); color: #7a5414; }
.q-tag.q-junk { background: var(--red-soft); color: #9b2a22; }
.q-tag.q-dead { background: #ecebef; color: #3b3645; }
.q-tag.q-none { background: var(--violet-soft); color: #5b21b6; }
.meta-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.meta-state.is-sent { color: var(--green); }
.meta-state.is-wait { color: #9a6b12; }
.meta-state.is-fail { color: var(--red); }
.quality-card { border: 1px solid var(--accent-line); background: linear-gradient(180deg, var(--violet-soft), #fff 70%); }
.quality-card .q-help { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }

/* ---------- Lead source panel ---------- */
.src-panel { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.src-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.src-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--side); color: var(--violet); flex: none; }
.src-head strong { display: block; font-size: 15px; }
.src-head span { font-size: 13px; color: var(--ink-3); }
.src-rows { display: grid; gap: 0; margin: 0; }
.src-rows > div { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.src-rows dt { color: var(--ink-3); font-weight: 500; }
.src-rows dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.src-act { display: inline-flex; gap: 2px; }
.src-act a, .src-act button { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--ink-3); cursor: pointer; text-decoration: none; }
.src-act a:hover, .src-act button:hover { background: var(--line-2); color: var(--accent); }
.ad-perf { border-radius: 14px; background: var(--paper); padding: 14px; }
.ad-perf h3 { font-size: 13.5px; margin: 0 0 10px; }
.ad-perf .qbar { display: flex; height: 9px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 8px 0; }
.ad-perf .qbar i { display: block; height: 100%; }
.ad-perf .qbar .g { background: var(--green); } .ad-perf .qbar .o { background: #e0a63c; } .ad-perf .qbar .r { background: var(--red); } .ad-perf .qbar .d { background: #b7b2c0; }
.ad-perf ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 13px; }
.ad-perf li b { font-family: var(--display); }
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 0; }
.answers > div { background: var(--paper); border-radius: 12px; padding: 10px 12px; }
.answers dt { font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }
.answers dd { margin: 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .src-panel { grid-template-columns: 1fr; } }

/* ---------- Feedback screen ---------- */
.fb-ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--line-2) 0); flex: none; }
.fb-ring span { width: 92px; height: 92px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 26px; font-weight: 700; }
.fb-top { display: flex; gap: 22px; align-items: center; }
.loop-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.loop-steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; font-size: 14px; }
.loop-steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--side); color: var(--violet); font-weight: 700; font-size: 13px; }
.loop-steps li.is-done::before { content: "✓"; background: var(--green); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.src-act .is-copied { color: var(--green); background: var(--green-soft); }
.q-cell { white-space: nowrap; } .q-cell .q-btn { padding: 5px 7px; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.q-title .src-act, .ads-name .src-act { display: inline-flex; vertical-align: middle; margin-left: 2px; } .q-title .src-act a, .q-title .src-act button, .ads-name .src-act a, .ads-name .src-act button { width: 24px; height: 24px; }

.src-panel + .form-section, #source .form-section { margin-top: 18px; }
.q-mini .q-btn.q-qualified { color: #0b8a5f; } .q-mini .q-btn.q-not_qualified { color: #b07a16; } .q-mini .q-btn.q-junk { color: #c2392f; } .q-mini .q-btn.q-dead { color: #6b6578; }
.q-mini .q-btn { border-color: currentColor; border-color: color-mix(in srgb, currentColor 35%, transparent); }
.q-mini .q-btn.is-on.q-qualified { background: var(--green); color: #fff; } .q-mini .q-btn.is-on.q-not_qualified { background: #e0a63c; color: #fff; }
.q-mini .q-btn.is-on.q-junk { background: var(--red); color: #fff; } .q-mini .q-btn.is-on.q-dead { background: #6b6578; color: #fff; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 90; background: var(--side); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); }
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast-bad { background: var(--red); }
.q-btn:disabled { opacity: .55; cursor: wait; }
.mark-list { list-style: none; margin: 0; padding: 0; }
.mark-list li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 2px; border-top: 1px solid var(--line-2); transition: opacity .4s, transform .4s; }
.mark-list li:first-child { border-top: 0; }
.mark-list li.is-done { opacity: 0; transform: translateX(30px); }
.mark-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mark-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 760px) { .mark-list li { flex-direction: column; align-items: stretch; } .mark-act { justify-content: flex-start; } }
.q-thumb { display: grid; place-items: center; color: var(--ink-3); }
.topbar { justify-content: flex-start; } .search { min-width: 0; } .menu-btn, .top-actions { flex: none; }
.q-btn, .icon-btn { position: relative; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr 1fr; } .stats > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
.demo-list { list-style: none; margin: 0; padding: 0; }
.demo-item { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 18px 4px; border-top: 1px solid var(--line-2); }
.demo-item:first-child { border-top: 0; }
.demo-item.is-new { background: linear-gradient(90deg, var(--violet-soft), transparent 60%); border-radius: 12px; padding-left: 14px; }
.demo-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.demo-who strong { font-size: 16px; }
.badge-new { background: var(--accent); color: #fff; }
.demo-meta { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 14px; }
.demo-meta .ic { color: var(--ink-3); }
.demo-details { margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.demo-details div { background: var(--paper); border-radius: 10px; padding: 7px 10px; }
.demo-details dt { font-size: 11.5px; color: var(--ink-3); }
.demo-details dd { margin: 0; font-size: 13.5px; font-weight: 600; }
.demo-side { display: flex; flex-direction: column; gap: 10px; }
.demo-actions { display: flex; gap: 8px; }
.demo-form { display: grid; gap: 8px; }
.demo-form textarea { min-height: 0; }
@media (max-width: 900px) { .demo-item { grid-template-columns: 1fr; } }
.ind-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.ind-photo-row { display: flex; gap: 12px; align-items: flex-start; background: var(--paper); border-radius: 12px; padding: 10px; }
.ind-photo-row input[type=file] { display: block; margin-top: 6px; font-size: 13px; max-width: 100%; }
.ind-thumb { flex: none; width: 64px; height: 48px; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--side); color: var(--violet); }
.ind-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- v7.4 Access types ---------- */
.access-card .card-head { gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
.acc-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #efe6fe; color: #5b21b6; }
.acc-pill.acc-crm_paid { background: #e3efe9; color: #1d5c4a; }
.acc-pill.acc-trial { background: #fff3db; color: #7a5414; }
.acc-state { font-size: 12px; font-weight: 700; color: var(--muted, #6b7078); }
.acc-st-ending_soon { color: #a36108; }
.acc-st-ended, .acc-st-suspended { color: var(--red); }
.acc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin: 12px 0; }
.acc-form { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.acc-days { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 0; }
.acc-days input { width: 64px; padding: 6px 8px; }
.acc-form .check-label { margin: 0; }
.acc-note { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-note input { flex: 1 1 220px; min-width: 0; }
.acc-hist { margin-top: 12px; }
.acc-hist summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.btn-danger { color: var(--red) !important; border-color: #f2cbc6 !important; }
.access-pick { display: grid; gap: 8px; margin-bottom: 12px; }
.access-opt, .form .access-opt { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; margin: 0; }
.access-opt input { margin-top: 3px; width: auto; }
.access-opt > span { display: flex; flex-direction: column; gap: 2px; }
.access-opt:has(input:checked) { border-color: var(--violet, #b86bf8); background: #faf5ff; }
.plan-free-note { border-left: 4px solid var(--violet, #b86bf8); }
.trial-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff3db; color: #7a5414; }
.paid-banner { display: flex; align-items: center; gap: 8px; background: #e3efe9; color: #1d5c4a; font-weight: 700; font-size: 14px; padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.gst-more { margin: 4px 0 14px; }
.gst-more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted, #6b7078); margin-bottom: 8px; }

/* ---------- v7.6 mobile fixes ---------- */
@media (max-width: 720px) {
    .page-head { align-items: flex-start; }
    .filters { display: grid; grid-template-columns: 1fr 1fr; }
    .filters input { grid-column: 1 / -1; width: 100%; }
    .filters select, .filters .btn { width: 100%; min-width: 0; flex: none; }
    /* Leads list as cards on phones: name + stage, quality buttons, then the small details, then call buttons */
    .leads-table thead { display: none; }
    .leads-table, .leads-table tbody { display: block; width: 100%; }
    .leads-table tr { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
    .leads-table.has-check tr { padding-left: 34px; }
    .leads-table td { display: block; padding: 0; border: 0; }
    .leads-table td.check { position: absolute; left: 0; top: 16px; }
    .leads-table td.c-lead { flex: 1 1 55%; min-width: 0; }
    .leads-table td.c-stage { flex: 0 0 auto; margin-left: auto; align-self: flex-start; }
    .leads-table td.q-cell { flex: 1 1 100%; }
    .leads-table td.c-meta { flex: 0 0 auto; font-size: 12.5px; }
    .leads-table td.c-meta + td.c-meta::before { content: "·"; margin-right: 8px; color: var(--ink-3); }
    .leads-table td.c-src br { display: none; }
    .leads-table td.c-src .muted { margin-left: 4px; }
    .leads-table td.actions { flex: 1 1 100%; display: flex; gap: 8px; }
    .leads-table td.actions .icon-btn .hide-sm { display: inline; }
}
@media (max-width: 720px) {
    .leads-table td, .leads-table tr:hover td { background: none !important; }
    .leads-table .q-mini { gap: 8px; }
    .leads-table .q-mini .q-btn { width: 38px; height: 38px; }
}
@media (max-width: 720px) { .leads-table td.c-empty { display: none; } }
@media (max-width: 720px) { .leads-table .q-mini .q-btn { padding: 0; justify-content: center; } }

/* 7.8 auto-renew */
.autorenew-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--line-2); flex-basis: 100%; }
.autorenew-box p { margin: 0; }
.autorenew-box.is-on { background: var(--accent-soft); }
.autorenew-tick { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 4px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.autorenew-tick input { margin-top: 3px; }

/* 7.9 WhatsApp */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--wa); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.wa-thread { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 12px; margin-bottom: 12px; border-radius: 10px; background: var(--line-2); }
.wa-msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); align-self: flex-start; }
.wa-msg.wa-out { align-self: flex-end; background: #dcf5e4; }
.wa-msg.is-failed { background: var(--red-soft); }
.wa-msg p { margin: 0 0 4px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.wa-meta { display: block; font-size: 11px; color: var(--ink-3); }
.wa-err { display: block; font-size: 12px; color: var(--red); margin-top: 2px; }
.wa-reply { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 10px; }
.wa-reply textarea { flex: 1; min-height: 44px; }
.wa-tpl-send { margin-top: 4px; }
.wa-chat-list { list-style: none; margin: 0; padding: 0; }
.wa-chat-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.wa-chat-list li:last-child { border-bottom: 0; }
.wa-chat-list li.is-unread .wa-chat-name { font-weight: 800; }
.wa-chat-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wa-chat-name { font-weight: 600; color: var(--ink); }
.wa-chat-last { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.wa-chat-side { display: flex; align-items: center; gap: 8px; flex: none; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat-row > div { padding: 10px 12px; border-radius: 10px; background: var(--line-2); display: flex; flex-direction: column; }
.stat-row b { font-size: 20px; }
.stat-row span { font-size: 12px; color: var(--ink-3); }
.wa-param[hidden] { display: none; }
.wa-tpl-body { margin-top: -6px; }
@media (max-width: 600px) { .wa-msg { max-width: 92%; } .wa-reply { flex-direction: column; align-items: stretch; } }
.wa-test { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.wa-fu { align-items: end; }
.wa-media summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-top: 4px; }
.wa-media .form { margin-top: 8px; min-width: 220px; }
