:root {
  --brand: #0e7c86;
  --brand-ink: #ffffff;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #142028;
  --ink-2: #4a5864;
  --ink-3: #8593a0;
  --line: #e3e8ed;
  --line-2: #eef2f5;
  --soft: #f7f9fb;
  --sms: #2563eb;
  --whatsapp: #16a34a;
  --email: #9333ea;
  --voice: #ea580c;
  --danger: #dc2626;
  --ai: #7c3aed;
  --ai-bg: #f5f0ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 232px 360px 1fr; grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; }
.app.no-list { grid-template-columns: 232px 1fr; }
.app.no-list .list { display: none; }

.rail { background: #0f1b22; color: #c9d4dc; display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 18px; flex: none; }
.brand .name { font-family: var(--display); font-size: 16px; color: #fff; line-height: 1.15; font-weight: 600; }
.brand .sub { font-size: 11px; color: #7f909c; letter-spacing: .02em; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #61727e; padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: #c9d4dc; background: none; border: 0; width: 100%; text-align: left; }
.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav.active { background: rgba(255,255,255,.1); color: #fff; }
.nav .ico { width: 20px; text-align: center; opacity: .95; }
.nav .badge { margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; font-weight: 600; }
.rail .spacer { flex: 1; }
.rail .who { font-size: 12px; color: #8ea0ad; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 8px; }
.rail .who b { color: #fff; font-weight: 500; }
.powered { font-size: 11px; color: #5d6e7a; padding: 6px 10px; }

.list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.list-head { padding: 16px 16px 10px; border-bottom: 1px solid var(--line-2); }
.list-head h2 { margin: 0 0 10px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.list-head .row { display: flex; gap: 8px; }
.search { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; background: var(--soft); outline: none; }
.search:focus { border-color: var(--brand); background: #fff; }
.convs { overflow-y: auto; flex: 1; }
.conv { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: start; }
.conv:hover { background: var(--soft); }
.conv.active { background: #eef7f8; box-shadow: inset 3px 0 0 var(--brand); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #fff; font-size: 14px; flex: none; }
.conv .top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.conv .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread .nm::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; }
.conv .pv { color: var(--ink-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.conv .meta { font-size: 11.5px; color: var(--ink-3); text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.chips { display: inline-flex; gap: 3px; }
.ch { font-size: 10px; font-weight: 700; border-radius: 5px; padding: 1px 5px; color: #fff; letter-spacing: .02em; }
.ch.sms { background: var(--sms); } .ch.whatsapp { background: var(--whatsapp); } .ch.email { background: var(--email); } .ch.voice { background: var(--voice); }
.ai-chip { font-size: 10.5px; color: var(--ai); background: var(--ai-bg); border-radius: 6px; padding: 1px 6px; font-weight: 600; white-space: nowrap; }
.empty { padding: 40px 24px; text-align: center; color: var(--ink-3); }

/* ---------- thread ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg); }
.banner { background: linear-gradient(90deg, #0f1b22, #17323b); color: #dbe7ee; padding: 10px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.banner b { color: #fff; }
.banner .btn { padding: 6px 11px; font-size: 12.5px; }
.banner .live { display: inline-flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.thread-head { background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 20px; display: flex; align-items: center; gap: 12px; min-height: 66px; }
.thread-head .title { font-weight: 650; font-size: 16px; }
.thread-head .ids { font-size: 12px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; }
.thread-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.timeline { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px 10px; display: flex; flex-direction: column; gap: 14px; }
.day { text-align: center; font-size: 11.5px; color: var(--ink-3); margin: 6px 0; }
.msg { max-width: min(640px, 78%); display: flex; flex-direction: column; gap: 4px; }
.msg.in { align-self: flex-start; }
.msg.out { align-self: flex-end; align-items: flex-end; }
.bubble { padding: 10px 13px; border-radius: 14px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.02); }
.msg.out .bubble { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.msg.out.whatsapp .bubble { background: #dcf8c6; color: #111b21; }
.msg.out.email .bubble { background: #fff; color: var(--ink); border-color: var(--line); }
.msg.email .bubble { border-radius: 10px; }
.msg .subj { font-weight: 650; margin-bottom: 6px; }
.msg .info { font-size: 11px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.msg .fail { color: var(--danger); }
.trans { font-size: 12.5px; color: var(--ink-2); background: #fffbea; border: 1px solid #f6e7a8; border-radius: 10px; padding: 7px 10px; white-space: pre-wrap; }
.trans .lbl { font-size: 10.5px; font-weight: 700; color: #a07a00; text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 2px; }
.call { align-self: stretch; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--voice); border-radius: 12px; padding: 12px 14px; max-width: 760px; }
.call .h { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.call .sum { margin-top: 6px; color: var(--ink-2); }
.call details { margin-top: 8px; }
.call summary { cursor: pointer; color: var(--brand); font-size: 12.5px; }
.tx { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.tx .t { display: grid; grid-template-columns: 70px 1fr; gap: 8px; }
.tx .r { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; padding-top: 2px; }
.pill { font-size: 11px; border-radius: 999px; padding: 2px 8px; background: var(--line-2); color: var(--ink-2); }
.pill.ok { background: #e7f8ee; color: #137a3d; }

/* ---------- composer ---------- */
.composer { background: var(--panel); border-top: 1px solid var(--line); padding: 12px 20px 16px; }
.draft { border: 1px solid #e4d8ff; background: var(--ai-bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.draft .h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ai); font-weight: 650; }
.draft .body { white-space: pre-wrap; margin-top: 6px; max-height: 180px; overflow-y: auto; }
.draft .tr { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); white-space: pre-wrap; border-top: 1px dashed #d9c9ff; padding-top: 6px; }
.draft .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.compose-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.compose-row .via { font-size: 12px; color: var(--ink-3); }
.input, textarea.input, select.input { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; outline: none; width: 100%; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
textarea.input { resize: vertical; min-height: 74px; }
.send-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.send-row .grow { flex: 1; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 13px; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { border-color: #c9d3dc; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ai { background: var(--ai); color: #fff; border-color: var(--ai); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.18); }
.btn.light:hover { background: rgba(255,255,255,.2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 5px 9px; font-size: 12.5px; }
.chan-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.chan-btn.on.sms { background: var(--sms); color: #fff; border-color: var(--sms); }
.chan-btn.on.whatsapp { background: var(--whatsapp); color: #fff; border-color: var(--whatsapp); }
.chan-btn.on.email { background: var(--email); color: #fff; border-color: var(--email); }
.chan-btn:disabled { opacity: .4; }

/* ---------- settings ---------- */
.page { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 32px 60px; }
.page h1 { font-family: var(--display); font-size: 26px; margin: 0 0 4px; font-weight: 600; }
.page .lead { color: var(--ink-2); margin: 0 0 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); max-width: 900px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.toggle { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv div:nth-child(odd) { color: var(--ink-3); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 27, 34, .55); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: #fff; border-radius: 16px; width: min(440px, 100%); padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 6px; font-family: var(--display); font-size: 22px; font-weight: 600; }
.modal p { margin: 0 0 16px; color: var(--ink-2); }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #0f1b22; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--danger); }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- welcome / thread empty ---------- */
.welcome { margin: auto; text-align: center; max-width: 520px; padding: 30px; color: var(--ink-2); }
.welcome h2 { font-family: var(--display); font-weight: 600; font-size: 26px; color: var(--ink); margin: 0 0 8px; }
.stats { display: flex; gap: 12px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; min-width: 110px; }
.stat b { display: block; font-size: 22px; color: var(--ink); }

.back { display: none; }
@media (max-width: 1080px) {
  .app { grid-template-columns: 72px 320px 1fr; }
  .app.no-list { grid-template-columns: 72px 1fr; }
  .rail .brand .name, .rail .brand .sub, .nav .txt, .nav-label, .rail .who, .powered { display: none; }
  .nav { justify-content: center; position: relative; }
  .nav .badge { position: absolute; top: 2px; right: 4px; font-size: 10px; padding: 0 5px; }
}
@media (max-width: 760px) {
  .app, .app.no-list { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .rail { flex-direction: row; padding: 8px; overflow-x: auto; gap: 2px; }
  .rail .brand { padding: 0 6px 0 0; }
  .rail .spacer { display: none; }
  .nav { width: auto; padding: 8px 10px; }
  .app .list, .app .main { grid-row: 2; grid-column: 1; }
  .app.thread-open .list { display: none; }
  .app:not(.thread-open):not(.no-list) .main { display: none; }
  .back { display: inline-flex; }
  .app.thread-open .banner { display: none; }
  .draft .body { max-height: 110px; }
  .grid2 { grid-template-columns: 1fr; }
  .page { padding: 18px 16px 60px; }
  .msg { max-width: 92%; }
  .timeline { padding: 16px 12px; }
  .composer { padding: 10px 12px 12px; }
  .banner .live { margin-left: 0; }
}

/* ---------- lead intelligence ---------- */
.score-chip { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.score-chip.hot { background: #fff1e6; color: #c2410c; }
.score-chip.warm { background: #fef9c3; color: #854d0e; }
.score-chip.cold { background: #e0f2fe; color: #075985; }
.score-chip.nolead { background: #f1f5f9; color: #64748b; }
.who-btn { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 4px 6px; margin: -4px -6px; border-radius: 10px; min-width: 0; cursor: pointer; }
.who-btn:hover { background: var(--line-2); }
.profile { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(16,24,40,.12); z-index: 40; overflow-y: auto; padding: 18px 20px 40px; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.phead { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.pname { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; }
.pscore { display: flex; align-items: center; gap: 16px; margin: 18px 0 12px; }
.ring { --p: 0; --c: #94a3b8; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line-2) 0); }
.ring span { width: 60px; height: 60px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.ring.hot { --c: #ea580c; } .ring.warm { --c: #ca8a04; } .ring.cold { --c: #0284c7; } .ring.nolead { --c: #94a3b8; }
.status-pill { display: inline-block; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 3px 11px; background: var(--line-2); }
.status-pill.hot { background: #fff1e6; color: #c2410c; } .status-pill.warm { background: #fef9c3; color: #854d0e; } .status-pill.cold { background: #e0f2fe; color: #075985; } .status-pill.nolead { background: #f1f5f9; color: #64748b; }
.pactions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.pblock { margin-top: 16px; }
.pblock h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.pblock p { margin: 0; color: var(--ink); }
.pblock ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.pblock ul.good li::marker { content: '✓  '; color: #16a34a; }
.pblock ul.bad li::marker { content: '!  '; color: var(--danger); font-weight: 700; }
.pblock ul.src { padding-left: 16px; font-size: 13px; word-break: break-word; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.fact { display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
.fact span { font-size: 11px; color: var(--ink-3); }
.fact b, .fact a { font-weight: 550; overflow-wrap: anywhere; }
.nba { margin-top: 14px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
@media (max-width: 760px) { .profile { width: 100vw; } .facts { grid-template-columns: 1fr; } }

/* ---------- automations / campaigns / insights ---------- */
.pagehead { display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; max-width: 900px; margin-bottom: 8px; }
.acard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); max-width: 900px; }
.acard.off { opacity: .6; }
.ahead { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.aname { font-weight: 650; font-size: 15px; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 10px; }
.when { background: #fff7ed; color: #9a3412; border-radius: 8px; padding: 4px 9px; font-size: 12.5px; font-weight: 600; }
.arrow { color: var(--ink-3); }
.stepchip { background: var(--line-2); border-radius: 8px; padding: 4px 9px; font-size: 12.5px; }
.astats { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 13px; color: var(--ink-2); }
.astats .fail { color: var(--danger); }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: .15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.jst, .cst { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; background: var(--line-2); text-transform: capitalize; white-space: nowrap; }
.jst.done, .cst.completed { background: #e7f8ee; color: #137a3d; }
.jst.pending, .cst.scheduled { background: #e0f2fe; color: #075985; }
.jst.running, .cst.sending { background: #fef9c3; color: #854d0e; }
.jst.failed { background: #fee2e2; color: #b91c1c; }
.jst.skipped, .jst.cancelled, .cst.paused, .cst.cancelled { background: #f1f5f9; color: #64748b; }
.cst.draft { background: #f5f0ff; color: var(--ai); }
.modal.wide { width: min(720px, 100%); max-height: 90vh; overflow-y: auto; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.stepbox { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--soft); }
.stepbox .send-row { margin-top: 0; flex-wrap: wrap; }
.stepbox select.input { width: auto; }
.tpl { background: var(--soft); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 11px; font-size: 13px; margin: 10px 0; white-space: pre-wrap; }
.audcount { margin: 8px 0 4px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 10px; padding: 8px 11px; font-size: 13px; }
.insights { text-align: left; margin: 18px auto; max-width: 560px; }
.insights h4, .pblock h4 { margin: 0 0 8px; }
.insight { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--ai); border-radius: 10px; padding: 8px 11px; margin-bottom: 8px; }
.insight.alert { border-left-color: var(--danger); } .insight.recommendation { border-left-color: #16a34a; } .insight.forecast { border-left-color: #0284c7; }
.ih { display: flex; align-items: center; gap: 4px; }
.seg.stages { flex-wrap: wrap; }
.line { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.line .num { font-family: var(--display); font-size: 26px; font-weight: 600; }
.chanrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.chanbox { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink-3); }
.chanbox.on { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
@media (max-width: 760px) { .chanrow { grid-template-columns: 1fr 1fr; } .pagehead { flex-direction: column; } }
.input.code { font: 700 24px ui-monospace, Menlo, monospace; letter-spacing: 8px; text-align: center; }

/* ---------- reseller: admin console, pricing, plan & billing ---------- */
.console { min-height: 100vh; overflow-y: auto; height: 100vh; }
.console-top { position: sticky; top: 0; z-index: 5; background: #0f1b22; color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 24px; height: 56px; }
.console-top .brand-x { font-family: var(--display); font-size: 18px; font-weight: 600; white-space: nowrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs button { background: none; border: 0; color: #b8c6d0; padding: 18px 12px 16px; font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: #fff; border-bottom-color: #3ec7cf; }
.tabs .dot { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.console-body { max-width: 1180px; margin: 0 auto; padding: 26px 24px 80px; }
.console-body .card { max-width: none; }
.console-body h2 { font-family: var(--display); font-weight: 600; font-size: 24px; margin: 0 0 4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .k { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kpi .v { font-family: var(--display); font-size: 26px; font-weight: 600; margin-top: 4px; }
.kpi .s { font-size: 12px; color: var(--ink-2); }
.kpi.warn { border-color: #f5c26b; background: #fff8eb; }
.kpi.bad { border-color: #f3a4a4; background: #fff1f1; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: left; font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl input.input { padding: 5px 8px; width: 90px; }
.svc { display: inline-block; font-size: 11px; border-radius: 6px; padding: 2px 7px; margin: 1px 2px 1px 0; background: var(--line-2); color: var(--ink-2); font-weight: 600; }
.svc.active { background: #e7f8ee; color: #137a3d; }
.svc.requested { background: #fff4d6; color: #8a5a00; }
.svc.paused { background: #f1f1f1; color: #888; text-decoration: line-through; }
.pos { color: #137a3d; } .neg { color: var(--danger); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; }
.hint { font-size: 12.5px; color: var(--ink-2); background: var(--soft); border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.svc-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.svc-card.on { border-color: #9fdcb6; background: #f4fcf7; }
.svc-card .t { font-weight: 700; }
.svc-card .p { font-size: 12.5px; color: var(--ink-2); }
.price-sec h3 { margin-top: 0; }
.big-bal { font-family: var(--display); font-size: 34px; font-weight: 600; }
.pricing-hero { background: #0f1b22; color: #fff; padding: 56px 24px 46px; text-align: center; }
.pricing-hero h1 { font-family: var(--display); font-size: clamp(30px, 5vw, 46px); margin: 0 0 10px; font-weight: 600; }
.pricing-hero p { color: #c3d0d8; max-width: 640px; margin: 0 auto; font-size: 16px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label { border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; background: #fff; font-weight: 600; font-size: 13px; }
.pick label:has(input:checked) { border-color: var(--brand); background: #e8f6f7; color: var(--brand); }
@media (max-width: 760px) {
  .console-top { padding: 0 12px; gap: 10px; }
  .console-top .brand-x { display: none; }
  .console-body { padding: 18px 16px 60px; }
  .grid2 { grid-template-columns: 1fr; }
}
.num-results { margin-top: 12px; }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.num-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.num-card:hover { border-color: var(--brand); }
.num-card .nn { font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: .01em; }
.num-card .np b { font-size: 15px; }

/* ---------- analytics ---------- */
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: #137a3d; } .delta.down { color: var(--danger); } .delta.flat { color: var(--ink-3); }
.viz-host { position: relative; }
svg.viz { width: 100%; height: auto; display: block; overflow: visible; }
svg.viz .grid { stroke: var(--line-2); stroke-width: 1; }
svg.viz .axis { fill: var(--ink-3); font-size: 11px; }
svg.viz .hit { cursor: crosshair; }
svg.viz .hit:hover { fill: rgba(16, 24, 40, .04); }
.viz-tip { display: none; position: absolute; pointer-events: none; background: #0f1b22; color: #fff; font-size: 12px; line-height: 1.5; padding: 7px 10px; border-radius: 8px; box-shadow: var(--shadow); white-space: nowrap; z-index: 3; }
.viz-tip .muted { color: #b8c6d0; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; vertical-align: middle; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 900px; }
.an-grid .card { margin-bottom: 0; }
.an-grid + .card, .an-grid + .an-grid { margin-top: 18px; }
.mini-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-kpis div { display: flex; flex-direction: column; font-size: 11.5px; color: var(--ink-3); }
.mini-kpis b { font-family: var(--display); font-size: 20px; color: var(--ink); font-weight: 600; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: 12.5px; }
.hbar .hl { color: var(--ink-2); text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { background: var(--line-2); border-radius: 4px; height: 10px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.hbar b { text-align: right; font-variant-numeric: tabular-nums; }
.page .kpis { max-width: 900px; }
.dst { font-size: 11.5px; } .st-q { color: var(--ink-3); } .st-d, .st-r { color: #137a3d; }
@media (max-width: 760px) { .an-grid { grid-template-columns: 1fr; } .mini-kpis { grid-template-columns: repeat(2, 1fr); } }
.draft .checks { margin-top: 10px; background: #fff8eb; border: 1px solid #f5d79e; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: #6b4a00; }
.draft .checks ul { margin: 4px 0 4px 18px; padding: 0; }

/* ---------- human approval ---------- */
.approval-chip { margin-top: 8px; width: 100%; border: 1px solid var(--line); background: #f3fbf6; color: #137a3d; border-radius: 9px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; text-align: left; }
.approval-chip.auto { background: #fff8eb; color: #8a5a00; border-color: #f5d79e; }
.appr-list { display: flex; flex-direction: column; gap: 8px; }
.appr-row { display: grid; grid-template-columns: 1fr auto 86px; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.appr-row.auto { background: #fffaf0; border-color: #f5d79e; }
.appr-tag { font-size: 11.5px; font-weight: 700; text-align: center; border-radius: 999px; padding: 3px 8px; }
.appr-tag.on { background: #e7f8ee; color: #137a3d; } .appr-tag.off { background: #fff1d6; color: #8a5a00; }
.appr-guards { margin-top: 12px; padding: 10px 12px; background: var(--soft); border-radius: 12px; }
.draft .held { background: #fff1d6; color: #6b4a00; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
/* ---------- campaign editor ---------- */
.ctabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 14px; overflow-x: auto; }
.ctabs button { border: 0; background: none; padding: 9px 12px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.ctabs button.on { color: var(--ink); border-bottom-color: var(--brand); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.modes label { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink-2); }
.modes label b { color: var(--ink); font-size: 13.5px; }
.modes label:has(input:checked) { border-color: var(--brand); background: #eef8f8; }
.modes input { display: none; }
.kbcount { font-size: 11.5px; color: var(--ink-3); text-align: right; }
.cstats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.cstats b { color: var(--ink); }
.credit-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.credit-pack { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.credit-pack .c { font-family: var(--display); font-size: 22px; font-weight: 600; }
@media (max-width: 760px) { .modes { grid-template-columns: 1fr; } .appr-row { grid-template-columns: 1fr auto; } .appr-tag { display: none; } }

/* ---------- import, wizard, keywords, contacts ---------- */
.import-modal { width: min(980px, 100%); }
.dropzone { border: 2px dashed #b9c6d0; border-radius: 16px; padding: 38px 20px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; cursor: pointer; background: var(--soft); transition: .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: #eef8f8; }
.hint.err { background: #fff1f1; border-color: #f3a4a4; color: #8a1c1c; }
.imp-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
.imp-grid select.input { padding: 5px 8px; }
.imp-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.imp-stat { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; }
.imp-stat b { font-size: 20px; color: var(--ink); font-family: var(--display); }
.imp-stat.ok { background: #f3fbf6; border-color: #9fdcb6; } .imp-stat.warn { background: #fff8eb; border-color: #f5d79e; }
.consent { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; align-items: flex-start; }
.progress { height: 10px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin: 14px 0 8px; }
.progress span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.modal.wizard { width: min(1000px, 100%); max-height: 92vh; overflow-y: auto; padding: 0; }
.wiz-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px 0; }
.wiz-name { flex: 1; font-family: var(--display); font-size: 22px; font-weight: 600; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; background: none; }
.wiz-name:hover, .wiz-name:focus { border-color: var(--line); outline: none; }
.wiz-steps { display: flex; gap: 4px; padding: 10px 22px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.wiz-steps button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.wiz-steps button.on { color: var(--ink); border-bottom-color: var(--brand); }
.wizard.whatsapp .wiz-steps button.on { border-bottom-color: var(--whatsapp); }
.wizard.sms .wiz-steps button.on { border-bottom-color: var(--sms); }
.wiz-body { padding: 18px 22px 20px; }
.card.flat { box-shadow: none; background: var(--soft); max-width: none; }
.acts.wrap { flex-wrap: wrap; }
.msg-grid { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-family: ui-monospace, monospace; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.phone-prev { border: 10px solid #1d2b34; border-radius: 30px; min-height: 420px; background: #f2f2f7; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.phone-prev.wa { background: #efe7dd; }
.pp-head { text-align: center; font-size: 12px; color: #6b7280; font-weight: 600; padding-bottom: 6px; border-bottom: 1px solid rgba(0,0,0,.06); }
.pp-bubble { align-self: flex-start; max-width: 88%; background: #e9e9eb; color: #111; border-radius: 18px; padding: 9px 12px; font-size: 14px; line-height: 1.38; white-space: pre-wrap; word-break: break-word; }
.phone-prev.wa .pp-bubble { background: #fff; border-radius: 0 12px 12px 12px; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.pp-img { max-width: 70%; border-radius: 14px; }
.bubble-mini { background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; font-size: 13px; white-space: pre-wrap; margin-top: 8px; max-height: 80px; overflow: hidden; }
.bubble-mini.whatsapp { background: #f0faf3; }
.ccard.sms { border-left: 3px solid var(--sms); } .ccard.whatsapp { border-left: 3px solid var(--whatsapp); }
.empty-state { text-align: center; padding: 34px 20px; }
.variant { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; white-space: pre-wrap; font-size: 14px; }
.qr-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; max-width: 900px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; max-width: 260px; }
.qr-card img { width: 180px; } .qr-card code { word-break: break-all; text-align: center; }
.bulkbar { position: sticky; top: 0; z-index: 3; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: #0f1b22; color: #fff; border-radius: 12px; padding: 8px 14px; margin-bottom: 10px; max-width: 900px; }
.bulkbar .input { background: #fff; color: var(--ink); }
.bulkbar .btn.ghost { color: #cbd5e1; }
.tagchip { display: inline-flex; align-items: center; gap: 3px; background: #eef3f7; border-radius: 999px; padding: 2px 4px 2px 9px; font-size: 11.5px; margin: 1px 3px 1px 0; }
.tagchip button { border: 0; background: none; color: var(--ink-3); padding: 0 4px; font-size: 13px; line-height: 1; }
.tagchip button:hover { color: var(--danger); }
.tagadd { border: 1px dashed var(--line); background: none; border-radius: 999px; padding: 1px 8px; font-size: 12px; color: var(--ink-3); }
.muted-row td { opacity: .55; }
@media (max-width: 860px) { .imp-grid, .msg-grid { grid-template-columns: 1fr; } .phone-prev { min-height: 260px; } .imp-summary { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Dashboard (Overview, AI SDR, Pipeline, Rep performance, Churn prediction, Listings) ---------- */
.dash-page { max-width: none; }
.dash-page > * { max-width: 1180px; }
.dtop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dtop h1 { margin: 0; }
.live-pill { font-size: 12px; font-weight: 600; color: #137a3d; background: #e7f8ee; border-radius: 999px; padding: 3px 10px; display: inline-flex; align-items: center; gap: 6px; }
.live-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; animation: pulse 1.6s ease-in-out infinite; }
.live-pill.off { color: #8a5a00; background: #fff4d6; }
.live-pill.off::before { background: #d97706; animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.dtabs { display: flex; gap: 4px; background: var(--line-2); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.dtab { border: 0; background: none; white-space: nowrap; padding: 8px 14px; border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.dtab:hover { color: var(--ink); }
.dtab.on { background: var(--brand); color: var(--brand-ink); }
.dsec { margin: 26px 0 12px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dsec h2 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 600; }
.dsec p { flex-basis: 100%; margin: 2px 0 0; max-width: 760px; }
.dtag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8a5a00; background: #fff4d6; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.dcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); min-width: 0; }
.dcard.bad { border-color: #f3a4a4; background: #fff1f1; }
.dhead2 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.dhead2 h3 { margin: 0; font-size: 15px; }
.dhead2 p { margin: 2px 0 0; }
.dgrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dash-page .kpis { max-width: 1180px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 7px; font-size: 13px; min-width: 150px; }
.donut-legend .row { display: flex; align-items: center; gap: 8px; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.donut-legend b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
.funnel { display: flex; flex-direction: column; gap: 9px; }
.frow { display: grid; grid-template-columns: 130px 1fr 44px 120px; gap: 10px; align-items: center; font-size: 12.5px; }
.ftrack, .ptrack, .qt { background: var(--line-2); border-radius: 5px; height: 12px; overflow: hidden; display: block; }
.ffill, .pfill, .qf { display: block; height: 100%; border-radius: 5px; }
.frow b, .pbar b, .qrow b { text-align: right; font-variant-numeric: tabular-nums; }
.pbars { display: flex; flex-direction: column; gap: 9px; }
.pbar { display: grid; grid-template-columns: 130px 1fr 48px; gap: 10px; align-items: center; font-size: 12.5px; }
.pl, .fl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlabels { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.lrow { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: 10px 4px; text-align: left; }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--soft); }
.lname { font-weight: 600; min-width: 110px; }
.lprev { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt { margin-left: auto; }
.lrow .chev, .qrow .chev { color: var(--ink-3); margin-left: auto; }
.pill.hot, .pill.risk-high { background: #fde8e8; color: #b42318; }
.pill.risk-med { background: #fff4d6; color: #8a5a00; }
.pill.risk-low { background: #e7f8ee; color: #137a3d; }
.qrow { display: grid; grid-template-columns: 150px 1fr 30px 16px; gap: 10px; align-items: center; width: 100%; background: none; border: 0; border-radius: 8px; padding: 9px 6px; text-align: left; font-size: 13px; }
.qrow:hover { background: var(--soft); }
.qf { background: var(--brand); }
.dtbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtbl th.num, .dtbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtbl tr.tot td { border-top: 2px solid var(--line); background: var(--soft); }
.dtbl .clickrow { cursor: pointer; }
.dtbl .clickrow:hover td { background: var(--soft); }
.coach { background: var(--ai-bg); color: var(--ink-2); line-height: 1.5; }
.cv { font-weight: 700; border-radius: 6px; padding: 1px 7px; }
.cv.good { background: #e7f8ee; color: #137a3d; }
.cv.mid { background: #fff4d6; color: #8a5a00; }
.cv.bad { background: #fde8e8; color: #b42318; }
.insights { display: grid; gap: 8px; margin-top: 14px; }
.insight { border-left: 3px solid var(--brand); background: var(--soft); border-radius: 6px; padding: 9px 12px; font-size: 13px; color: var(--ink-2); }
.insight.good { border-color: #16a34a; background: #f4fcf7; }
.insight.bad { border-color: #dc2626; background: #fff6f6; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--soft); border-radius: 10px; padding: 10px; min-width: 0; }
.khead { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); margin-bottom: 8px; }
.kcard { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.kcard:hover { border-color: var(--brand); }
.method { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.mstep { background: var(--soft); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.mnum { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.obj { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.obj:last-child { border-bottom: 0; }
.oq { font-weight: 600; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.caps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.caps li { font-size: 13px; padding-left: 22px; position: relative; }
.caps li::before { content: '✓'; color: #16a34a; font-weight: 700; position: absolute; left: 0; }
.chat { display: flex; flex-direction: column; gap: 8px; }
.bub { max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; }
.bub.bot { align-self: flex-start; background: var(--ai-bg); }
.bub.them { align-self: flex-end; background: #e8f1ff; }
.cleanup { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.sync { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; margin: 4px 4px 0 0; }
.sync.ok { background: #e7f8ee; color: #137a3d; }
.sync.check { background: #fff4d6; color: #8a5a00; }
.sync.live { background: #fde8e8; color: #b42318; }
@media (max-width: 900px) {
  .dgrid2 { grid-template-columns: 1fr; }
  .dash-page { padding: 18px 14px 50px; }
  .frow { grid-template-columns: 100px 1fr 40px; }
  .frow .fp { display: none; }
  .pbar { grid-template-columns: 100px 1fr 44px; }
  .qrow { grid-template-columns: 1fr 30px 16px; }
  .qrow .qt { display: none; }
}

/* ---------- Dashboard v2: clickable numbers, drawer, sliders, comparison charts ---------- */
.dash-page { scroll-behavior: smooth; }
.dtop { position: sticky; top: -28px; z-index: 5; background: var(--bg); padding: 10px 0 6px; margin-top: -10px; }
.kpis.hero { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi.clickable { text-align: left; font: inherit; color: inherit; cursor: pointer; position: relative; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.kpi.clickable:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 8px 22px rgba(14, 124, 134, .14); }
.kpi.clickable:focus-visible, .mbar:focus-visible, .sseg:focus-visible, .vcard:focus-visible, .lrow:focus-visible, .dchip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.kpi .k { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.kpi .kgo { font-size: 11.5px; font-weight: 600; color: var(--brand); margin-top: 8px; opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s; }
.kpi.clickable:hover .kgo, .kpi.clickable:focus-visible .kgo { opacity: 1; transform: none; }
.kpi.bad .v { color: #b42318; }
.kpi.warn .v { color: #b54708; }
.dtag.mini { font-size: 9.5px; padding: 1px 6px; letter-spacing: .04em; }
.dright { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.usonly { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: #1d3557; border-radius: 999px; padding: 3px 10px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; max-width: 1180px; }
.filterbar .fl { font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.filterbar .grow { flex: 1; }
.dchip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; transition: all .12s; }
.dchip:hover { border-color: #c2ccd5; }
.dchip.on { background: #e8f5f6; border-color: var(--brand); color: #0b5e66; }
.dchip b { font-weight: 700; font-size: 11.5px; background: rgba(0, 0, 0, .07); border-radius: 999px; padding: 0 6px; }
.cdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.toolrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dsel { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 10px; font-weight: 600; font-size: 13px; }
.dsel:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.seg { flex-wrap: wrap; }
.dempty { color: var(--ink-3); background: var(--soft); border: 1px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; font-size: 13px; }
.insights { max-width: 1180px; margin: 0 0 16px; }

/* sliders */
.rng-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 84px; gap: 14px; align-items: center; padding: 8px 0; }
.rng-l { font-size: 13px; font-weight: 600; }
.rng { width: 100%; accent-color: var(--brand); height: 28px; cursor: pointer; }
.rng-out { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; }
.inlineslider { min-width: 280px; }
.inlineslider .rng-row { grid-template-columns: auto 1fr 50px; padding: 0; gap: 10px; }
.sliders { display: grid; margin-bottom: 8px; }
.whatif-out { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 14px; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.wstat { background: var(--soft); border-radius: 10px; padding: 11px 13px; display: flex; flex-direction: column; gap: 2px; }
.wstat b { font-family: var(--display); font-size: 22px; font-weight: 600; }
.radar-line { font-size: 14px; margin: 6px 0 10px; }
.bigcount { font-family: var(--display); font-size: 26px; margin-right: 4px; }

/* comparison charts */
.sfunnel { display: flex; flex-direction: column; gap: 10px; }
.srow { display: grid; grid-template-columns: 140px 1fr 48px 118px; gap: 10px; align-items: center; font-size: 12.5px; }
.sl { color: var(--ink-2); }
.strack { display: flex; height: 22px; background: var(--line-2); border-radius: 6px; overflow: hidden; gap: 1px; }
.sseg { border: 0; padding: 0; height: 100%; cursor: pointer; min-width: 2px; transition: filter .12s, transform .12s; }
.sseg:hover { filter: brightness(1.15) saturate(1.1); }
.sv { text-align: right; font-variant-numeric: tabular-nums; }
.sp { font-size: 11.5px; }
.mbars { display: flex; flex-direction: column; gap: 6px; }
.mbar { display: grid; grid-template-columns: minmax(130px, 190px) 1fr 62px; gap: 10px; align-items: center; width: 100%; background: none; border: 0; border-radius: 8px; padding: 6px 6px; text-align: left; font-size: 13px; cursor: pointer; }
.mbar:hover, .mbar.on { background: var(--soft); }
.mn { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.best { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #137a3d; background: #e7f8ee; border-radius: 999px; padding: 1px 7px; }
.mt { background: var(--line-2); border-radius: 5px; height: 12px; overflow: hidden; display: block; }
.mf { display: block; height: 100%; border-radius: 5px; transition: width .35s ease; }
.mbar b { text-align: right; font-variant-numeric: tabular-nums; }
.pbar { background: none; border: 0; text-align: left; font-size: 12.5px; width: 100%; padding: 2px 0; }
button.pbar { cursor: pointer; border-radius: 6px; } button.pbar:hover { background: var(--soft); }
.pfill { transition: width .3s ease; }
.dseg { cursor: pointer; transition: opacity .15s; } .dseg:hover { opacity: .85; }
.donut-legend button.row { background: none; border: 0; text-align: left; padding: 3px 4px; border-radius: 6px; cursor: pointer; font: inherit; }
.donut-legend button.row:hover, .donut-legend button.row.on { background: var(--soft); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-host { position: relative; }
.viz { width: 100%; height: auto; display: block; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover, .sortable.on { color: var(--brand); }
.dtbl td { vertical-align: middle; }
.dtbl .win { font-weight: 700; color: #137a3d; background: #f4fcf7; }
.dtbl tr.dim td { opacity: .5; }
.h2h-line { font-weight: 600; margin: 4px 0 12px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; max-width: 1180px; margin-bottom: 20px; }
.vcard { text-align: left; border: 1px solid var(--line); border-top: 4px solid var(--grey, #8593a0); background: #fff; border-radius: 12px; padding: 14px 16px; cursor: pointer; font: inherit; color: inherit; box-shadow: var(--shadow); }
.vcard:hover { transform: translateY(-2px); }
.vcard.good { border-top-color: #16a34a; } .vcard.bad { border-top-color: #dc2626; } .vcard.warn { border-top-color: #d97706; }
.vtop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vt { margin-left: auto; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.vcard.good .vt { color: #137a3d; } .vcard.bad .vt { color: #b42318; } .vcard.warn .vt { color: #b54708; } .vcard.neutral .vt { color: var(--ink-3); }
.vstats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; margin: 10px 0 6px; color: var(--ink-2); }
.vstats b { color: var(--ink); }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.mstat { background: var(--soft); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; }
.mstat b { font-size: 15px; }
.verdict { border-left: 4px solid var(--ink-3); background: var(--soft); border-radius: 8px; padding: 10px 14px; }
.verdict p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.verdict.good { border-color: #16a34a; background: #f4fcf7; } .verdict.bad { border-color: #dc2626; background: #fff6f6; } .verdict.warn { border-color: #d97706; background: #fffaf0; }
.coachp { line-height: 1.6; background: var(--ai-bg); border-radius: 10px; padding: 14px; }
.linkish { background: none; border: 0; text-align: left; font: inherit; cursor: pointer; padding: 0; width: 100%; }
.osug { margin-top: 6px; padding-left: 4px; }
.cleanup .sync { margin-top: 6px; }

/* drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(15, 27, 34, .4); z-index: 60; animation: fadein .15s ease; backdrop-filter: blur(1px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; z-index: 61; box-shadow: -18px 0 50px rgba(0, 0, 0, .22); display: flex; flex-direction: column; animation: slidein .2s ease; }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line-2); }
.drawer-head > div:first-child { flex: 1; min-width: 0; }
.drawer-head h3 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 600; }
.drawer-body { padding: 16px 20px 40px; overflow-y: auto; flex: 1; }
.drawer-body h4 { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.dtip { position: fixed; z-index: 80; display: none; pointer-events: none; background: #0f1b22; color: #e9f0f4; font-size: 12px; padding: 8px 10px; border-radius: 8px; max-width: 280px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.dtip b { color: #fff; }
.dtip .cdot { margin-right: 2px; }
@media (max-width: 900px) {
  .rng-row { grid-template-columns: 1fr 70px; } .rng-row .rng-l { grid-column: 1 / -1; }
  .inlineslider { min-width: 0; width: 100%; }
  .srow { grid-template-columns: 96px 1fr 40px; } .srow .sp { display: none; }
  .mbar { grid-template-columns: minmax(96px, 130px) 1fr 54px; }
  .dtop { position: static; }
}
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-bg, .kpi.clickable, .mf, .pfill { animation: none; transition: none; } }

/* ---- Vet dashboard: practice pulse, agents, reviews, inventory ---- */
.vpulse { background: linear-gradient(160deg, #0f2e2a 0%, #14403a 100%); color: #e9f6f1; border-radius: 18px; padding: 22px 22px 18px; margin: 0 0 18px; }
.vp-head h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 600; color: #fff; }
.vp-head p { margin: 4px 0 0; font-size: 13px; color: #9fc9bd; }
.vp-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.vp-tile { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); min-width: 0; }
.vp-tile:hover { background: rgba(255,255,255,.11); }
.vp-tile:focus-visible { outline: 2px solid #9fe3cf; outline-offset: 2px; }
.vp-tile.alert { background: rgba(224,165,38,.16); border-color: rgba(224,165,38,.45); }
.vp-label { font-size: 12.5px; color: #b9dbd1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vp-sample { font-size: 10px; font-weight: 700; color: #4a3500; background: #f3d27a; border-radius: 999px; padding: 1px 7px; }
.vp-value { font-family: var(--display); font-size: 30px; font-weight: 600; color: #fff; line-height: 1.1; }
.vp-delta .delta { font-size: 12px; } .vp-tile .delta.up { color: #7fe0b6; } .vp-tile .delta.down { color: #ff9e95; }
.vp-spark svg { width: 100%; height: 26px; display: block; }
.vp-sub { font-size: 12px; color: #9fc9bd; }
.vgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.vagent { background: var(--panel, #fff); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.va-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .va-top h3 { margin: 0; font-size: 15px; }
.va-status { font-size: 12px; color: var(--ink-2); background: var(--soft); border-radius: 999px; padding: 2px 8px; }
.va-big b { font-family: var(--display); font-size: 32px; display: block; color: var(--ink); }
.va-rows { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.va-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2, #eef1f3); font-size: 13px; }
.va-row span { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.va-row b { white-space: nowrap; } .va-row.good b { color: #15803d; } .va-row.warn b { color: #b45309; } .va-row.bad b { color: #c2410c; }
.vagent .btn { align-self: flex-start; margin-top: auto; }
.vlive { font-size: 12px; font-weight: 600; color: #15803d; background: #e3f4ee; border-radius: 999px; padding: 3px 10px; }
.vstars { color: #e0a526; letter-spacing: 1px; font-size: 14px; } .vstars .off { color: #d9dee3; }
.vrevs { display: flex; flex-direction: column; gap: 10px; }
.vrev { all: unset; box-sizing: border-box; cursor: pointer; display: block; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.vrev:hover { border-color: var(--brand); } .vrev:focus-visible { outline: 2px solid var(--brand); }
.vrev-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vrev-text { margin: 8px 0; color: var(--ink); font-size: 14px; }
.vreply { background: var(--soft); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; padding: 8px 10px; font-size: 13px; color: var(--ink-2); }
.vst { font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 2px 9px; margin-left: auto; white-space: nowrap; }
.vst.ok { color: #15803d; background: #e3f4ee; } .vst.warn { color: #92600a; background: #fdf1d6; } .vst.bad { color: #b42318; background: #fde7e5; }
.vinv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2, #eef1f3); }
.vneed { display: flex; flex-direction: column; gap: 10px; }
.vneed-row { display: grid; grid-template-columns: minmax(0, 1.3fr) 2fr auto; gap: 10px; align-items: center; font-size: 13px; }
.vn-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vn-bars { position: relative; height: 12px; background: var(--soft); border-radius: 6px; }
.vn-have { position: absolute; left: 0; top: 0; bottom: 0; background: #1f7a6b; border-radius: 6px; }
.vn-need { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: #0f2e2a; border-radius: 2px; }
.vn-need.short { background: #d9534a; }
.neg { color: #c2410c; }
.wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.wstat { display: flex; flex-direction: column; gap: 2px; background: var(--soft); border-radius: 10px; padding: 12px; } .wstat b { font-family: var(--display); font-size: 26px; }
.dtbl th.sortable { cursor: pointer; user-select: none; } .dtbl th.sortable.on { color: var(--brand); }
.clickrow { cursor: pointer; } .clickrow:hover td { background: var(--soft); }
@media (max-width: 1180px) { .vp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .vgrid3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .vp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .vpulse { padding: 16px; } .vp-value { font-size: 24px; } .wgrid { grid-template-columns: 1fr; } .vneed-row { grid-template-columns: 1fr auto; } .vn-bars { grid-column: 1 / -1; grid-row: 2; } }

/* ---- Vet dashboard v3: grouped tabs, clinic tabs (vaccines, bills, travel certificates), printable documents ---- */
a.btn { text-decoration: none; }
.banner a.btn.light { color: #fff; }
.dtop h1 { font-family: var(--display); font-weight: 600; font-size: 26px; }
/* Tab bar: one row per group (Clinic, Growth); tabs wrap onto a new line instead of being clipped, at every width. */
.dtabs { flex-direction: column; align-items: stretch; gap: 0; padding: 4px 6px; }
.dtab-group { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; padding: 4px 0; }
.dtab-group + .dtab-group { border-top: 1px solid var(--line); }
.dtab-g { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); min-width: 64px; padding: 0 6px 0 4px; }
.vp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.vp-value { font-size: 27px; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; white-space: nowrap; }
.dtbl td .muted.small { margin-top: 1px; }
.pbar.money { grid-template-columns: minmax(130px, 210px) 1fr 64px; }
.travel-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.tform { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 12px; }
.tfield { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tfield .dsel { width: 100%; }
.trules { margin: 12px 0 8px; background: var(--soft); border-radius: 8px; padding: 8px 10px; }
.tchecks { display: flex; flex-direction: column; gap: 6px; }
.tcheck { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line-2); }
.tcheck .small { color: var(--ink-2); margin-top: 1px; }
.tci { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--ink-3); }
.tcheck.ok .tci { background: #16a34a; } .tcheck.ok { background: #f6fcf8; }
.tcheck.warn .tci { background: #d97706; } .tcheck.warn { background: #fffaf0; }
.tcheck.wait .tci { background: #2563eb; } .tcheck.wait { background: #f3f7ff; }
.tcheck.fail .tci { background: #dc2626; } .tcheck.fail { background: #fff5f5; border-color: #f7c9c9; }
.tcheck.info .tci { background: #64748b; }
.btn[disabled] { opacity: .55; cursor: not-allowed; filter: none; }
.cert { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-top: 14px; background: #fff; }
.cert-wm { position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(-24deg); font-family: var(--display); font-size: 34px; font-weight: 600; color: rgba(220, 38, 38, .09); pointer-events: none; text-align: center; letter-spacing: .06em; }
.cert-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 12px; }
.cert-org { font-family: var(--display); font-size: 17px; color: var(--brand); }
.cert-title { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: 12.5px; text-align: right; }
.cert h5 { margin: 14px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; }
.cert-grid > div { display: flex; flex-direction: column; }
.cert-sign { display: flex; justify-content: space-between; border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 10px; font-size: 13px; }
@media (max-width: 1180px) { .vp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .travel-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .vp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pbar.money { grid-template-columns: 110px 1fr 56px; } }
@media print {
  body.printing-doc > *:not(.drawer) { display: none !important; }
  body.printing-doc .drawer { position: static; width: auto; box-shadow: none; animation: none; }
  body.printing-doc .drawer-head, body.printing-doc .drawer-body > :not(.cert) { display: none !important; }
  body.printing-doc .drawer-body { overflow: visible; padding: 0; }
  body.printing-doc .cert { border: 0; }
}

/* ---- Vet dashboard v4: editable practice — charts, notes, forms, invoice builder, tasks ----
   Direction: the paper chart and the kennel card. Species carry a colour stripe (teal dog, violet cat, amber rabbit);
   inputs sit slightly inset (darker than the card); one accent (clinic teal) for actions; red only for alerts and money owed. */
:root { --inset: #f4f7f9; --inset-line: #dfe5ea; --flag: #b42318; --flag-bg: #fef1ef; --ok: #137a3d; --ease: cubic-bezier(.23, 1, .32, 1); }
.toast { z-index: 95; }
.drawer.wide { width: min(720px, 100vw); }
.drawer { animation-timing-function: var(--ease); }
.btn { transition: transform .12s var(--ease), background-color .12s, border-color .12s; }
.btn:active:not([disabled]) { transform: scale(.97); }
.btn.danger { background: #fff; color: var(--flag); border-color: #f1c4bf; }
.btn.danger:hover { background: var(--flag-bg); }
.danger-text { color: var(--flag) !important; }
.pos { color: var(--ok); } .neg { color: var(--flag); }
.vst.muted { color: var(--ink-3); background: var(--line-2); }
.iconbtn { border: 0; background: none; width: 30px; height: 30px; border-radius: 8px; color: var(--ink-3); display: inline-grid; place-items: center; flex: none; }
.iconbtn:hover { background: var(--line-2); color: var(--ink); }
.iconbtn:focus-visible, .linkbtn:focus-visible, .qaction:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.sandbox { font-size: 12px; font-weight: 600; color: #5b3fa8; background: #f1ecff; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.dsec .btn { align-self: center; }

/* forms */
.dform { display: flex; flex-direction: column; gap: 4px; }
.dform h4 { margin: 18px 0 6px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.ffield { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ffield.span2 { grid-column: 1 / -1; }
.ffield.narrow { max-width: 140px; }
.flabel { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.fhint { font-size: 11.5px; color: var(--ink-3); }
.drawer .input, .tadd .input { background: var(--inset); border-color: var(--inset-line); }
.drawer .input:focus, .tadd .input:focus { background: #fff; }
textarea.input { resize: vertical; line-height: 1.5; }
.fchecks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.fcheck { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; min-height: 32px; }
.fcheck input { width: 17px; height: 17px; accent-color: var(--brand); }
.ferr { color: var(--flag); font-size: 13px; font-weight: 600; margin: 10px 0 0; }
.ferr:empty { display: none; }
.factions { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 14px 0 12px; border-top: 1px solid var(--line-2); position: sticky; bottom: -40px; background: #fff; }
.grow { flex: 1; }

/* quick actions (overview) */
.qactions { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.qaction { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; font-weight: 600; font-size: 13.5px; text-align: left; box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: transform .12s var(--ease), border-color .12s, box-shadow .12s; }
.qaction:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(14,124,134,.12); transform: translateY(-1px); }
.qaction:active { transform: scale(.98); }
.qi { width: 32px; height: 32px; border-radius: 9px; background: #e8f5f6; display: grid; place-items: center; font-size: 16px; flex: none; }

/* to-do + activity */
.dgrid-tasks { grid-template-columns: 1.5fr 1fr; }
.tadd { display: grid; grid-template-columns: 1fr 150px 170px auto; gap: 8px; margin-bottom: 10px; }
.tasks { list-style: none; margin: 0 0 6px; padding: 0; }
.task { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line-2); }
.task:last-child { border-bottom: 0; }
.task input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; cursor: pointer; }
.tbody { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ttext { font-weight: 550; }
.task.done .ttext { text-decoration: line-through; color: var(--ink-3); }
.actlog { list-style: none; margin: 0 0 10px; padding: 0; }
.actlog li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.trylist { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13.5px; }

/* patient chart (signature) */
.ptable tr td.pcell { position: relative; padding-left: 16px; }
.ptable tr td.pcell::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 3px; background: var(--sp); }
.psearch { max-width: 340px; }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--flag); background: var(--flag-bg); border-radius: 8px; padding: 4px 9px; }
.flag.sm { font-size: 11.5px; padding: 2px 8px; }
.chart { border: 1px solid var(--line); border-left: 6px solid var(--sp); border-radius: 12px; padding: 14px 16px; background: linear-gradient(90deg, color-mix(in srgb, var(--sp) 6%, #fff), #fff 55%); }
.chart-id { display: flex; align-items: center; gap: 12px; }
.chart-ico { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--sp) 14%, #fff); display: grid; place-items: center; font-size: 22px; flex: none; }
.chart-name { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -.01em; display: block; line-height: 1.1; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.chart-grid .mstat { background: rgba(255,255,255,.75); border: 1px solid var(--line-2); }
.chart-grid .mstat b { font-size: 13.5px; overflow-wrap: anywhere; }
.chart-actions { margin: 12px 0 4px; }
.plist { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.prow { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line-2); background: #fff; text-align: left; width: 100%; font-size: 13px; }
.prow:last-child { border-bottom: 0; }
button.prow:hover { background: var(--soft); }
.prow .vst { margin-left: auto; }
.prow.po > div { min-width: 0; }

/* notes */
.ncompose { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.nrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nrow select.input { width: auto; padding: 6px 10px; font-size: 13px; }
.notes { display: flex; flex-direction: column; gap: 8px; }
.note { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: #fff; }
.note.pinned { border-color: #f0d79a; background: #fffcf3; }
.note p { margin: 6px 0 0; line-height: 1.55; text-wrap: pretty; }
.nmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nkind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border-radius: 999px; padding: 2px 8px; background: var(--line-2); color: var(--ink-2); }
.nkind.clinical { background: #e8f5f6; color: #0b5e66; } .nkind.client { background: #eef2ff; color: #3949ab; } .nkind.billing { background: #fff4d6; color: #8a5a00; } .nkind.travel { background: #f1ecff; color: #5b3fa8; }

/* invoice builder */
.ilines { display: flex; flex-direction: column; gap: 6px; }
.iline { display: grid; grid-template-columns: minmax(0, 1fr) 64px 96px 92px 30px; gap: 8px; align-items: center; }
.iline.ihead { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.iline .input { padding: 7px 9px; }
.iamt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ihead .num { text-align: right; }
.iadd { display: flex; gap: 8px; margin-top: 4px; }
.iadd select { flex: 1; }
.itotals { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 14px 0 6px; padding: 12px 14px; background: var(--soft); border-radius: 12px; }
.itotal-box { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.itotal { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dtbl td, .kpi .v, .vp-value, .mstat b { font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) { .qactions { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dgrid-tasks { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .fgrid, .chart-grid { grid-template-columns: 1fr 1fr; }
  .qactions { grid-template-columns: 1fr 1fr; }
  .tadd { grid-template-columns: 1fr 1fr; } .tadd .input:first-child { grid-column: 1 / -1; }
  .iline { grid-template-columns: minmax(0, 1fr) 52px 80px 30px; } .iline .iamt, .iline.ihead span:nth-child(4) { display: none; }
  .psearch { max-width: none; flex-basis: 100%; }
  .itotal { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .btn, .qaction { transition: none; } .btn:active, .qaction:active { transform: none; } }

/* ---- Vet dashboard v5: ROI & growth, AI agent controls ---- */
.roiband { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 18px; width: 100%; text-align: left; border: 0; border-radius: 16px; padding: 18px 22px; margin: 0 0 22px; color: #fff; cursor: pointer;
  background: radial-gradient(120% 140% at 0% 0%, #13606a 0%, #0b3f46 60%, #0a3339 100%); box-shadow: 0 10px 30px rgba(10, 51, 57, .18); transition: transform .15s var(--ease), box-shadow .15s; }
.roiband:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(10, 51, 57, .26); }
.roiband:focus-visible { outline: 3px solid #9fe3cf; outline-offset: 2px; }
.rb-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rb-k { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #9fe3cf; display: flex; gap: 8px; align-items: center; }
.rb-v { font-family: var(--display); font-size: 38px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rb-v small { font-size: 15px; font-weight: 500; color: #cfe9e5; letter-spacing: 0; }
.rb-s { font-size: 13.5px; color: #d7ecea; }
.rb-agents { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.rb-a { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #d7ecea; min-width: 0; }
.rb-a i { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.rb-a b { margin-left: auto; color: #fff; font-variant-numeric: tabular-nums; }
.rb-go { font-weight: 700; font-size: 13.5px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 8px 14px; white-space: nowrap; }

.vgrid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.agcard { display: flex; flex-direction: column; gap: 6px; text-align: left; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s; min-width: 0; }
.agcard:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,24,40,.08); }
.agcard:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.agcard.paused { opacity: .72; border-top-color: #b8c4cc; }
.ag-top { display: flex; align-items: center; justify-content: space-between; }
.ag-name { font-size: 14.5px; }
.ag-money { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.ag-foot { display: flex; gap: 12px; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ag-foot .chev { margin-left: auto; color: var(--ink-3); }
.ab-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; flex: none; background: color-mix(in srgb, var(--accent) 13%, #fff); }
.ab-st { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.ab-st.on { color: #137a3d; background: #e7f6ec; }
.ab-st.off { color: #8a5a00; background: #fff4d6; }

.agentbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; align-items: center; background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 14px; padding: 14px 18px; margin: 0 0 18px; }
.agentbar.paused { background: #fffcf3; border-left-color: #e0a526; }
.ab-id { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ab-id b { display: block; font-size: 15.5px; }
.ab-res { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.ab-money { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ab-ctl { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.ab-ctl .seg button { font-size: 12.5px; }
.abset { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.abset select.input { width: auto; padding: 6px 10px; font-size: 13px; background: var(--inset); border-color: var(--inset-line); }
.ab-ctl .btn:last-child { margin-left: auto; }

.roihero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 18px; }
.rh-main { display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.rh-k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.rh-v { font-family: var(--display); font-size: 56px; font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.rh-s { font-size: 13.5px; color: var(--ink-2); max-width: 46ch; }
.rh-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rh-side > div { background: var(--soft); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.rh-side span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.rh-side b { font-size: 22px; font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.agroi { display: flex; flex-direction: column; gap: 4px; }
.agr { display: grid; grid-template-columns: minmax(0, 190px) 1fr 70px 46px; gap: 10px; align-items: center; border: 0; background: none; padding: 9px 6px; border-radius: 10px; text-align: left; font-size: 13.5px; cursor: pointer; }
.agr:hover { background: var(--soft); }
.agr-n { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.agr-n i, .legend i { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.agr-bar { height: 10px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.agr-bar span { display: block; height: 100%; border-radius: 6px; }
.agr b { text-align: right; font-variant-numeric: tabular-nums; }
.agr-x { font-size: 12px; font-weight: 700; color: #137a3d; text-align: right; }
.costlist { display: flex; flex-direction: column; }
.costlist > div { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.costlist .tot { font-weight: 700; }
.costlist .tot.good b { color: #137a3d; }
.dtbl.ba td:first-child { font-weight: 550; }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.calc .fgrid .ffield:last-child { grid-column: 1 / -1; }
.calc .input { background: var(--inset); border-color: var(--inset-line); }
.calc-out { display: flex; flex-direction: column; gap: 12px; background: var(--soft); border-radius: 14px; padding: 16px; }
.calc-big { display: flex; flex-direction: column; gap: 2px; }
.calc-big b { font-family: var(--display); font-size: 40px; font-weight: 600; letter-spacing: -.02em; color: var(--brand); font-variant-numeric: tabular-nums; }
.calc-roi { font-weight: 700; color: #137a3d; font-size: 14px; }

@media (max-width: 1180px) { .vgrid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .roiband { grid-template-columns: 1fr 1fr; } .rb-go { grid-column: 1 / -1; justify-self: start; } }
@media (max-width: 900px) { .roihero, .calc { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .roiband { grid-template-columns: 1fr; padding: 16px; gap: 12px; }
  .rb-v { font-size: 32px; }
  .rb-agents { grid-template-columns: 1fr; }
  .vgrid4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .agcard { padding: 12px; }
  .ag-money { font-size: 22px; }
  .ag-foot { flex-wrap: wrap; gap: 6px 10px; }
  .agentbar { grid-template-columns: 1fr; padding: 14px; }
  .ab-res { align-items: flex-start; text-align: left; }
  .ab-ctl .btn:last-child { margin-left: 0; }
  .ab-ctl .seg { width: 100%; display: flex; } .ab-ctl .seg button { flex: 1; }
  .rh-v { font-size: 44px; }
  .rh-side b { font-size: 18px; }
  .agr { grid-template-columns: minmax(0, 1fr) 64px 40px; } .agr-bar { display: none; }
  /* tab bar on phones: group label on its own line, compact tabs that wrap */
  .dtab-g { flex-basis: 100%; padding: 2px 4px 2px; }
  .dtab { padding: 7px 11px; font-size: 13.5px; }
}
@media (max-width: 380px) { .vgrid4 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .banner { padding: 8px 12px; gap: 6px; font-size: 12.5px; }
  .banner .bn-more { display: none; }
  .banner .live { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
  .banner .btn { font-size: 11.5px; padding: 6px 8px; justify-content: center; text-align: center; white-space: normal; line-height: 1.25; }
}

/* ---- v6: "fully managed for you" message ---- */
.managed { background: linear-gradient(135deg, #f1faf9 0%, #ffffff 60%); border: 1px solid #cfe9e5; border-radius: 16px; padding: 18px 20px; margin: 0 0 22px; }
.mg-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mg-head > div { min-width: 0; flex: 1 1 380px; }
.mg-k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #0b5e66; background: #dff3f0; border-radius: 999px; padding: 3px 10px; }
.managed h3 { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 10px 0 4px; line-height: 1.2; }
.managed p { margin: 0; color: var(--ink-2); font-size: 14px; }
.mg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.mg-item { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.mg-item b { color: var(--ink); font-size: 14px; }
.mg-ico { font-size: 18px; }
.ab-managed { font-size: 12px; font-weight: 600; color: #0b5e66; }
@media (max-width: 1100px) { .mg-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .managed { padding: 14px; }
  .managed h3 { font-size: 19px; }
  .mg-head .btn { width: 100%; justify-content: center; }
  .mg-grid { grid-template-columns: 1fr; gap: 8px; }
  .ab-managed { width: 100%; }
}
