:root {
  --bg: #0a0b0d; --panel: #111316; --panel-2: #16191d; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #f2f3f5; --muted: #8b9098; --dim: #5d626a;
  --accent: #f5c518; --accent-ink: #141100;
  --hot: #ff5a4f; --warm: #f5a524; --cold: #6aa9ff; --ok: #3ecf8e;
  --radius: 16px; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 32px 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 900; font-size: 20px; letter-spacing: -.04em; }
.login h1 { font-size: 30px; line-height: 1.1; margin: 28px 0 6px; letter-spacing: -.03em; }
.login p { color: var(--muted); margin: 0 0 24px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.input, .select, textarea.input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; }
.input:focus, .select:focus { border-color: var(--accent); }
.btn { border: 0; border-radius: 999px; padding: 13px 20px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-white { background: #fff; color: #000; }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--text); }
.btn-block { width: 100%; }
.error { color: var(--hot); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------- app shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(10,11,13,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.topbar .logo { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
.title { font-weight: 750; font-size: 17px; letter-spacing: -.02em; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.off { background: var(--hot); box-shadow: 0 0 10px var(--hot); }
.spacer { flex: 1; }
.icon-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; height: 38px; min-width: 38px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.menu { position: absolute; right: 16px; top: 58px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; min-width: 200px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 11px 12px; border-radius: 10px; }
.menu button:hover { background: var(--panel-2); }
.menu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 120px; }

/* ---------- today strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: left; border-width: 1px; }
.stat .num { font-family: var(--mono); font-size: 34px; font-weight: 700; line-height: 1; margin-top: 8px; letter-spacing: -.03em; }
.stat.alert { border-color: rgba(255,90,79,.5); background: linear-gradient(180deg, rgba(255,90,79,.10), transparent); }
.stat.alert .num { color: var(--hot); }
.progress { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.progress-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bar { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 10px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 9px 14px; font-weight: 600; font-size: 14px; }
.chip .c { font-family: var(--mono); font-size: 12px; margin-left: 6px; color: var(--dim); }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.chip.on .c { color: #444; }
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.toolbar .input { padding: 11px 14px; }
.toolbar .select { width: auto; padding: 11px 12px; }

/* ---------- lead list ---------- */
.list { display: grid; gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 12px; display: grid; gap: 10px; text-align: left; width: 100%; }
.card:hover { border-color: var(--line-2); }
.card.fresh { border-color: rgba(245,197,24,.6); box-shadow: 0 0 0 1px rgba(245,197,24,.25), 0 0 30px rgba(245,197,24,.08); }
.card-top { display: flex; gap: 12px; align-items: flex-start; }
.card-name { font-size: 19px; font-weight: 720; letter-spacing: -.02em; line-height: 1.2; }
.card-sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--panel-2); }
.pill.hot { color: var(--hot); border-color: rgba(255,90,79,.4); }
.pill.warm { color: var(--warm); border-color: rgba(245,165,36,.4); }
.pill.cold { color: var(--cold); border-color: rgba(106,169,255,.4); }
.pill.status-New { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill.status-Joined { color: var(--ok); border-color: rgba(62,207,142,.4); }
.pill.status-Not\ interested { color: var(--dim); }
.age { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.age.late { color: var(--hot); font-weight: 700; }
.card-actions { display: flex; gap: 8px; }
.card-actions .btn { padding: 10px 16px; font-size: 14px; }
.empty { text-align: center; color: var(--muted); padding: 60px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty b { display: block; color: var(--text); font-size: 20px; margin-bottom: 6px; }

/* ---------- sheet (lead detail / modals) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: flex; justify-content: flex-end; }
.sheet { width: 100%; max-width: 520px; height: 100%; background: var(--bg); border-left: 1px solid var(--line); overflow-y: auto; padding: 0 0 40px; }
.sheet-head { position: sticky; top: 0; background: rgba(10,11,13,.92); backdrop-filter: blur(12px); padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); z-index: 2; }
.sheet-body { padding: 18px 16px; display: grid; gap: 18px; }
.lead-name { font-size: 30px; font-weight: 780; letter-spacing: -.035em; line-height: 1.1; }
.lead-phone { font-family: var(--mono); color: var(--muted); margin-top: 6px; font-size: 15px; }
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-actions .btn { padding: 16px; font-size: 16px; }
.section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 9px 13px; font-size: 14px; font-weight: 600; }
.seg button.on { background: #fff; color: #000; border-color: #fff; }
.seg.score button.on[data-v="Hot"] { background: var(--hot); border-color: var(--hot); color: #fff; }
.seg.score button.on[data-v="Warm"] { background: var(--warm); border-color: var(--warm); color: #1a1000; }
.seg.score button.on[data-v="Cold"] { background: var(--cold); border-color: var(--cold); color: #00122a; }
.answers { display: grid; gap: 8px; margin: 0; }
.answers div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.answers div:last-child { border-bottom: 0; padding-bottom: 0; }
.answers dt { color: var(--muted); }
.answers dd { margin: 0; font-weight: 600; text-align: right; }
.timeline { display: grid; gap: 12px; }
.tl { display: grid; grid-template-columns: 10px 1fr; gap: 10px; }
.tl i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-top: 7px; }
.tl.note i { background: var(--accent); }
.tl .t { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.tl .m { font-size: 12px; color: var(--dim); font-family: var(--mono); margin-top: 2px; }
.row { display: flex; gap: 8px; align-items: center; }
.row .input { flex: 1; }

/* ---------- toast & fab ---------- */
.toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: #fff; color: #000; border-radius: 14px; padding: 12px 14px; font-weight: 650; box-shadow: 0 20px 50px rgba(0,0,0,.5); display: flex; gap: 10px; align-items: center; animation: drop .25s ease-out; }
.toast small { display: block; font-weight: 500; color: #555; }
@keyframes drop { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }
.fab { position: fixed; right: 18px; bottom: 22px; z-index: 30; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 30px; font-weight: 400; box-shadow: 0 14px 40px rgba(245,197,24,.25); }
.banner { background: rgba(255,90,79,.12); border: 1px solid rgba(255,90,79,.4); color: #ffb3ad; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }
.notify-cta { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.notify-cta .btn { padding: 8px 14px; font-size: 13px; margin-left: auto; }

.team-list { display: grid; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.team-row .grow { flex: 1; min-width: 0; }
.team-row .btn { padding: 7px 12px; font-size: 13px; }

@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat .num { font-size: 30px; }
  .sheet { max-width: none; border-left: 0; }
  .title-wrap .live { display: none; }
}
