:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f232c;
  --line: #2a2f3a;
  --ink: #eef0f4;
  --muted: #9aa2b1;
  --accent: #4f8cff;
  --accent-ink: #ffffff;
  --good: #3ecf8e;
  --warn: #f5a524;
  --bad: #ff6b6b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
}
main, .top { max-width: 760px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: 26px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 18px; margin: 0; }
.muted { color: var(--muted); }

/* Header + stats */
.top { padding-top: 16px; padding-bottom: 8px; }
.title-row { display: flex; align-items: center; justify-content: space-between; }
.logout { color: var(--muted); text-decoration: none; font-size: 14px; padding: 10px 0 10px 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px; text-align: center; }
.stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

/* Call backs */
.callbacks { margin: 16px 0 6px; padding: 14px; background: #241d0e; border: 1px solid #5a4313; border-radius: var(--radius); }
.callbacks .count { color: var(--warn); }
.cb-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #3b2e12; }
.cb-row:first-child { border-top: 0; }
.cb-info { flex: 1; min-width: 0; }
.cb-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-info small { color: var(--muted); }

/* Controls */
.controls { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 12px 0 8px; }
input[type=search], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
input[type=search] { font-size: 16px; min-height: 48px; }
select { min-height: 44px; appearance: none; -webkit-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: 30px; }
.search-row { display: flex; gap: 8px; }
.filter-btn { flex: none; padding: 0 16px; min-height: 48px; }
.filter-btn.active { border-color: var(--accent); color: var(--accent); }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.filters[hidden] { display: none; }
.result-line { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; margin-top: 8px; min-height: 24px; }
.link-btn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 14px; padding: 6px 0; cursor: pointer; }

/* Cards */
.list { display: grid; gap: 12px; padding-bottom: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card-head { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.local-time { font-size: 14px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.local-time.t-good { color: var(--good); }
.local-time.t-ok { color: var(--warn); }
.local-time.t-bad { color: var(--bad); }
.cb-info .local-time { font-size: 13px; margin-top: 1px; }
.badge { flex: none; font-size: 12px; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.social { color: var(--warn); border-color: #6b4f16; }
.actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.btn { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 12px; font-weight: 600;
  text-decoration: none; color: var(--ink); background: var(--panel-2); border: 1px solid var(--line); font-size: 16px; cursor: pointer; }
.btn.call, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn[aria-disabled=true] { opacity: .35; pointer-events: none; }
.phone-line { color: var(--muted); font-size: 14px; margin-top: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.status-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.status-row span { color: var(--muted); font-size: 14px; flex: none; width: 52px; }
.status { font-weight: 600; }
.status.s-new { color: var(--ink); }
.status.s-callback { color: var(--warn); }
.status.s-interested, .status.s-zoom { color: var(--accent); }
.status.s-won { color: var(--good); }
.status.s-no { color: var(--bad); }
.contacted { color: var(--muted); font-size: 13px; margin: 6px 0 0 62px; min-height: 0; }
.notes { margin-top: 10px; resize: vertical; min-height: 48px; font-size: 16px; }
.saved { font-size: 12px; color: var(--good); height: 14px; margin-top: 4px; text-align: right; }
.more { width: 100%; margin: 4px 0 24px; min-height: 52px; border-radius: 12px; background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); font: inherit; font-weight: 600; cursor: pointer; }
.message { text-align: center; color: var(--muted); padding: 24px 0; }

/* Login */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-box { width: 100%; max-width: 380px; display: grid; gap: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; }
.login-box .btn { width: 100%; }
.error { color: var(--bad); min-height: 20px; margin: 0; }

@media (min-width: 640px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
}
