/* JF Outreach: calm light interface (design language of the Vision Concepts CRM), petrol accent, WhatsApp green only for WhatsApp. */
:root {
  --ink: #0b1a1f; --ink2: #34444b; --muted: #66767c; --soft: #93a1a6; --line: rgba(11, 26, 31, 0.09); --line2: rgba(11, 26, 31, 0.15);
  --bg: #f4f5f3; --card: #fff; --hover: #f2f4f3; --teal: #0f8f86; --teal-l: #2bc9b4; --teal-bg: #e6f6f4;
  --red: #c4432f; --red-bg: #fdecea; --blue: #2f6fe0; --blue-bg: #eaf1fe; --violet: #6b55e0; --violet-bg: #efecfd; --green: #1f9a55; --green-bg: #e7f6ee;
  --amber: #a7660b; --amber-bg: #fdf3e1; --wa: #1fa855; --wa-bg: #e4f7ea; --bubble-out: #dff6e7;
  --r: 14px; --side: 236px; --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: 14.5px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4 { letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.12rem; } h3 { font-size: 0.98rem; display: flex; align-items: center; gap: 8px; } h4 { font-size: 0.9rem; margin: 6px 0 -2px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84em; background: #eef0ef; padding: 1px 5px; border-radius: 5px; }
code.break { word-break: break-all; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.soft { color: var(--soft); }
.muted { color: var(--muted); } .soft { color: var(--soft); } .small { font-size: 0.82rem; } .tiny { font-size: 0.74rem; }
.row { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .right { margin-left: auto; }
.right-end { justify-content: flex-end; margin-top: 14px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.link { color: var(--teal); font-weight: 600; } .txt-bad { color: var(--red); }
.mobile-only { display: none !important; }
[hidden] { display: none !important; }

/* Layout */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; font-weight: 700; font-size: 1.02rem; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; }
.brand small { display: block; font-weight: 500; font-size: 0.74rem; color: var(--muted); letter-spacing: 0; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--ink2); font-weight: 500; }
.nav a:hover { background: var(--hover); }
.nav a.on { background: var(--ink); color: #fff; }
.nav a .badge { margin-left: auto; }
.side-foot { margin-top: auto; padding: 10px 8px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.side-foot b { font-size: 0.86rem; } .side-foot small { display: block; font-size: 0.74rem; text-transform: capitalize; }
.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 22px 28px 70px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin: 4px 0 18px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 3px; max-width: 760px; }
.page-head .right { display: flex; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 0.86rem; margin-bottom: 6px; }
.back:hover { color: var(--ink); }
.tabbar { display: none; }
.loading { display: grid; place-items: center; padding: 80px 0; }
.spin { width: 26px; height: 26px; border: 3px solid var(--line2); border-top-color: var(--teal); border-radius: 50%; animation: rot 0.8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* Buttons + inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; background: #fff; box-shadow: inset 0 0 0 1px var(--line2); white-space: nowrap; transition: background 0.15s, transform 0.15s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #22343b; }
.btn.wa { background: var(--wa); color: #fff; box-shadow: none; } .btn.wa:hover { background: #18914a; }
.btn.danger { color: var(--red); }
.btn.danger-fill { background: var(--red); color: #fff; box-shadow: none; }
.btn.ghost { box-shadow: none; background: transparent; } .btn.ghost:hover { background: var(--hover); }
.btn.light { background: #fff; color: var(--ink); box-shadow: none; }
.btn.ghost-dark { background: transparent; color: #fff; box-shadow: none; } .btn.ghost-dark:hover { background: rgba(255, 255, 255, 0.12); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 0.84rem; border-radius: 9px; }
.btn.icon { width: 38px; padding: 0; } .btn.sm.icon { width: 32px; }
.btn.round { border-radius: 50%; }
.btn.big { height: 46px; font-size: 0.98rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.linkbtn { color: #9ff0e2; font-weight: 600; text-decoration: underline; font-size: 0.86rem; }
.field { display: grid; gap: 5px; align-content: start; }
.field > span { font-size: 0.8rem; font-weight: 600; color: var(--ink2); }
.field small { font-size: 0.76rem; }
.in, select.in, textarea.in { line-height: 1.3; width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line2); background: #fff; padding: 0 12px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
select.in { padding-right: 30px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366767c' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
textarea.in { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.in:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(43, 201, 180, 0.2); }
.in:disabled { background: #f6f7f6; color: var(--muted); }
.sm-in { height: 36px !important; width: auto !important; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chk { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 0.9rem; padding: 4px 0; }
.chk input { width: 17px; height: 17px; accent-color: var(--teal); margin-top: 2px; flex: none; }
.pad-top { padding-top: 26px; }
.seg { display: inline-flex; background: #e8ebe9; border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button, .seg label { padding: 7px 13px; border-radius: 8px; font-weight: 600; font-size: 0.85rem; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg button.on, .seg label:has(input:checked) { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--teal); }
.small-seg button { padding: 5px 10px; font-size: 0.8rem; }

/* Cards, KPIs, banners */
.card { background: var(--card); border-radius: var(--r); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), inset 0 0 0 1px var(--line); padding: 18px; min-width: 0; display: grid; gap: 12px; align-content: start; }
.card + .card, .banner + .card, .card + .banner, .kpis + .card, .banner + .banner { margin-top: 14px; }
.card.flush { padding: 0; gap: 0; }
.card > .btn, .card > .row > .btn:only-child { justify-self: start; }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border-radius: var(--r); padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--line); }
.kpi p { font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.kpi b { display: block; font-size: 1.7rem; margin-top: 4px; letter-spacing: -0.03em; line-height: 1.1; }
.kpi.alert b { color: var(--red); } .kpi.good b { color: var(--green); }
.card .kpis { margin: 0; }
.cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
.cols > .card + .card { margin-top: 0; }
.empty { color: var(--soft); padding: 10px 2px; font-size: 0.9rem; }
.empty-cta { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 10px 18px; color: var(--muted); }
.empty-cta > svg.i { width: 26px; height: 26px; color: var(--teal); background: var(--teal-bg); padding: 11px; box-sizing: content-box; border-radius: 14px; margin-bottom: 4px; }
.empty-cta b { color: var(--ink); font-size: 1rem; }
.empty-cta span { font-size: 0.88rem; max-width: 360px; margin-bottom: 8px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--r); background: var(--blue-bg); color: #1d4fa8; margin-bottom: 14px; }
.banner > svg.i { margin-top: 2px; }
.banner b { display: block; color: inherit; } .banner span { font-size: 0.88rem; color: var(--ink2); display: block; margin-top: 2px; }
.banner > div { flex: 1; min-width: 0; }
.banner.warn { background: var(--amber-bg); color: var(--amber); } .banner.bad { background: var(--red-bg); color: var(--red); } .banner.info { background: var(--teal-bg); color: #0b6f68; }
.checklist { display: grid; gap: 7px; padding-left: 18px; color: var(--ink2); font-size: 0.9rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--soft); }
.dot.good { background: var(--green); } .dot.bad { background: var(--red); }

/* Badges, tags */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px; font-size: 0.74rem; font-weight: 600; background: #eef0ef; color: var(--ink2); white-space: nowrap; }
.badge.n { min-width: 20px; height: 20px; justify-content: center; border-radius: 99px; background: var(--wa); color: #fff; padding: 0 6px; }
.badge.soft-b { background: #eef0ef; color: var(--ink2); border-radius: 99px; }
.nav a.on .badge.soft-b { background: rgba(255, 255, 255, 0.18); color: #fff; }
.st-new { background: #eef0ef; color: #4b5a60; } .st-contacted { background: var(--blue-bg); color: var(--blue); } .st-replied { background: var(--teal-bg); color: var(--teal); }
.st-interested { background: var(--amber-bg); color: var(--amber); } .st-meeting { background: var(--violet-bg); color: var(--violet); } .st-won { background: var(--green-bg); color: var(--green); }
.st-lost { background: #f1eeee; color: #8a5b55; } .st-do_not_contact { background: var(--red-bg); color: var(--red); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tagchip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; background: #eef0ef; color: var(--ink2); font-size: 0.76rem; font-weight: 600; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.tagchip button { display: grid; place-items: center; color: var(--soft); } .tagchip button svg.i { width: 13px; height: 13px; }
.tagchip.add { background: #fff; box-shadow: inset 0 0 0 1px var(--line2); cursor: pointer; } .tagchip.add svg.i { width: 13px; height: 13px; }
.tagchip.more { background: transparent; color: var(--muted); }
.tagchip.ai { background: var(--violet-bg); color: var(--violet); } .tagchip.ai svg.i { width: 12px; height: 12px; }
.tag-bad { font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--red); background: var(--red-bg); border-radius: 5px; padding: 1px 5px; }
.chips-ph { display: flex; flex-wrap: wrap; gap: 5px; } .chips-ph .tagchip { cursor: pointer; } .chips-ph .tagchip:hover { background: var(--teal-bg); color: var(--teal); }

/* Lists */
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li.click { cursor: pointer; border-radius: 10px; } .li.click:hover { background: var(--hover); }
.li b { font-weight: 600; }
.li small { display: block; }
.av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 0.8rem; flex: none; background: var(--teal-bg); color: var(--teal); }
.av.sm { width: 30px; height: 30px; font-size: 0.74rem; } .av.lg { width: 54px; height: 54px; border-radius: 15px; font-size: 1.1rem; }
.av.c1 { background: var(--amber-bg); color: var(--amber); } .av.c2 { background: var(--violet-bg); color: var(--violet); } .av.c3 { background: var(--blue-bg); color: var(--blue); } .av.c4 { background: var(--green-bg); color: var(--green); }
.av svg.i { width: 16px; height: 16px; }

/* Leads table */
.chiprow { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; padding-bottom: 2px; }
.chiprow::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 13px; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 1px var(--line2); font-weight: 600; font-size: 0.84rem; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.chip b { font-weight: 600; color: var(--soft); }
.chip.on { background: var(--ink); color: #fff; box-shadow: none; } .chip.on b { color: rgba(255, 255, 255, 0.6); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select.in { height: 38px; width: auto; min-width: 128px; max-width: 190px; }
.filters .search { flex: 1 1 240px; max-width: 360px; }
.filter-toggle { display: none; }
.search { position: relative; min-width: 240px; flex: 1; max-width: 460px; }
.search input { padding-left: 37px; height: 38px; }
.search svg { position: absolute; left: 12px; top: 10px; color: var(--soft); }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); }
.table-wrap.flat { box-shadow: none; border-radius: 0; }
table.t { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.t th { text-align: left; font-size: 0.74rem; font-weight: 600; color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfa; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 320px; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { cursor: pointer; } .t tbody tr.noclick { cursor: default; }
.t tbody tr:hover td { background: #f8faf9; } .t tbody tr.noclick:hover td { background: transparent; }
.t tr.dnc td { opacity: 0.6; }
.t .num { text-align: right; }
.t td.sel, .t th.sel { width: 40px; padding-right: 0; }
.t input[type=checkbox], .mcard input[type=checkbox], .qrow input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--teal); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { font-weight: 600; } .who small { display: block; font-size: 0.78rem; }
.contact { display: grid; gap: 2px; font-size: 0.84rem; min-width: 200px; max-width: 280px; }
.t td.area { white-space: nowrap; }
.t .tags { flex-wrap: nowrap; }
.t .who { max-width: 300px; }
.contact span { display: flex !important; align-items: center; gap: 6px; } .contact svg.i { width: 14px; height: 14px; color: var(--soft); }
.contact .invalid { color: var(--soft); text-decoration: line-through; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 2px; flex-wrap: wrap; }
#bulkBar { position: sticky; bottom: 16px; z-index: 15; }
.bulk { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 14px; margin-top: 6px; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.35); }
.bulk-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.bulk select { height: 32px; border-radius: 9px; border: 0; padding: 0 10px; background: #fff; color: var(--ink); max-width: 200px; }

/* Lead detail */
.lead-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 6px 0 16px; }
.lead-head h1 { font-size: 1.6rem; line-height: 1.2; }
.lead-head .sub { color: var(--muted); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dot-sep::before { content: '·'; margin-right: 10px; }
.seg { justify-self: start; }
.status-sel { width: auto !important; min-width: 160px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.lead-grid { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.lead-grid > div { min-width: 0; }
.lead-grid > div > .card + .card { margin-top: 14px; }
.props { display: grid; }
.prop { display: grid; grid-template-columns: 100px 1fr; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); align-items: center; font-size: 0.88rem; min-height: 36px; }
.prop:last-child { border-bottom: 0; }
.prop > span:first-child { color: var(--muted); font-size: 0.8rem; }
.prop a { color: var(--teal); }
.prop .val { min-width: 0; overflow-wrap: anywhere; }
.timeline { display: grid; }
.ev { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #eef0ef; color: var(--ink2); }
.ev-ic svg.i { width: 16px; height: 16px; }
.ev-ic.note { background: #f3f0e6; color: #7a6a3a; } .ev-ic.status { background: var(--violet-bg); color: var(--violet); }
.ev-ic.email { background: var(--blue-bg); color: var(--blue); } .ev-ic.inb { box-shadow: inset 0 0 0 2px currentColor; }
.ev-ic.wa { background: var(--wa-bg); color: var(--wa); } .ev-ic.queued { background: var(--amber-bg); color: var(--amber); } .ev-ic.bad { background: var(--red-bg); color: var(--red); }
.ev-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ev-top b { font-weight: 600; }
.ev-top time { margin-left: auto; color: var(--soft); font-size: 0.78rem; white-space: nowrap; }
.ev-body { margin-top: 4px; color: var(--ink2); white-space: pre-wrap; font-size: 0.88rem; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.mail-ic { color: var(--blue); } .wa-ic { color: var(--wa); }

/* Import */
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.steps span { padding: 6px 12px; border-radius: 99px; background: #e8ebe9; color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.steps span.on { background: var(--ink); color: #fff; } .steps span.done { background: var(--teal-bg); color: var(--teal); }
.drop { display: grid; justify-items: center; gap: 8px; padding: 54px 20px; border: 2px dashed var(--line2); border-radius: 18px; background: #fff; cursor: pointer; text-align: center; transition: border-color 0.15s, background 0.15s; }
.drop:hover, .drop.over { border-color: var(--teal); background: #f6fbfa; }
.drop svg.i { width: 30px; height: 30px; color: var(--teal); }
.drop b { font-size: 1.02rem; }
.progress { height: 6px; background: #e3e7e5; border-radius: 6px; overflow: hidden; margin-top: 14px; }
.progress i { display: block; height: 100%; background: var(--teal); border-radius: 6px; }
.progress i.indet { width: 35%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.map-wrap { overflow-x: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.t.map th { background: #fafbfa; vertical-align: top; min-width: 196px; }
.t td.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.t.map select.in { height: 34px; font-size: 0.84rem; font-weight: 600; color: var(--ink); margin-top: 6px; }
.map-h { font-size: 0.78rem; color: var(--ink2); max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.t.map td { color: var(--ink2); font-size: 0.84rem; max-width: 220px; }
.issues { background: #fafbfa; border-radius: 12px; padding: 10px 14px; }
.issues summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.issues ul { margin-top: 8px; padding-left: 18px; display: grid; gap: 3px; font-size: 0.84rem; color: var(--ink2); max-height: 300px; overflow: auto; }

/* Campaigns + queue */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cgrid .card + .card { margin-top: 0; }
.ccard { transition: box-shadow 0.15s, transform 0.15s; overflow: hidden; } .ccard > * { min-width: 0; } .ccard .badge { flex: none; }
.ccard:hover { box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.18), inset 0 0 0 1px var(--line2); transform: translateY(-1px); }
.ccard b { font-weight: 700; } .ccard small { display: block; }
.muted-card { opacity: 0.7; }
.ch-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--blue-bg); }
.ch-ic.whatsapp { background: var(--wa-bg); }
.cstats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cstats div { display: grid; min-width: 0; } .cstats b { font-size: 1.1rem; } .cstats span { font-size: 0.72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbar { height: 5px; border-radius: 5px; background: #e8ebe9; overflow: hidden; } .cbar i { display: block; height: 100%; background: var(--teal); }
.qtabs { margin-bottom: 4px; } .qtabs .chiprow { margin-bottom: 8px; flex: 1; }
.qhead { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 54px; }
.qrow { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.qrow:last-child { border-bottom: 0; }
.qrow > input { margin-top: 9px; }
.qtop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .qtop a:hover b { color: var(--teal); }
.qmsg { font-size: 0.88rem; color: var(--ink2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.qmeta { margin-top: 3px; }
.preview { background: #fafbfa; border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.preview .pre { font-size: 0.88rem; color: var(--ink2); max-height: 220px; overflow: auto; }

/* WhatsApp */
.wa-split { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 150px); min-height: 520px; background: #fff; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.wa-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.wa-list-head { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.wa-list-head .search { max-width: none; min-width: 0; }
.wa-items { overflow-y: auto; flex: 1; }
.wa-item { display: flex; gap: 11px; padding: 11px 12px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); align-items: flex-start; }
.wa-item:hover { background: var(--hover); } .wa-item.on { background: var(--teal-bg); }
.wa-item .av { width: 42px; height: 42px; border-radius: 50%; }
.wa-r1, .wa-r2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wa-r1 b { flex: 1; min-width: 0; font-weight: 600; } .wa-r1 time { font-size: 0.74rem; color: var(--soft); white-space: nowrap; }
.wa-r2 { font-size: 0.84rem; color: var(--muted); } .wa-r2 > span.ellipsis { flex: 1; min-width: 0; } .wa-r2 .badge { flex: none; } .you { color: var(--soft); }
.wa-item small { display: block; font-size: 0.74rem; margin-top: 1px; }
.wa-chat { display: flex; flex-direction: column; min-width: 0; background: #efeae2 linear-gradient(0deg, rgba(244, 241, 235, 0.92), rgba(244, 241, 235, 0.92)); }
.wa-chat-head { display: flex; gap: 11px; align-items: center; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.wa-chat-head .av { width: 40px; height: 40px; border-radius: 50%; }
.wa-chat-head b { font-weight: 600; } .wa-chat-head small { display: block; font-size: 0.78rem; }
.wa-window { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; padding: 7px 12px; text-align: center; }
.wa-window svg.i { width: 15px; height: 15px; }
.wa-window.open { background: var(--green-bg); color: var(--green); } .wa-window.closed { background: var(--amber-bg); color: var(--amber); }
.wa-log { flex: 1; overflow-y: auto; padding: 16px 6% 10px; display: flex; flex-direction: column; gap: 4px; }
.day { text-align: center; margin: 10px 0 6px; } .day span { background: rgba(255, 255, 255, 0.9); padding: 4px 10px; border-radius: 8px; font-size: 0.74rem; font-weight: 600; color: var(--muted); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); }
.msg { display: flex; } .msg.m-out { justify-content: flex-end; }
.bub { max-width: min(560px, 78%); background: #fff; border-radius: 12px; padding: 7px 10px 5px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); font-size: 0.92rem; overflow-wrap: anywhere; }
.msg.m-in .bub { border-top-left-radius: 4px; } .msg.m-out .bub { background: var(--bubble-out); border-top-right-radius: 4px; }
.msg.failed .bub { box-shadow: inset 0 0 0 1.5px var(--red); }
.bub .txt { white-space: pre-wrap; }
.bub .meta { display: flex; justify-content: flex-end; align-items: center; gap: 3px; font-size: 0.7rem; color: var(--soft); margin-top: 2px; }
.bub img { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin-bottom: 4px; }
.bub audio { width: 240px; max-width: 100%; height: 38px; display: block; }
.bub .doc { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: rgba(0, 0, 0, 0.04); border-radius: 8px; font-weight: 600; font-size: 0.86rem; margin-bottom: 4px; }
.bub .err { color: var(--red); margin-top: 3px; }
.tpl-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; color: var(--violet); background: var(--violet-bg); border-radius: 5px; padding: 1px 6px; margin-bottom: 4px; }
svg.i.tick { width: 15px; height: 15px; } svg.i.tick.read { color: #2f8fe0; } svg.i.tick.bad { color: var(--red); }
.wa-comp { background: #f6f6f4; border-top: 1px solid var(--line); padding: 8px 12px calc(10px + var(--safe-b)); display: grid; gap: 6px; }
.wa-tools { display: flex; gap: 8px; }
.wa-input { display: flex; gap: 6px; align-items: flex-end; }
.wa-input textarea { flex: 1; resize: none; border: 1px solid var(--line2); border-radius: 20px; padding: 9px 14px; min-height: 40px; max-height: 160px; outline: none; background: #fff; line-height: 1.4; }
.wa-input textarea:focus { border-color: var(--teal); }
.wa-input textarea:disabled { background: #eef0ef; }
.wa-input label.btn { cursor: pointer; }
#waMic.rec { color: #fff; background: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(196, 67, 47, 0.2); } }
.wa-note { display: flex; gap: 8px; align-items: center; color: var(--amber); font-size: 0.82rem; font-weight: 600; }
.wa-empty { margin: auto; display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--muted); max-width: 360px; padding: 20px; }
.wa-empty svg.i { width: 34px; height: 34px; color: var(--wa); }
.wa-empty b { color: var(--ink); }
.small-cta { padding: 30px 14px; } .small-cta svg.i { width: 22px; height: 22px; padding: 9px; }

/* Settings */
.set-grid { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.set-nav { display: grid; gap: 2px; position: sticky; top: 16px; }
.set-nav a { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 10px; color: var(--ink2); font-weight: 500; }
.set-nav a:hover { background: #e9ecea; } .set-nav a.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
#setBody { min-width: 0; }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.daychip { cursor: pointer; } .daychip input { position: absolute; opacity: 0; pointer-events: none; }
.daychip span { display: inline-flex; height: 34px; align-items: center; padding: 0 13px; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 1px var(--line2); font-weight: 600; font-size: 0.84rem; color: var(--muted); }
.daychip input:checked + span { background: var(--ink); color: #fff; box-shadow: none; }
.daychip input:focus-visible + span { outline: 2px solid var(--teal); }
.sticky-save { display: flex; justify-content: flex-end; margin-top: 14px; }
.prov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prov { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line2); background: #fff; }
.prov:hover { background: #fafbfa; }
.prov.on { box-shadow: inset 0 0 0 2px var(--teal); background: #f6fbfa; }
.prov b { display: block; font-size: 0.92rem; } .prov .grow > span { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 3px; }
.prov .radio { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line2); flex: none; margin-top: 1px; }
.prov.on .radio { box-shadow: inset 0 0 0 5px var(--teal); }
.prov-st { margin-top: 8px; }
.copyrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .copyrow code { padding: 8px 10px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.qr-row { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.qr { width: 240px; height: 240px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.steps-list { display: grid; gap: 8px; padding-left: 20px; }
.pair-code { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: 0.12em; margin-top: 8px; }
details summary { cursor: pointer; font-weight: 600; font-size: 0.88rem; color: var(--teal); margin: 6px 0; }

/* Modal */
.ov { position: fixed; inset: 0; z-index: 100; background: rgba(11, 26, 31, 0.38); display: grid; place-items: center; padding: 20px; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.4); animation: pop 0.18s cubic-bezier(0.22, 1, 0.36, 1); }
.modal.wide { max-width: 820px; }
@keyframes pop { from { transform: translateY(12px) scale(0.98); opacity: 0; } }
.m-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 10px; position: sticky; top: 0; background: #fff; z-index: 2; }
.m-head h2 { font-size: 1.12rem; }
.m-body { padding: 8px 20px 16px; display: grid; gap: 12px; }
.m-body .banner { margin: 0; }
.m-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 2; }
.m-foot .danger { margin-right: auto; }
body.modal-open { overflow: hidden; }

/* Toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.4); font-size: 0.9rem; max-width: 380px; animation: pop 0.2s; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.toast.err { background: var(--red); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(80% 60% at 50% 0%, #e2f1ee, var(--bg)); }
.login form { width: 100%; max-width: 390px; background: #fff; border-radius: 24px; padding: 30px 28px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.25), inset 0 0 0 1px var(--line); display: grid; gap: 14px; }
.login-brand { display: flex; gap: 11px; align-items: center; } .login-brand img { width: 40px; height: 40px; }
.login-brand b { display: block; font-size: 1.05rem; letter-spacing: -0.02em; } .login-brand small { color: var(--muted); font-size: 0.8rem; }
.login h1 { font-size: 1.45rem; margin-top: 8px; }
#step1, #step2 { display: grid; gap: 12px; }
.login .err { color: var(--red); font-size: 0.86rem; min-height: 1.2em; }
.code-in { font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; height: 52px !important; }

/* Responsive */
@media (max-width: 1180px) {
  .hide-l { display: none; }
  .lead-grid { grid-template-columns: 1fr; }
  .lead-grid > div:last-child { order: -1; } .lead-grid > div:first-child { margin-top: 14px; }
  .prov-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .cols, .cols.even { grid-template-columns: 1fr; } .cols > .card + .card { margin-top: 14px; }
  .set-grid { grid-template-columns: 1fr; }
  .set-nav { position: static; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; padding-bottom: 2px; }
  .set-nav a { white-space: nowrap; flex: none; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .content { padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(96px + var(--safe-b)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; font-size: 0.68rem; font-weight: 600; color: var(--muted); padding: 4px 0; position: relative; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a .badge.n { position: absolute; top: -2px; left: 54%; height: 17px; min-width: 17px; font-size: 0.66rem; }
  .tabbar svg.i { width: 23px; height: 23px; }
  .mobile-only { display: block !important; } .btn.mobile-only { display: inline-flex !important; } .desktop-only { display: none !important; }
  .hide-s { display: none; }
  .page-head { margin-bottom: 12px; align-items: flex-start; }
  .page-head h1 { font-size: 1.45rem; }
  .page-head .right { margin-left: 0; width: 100%; } .page-head .right .btn { flex: 1; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .filters { gap: 6px; } .filters .search { min-width: 100%; max-width: none; } .filters select.in { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .mlist { display: grid; gap: 8px; }
  .mcard { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 14px; padding: 12px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
  .mcard .t1 { font-weight: 600; } .mcard .t2 { color: var(--muted); font-size: 0.84rem; display: flex; min-width: 0; }
  #bulkBar { bottom: calc(72px + var(--safe-b)); } .bulk-actions { width: 100%; margin-left: 0; } .bulk-actions select { flex: 1; max-width: none; }
  .lead-head { gap: 12px; align-items: flex-start; } .lead-head h1 { font-size: 1.3rem; } .lead-head > .row { width: 100%; } .status-sel { flex: 1; }
  .lead-head .av.lg { width: 46px; height: 46px; font-size: 0.95rem; }
  .lead-head .sub { display: block; } .lead-head .sub .dot-sep { display: block; } .dot-sep::before { display: none; }
  .filter-toggle { display: inline-flex; } .filters select.in { display: none; } .filters.open select.in { display: block; } .filters select#fstatus { display: none !important; }
  .filters .search { flex: 1 1 0; min-width: 0 !important; }
  .actions .btn { flex: 1 1 calc(50% - 8px); }
  .prop { grid-template-columns: 92px 1fr; }
  .cgrid { grid-template-columns: 1fr; }
  .wa-head { display: none; }
  .content.page-whatsapp { padding: 0 0 calc(64px + var(--safe-b)); }
  .wa-split { grid-template-columns: 1fr; height: calc(100dvh - 64px - var(--safe-b)); min-height: 0; margin: 0; border-radius: 0; box-shadow: none; }
  .wa-chat-head { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .wa-split .wa-chat { display: none; } .wa-split.open .wa-list { display: none; } .wa-split.open .wa-chat { display: flex; }
  .wa-log { padding: 12px 10px; } .bub { max-width: 86%; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; align-self: end; }
  .ov { padding: 0; place-items: end center; }
  #toasts { left: 12px; right: 12px; bottom: calc(80px + var(--safe-b)); }
  .qrow { padding: 12px; } .qhead { padding: 10px 12px; }
  .cstats b { font-size: 1rem; }
  .qr { width: 210px; height: 210px; }
  .sticky-save .btn { width: 100%; }
  .li.wrap-m { flex-wrap: wrap; } .li.wrap-m > .grow { flex: 1 1 calc(100% - 50px); } .li.wrap-m > .badge { margin-left: 46px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .kpi { padding: 10px 11px; } .kpi p { font-size: 0.7rem; line-height: 1.25; } .kpi b { font-size: 1.25rem !important; }
  .qtabs { flex-wrap: wrap; } .qtabs .chiprow { flex: 1 1 100%; margin-bottom: 0; } .qtabs select { margin-left: 0 !important; width: 100% !important; }
}

/* Scrape */
.progress.big { height: 8px; margin: 0 0 14px; } .progress.big i { transition: width .4s; }
.break-h { overflow-wrap: anywhere; font-size: 1.3rem; }
.scrape-t td { max-width: 200px; } .scrape-t td .ellipsis { max-width: 200px; } .scrape-t td b { display: block; } .scrape-t small { display: block; max-width: 220px; }
.t tr.done-row td { opacity: .55; }
a.qrow:hover { background: var(--hover); }
.empty.pad { padding: 16px; }
.save-bar { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: center; position: sticky; bottom: 0; background: #fff; border-radius: 0 0 var(--r) var(--r); }
.save-bar .in { max-width: 360px; }
.log summary { color: var(--ink2); }
.log ul { list-style: none; display: grid; gap: 4px; font-size: .82rem; max-height: 320px; overflow: auto; font-family: ui-monospace, Menlo, monospace; }
.log li.warn { color: var(--amber); } .log li.error { color: var(--red); } .log time { color: var(--soft); margin-right: 6px; }
@media (max-width: 760px) { .pad-m { padding: 10px; } .save-bar { flex-wrap: wrap; bottom: calc(64px + var(--safe-b)); } .save-bar .in { max-width: none; } .save-bar .btn { width: 100%; } }
.ms-av { background: #f3f5f8; } svg.i.ms-logo { width: 15px; height: 15px; }
.btn.ms { gap: 8px; }
@media (max-width: 760px) { .card-head > .right.row { flex-wrap: wrap; margin-left: 0; width: 100%; } .card-head > .right.row .btn { flex: 1 1 auto; } }
.log li { overflow-wrap: anywhere; } details.card { min-width: 0; }
.main { overflow-x: clip; }
.card > * { min-width: 0; }
.keychip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 9px; background: #eef0ef; font-weight: 600; font-size: .84rem; font-family: ui-monospace, Menlo, monospace; }
.ai-msg:empty { display: none; } .ai-msg.good { color: var(--green); } .ai-msg.bad { color: var(--red); }
