/* BLG · Lead Intelligence. Visual language shared with the Bever AI Command Center:
   black header, amber #FFC200, Barlow Condensed headings, JetBrains Mono labels, light surface with a dark-mode twin. */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/BarlowCondensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/BarlowCondensed-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/Barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/Barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/Barlow-600.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 100 800; font-style: normal; font-display: swap; src: url(fonts/JetBrainsMono-400.woff2) format("woff2"); }

:root {
  --bg: #F3F3F0; --surface: #FFFFFF; --sunk: #EAEAE5; --ink: #141413; --muted: #5E6167; --line: #DADAD3;
  --amber: #FFC200; --amber-ink: #8A6400; --amber-soft: #FFF3C9; --black: #0A0A0A;
  --ok: #1E7B4B; --ok-soft: #DDF1E5; --warn: #A35A00; --warn-soft: #FDEBD3; --bad: #B42318; --bad-soft: #FBE1DE; --info: #2A5DB0; --info-soft: #E0E9F8;
  --display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif; --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --radius: 8px; --gap: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110; --surface: #1A1A18; --sunk: #232320; --ink: #EDEDE8; --muted: #A3A49E; --line: #34342F;
    --amber-ink: #FFC200; --amber-soft: #3A2F08; --ok: #5CCB8F; --ok-soft: #173424; --warn: #F2A54A; --warn-soft: #3A2710;
    --bad: #F2877C; --bad-soft: #3D1814; --info: #86ABEB; --info-soft: #18253D;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface: #1A1A18; --sunk: #232320; --ink: #EDEDE8; --muted: #A3A49E; --line: #34342F;
  --amber-ink: #FFC200; --amber-soft: #3A2F08; --ok: #5CCB8F; --ok-soft: #173424; --warn: #F2A54A; --warn-soft: #3A2710;
  --bad: #F2877C; --bad-soft: #3D1814; --info: #86ABEB; --info-soft: #18253D;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.1; }
h1 { font: 700 30px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
h2 { font: 700 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .05em; text-wrap: balance; }
h3 { font: 700 16px/1.2 var(--display); text-transform: uppercase; letter-spacing: .05em; }
small, .muted { color: var(--muted); }
.faint { color: var(--muted); opacity: .8; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }

/* ---------- header (black, like the Command Center) ---------- */
.app { min-height: 100dvh; }
.topbar { background: var(--black); color: #F5F5F0; padding: calc(16px + var(--safe-t)) 16px 0; position: sticky; top: 0; z-index: 30; }
.top-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; gap: 12px; align-items: center; color: #F5F5F0; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; flex: none; display: block; }
.brand h1 { color: #fff; font-size: 28px; }
.brand .sub { font: 500 11.5px/1.3 var(--mono); color: #BDBDB5; letter-spacing: .04em; margin-top: 4px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: #232320; border: 1px solid #3a3a35; border-radius: 6px; min-width: 38px; height: 36px; padding: 0 10px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; color: #EDEDE8; cursor: pointer; font: 600 13px var(--body); }
.icon-btn:hover { border-color: #EDEDE8; }
.tabs { max-width: 1180px; margin: 14px auto 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { font: 700 15px var(--display); letter-spacing: .06em; text-transform: uppercase; color: #A9A9A1; padding: 10px 13px; border-bottom: 3px solid transparent; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tabs a:hover { color: #fff; text-decoration: none; }
.tabs a.active { color: #fff; border-bottom-color: var(--amber); }
.tabs a svg { display: none; }
.pill { font: 500 11px var(--mono); padding: 3px 9px; border-radius: 10px; letter-spacing: .04em; text-transform: uppercase; }
.pill-off { background: var(--bad-soft); color: var(--bad); }
.pill-sync { background: var(--amber); color: #111; }
.view { padding: 22px 16px 64px; max-width: 1180px; width: 100%; margin: 0 auto; outline: none; min-width: 0; }
body.logged-out .topbar { display: none; }
body.logged-out .view { min-height: calc(100dvh - 90px); display: flex; align-items: center; justify-content: center; padding-top: 24px; }
.foot { text-align: center; padding: 18px 16px calc(20px + var(--safe-b)); font: 500 11.5px/1.7 var(--mono); letter-spacing: .05em; color: var(--muted); text-transform: uppercase; display: grid; gap: 2px; }
.foot b { color: var(--ink); font-weight: 500; }
.foot a { color: var(--info); text-transform: none; }
.ok-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 7px; box-shadow: 0 0 0 3px var(--ok-soft); }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card + .card, .stack > * + * { margin-top: var(--gap); }
.grid > .card { margin-top: 0; }
.card h2 { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .grid-md-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-md-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; max-width: 75ch; }
.page-head h1 { font-size: 26px; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 12px; max-width: 75ch; }
.rule { background: var(--amber-soft); color: var(--amber-ink); border-radius: var(--radius); padding: 10px 14px; font-size: 13.5px; font-weight: 500; margin-bottom: 14px; }
.notice { padding: 10px 14px; border-radius: var(--radius); background: var(--amber-soft); color: var(--amber-ink); font-size: 13.5px; }
.notice.err { background: var(--bad-soft); color: var(--bad); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kpi { background: var(--surface); padding: 14px 16px; color: var(--ink); display: block; }
.kpi:hover { text-decoration: none; background: var(--sunk); }
.kpi b { display: block; font: 700 32px/1 var(--display); font-variant-numeric: tabular-nums; }
.kpi span { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi.accent b { color: var(--amber-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 13px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 13px var(--body); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #111; }
.btn.primary:hover { filter: brightness(.96); border-color: var(--amber); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.badge, .chip { display: inline-flex; align-items: center; gap: 5px; font: 500 11px/1 var(--mono); padding: 5px 8px; border-radius: 4px; background: var(--sunk); color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; border: 0; }
.badge.HIGH, .badge.fact { background: var(--ok-soft); color: var(--ok); }
.badge.MEDIUM { background: var(--amber-soft); color: var(--amber-ink); }
.badge.LOW, .badge.unknown { background: var(--sunk); color: var(--muted); }
.badge.inference { background: var(--info-soft); color: var(--info); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip.svc { background: var(--amber-soft); color: var(--amber-ink); }
.chip { text-transform: none; font-family: var(--body); font-size: 12.5px; letter-spacing: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- lead / CRM ---------- */
.score { flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font: 700 18px var(--display);
  background: conic-gradient(var(--c, var(--amber)) calc(var(--p, 0) * 1%), var(--line) 0); position: relative; }
.score::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.score span { position: relative; }
.score.big { width: 74px; height: 74px; font-size: 26px; }
.signal { margin: 10px 0 6px; font-size: 13px; }
.signal b { color: var(--amber-ink); font-weight: 600; }
.why { font-size: 13.5px; margin: 6px 0 10px; }

.pipe { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pipe button { display: inline-flex; align-items: baseline; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.pipe button b { font: 700 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.pipe button span { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pipe button:hover { border-color: var(--ink); }
.pipe button.on { background: var(--black); border-color: var(--black); }
.pipe button.on b { color: var(--amber); } .pipe button.on span { color: #D8D8D0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: center; }
.filters > * { flex: 0 1 auto; }
.filters .grow { flex: 1 1 220px; }
.input, select.input, textarea.input, select, input[type=text], input[type=search], input[type=email], input[type=password], input[type=date], input[type=number], input[type=datetime-local], textarea {
  font: 14px var(--body); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-height: 38px; }
.input { width: 100%; }
textarea.input, textarea { min-height: 90px; resize: vertical; width: 100%; line-height: 1.45; }
label.lbl { display: block; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 8px 12px; cursor: pointer; color: var(--muted); font: 600 13px var(--body); }
.seg button.on { background: var(--amber); color: #111; }

.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--sunk); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.lead-row { cursor: pointer; }
tr.lead-row:hover td { background: var(--sunk); }
td .small, .small { color: var(--muted); font-size: 12px; }
td .co { font: 600 15px var(--body); color: var(--ink); }
table.tbl th, table.tbl td { text-align: left; }
.scroll-x { overflow-x: auto; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
  .crm-table { min-width: 0; }
  .crm-table thead { display: none; }
  .crm-table tr.lead-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .crm-table tr:last-child { border-bottom: 0; }
  .crm-table td { border: 0; padding: 0; min-width: 0; }
  .crm-table td:first-child { grid-column: 1 / -1; }
  .crm-table td[data-l]::before { content: attr(data-l); display: block; font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  .crm-table td.hide-sm { display: none; }
}

.kv { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); gap: 6px 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; padding-top: 3px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 2px; }
.ev { font-size: 13px; }
.ev .src { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.ev blockquote { margin: 4px 0 0; padding: 6px 10px; border-left: 3px solid var(--amber); background: var(--sunk); border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.evref { display: inline-block; font: 500 11px var(--mono); padding: 0 6px; margin: 0 2px; border-radius: 4px; background: var(--sunk); color: var(--amber-ink); cursor: pointer; }
.section-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin: 14px 0 12px; scrollbar-width: none; }
.section-nav a { flex: none; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; padding: 7px 10px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.section-nav a:hover { color: var(--ink); text-decoration: none; border-color: var(--ink); }
.detail-head { display: flex; gap: 14px; align-items: center; }
.detail-head .t { flex: 1; min-width: 0; }
.detail-head h1 { overflow-wrap: anywhere; font-size: 30px; }
.status-select { max-width: 220px; }

/* contacts (10 slots) */
.slots { display: grid; gap: 8px; }
.slot { display: grid; grid-template-columns: 26px minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1.6fr) auto; gap: 8px; align-items: center; }
.slot .n { font: 500 12px var(--mono); color: var(--muted); text-align: right; }
.slot input { width: 100%; min-width: 0; }
.slot .mail { min-width: 34px; }
.slot-head { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
@media (max-width: 760px) {
  .slot { grid-template-columns: 22px 1fr 1fr; }
  .slot .em { grid-column: 2 / 3; } .slot .mail { grid-column: 3 / 4; justify-self: end; }
  .slot-head { display: none; }
  .slot + .slot { padding-top: 8px; border-top: 1px dashed var(--line); }
}

/* notes */
.note { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.note:first-child { border-top: 0; }
.note-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font: 500 12px var(--mono); color: var(--muted); }
.note-meta time { color: var(--amber-ink); font-weight: 500; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; }
.note-actions { display: flex; gap: 6px; }

/* bars */
.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) auto; align-items: center; gap: 8px; font-size: 13px; }
.bar .lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .lab a { color: var(--ink); }
.bar .track { display: block; height: 8px; background: var(--sunk); border-radius: 99px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--amber); border-radius: 99px; width: 0; }
.bar .n { font: 500 12px var(--mono); color: var(--muted); min-width: 2ch; text-align: right; }
.comp { margin-bottom: 10px; }
.comp .head { display: flex; justify-content: space-between; font-size: 13.5px; }
.comp .track { height: 8px; background: var(--sunk); border-radius: 99px; margin: 5px 0; overflow: hidden; }
.comp .fill { height: 100%; background: var(--amber); border-radius: 99px; }
.comp ul { margin: 2px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--muted); }

.run { display: grid; gap: 4px; }
.run .st, .st { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.st-done { color: var(--ok); } .st-partial { color: var(--warn); } .st-failed { color: var(--bad); } .st-running, .st-queued { color: var(--info); } .st-missed { color: var(--muted); }
.progress { height: 6px; background: var(--sunk); border-radius: 9px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--amber); width: 30%; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.toggle { position: relative; width: 44px; height: 26px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; cursor: pointer; }
.toggle span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--amber); }
.toggle input:checked + span::before { transform: translateX(18px); }
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 10px; }
.admin-tabs a { flex: none; padding: 7px 12px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.admin-tabs a.on { background: var(--amber); color: #111; border-color: var(--amber); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 50; background: var(--black); color: #fff; padding: 9px 14px; border-radius: 6px; font-size: 13px; max-width: calc(100vw - 32px); }
.modal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 32px)); padding: 18px; }
.modal::backdrop { background: rgba(0, 0, 0, .55); }
.login { width: min(400px, 100%); margin: 0 auto; padding: 24px 22px; }
.login .brand-big { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 18px; text-align: center; }
.login .brand-big img { width: 88px; height: 88px; }
.login .brand-big h1 { font-size: 40px; letter-spacing: .06em; }
.login .brand-big p { margin: 6px 0 0; font: 500 11.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
details.more-filters summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .brand h1 { font-size: 24px; } .brand .sub { display: none; } h1 { font-size: 26px; } }
