/* MA Leads — Master Artists lead sourcing */
:root {
  --ma-navy: #12003B;
  --ma-orange: #FF4300;
  --bg: #F5F4F9;
  --surface: #FFFFFF;
  --surface-2: #F9F8FC;
  --line: #E6E3EF;
  --line-2: #D7D2E4;
  --text: #17122B;
  --muted: #6B6680;
  --good: #0E8A4F; --good-bg: #E3F6EC;
  --bad: #C8321C;  --bad-bg: #FDE8E4;
  --warn: #9A6200; --warn-bg: #FFF2D6;
  --info: #2457C5; --info-bg: #E5EDFD;
  --violet: #5B2BC2; --violet-bg: #EEE7FD;
  --r: 14px; --r-sm: 9px;
  --shadow: 0 1px 2px rgba(18,0,59,.04), 0 4px 18px rgba(18,0,59,.04);
  --side-w: 248px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
h2 { font-size: 20px; } h3 { font-size: 15px; font-weight: 700; } h4 { font-size: 13px; }
p { margin: .3em 0; }
small { display: block; color: var(--muted); font-size: 12px; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; font: 600 11px/18px Inter, sans-serif; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; }
.muted { color: var(--muted); } .tiny { font-size: 12px; } .center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.good { color: var(--good); } .bad { color: var(--bad); }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }

