:root {
  --bg: #f6f4ef; --card: #fff; --ink: #1d1b18; --muted: #77716a; --line: #e5e0d7;
  --accent: #d2452c; --accent-soft: #fbe6e1; --green: #2f8f5b; --amber: #c98a12;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: inherit; }
.wrap { max-width: 1480px; margin: 0 auto; padding: 0 20px; }
.top { padding: 26px 0 14px; }
h1 { margin: 0; font-size: 30px; letter-spacing: -.02em; font-weight: 750; }
h1 span { color: var(--accent); }
.sub { margin: 4px 0 0; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.chip { text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.chip b { font-weight: 600; color: var(--muted); margin-left: 6px; font-size: 12px; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.on b { color: #cfc8bd; }

.filters { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.filters .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .row.small { font-size: 13px; color: var(--muted); gap: 14px; }
.filters input, .filters select, .filters button { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); }
.filters .grow { flex: 1 1 260px; min-width: 0; max-width: 100%; }
.filters button { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; cursor: pointer; padding: 7px 18px; }
.filters .num { width: 64px; padding: 4px 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { cursor: pointer; }
.seg input { display: none; }
.seg span { display: block; padding: 4px 10px; border-right: 1px solid var(--line); color: var(--ink); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.chk { display: inline-flex; gap: 5px; align-items: center; cursor: pointer; color: var(--ink); }

.meta { display: flex; gap: 18px; margin: 14px 2px 8px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.meta b { color: var(--ink); }

.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
.list th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: lowercase; padding: 10px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.list td { padding: 9px 10px; border-bottom: 1px solid #f0ece5; vertical-align: top; }
.list tr:hover td { background: #fcfaf6; }
.list td.n { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.list td.num { font-family: var(--mono); white-space: nowrap; }
.name a { font-weight: 600; text-decoration: none; }
.name a:hover { text-decoration: underline; }
.act, .dist { color: var(--muted); font-size: 12px; }
.addr a { text-decoration: none; }
.addr a:hover { text-decoration: underline; }
.phones a { display: block; white-space: nowrap; text-decoration: none; font-family: var(--mono); font-size: 12.5px; }
.cat { color: var(--muted); font-size: 12.5px; }
.score { display: inline-block; min-width: 34px; text-align: center; font-weight: 700; font-family: var(--mono); border-radius: 6px; padding: 2px 6px; cursor: help; }
.score.hot { background: var(--accent); color: #fff; }
.score.warm { background: #fbe9c9; color: #7a4f00; }
.score.cold { background: #eeeae3; color: var(--muted); }
.badge { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 5px; margin-left: 4px; vertical-align: 1px; }
.badge.new { background: #dff3e7; color: var(--green); }
.badge.chain { background: #eeeae3; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; text-decoration: none; border-radius: 5px; padding: 1px 6px; margin: 0 3px 3px 0; border: 1px solid var(--line); }
.tag.k-platform { background: #efe9ff; border-color: #ddd2ff; color: #5432c9; }
.tag.k-social { background: #e7f0ff; border-color: #d1e2ff; color: #2357b8; }
.tag.k-messenger { background: #e3f6ef; border-color: #c9ecdd; color: #1f7a52; }
.tag.k-email { color: var(--muted); }
.none { color: var(--muted); font-size: 12px; }
.ops { white-space: nowrap; }
.ops select { font: inherit; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; background: #fff; }
.ops button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 14px; padding: 2px 5px; border-radius: 5px; }
.ops button:hover { background: var(--accent-soft); color: var(--accent); }
.ops .note.has { color: var(--amber); }
tr.st-client td { background: #eef8f1; }
tr.st-refused td { opacity: .5; }
tr.st-interested td:first-child { box-shadow: inset 3px 0 0 var(--green); }
tr.st-later td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
tr.st-called td:first-child { box-shadow: inset 3px 0 0 #9b948a; }
tr.gone { opacity: .25; transition: opacity .3s; }
.nothing { text-align: center; color: var(--muted); padding: 40px; }
.pager { display: flex; gap: 18px; justify-content: center; margin: 18px 0; color: var(--muted); }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: 12px; padding: 30px; margin-top: 10px; }
.empty code { background: #f1ede6; padding: 1px 5px; border-radius: 4px; }
.foot { color: var(--muted); font-size: 12px; padding: 20px 20px 40px; }
@media (max-width: 760px) {
  h1 { font-size: 22px; }
  .list th:nth-child(1), .list td:nth-child(1), .list th:nth-child(9), .list td:nth-child(9) { display: none; }
}
.meta .grow { flex: 1; }
.login { max-width: 360px; margin: 60px auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.login h2 { margin: 0 0 14px; font-size: 20px; }
.login input { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin-bottom: 10px; }
.login button { width: 100%; font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px; cursor: pointer; }
.login .err { color: var(--accent); font-size: 13px; margin: 0 0 10px; }
.login a { color: var(--muted); font-size: 13px; }
.meta .who { color: var(--muted); }
.meta .who b { color: var(--ink); }
.layer { margin: 0 2px 8px; font-size: 13px; color: var(--muted); }
.badge.gst { background: #fff3d6; color: #8a5a00; }
.gnote { font-size: 12px; color: #8a5a00; margin-top: 2px; }
.admins { max-width: 760px; margin: 30px auto; }
.admins h1 { font-size: 24px; margin: 0 0 4px; }
.admins .card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 14px; }
.admins form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admins input { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.admins button { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.admins button.main { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.admins button.danger { color: var(--accent); }
.admins table { width: 100%; border-collapse: collapse; }
.admins td, .admins th { text-align: left; padding: 8px 6px; border-bottom: 1px solid #f0ece5; font-size: 13px; vertical-align: middle; }
.admins .ok { color: var(--green); } .admins .err { color: var(--accent); }
tr.st-unavailable td { color: var(--muted); }
tr.st-unavailable td:first-child { box-shadow: inset 3px 0 0 #c9c3b8; }
tr.st-custom td:first-child { box-shadow: inset 3px 0 0 #5b7fd6; }
