/* LeadHunter · mobile-first. One accent, quiet surfaces, numbers in mono. */
:root {
  --bg: #0b0c0f;
  --surface: #121318;
  --surface-2: #181a20;
  --line: #24262d;
  --line-2: #30333b;
  --ink: #f2f2f4;
  --ink-2: #c4c6ce;
  --muted: #8e919c;
  --accent: #6553f5;
  --accent-hover: #5442e6;
  --accent-ink: #b3aaff;
  --accent-soft: rgba(101, 83, 245, .14);
  --accent-line: rgba(101, 83, 245, .4);
  --green: #3ccf91;
  --green-soft: rgba(60, 207, 145, .12);
  --amber: #f2b33d;
  --amber-soft: rgba(242, 179, 61, .13);
  --red: #f26060;
  --red-soft: rgba(242, 96, 96, .12);
  --radius: 12px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --tap: 44px;
  --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 650; }
h4 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sub { color: var(--muted); font-size: 14px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px;
  background: rgba(11, 12, 15, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand i { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; }
.brand i::after { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #fff; }
.topbar .spacer { flex: 1; }
main { padding: 20px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); max-width: 1080px; margin: 0 auto; }
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.nav a:hover { text-decoration: none; color: var(--ink); }
.nav a.on { color: var(--ink); }
.nav a.on .i { color: var(--accent-ink); }
.nav .i { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
  .topbar { display: none; }
  .nav { position: sticky; top: 0; height: 100vh; padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; border-top: 0; border-right: 1px solid var(--line); }
  .nav .brand { margin: 0 10px 24px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; height: 42px; padding: 0 12px; border-radius: 8px; font-size: 14.5px; }
  .nav a.on { background: var(--surface-2); }
  .nav .nav-foot { margin-top: auto; padding: 12px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
  main { padding: 36px 40px 64px; width: 100%; }
}
.nav .brand, .nav .nav-foot { display: none; }
@media (min-width: 900px) { .nav .brand, .nav .nav-foot { display: flex; } }

/* ---------- basics ---------- */
.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s; }
.btn:hover { text-decoration: none; border-color: #41444e; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: none; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--red); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: var(--tap); }
.btn.wa { background: #1f8f55; border-color: #1f8f55; color: #fff; }
.input { width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 16px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
label.field { display: grid; gap: 6px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
@media (min-width: 640px) { .card { padding: 20px; } }
.stack { display: grid; gap: 16px; }
.section { margin-top: 28px; }
.section > h2, .section > .head { margin-bottom: 12px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-2); white-space: nowrap; }
.pill.good { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.pill.warn { background: var(--amber-soft); color: var(--amber); border-color: rgba(242, 179, 61, .35); }
.pill.ok { background: var(--green-soft); color: var(--green); border-color: rgba(60, 207, 145, .3); }
.pill.bad { background: var(--red-soft); color: var(--red); border-color: rgba(242, 96, 96, .3); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: none; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { text-decoration: none; color: var(--ink); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--ink); }
.chip .num { font-size: 12px; color: var(--muted); }
.notice { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.notice.bad { border-color: rgba(242, 96, 96, .35); background: var(--red-soft); color: #ffc2c2; }
.notice.warn { border-color: rgba(242, 179, 61, .35); background: var(--amber-soft); color: #ffe1a6; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 16px; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 24px 0; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent-ink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { height: 92px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.green span { background: var(--green); }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 32px);
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 16px; font-size: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.toast.bad { border-color: rgba(242, 96, 96, .5); color: #ffc2c2; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.offline { position: fixed; z-index: 95; top: 0; left: 0; right: 0; background: var(--amber); color: #1a1300; text-align: center; font-size: 13.5px; font-weight: 600; padding: 6px; }

/* ---------- page head ---------- */
.page-head { display: grid; gap: 6px; margin-bottom: 20px; }
.page-head p { margin: 0; color: var(--muted); }
.hello { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
@media (min-width: 640px) { .hello { font-size: 30px; } }

/* ---------- inicio ---------- */
.page-head.split { grid-template-columns: 1fr auto; align-items: end; gap: 12px 20px; }
@media (max-width: 639px) { .page-head.split { grid-template-columns: 1fr; } .page-head.split > .btn { display: none; } }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: grid; gap: 4px; align-content: start; padding: 16px 18px; color: var(--ink); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.kpi:hover { text-decoration: none; background: var(--surface-2); }
.kpi:nth-child(2n) { border-right: 0; }
.kpi:nth-last-child(-n + 2) { border-bottom: 0; }
@media (min-width: 900px) { .kpi { border-bottom: 0; } .kpi:nth-child(2n) { border-right: 1px solid var(--line); } .kpi:last-child { border-right: 0; } }
.kpi-l { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .num { font-size: 28px; font-weight: 600; line-height: 1.15; }
.kpi .num small { font-size: 16px; color: var(--muted); }
.kpi .num.warn-n { color: var(--amber); }
.kpi-s { font-size: 12.5px; color: var(--muted); }
.kpi .bar { margin-top: 4px; }
.quick-t { grid-column: 1 / -1; font-size: 15px; }
.map.pick { height: 300px; cursor: crosshair; }
@media (min-width: 640px) { .map.pick { height: 360px; } }
.quick { display: grid; gap: 10px; }
@media (min-width: 640px) { .quick { grid-template-columns: 1fr 1fr auto; align-items: end; } }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: grid; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.stat:hover { text-decoration: none; border-color: var(--line-2); }
.stat .num { font-size: 26px; font-weight: 600; line-height: 1.1; }
.stat .sub { font-size: 13px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); min-height: var(--tap); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover, .list-row a:hover { text-decoration: none; }
.list-row a.grow { color: var(--ink); }
.list-row a.grow:hover b { color: var(--accent-ink); }
.list-row a.grow .sub { display: block; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { width: 74px; flex: none; font-size: 13px; line-height: 1.3; }
.when b { text-transform: capitalize; }
.when small { color: var(--muted); font-family: var(--mono); }
.late .when b { color: var(--amber); }

/* ---------- buscar ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; min-height: 58px; }
.seg small { color: var(--muted); font-size: 12.5px; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.seg input:disabled + span { opacity: .55; cursor: not-allowed; }
.search-card { display: grid; gap: 16px; }
.progress { display: grid; gap: 8px; padding: 16px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 24px 0 12px; }
.results-head h2 em { font-style: normal; color: var(--accent-ink); font-family: var(--mono); }

/* business card */
.biz { display: grid; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.biz + .biz { margin-top: 10px; }
.biz-top { display: flex; gap: 10px; align-items: flex-start; }
.biz-top .grow { flex: 1; min-width: 0; }
.biz h3 { font-size: 16px; overflow-wrap: anywhere; }
.biz .meta { color: var(--muted); font-size: 13.5px; display: flex; gap: 4px 12px; flex-wrap: wrap; margin-top: 2px; }
.biz .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.biz .acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.biz .acts .btn { padding: 0 10px; }
.biz .why { font-size: 13.5px; color: var(--ink-2); }
.save { flex: none; }
.save.on { color: var(--green); border-color: rgba(60, 207, 145, .4); }
.load-more { margin-top: 12px; }

/* ---------- sheet (business file) ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
.sheet { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: 100%; max-height: 92dvh; padding: 0; border: 1px solid var(--line-2); border-bottom: 0;
  border-radius: 18px 18px 0 0; background: var(--surface); overflow: auto; overscroll-behavior: contain; }
.sheet[open] { animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 900px) {
  .sheet { inset: 0 0 0 auto; width: 520px; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; border-left: 1px solid var(--line-2); }
  .sheet[open] { animation: left .2s ease-out; }
  @keyframes left { from { transform: translateX(24px); opacity: 0; } }
}
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; gap: 10px; padding: 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.sheet-head .grow { flex: 1; min-width: 0; }
.sheet-body { padding: 16px; display: grid; gap: 20px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.quick-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-acts .btn { flex-direction: column; gap: 4px; min-height: 60px; font-size: 12.5px; padding: 6px; }
.history { display: grid; gap: 8px; font-size: 13.5px; }
.history div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; color: var(--ink-2); }
.history span { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.callbox { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--accent-soft); }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 640px) { .outcomes { grid-template-columns: repeat(5, 1fr); } }
.outcomes .btn { min-height: 48px; white-space: normal; text-align: center; line-height: 1.2; font-size: 13.5px; }
.script summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.script ol { margin: 4px 0 10px; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); font-size: 14px; }
.objections { display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.objections b { color: var(--ink-2); }

/* ---------- seguimiento / agenda ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { flex: none; min-height: var(--tap); padding: 0 14px; display: flex; align-items: center; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-nav b { min-width: 150px; text-align: center; }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-head span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; text-align: center; padding-bottom: 4px; }
.cal-day { min-height: 64px; border: 1px solid var(--line); border-radius: 6px; padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal.semana .cal-day { min-height: 140px; }
@media (min-width: 640px) { .cal-day { min-height: 92px; padding: 5px; } .cal.semana .cal-day { min-height: 220px; } }
.cal-day.out { opacity: .4; }
.cal-day.today { border-color: var(--accent-line); background: var(--accent-soft); }
.cal-n { font-size: 12px; color: var(--muted); }
.cal-it { font-size: 11px; padding: 2px 4px; border-radius: 4px; background: var(--accent-soft); cursor: grab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; touch-action: none; }
.cal-it.seg { background: var(--amber-soft); }
@media (min-width: 640px) { .cal-it { font-size: 12px; } }
.funnel-row { display: grid; grid-template-columns: 100px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; margin-bottom: 8px; }
.money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.money small { display: block; color: var(--muted); font-size: 12.5px; }
.money b { font-family: var(--mono); font-size: 17px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); }
.tbl-wrap { overflow-x: auto; }
.queue-card .biz { border-color: var(--accent-line); }

/* ---------- map ---------- */
.map { height: 320px; border-radius: var(--radius); border: 1px solid var(--line); }
@media (min-width: 640px) { .map { height: 400px; } }

/* ---------- login ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 18px; }
.auth-card .brand { font-size: 22px; justify-content: center; }
.auth-card p { margin: 0; text-align: center; color: var(--muted); }

/* ---------- confirm dialog ---------- */
.ask { width: min(420px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); color: var(--ink); }
.ask[open] { animation: pop .15s ease-out; }
.ask p { margin: 0; font-size: 15px; line-height: 1.5; }
.btn.danger-solid { background: #c93c3c; border-color: #c93c3c; color: #fff; }
.btn.danger-solid:hover { background: #b23131; }
.invite-link { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border: 1px dashed var(--accent-line); border-radius: 10px; background: var(--accent-soft); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }

/* ---------- tutorials ---------- */
.tip-dim { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .4); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.tip-ring { position: fixed; z-index: 71; border-radius: 12px; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(0, 0, 0, .0); pointer-events: none; transition: all .2s; }
.tip { position: fixed; z-index: 72; width: min(360px, calc(100vw - 32px)); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px;
  padding: 18px; box-shadow: 0 18px 48px rgba(0, 0, 0, .5); display: grid; gap: 10px; animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
.tip small { color: var(--accent-ink); font-weight: 600; font-size: 12.5px; }
.tip p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.tip .row { justify-content: flex-end; }
.tip .later { margin-right: auto; }
.help-list .list-row { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