/* ---------- Sidebar ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--ma-navy); color: #E9E5F7; display: flex; flex-direction: column; z-index: 40; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px; }
.ma-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.ma-brand img { width: 34px; height: 34px; object-fit: contain; }
.ma-brand span { font-weight: 800; font-size: 15px; letter-spacing: -.01em; line-height: 1.1; }
.ma-brand small { color: #A79FC6; font-weight: 500; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.side-close { display: none; background: none; border: 0; color: #fff; cursor: pointer; }
.ws-card { margin: 8px 12px 6px; padding: 10px; display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; }
.ws-card img { width: 38px; height: 38px; object-fit: contain; border-radius: 9px; background: #fff; padding: 3px; }
.ws-card b { color: #fff; display: block; font-size: 13px; line-height: 1.2; }
.ws-card small { color: #A79FC6; font-size: 11px; }
.ws-initial { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: #fff; font-weight: 800; font-size: 16px; flex: none; }
.ws-initial.xs { width: 26px; height: 26px; font-size: 12px; border-radius: 7px; }
.side nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: #CFC9E6; text-decoration: none; font-weight: 500; position: relative; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.side nav a.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--ma-orange); }
.side nav a .count { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; background: var(--ma-orange); color: #fff; padding: 0 7px; border-radius: 99px; line-height: 18px; }
.side nav a.exit { margin-top: 10px; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0 0 10px 10px; padding-top: 14px; color: #FFB295; }
.side-foot { padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.me { display: flex; gap: 10px; align-items: center; }
.me b { color: #fff; font-size: 13px; display: block; } .me small { color: #A79FC6; font-size: 11px; }
.me-links { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; }
.me-links a { color: #A79FC6; text-decoration: none; display: flex; align-items: center; gap: 4px; }
.me-links a:hover { color: #fff; }
.me-links .ic { width: 14px; height: 14px; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ma-orange); color: #fff; font-weight: 700; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; background: var(--violet-bg); color: var(--violet); }
.scrim { display: none; }

/* ---------- Main ---------- */
.has-nav .main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 22px 28px 6px; }
.burger { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.tb-title h1 { font-size: 22px; font-weight: 800; }
.tb-title p { color: var(--muted); margin: 2px 0 0; }
.tb-title p .badge { vertical-align: 1px; }
.tb-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.content { padding: 14px 28px 30px; flex: 1; }
.foot { padding: 14px 28px 22px; color: var(--muted); font-size: 12px; }
.flashes { padding: 0 28px; }
.flash { padding: 10px 14px; border-radius: 10px; margin: 8px 0; font-weight: 500; border: 1px solid transparent; transition: opacity .6s; }
.flash.ok { background: var(--good-bg); color: var(--good); }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.fade { opacity: 0; }
.kbd-hint { color: var(--muted); font-size: 12px; margin-left: 4px; }

/* ---------- Cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 460px; }
.card h3 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-h h3 { margin: 0; }
.card-h a { font-size: 13px; color: var(--muted); text-decoration: none; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; background: var(--surface-2); }
.card .card-h + .empty { border: 0; box-shadow: none; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.col-main, .col-side { min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row { display: flex; align-items: center; } .gap { gap: 10px; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin: -4px 0 18px; }
.section-t { font-size: 15px; margin: 22px 0 10px; }
.empty { text-align: center; padding: 46px 20px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r); }
.empty h3 { font-size: 16px; margin-bottom: 4px; } .empty p { color: var(--muted); max-width: 420px; margin: 0 auto 14px; }

/* ---------- Forms ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: #3E3856; }
label small { font-weight: 400; display: inline; }
label.inline { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 11px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input[type=color] { width: 44px; height: 36px; padding: 3px; cursor: pointer; }
input.mini { width: 74px; text-align: right; padding: 5px 8px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
label.check.big { font-size: 13.5px; margin-bottom: 4px; }
.color-in { display: flex; gap: 8px; align-items: center; }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.seg label { flex: 1; flex-direction: row; cursor: pointer; }
.seg input { display: none; }
.seg span { flex: 1; text-align: center; padding: 7px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--accent); color: #fff; }
.logo-row { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.logo-preview { width: 88px; height: 88px; border: 1px dashed var(--line-2); border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview span { font-size: 11px; color: var(--muted); }
label.file input { padding: 6px; }
details.help { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
details.help summary { cursor: pointer; font-weight: 600; color: var(--muted); }
details.help ol { padding-left: 18px; } details.help li { margin: 4px 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 600 13.5px/1.2 Inter, sans-serif; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .05s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--text); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(.94); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); border-color: #F2B9AE; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.approve { background: var(--good); border-color: var(--good); color: #fff; }
.btn.approve:hover { filter: brightness(.94); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.big { padding: 11px 18px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn kbd { background: rgba(255,255,255,.18); color: inherit; border-color: rgba(255,255,255,.3); }
.btn:not(.primary):not(.approve) kbd { background: var(--surface-2); }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.icon-btn:hover { color: var(--bad); background: var(--bad-bg); }

/* ---------- Badges, chips ---------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; font-style: normal; white-space: nowrap; background: #EEECF4; color: #57516F; }
.badge.green { background: var(--good-bg); color: var(--good); }
.badge.red { background: var(--bad-bg); color: var(--bad); }
.badge.amber { background: var(--warn-bg); color: var(--warn); }
.badge.blue { background: var(--info-bg); color: var(--info); }
.badge.violet { background: var(--violet-bg); color: var(--violet); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: #EEECF4; color: #57516F; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.num small { display: inline; margin-left: 4px; }
.tbl.hover tbody tr { cursor: pointer; } .tbl.hover tbody tr:hover { background: var(--surface-2); }
.tbl td a { text-decoration: none; }
.tbl tr.off { opacity: .5; }
.tbl select { padding: 5px 8px; min-width: 150px; }
.who { display: flex; align-items: center; gap: 9px; }
.who img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 12px; border-top: 1px solid var(--line); color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; }
.filters input[name=q] { flex: 1 1 220px; width: auto; }
.filters select, .filters input[type=date] { width: auto; }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; background: #ECEAF3; border-radius: 10px; padding: 3px; gap: 2px; }
.tabs a, .tabs button { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font: 600 13px Inter, sans-serif; border: 0; background: none; cursor: pointer; white-space: nowrap; }
.tabs a.on, .tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tabs button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- KPIs & charts ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi span { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi.good b { color: var(--good); } .kpi.bad b { color: var(--bad); }
.banner { display: flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: 14px; border-radius: 12px; background: var(--ma-navy); color: #fff; text-decoration: none; }
.banner b { background: var(--ma-orange); padding: 0 9px; border-radius: 99px; }
.banner span { margin-left: auto; font-weight: 700; }
.banner:hover { color: #fff; filter: brightness(1.15); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 6px; }
.cbar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 4px; }
.cstack { flex: 1; width: 100%; position: relative; }
.cstack i { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 5px 5px 2px 2px; min-height: 2px; }
.cstack i.a { background: #DCD6EE; } .cstack i.b { background: var(--accent); left: 22%; right: 22%; }
.cbar small { font-size: 10.5px; }
.legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.legend .l1 { background: #DCD6EE; } .legend .l2 { background: var(--accent); }
.hbar { display: grid; grid-template-columns: minmax(0, 1.3fr) 1fr 28px; gap: 8px; align-items: center; margin: 7px 0; font-size: 12.5px; }
.hbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar div { height: 8px; background: #EEECF4; border-radius: 99px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.hbar b { text-align: right; }
.bar { height: 7px; background: #EEECF4; border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.bar.sm { height: 5px; margin: 2px 0; width: 120px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed li:last-child { border: 0; }
ul.tight { padding-left: 18px; margin: 6px 0; } ul.tight li { margin: 6px 0; }

/* ---------- Owner: clients ---------- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.client-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border-top: 4px solid var(--cb); }
.client-card.paused { opacity: .65; }
.cc-head { display: flex; gap: 12px; align-items: center; padding: 16px; }
.cc-head img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); padding: 3px; }
.cc-head .ws-initial { width: 44px; height: 44px; }
.cc-head h3 { margin: 0; } .cc-head .badge { margin-left: auto; }
.cc-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cc-stats div { padding: 10px; text-align: center; border-right: 1px solid var(--line); }
.cc-stats div:last-child { border: 0; }
.cc-stats b { display: block; font-size: 18px; } .cc-stats span { font-size: 11px; color: var(--muted); }
.cc-actions { display: flex; gap: 8px; padding: 12px 16px; }
.people { list-style: none; padding: 0; margin: 0 0 14px; }
.people li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.people li.off { opacity: .5; }
.people b { font-size: 13px; }
.add-user { border-top: 1px solid var(--line); padding-top: 14px; }
details.menu { position: relative; }
details.menu summary { list-style: none; cursor: pointer; padding: 2px 9px; border-radius: 7px; color: var(--muted); font-weight: 800; }
details.menu summary::-webkit-details-marker { display: none; }
details.menu summary:hover { background: var(--surface-2); }
details.menu > div { position: absolute; right: 0; top: 100%; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(18,0,59,.14); padding: 5px; min-width: 170px; }
details.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 7px; font: 500 13px Inter, sans-serif; cursor: pointer; color: var(--text); }
details.menu button:hover { background: var(--surface-2); }
.creds { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; background: #FFF8E6; border: 1px solid #F3D891; border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.creds pre { margin: 8px 0 0; white-space: pre-wrap; font: 12.5px/1.5 ui-monospace, Menlo, monospace; background: #fff; padding: 10px 12px; border-radius: 8px; border: 1px solid #F3D891; }

/* ---------- Agent: my day ---------- */
.day-hero { display: flex; gap: 22px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.ring { --p: 0; width: 118px; height: 118px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), #EEECF4 0); }
.ring > div { width: 94px; height: 94px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; align-content: center; }
.ring b { font-size: 30px; font-weight: 800; line-height: 1; } .ring span { font-size: 12px; color: var(--muted); }
.day-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; flex: 1; }
.day-stats span { font-size: 12px; color: var(--muted); font-weight: 600; } .day-stats b { display: block; font-size: 21px; font-weight: 800; }
.brief { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; }
.brief p { color: var(--muted); margin: 4px 0 0; }
.attention { border-color: #F3C0B4; }
.terr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.terr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.terr-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.terr p { margin: 6px 0; } .terr .ic { width: 14px; height: 14px; }
.terr-a { display: flex; gap: 6px; margin-top: auto; padding-top: 12px; }

/* ---------- Agent: add leads ---------- */
.counter { display: flex; align-items: baseline; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 14px; transition: transform .2s; }
.counter b { font-size: 24px; font-weight: 800; color: var(--accent); }
.counter span { color: var(--muted); font-weight: 600; }
.counter.bump { transform: scale(1.12); }
.add-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.add-side { position: sticky; top: 16px; }
.capture { padding: 14px; }
.cap-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs.small a, .tabs.small button { padding: 5px 11px; font-size: 12.5px; }
.terr-pick { flex-direction: row; align-items: center; gap: 6px; color: var(--muted); }
.terr-pick select { width: auto; max-width: 280px; padding: 6px 9px; }
.smart { position: relative; display: flex; align-items: center; }
.smart > .ic { position: absolute; left: 14px; color: var(--muted); }
.smart input { padding: 14px 44px 14px 42px; font-size: 15.5px; border-width: 2px; border-radius: 12px; }
.smart-k { position: absolute; right: 12px; }
.results { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.res { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%; text-align: left; padding: 10px 14px; background: var(--surface); border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: inherit; }
.res span { color: var(--muted); font-size: 12.5px; grid-column: 1; }
.res em { font-style: normal; font-size: 12px; color: var(--muted); grid-column: 2; grid-row: 1; text-align: right; }
.res i { grid-column: 1 / -1; justify-self: start; margin-top: 3px; }
.res.on, .res:hover { background: color-mix(in srgb, var(--accent) 8%, white); }
.res.is-dupe b { color: var(--muted); }
.res-k { padding: 7px 14px; font-size: 11.5px; color: var(--muted); background: var(--surface-2); }
.res-load, .res-err { padding: 14px; color: var(--muted); }
.res-err { color: var(--bad); }
.finder-bar { display: flex; gap: 8px; }
.finder-list { margin-top: 10px; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.finder-list:empty { display: none; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) 76px 52px 130px 54px; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--surface-2); }
.frow.current { background: color-mix(in srgb, var(--accent) 10%, white); box-shadow: inset 3px 0 0 var(--accent); }
.frow.done { opacity: .5; cursor: default; }
.f-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-meta small { display: inline; }
.finder-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.dupe { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.dupe.strong { background: var(--bad-bg); color: var(--bad); }
.dupe p { margin: 3px 0 0; font-size: 12.5px; }
.dupe-a { display: flex; gap: 6px; }
.lead-form { display: flex; flex-direction: column; gap: 12px; }
.lf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.lf-grid .span2 { grid-column: span 2; }
.with-btn { display: flex; gap: 6px; }
.site-status { min-height: 16px; } .site-status.good { color: var(--good); } .site-status.bad { color: var(--bad); } .site-status.busy { color: var(--info); }
details.more { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
details.more[open] { padding-bottom: 12px; }
details.more summary { cursor: pointer; font-weight: 600; font-size: 13px; }
details.more .lf-grid { margin-top: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qual { padding: 0; overflow: hidden; }
.qual-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.verdict { display: block; font-size: 17px; font-weight: 800; }
.verdict.good { color: var(--good); } .verdict.bad { color: var(--bad); } .verdict.warn { color: var(--warn); }
.score { --p: 0; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: radial-gradient(closest-side, var(--surface) 76%, transparent 78%), conic-gradient(var(--accent) calc(var(--p) * 1%), #EEECF4 0); }
.score.big { width: 70px; height: 70px; font-size: 16px; }
.qlist { list-style: none; margin: 0; padding: 6px 0; }
.qlist.static { padding: 0; }
.qrow { display: flex; gap: 10px; align-items: flex-start; padding: 8px 16px; font-size: 13px; }
.qlist.static .qrow { padding: 7px 0; border-bottom: 1px solid var(--line); }
.qlist.static .qrow:last-child { border: 0; }
.qrow > div:first-of-type { flex: 1; min-width: 0; }
.qrow em { font-style: normal; font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--violet); background: var(--violet-bg); padding: 0 5px; border-radius: 4px; margin-left: 4px; }
.qi { width: 20px; height: 20px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: #EEECF4; color: var(--muted); margin-top: 1px; }
.qrow.pass .qi { background: var(--good-bg); color: var(--good); }
.qrow.fail .qi { background: var(--bad-bg); color: var(--bad); }
.qrow.fail > div > span { color: var(--bad); }
.qrow small.auto { font-size: 10.5px; color: #A9A4BC; margin-top: 2px; }
.qrow.manual { background: var(--surface-2); }
.qrow.manual.unknown { background: color-mix(in srgb, var(--accent) 6%, white); }
.yn { display: flex; align-items: center; gap: 4px; flex: none; }
.yn button { border: 1px solid var(--line-2); background: var(--surface); padding: 4px 10px; border-radius: 7px; font: 600 12.5px Inter, sans-serif; cursor: pointer; color: var(--muted); }
.yn button.on[data-v=yes] { background: var(--good); border-color: var(--good); color: #fff; }
.yn button.on[data-v=no] { background: var(--bad); border-color: var(--bad); color: #fff; }
.yn button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.qtext { margin-top: 5px; padding: 6px 9px; }
.site-box { border-top: 1px solid var(--line); padding: 12px 16px; font-size: 13px; }
.save-bar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.brief-mini summary { cursor: pointer; font-weight: 700; }
.brief-mini p { color: var(--muted); font-size: 13px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ma-navy); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(18,0,59,.3); z-index: 100; font-weight: 500; animation: pop .2s ease; max-width: 90vw; }
.toast.good { background: var(--good); } .toast.bad { background: var(--bad); } .toast.warn { background: #8A5A00; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Lead view ---------- */
.facts { align-content: start; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.facts div.wide { grid-column: 1 / -1; }
.facts dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.facts dd { margin: 3px 0 0; font-size: 14px; word-break: break-word; }
.facts dd small { display: inline; }
.facts .hours { font-size: 12.5px; color: var(--muted); }
.review-box .reason { width: auto; min-width: 220px; }

/* ---------- Review queue ---------- */
.rv { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.rv-list { max-height: calc(100vh - 150px); overflow-y: auto; position: sticky; top: 16px; }
.rv-bulk { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 2; }
.rv-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.rv-item:hover { background: var(--surface-2); }
.rv-item.on { background: color-mix(in srgb, var(--accent) 9%, white); box-shadow: inset 3px 0 0 var(--accent); }
.rv-item.done { opacity: .55; }
.rv-item b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-h { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.rv-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.rv-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.rv-actions select { width: auto; min-width: 210px; }
.rv-actions input { flex: 1; min-width: 160px; width: auto; }

/* ---------- Criteria builder ---------- */
.crit-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); background: var(--surface); }
.crit-row.inactive { opacity: .5; }
.crit-row.dragging { opacity: .4; }
.drag { cursor: grab; color: #B9B4CC; padding-top: 8px; user-select: none; letter-spacing: -2px; }
.crit-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.crit-label { font-weight: 600; }
.crit-line { display: flex; gap: 6px; }
.crit-line select { flex: 1.4; } .crit-line input { flex: 1; }
.crit-help { font-size: 12.5px; padding: 6px 10px; color: var(--muted); }
.crit-flags { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; min-width: 104px; }
#addCrit { margin-top: 12px; }

/* ---------- Auth ---------- */
body.auth { background: radial-gradient(1200px 600px at 10% -10%, #2A0F6E 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #3B1200 0%, transparent 55%), var(--ma-navy); min-height: 100vh; }
body.auth .main { min-height: 100vh; }
body.auth .foot, body.auth .flashes { display: none; }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; padding: 32px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-brands { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-logo { width: 54px; height: 54px; object-fit: contain; background: var(--ma-navy); border-radius: 14px; padding: 6px; }
.auth-logo.client { background: #fff; border: 1px solid var(--line); }
.auth-brands .x { color: var(--muted); font-size: 18px; }
.auth-card h1 { font-size: 22px; font-weight: 800; }
.auth-card form { margin-top: 18px; }
.auth-foot { color: #A79FC6; font-size: 12px; margin-top: 18px; }
.auth-foot b { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .cols, .add-wrap { grid-template-columns: minmax(0, 1fr); }
  .add-side { position: static; }
  .rv { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,0,30,.45); z-index: 30; }
  .side-close, .burger { display: inline-flex; }
  .has-nav .main { margin-left: 0; }
  .topbar { padding: 14px 16px 4px; flex-wrap: wrap; }
  .tb-title h1 { font-size: 19px; }
  .content, .flashes { padding-left: 16px; padding-right: 16px; }
  .form-grid, .grid2, .grid3 { grid-template-columns: 1fr; }
  .lf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rv, .rv-grid { grid-template-columns: 1fr; }
  .rv-list { position: static; max-height: 300px; }
  .day-hero { flex-direction: column; align-items: stretch; }
  .ring { align-self: center; }
  .day-stats { grid-template-columns: repeat(2, 1fr); }
  .frow { grid-template-columns: minmax(0, 1fr) 64px 54px; }
  .frow .f-tag, .frow .f-meta:nth-child(3) { display: none; }
  .tbl { display: block; overflow-x: auto; }
  .creds { flex-direction: column; }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .lf-grid { grid-template-columns: 1fr; } .lf-grid .span2 { grid-column: auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

/* Owner preview banner */
.preview-bar { position: sticky; top: 0; z-index: 35; display: flex; gap: 12px; align-items: center; justify-content: space-between; background: repeating-linear-gradient(135deg, #FFE7B8, #FFE7B8 14px, #FFDFA0 14px, #FFDFA0 28px); color: #5A3A00; padding: 9px 28px; font-size: 13px; border-bottom: 1px solid #F0C774; }
.preview-bar a { background: var(--ma-navy); color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.preview-bar a:hover { color: #fff; filter: brightness(1.2); }
@media (max-width: 900px) { .preview-bar { padding: 9px 16px; flex-wrap: wrap; } }
.client-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.client-links a { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; }
.test-box { background: #F3F0FF; border: 1px dashed #B8A6F0; }
.people form { margin: 0; }
details.menu form.edit-user { padding: 6px; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; min-width: 230px; }
details.menu form.edit-user input { padding: 6px 8px; font-size: 13px; }
details.menu form.edit-user button { background: var(--surface-2); text-align: center; font-weight: 600; }
.checklist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.checklist li { display: grid; grid-template-columns: 22px 1fr; align-items: start; padding: 6px 0; font-size: 13px; }
.checklist li small { grid-column: 2; }
.checklist li.ok .qi { background: var(--good-bg); color: var(--good); }
.checklist li.ok b { color: var(--muted); font-weight: 500; }
@media (max-width: 900px) { .checklist { grid-template-columns: 1fr; } }

/* Send to MA Leads button */
.mb-card.compact { margin-top: 10px; border: 1px dashed var(--line-2); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
.mb-card.compact summary { cursor: pointer; font-size: 13px; }
.mb-body { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.mb-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--ma-orange); color: #fff !important; text-decoration: none; font-weight: 800; padding: 10px 16px; border-radius: 10px; cursor: grab; box-shadow: 0 4px 0 #B83000; white-space: nowrap; }
.mb-btn:active { cursor: grabbing; }
.mb-steps { margin: 0; padding-left: 18px; font-size: 13px; flex: 1; min-width: 240px; }
.mb-steps li { margin: 4px 0; }
.f-maps { font-size: 12px; font-weight: 700; color: var(--info); text-decoration: none; }

/* Business type picker, sources, sweep */
.tp-ic { color: var(--accent); font-size: 12px; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.sources a { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; white-space: nowrap; }
.sources a:hover { border-color: var(--accent); }
.sweep-grid { display: grid; gap: 4px; margin-top: 8px; max-width: 640px; }
.sq { position: relative; aspect-ratio: 1; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); display: grid; place-items: center; min-width: 0; }
.sq a { font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; position: absolute; inset: 0; display: grid; place-items: center; }
.sq.opened { background: var(--info-bg); }
.sq.done { background: var(--good-bg); border-color: #9ED9B8; }
.sq.done a { color: var(--good); }
.sq .tick { position: absolute; right: 1px; bottom: 1px; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 4px; font-size: 10px; line-height: 16px; background: #EEECF4; color: var(--muted); cursor: pointer; z-index: 1; }
.sq.done .tick { background: var(--good); color: #fff; }
.crit-type { font-size: 12.5px; padding: 5px 9px; color: var(--muted); }
