/* Blue Book Power Dialer — agent UI. Clean professional work-tool styling. */
/* L2brand (2026-10-05): brand tokens shared with the BI dashboard
   (dashboard-worker/dashboard.html). Light lift: palette/fonts/buttons/cards
   only — no layout or functional changes. */
:root {
  /* --- Blue Book shared brand tokens (dashboard) --- */
  --bb-sidebar: #0b1c35; --bb-sidebar-active: #13305e; --bb-sidebar-text: #c5cfdd;
  --bb-bg: #edf3f8; --bb-card: #ffffff; --bb-border: #e3e9f0;
  --bb-ink: #0f1f3d; --bb-ink-2: #3e4a5f; --bb-muted: #6b778c;
  --bb-navy: #173d81; --bb-blue: #3c7af3; --bb-orange: #ee9139;
  --bb-green: #2e9d4f; --bb-amber: #f2a93b; --bb-red: #d93a3a;
  --bb-radius: 12px;
  --bb-shadow: 0 1px 2px rgba(15,31,61,.06), 0 1px 8px rgba(15,31,61,.04);
  --bb-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* --- dialer semantic vars, remapped to brand tokens --- */
  --bg: var(--bb-bg);
  --panel: var(--bb-card);
  --ink: var(--bb-ink);
  --muted: var(--bb-muted);
  --line: var(--bb-border);
  --brand: var(--bb-sidebar);
  --brand-ink: #ffffff;
  --accent: var(--bb-navy);
  --hot: var(--bb-red);
  --priority: #9a6a00;
  --nurture: var(--bb-blue);
  --ok: var(--bb-green);
  --warn: #b26a00;
  --danger: var(--bb-red);
  --sim: #6a1b9a;
  --radius: var(--bb-radius);
  --shadow: var(--bb-shadow);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--bb-font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 8px; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

/* ---------- session bar ---------- */
.session-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--brand); color: var(--brand-ink);
  padding: 10px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.session-bar .brand { font-weight: 700; font-size: 16px; letter-spacing: .2px; white-space: nowrap; display: flex; align-items: center; gap: 9px; }
.session-bar .brand small { font-weight: 400; opacity: .75; font-size: 12px; margin-left: 6px; }
/* L2brand: Blue Book roofline mark + wordmark, shared with the dashboard. */
.brand-logo { display: flex; align-items: center; gap: 7px; }
.brand-logo svg { flex: none; }
.brand-logo .word { font-weight: 800; font-size: 17px; color: #fff; letter-spacing: -.3px; line-height: 1; }
.brand-logo .word .sub { display: block; font-size: 7.5px; letter-spacing: 2.2px; color: #fff; font-weight: 600; margin-top: 1px; }
.brand-sep { width: 1px; height: 22px; background: rgba(255,255,255,.25); }
.session-bar label { font-size: 12px; opacity: .85; }
.session-bar select, .session-bar input {
  background: #fff; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff; white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa3b2; }
.pill.waiting .dot { background: #ffcf4d; }
.pill.live .dot { background: #34d17b; }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; }
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 7px 14px; font-weight: 600;
}
.btn:hover { background: #eef1f5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #0f2c63; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.sim-badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .8px;
  color: #fff; background: var(--sim); border-radius: 4px; padding: 3px 8px; white-space: nowrap;
}
/* N-B2: distinct red LIVE badge — shown only when SIMULATION is false. */
.live-badge {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .8px;
  color: #fff; background: var(--danger); border-radius: 4px; padding: 3px 8px; white-space: nowrap;
}
.tabs { margin-left: auto; display: flex; gap: 6px; }
.tabs .btn.active { background: #fff; color: var(--brand); border-color: #fff; }

/* ---------- layout ---------- */
.wrap { max-width: 1460px; margin: 0 auto; padding: 14px 16px 40px; }
.call-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.call-banner .state { font-weight: 700; font-size: 15px; }
.call-banner .sub { color: var(--muted); font-size: 13px; }
.call-banner.ringing { border-left: 5px solid var(--warn); }
.call-banner.connected { border-left: 5px solid var(--ok); }
.call-banner.dialing { border-left: 5px solid var(--nurture); }
.dialer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.col-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.col-right { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 10px; }
.card h3 .sim-badge { margin-left: 8px; text-transform: none; letter-spacing: .8px; }

/* ---------- lead card ---------- */
.lead-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.lead-name { font-size: 20px; font-weight: 700; }
.lead-addr { color: var(--muted); margin-top: 2px; }
.score-wrap { text-align: right; }
.score { font-size: 26px; font-weight: 800; }
.tier { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: #fff; margin-top: 2px; }
.tier.HOT { background: var(--hot); } .tier.PRIORITY { background: var(--priority); } .tier.NURTURE { background: var(--nurture); }
/* L2: contract tiers from the Twenty scoring API (A/B/C/D). Legacy classes kept for compat. */
.tier-a { background: var(--hot); } .tier-b { background: var(--priority); }
.tier-c { background: var(--nurture); } .tier-d { background: #5b6675; }
.tier-unknown { background: #9aa3b2; }
.score-src { font-size: 11px; color: var(--muted); margin: 6px 0 2px; }
/* L2: session setup modal */
.setup-h { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 14px 0 8px; }
.join-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.join-opt:hover { border-color: var(--brand); }
.join-opt input { margin-top: 3px; }
.join-desc { font-size: 12px; color: var(--muted); }
#btn-mute.muted { background: var(--danger); border-color: var(--danger); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip { font-size: 12px; background: #eef2f7; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.chip.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.lead-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; font-size: 13px; }
.lead-meta dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.lead-meta dd { margin: 2px 0 0; font-weight: 600; }
.rec-ok { color: var(--ok); } .rec-no { color: var(--danger); }
.internal-notes { background: #fff8e6; border: 1px solid #ecd27a; border-radius: 6px; padding: 8px 10px; margin-top: 10px; font-size: 13px; }

/* ---------- track panel ---------- */
.track-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.track-head select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; font-weight: 600; }
.tone { font-size: 12.5px; color: var(--muted); font-style: italic; border-left: 3px solid var(--accent); padding-left: 10px; margin-bottom: 12px; }
.script-block { margin-bottom: 14px; }
.script-block > .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 4px; }
.script-text { background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 14px; }
.script-text.opener { background: #eaf1fd; border-color: #bcd3f5; font-size: 14.5px; }
ol.disc { margin: 4px 0; padding-left: 20px; } ol.disc li { margin-bottom: 8px; }
.obj { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; overflow: hidden; }
.obj summary { padding: 8px 12px; font-weight: 600; cursor: pointer; background: #fafbfc; list-style: none; }
.obj summary::-webkit-details-marker { display: none; }
.obj summary::before { content: "Q: "; color: var(--muted); font-weight: 400; }
.obj .a { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
.obj .a::before { content: "A: "; font-weight: 700; color: var(--ok); }

/* ---------- bottom bar: universal objections ---------- */
.univ-objs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; }

/* ---------- right rail cards ---------- */
.dnc-script { font-size: 13px; }
.dnc-trigger { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.dnc-rule { font-size: 12px; color: var(--danger); font-weight: 600; margin-top: 8px; }
.note-field { margin-bottom: 10px; }
.note-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.note-field input, .note-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
.disp-ref { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.disp-ref li { padding: 5px 0; border-bottom: 1px solid #f0f2f5; }
.disp-ref li:last-child { border-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 8px; text-align: center; }
.stat .n { font-size: 20px; font-weight: 800; }
.stat .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.queue-item { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; font-size: 13px; }
.queue-item .qn { font-weight: 700; }
.queue-item .qm { color: var(--muted); font-size: 12px; }
.log-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; font-size: 12.5px; }
.log-list li { padding: 5px 0; border-bottom: 1px solid #f0f2f5; }
.log-list .t { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 30px 16px; overflow-y: auto;
}
.modal { background: #fff; border-radius: 10px; max-width: 760px; width: 100%; padding: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.25);
  /* [MOBILE-MODAL] the card itself scrolls, so the Save button is always reachable on a phone (iOS ignored the backdrop's scroll) */
  max-height: calc(100dvh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
@media (max-width: 640px) { .modal-back { padding: 10px 8px; align-items: stretch; } .modal { max-height: calc(100dvh - 20px); padding: 14px; border-radius: 12px; } }
.modal h2 { margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.disp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.disp-btn {
  border: 2px solid var(--line); background: #fff; border-radius: 8px; padding: 10px;
  font-weight: 600; text-align: left; font-size: 13.5px;
}
.disp-btn:hover { border-color: var(--nurture); }
.disp-btn.selected { border-color: var(--brand); background: #eaf1fd; }
.cond-fields { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.cond-fields .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.copy-row { display: flex; gap: 8px; align-items: flex-start; }
.copy-row .script-text { flex: 1; }

/* ---------- countdown ---------- */
.countdown { text-align: center; padding: 30px 10px; }
.countdown .n { font-size: 56px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 12px; }
.set-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f0f2f5; }
.set-row:last-child { border-bottom: 0; }
.set-row .sk { font-weight: 600; font-size: 13px; }
.set-row .sk code { background: #eef1f5; padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.set-row .sd { font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 420px; }
.set-row .sv { min-width: 150px; text-align: right; }
.set-row input, .set-row select, .set-row textarea { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; width: 150px; }
.set-row textarea { width: 220px; height: 56px; }
.set-row .err { color: var(--danger); font-size: 12px; margin-top: 4px; }
.locked-note { font-size: 12px; color: var(--warn); background: #fff8e6; border: 1px solid #ecd27a; border-radius: 6px; padding: 8px 10px; margin-top: 6px; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.audit-table th, .audit-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.audit-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

.hidden { display: none !important; }
.mt { margin-top: 12px; }
.kbd { display: inline-block; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 7px; font-size: 12px; background: #f8fafc; font-family: monospace; }
@media (max-width: 1080px) { .dialer-grid { grid-template-columns: 1fr; } }

/* ---------- Agent Pay-Per-Lead (realtor) ---------- */
.rt-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .8px; color: #fff; background: var(--accent); border-radius: 4px; padding: 3px 8px; white-space: nowrap; }
.rt-seq { margin-top: 6px; font-weight: 700; font-size: 13px; text-align: right; }
.rt-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.rt-tasks { margin-top: 12px; border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 6px; padding: 8px 12px; background: #fffaf0; }
.rt-tasks ul { list-style: none; margin: 6px 0 0; padding: 0; }
.rt-tasks li { padding: 4px 0; font-size: 13.5px; }
.rt-points { margin: 6px 0; padding-left: 20px; }
.rt-never { border: 1px solid var(--danger); border-left-width: 4px; border-radius: 6px; padding: 8px 12px; background: #fff5f5; font-size: 13.5px; margin-top: 8px; }
.obj.respa summary { border-left: 4px solid var(--warn); }
.rt-h { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 14px 0 8px; }
.rt-capture { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; margin: 8px 0; }
.rt-capture summary { cursor: pointer; font-weight: 600; }
.rt-remind { border: 1px solid var(--warn); border-left-width: 4px; border-radius: 6px; padding: 8px 12px; background: #fffaf0; font-size: 13.5px; margin: 8px 0; }
.rt-remind.danger { border-color: var(--danger); background: #fff5f5; }
.rt-error { color: var(--danger); font-weight: 600; font-size: 13px; margin-top: 8px; min-height: 1em; }
.rt-side { text-align: right; }

/* call-list picker + tags */
.list-group-h { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 10px 0 6px; }
.list-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 6px; cursor: pointer; }
.list-row:hover, .list-row.picked { border-color: var(--brand); }
.list-row input { margin-top: 3px; }
.lr-name { font-weight: 600; }
.lr-count { color: var(--muted); font-size: 12px; margin-left: 6px; }
.lr-tags { display: block; margin-top: 3px; }
.tag-chip { font-size: 12px; background: #eef2f7; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; margin: 2px 4px 2px 0; cursor: pointer; font-family: inherit; color: inherit; display: inline-block; }
.tag-chip.small { padding: 1px 8px; font-size: 11px; cursor: default; }
.tag-chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tag-chip.locked { opacity: .75; cursor: not-allowed; }
.tag-chip.test { background: #fff3cd; border-color: #e6c35c; }
.tag-picker { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.tag-h { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.match-sw { margin: 8px 0; display: flex; gap: 6px; }
.list-summary { font-size: 13px; background: #f5f7fa; border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.preview-link { font-size: 13px; }
.setup-peek { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #1a2433; color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 300; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.setup-peek.hidden { display: none; }
#session-list { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ===== [QA-SHELL] shared app shell: left navigation + profile menu ===== */
.bb-app{display:grid;grid-template-columns:186px minmax(0,1fr);min-height:100vh}
.bb-app.collapsed{grid-template-columns:60px minmax(0,1fr)}
.bb-main{min-width:0}
.bb-side{background:#0b1c35;color:#c5cfdd;display:flex;flex-direction:column;padding:16px 10px 20px;position:sticky;top:0;height:100vh;overflow-y:auto;overflow-x:hidden;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}
.bb-logo{display:flex;align-items:flex-end;gap:6px;padding:4px 8px 14px}
.bb-logo svg{flex:none}
.bb-word b{display:block;font-weight:800;font-size:19px;color:#fff;letter-spacing:-.5px;line-height:1}
.bb-word span{display:block;font-size:7.5px;letter-spacing:2.4px;color:#fff;text-align:right;font-weight:600;margin-top:2px}
.bb-fold{align-self:flex-end;background:transparent;border:1px solid rgba(255,255,255,.16);color:#c5cfdd;border-radius:7px;width:28px;height:26px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 4px 10px}
.bb-fold:hover{background:rgba(255,255,255,.08);color:#fff}
.bb-fold svg,.bb-nav a svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.bb-group{font-size:10px;letter-spacing:1.6px;text-transform:uppercase;color:#7d8aa3;padding:10px 12px 6px;font-weight:600}
.bb-nav a{display:flex;align-items:center;gap:11px;padding:9px 12px;border-radius:8px;color:#c5cfdd;text-decoration:none;font-size:14px;font-weight:500;margin-bottom:3px;position:relative;white-space:nowrap}
.bb-nav a:hover{background:rgba(255,255,255,.05);color:#fff}
.bb-nav a.active{background:#13305e;color:#fff}
.bb-nav a.active::before{content:"";position:absolute;left:-10px;top:6px;bottom:6px;width:3px;border-radius:2px;background:#ee9139}
.bb-nav a.cur{color:#fff}
.bb-tag{margin-top:auto;padding:0 12px;font-size:10px;letter-spacing:3px;line-height:2;color:#7d8aa3}
.bb-tag hr{border:0;border-top:2px solid #ee9139;width:38px;margin:0 0 12px}
.bb-app.collapsed .bb-word,.bb-app.collapsed .bb-nav a span,.bb-app.collapsed .bb-group,.bb-app.collapsed .bb-tag{display:none}
.bb-app.collapsed .bb-logo{padding:4px 2px 14px;justify-content:center}
.bb-app.collapsed .bb-fold{align-self:center}
.bb-app.collapsed .bb-fold svg{transform:rotate(180deg)}
.bb-app.collapsed .bb-nav a{justify-content:center;padding:10px 0}
/* the side navigation and profile menu replace these header pieces (kept in the DOM for app.js) */
.session-bar .brand,.session-bar .brand-sep,.session-bar nav.tabs,.session-bar #appmenu,.session-bar label[for="agent-select"],.session-bar #agent-select{display:none}
.bb-prof{position:relative;margin-left:auto}
.bb-prof-btn{background:transparent;border:0;padding:0;cursor:pointer}
.bb-av{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%;background:#fff;color:#0b1c35;font-weight:700;font-size:13px;border:2px solid rgba(255,255,255,.6)}
.bb-prof-btn:focus-visible .bb-av{outline:2px solid #fff;outline-offset:2px}
.bb-prof-menu{position:absolute;right:0;top:calc(100% + 8px);min-width:230px;background:#fff;color:#1a2433;border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.28);padding:6px;z-index:300}
.bb-prof-head{padding:10px 12px;border-bottom:1px solid #e3e9f0;margin-bottom:4px}
.bb-prof-head b{display:block;font-size:14px}
.bb-prof-head small{color:#5b6b7f;font-size:12px}
.bb-prof-menu a{display:block;padding:9px 12px;border-radius:7px;color:#1a2433;text-decoration:none;font-size:14px}
.bb-prof-menu a:hover,.bb-prof-menu a:focus-visible{background:#eef2f7;outline:none}
@media (max-width:760px){.bb-app,.bb-app.collapsed{grid-template-columns:52px minmax(0,1fr)}.bb-word,.bb-nav a span,.bb-group,.bb-tag,.bb-fold{display:none}.bb-nav a{justify-content:center;padding:10px 0}}

/* [QA-SETTINGS] settings sub-menu */
.stabs{display:flex;gap:4px;flex-wrap:wrap;border-bottom:1px solid #dbe3ec;margin:0 0 14px}
.stabs button{background:transparent;border:0;border-bottom:3px solid transparent;padding:10px 14px;font:inherit;font-size:14px;font-weight:600;color:#5b6b7f;cursor:pointer;margin-bottom:-1px}
.stabs button:hover{color:#0f1f3d}
.stabs button.on{color:#173d81;border-bottom-color:#ee9139}
.stabs button:focus-visible{outline:2px solid #3c7af3;outline-offset:-2px}
#view-settings [data-spane].spane-off{display:none}


/* [QA-AVATAR] */
.bb-av.has-pic{padding:0;overflow:hidden}.bb-av img{width:100%;height:100%;object-fit:cover;display:block}

/* [QA-VIEWAS] */
.bb-viewas{background:#fff4d6;border-bottom:1px solid #f2c94c;color:#5c4400;padding:9px 16px;font-size:13px}
.bb-viewas button{margin-left:10px;border:1px solid #c79a00;background:#fff;border-radius:6px;padding:4px 10px;font:inherit;font-size:12px;font-weight:600;cursor:pointer;color:#5c4400}

/* [QA-COMPANY] Company / Goals and targets */
.co-body{font-size:13px}
.co-row{display:grid;grid-template-columns:200px 1fr;gap:10px;align-items:start;padding:8px 0;border-bottom:1px solid #eef2f7}
.co-row>label{font-weight:600;color:#0f1f3d;padding-top:6px}
.co-row input[type=text],.co-row select{max-width:420px;width:100%}
.co-h{margin:16px 0 4px;font-size:13px;color:#173d81}
.co-logo{width:200px;height:90px;border:1px dashed #c3cfdd;border-radius:8px;display:flex;align-items:center;justify-content:center;color:#5b6b7f;background:#f8fafc;overflow:hidden}
.co-logo img{max-width:100%;max-height:100%;object-fit:contain}
.co-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0}
.co-hint{color:#5b6b7f;font-size:12px;margin-top:4px}
.co-msg{font-size:12px;min-height:16px}
@media(max-width:640px){.co-row{grid-template-columns:1fr}}

/* [QA-FIX1/D2] the add-tag row is flex only while it is not hidden (inline display:flex used to defeat the hidden attribute) */
.crm-tag-new { display: flex; }
.crm-tag-new[hidden] { display: none !important; }
#settings-save-err { color: var(--danger); font-size: 13px; }
#settings-save-err.hidden { display: none !important; }
#btn-settings-save[hidden], #btn-settings-reset[hidden] { display: none !important; }

/* [LEAD-CARD] address search on hover + context block */
.addr-wrap .addr-link { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; }
.addr-wrap .addr-link:hover { border-bottom-color: currentColor; }
.addr-wrap .addr-tools { font-size: 12px; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.addr-wrap:hover .addr-tools, .addr-wrap:focus-within .addr-tools { opacity: 1; }
.addr-wrap .addr-tools a { color: var(--accent, #2563eb); text-decoration: none; }
@media (hover: none) { .addr-wrap .addr-tools { opacity: 1; } }
.lead-crm { font-size: 12px; font-weight: 500; margin-left: 6px; color: var(--accent, #2563eb); text-decoration: none; }
.lead-ctx { margin-top: 6px; }

/* [WARM-HANDOFF] */
.handoff { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--border, #ddd); border-radius: 8px; font-size: 13px; }
.handoff.warm { border-color: #d9822b; background: rgba(217,130,43,.08); }
.handoff-h { font-weight: 600; margin-bottom: 4px; }
.handoff ul { margin: 0; padding-left: 18px; }
.handoff li { margin: 2px 0; }

/* [CALL-HISTORY] CRM seller timeline */
.tl-item { border-top: 1px solid #e6edf3; padding: 10px 0; }
.tl-head { font-size: 13px; color: #33465a; }
.tl-notes { white-space: pre-wrap; font-size: 13px; margin-top: 6px; line-height: 1.45; }
.tl-audio { width: 100%; margin-top: 8px; height: 36px; }
.tl-sum { font-size: 13px; margin-top: 6px; line-height: 1.45; }
.tl-tx { margin-top: 6px; font-size: 13px; }
.tl-tx > div { white-space: pre-wrap; max-height: 320px; overflow: auto; background: #f6f8fa; padding: 8px; border-radius: 6px; margin-top: 4px; line-height: 1.45; }
.call-btn { margin-left: 6px; text-decoration: none; }

/* [SETTINGS-LAYOUT] User management cards (replaces the overflowing 10-column table) */
.user-card { border: 1px solid var(--border, #e3e9f0); border-radius: 10px; padding: 14px 16px; margin: 0 0 12px; background: var(--card, #fff); }
.uc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.uc-head b { font-size: 15px; }
.uc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.uc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; }
.uc-f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 400; min-width: 0; }
.uc-f input, .uc-f select { width: 100%; box-sizing: border-box; padding: 8px 10px; font-size: 13px; }
.uc-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border, #eef2f7); }
.uc-lab { flex: 0 0 90px; font-size: 12px; color: var(--muted); padding-top: 2px; }
.uc-wrap { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.uc-wrap label, .uc-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; margin: 0 !important; white-space: nowrap; }
.uc-wrap input[type=checkbox], .uc-wrap input[type=radio], .uc-chk input { width: auto; margin: 0; }
.uc-proj { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.uc-proj-list { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0 0 22px; }
.uc-proj-list.off { opacity: .45; pointer-events: none; }
.uc-proj-list label { white-space: normal; }
.uc-note { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .uc-row { flex-direction: column; gap: 6px; } .uc-lab { flex: none; } }
/* [SETTINGS-LAYOUT] settings content never overruns its card */
#view-settings .card { overflow-wrap: anywhere; min-width: 0; }
#view-settings .card table { max-width: 100%; }
#view-settings .stabs { flex-wrap: wrap; }
/* [SETTINGS-LAYOUT] dialer settings rows: label and control share the width instead of overrunning it */
.set-row { flex-wrap: wrap; }
.set-row > :first-child { flex: 1 1 180px; min-width: 0; }
.set-row .sd { max-width: none; overflow-wrap: anywhere; }
.set-row .sv { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.set-row input, .set-row select, .set-row textarea { max-width: 100%; box-sizing: border-box; padding: 7px 9px; }
.set-row textarea { width: 240px; min-height: 64px; height: auto; resize: vertical; }
.audit-table { table-layout: auto; }
.audit-table td { overflow-wrap: anywhere; word-break: break-word; vertical-align: top; }
#view-settings .card { overflow-x: auto; }

/* [UPCOMING] projected outreach in the record timeline */
.up-box { background: #f6f9fc; border: 1px solid #e1e9f1; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.up-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; font-size: 13px; }
.up-head span { color: #6b7c8f; font-size: 12px; }
.up-row { display: flex; gap: 10px; padding: 5px 0; border-top: 1px solid #e6edf3; font-size: 13px; line-height: 1.4; }
.up-when { flex: 0 0 150px; color: #33465a; font-variant-numeric: tabular-nums; }
.up-what { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.up-what small { color: #6b7c8f; }
.up-det { display: block; }
.up-end { color: #6b7c8f; }
.up-due { background: #fdecea; color: #a12a1b; }
.up-more summary { cursor: pointer; font-size: 12px; color: #2a5d8f; padding-top: 6px; }
@media (max-width: 560px) { .up-row { flex-direction: column; gap: 2px; } .up-when { flex-basis: auto; font-weight: 600; } }

/* [SESSION-CALLS] */
.sc-wrap { max-height: 260px; overflow: auto; }
.sc-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.sc-t th { position: sticky; top: 0; background: var(--card, #fff); text-align: left; font-weight: 600; color: var(--muted, #6b7c8f); padding: 4px 8px 6px 0; border-bottom: 1px solid #e6edf3; }
.sc-t td { padding: 6px 8px 6px 0; border-top: 1px solid #eef2f6; vertical-align: top; overflow-wrap: anywhere; }
.sc-t td:nth-child(1), .sc-t td:nth-child(3) { white-space: nowrap; }
.sc-live { color: #1d6fb8; }
.sc-none { color: #a36a00; }
@media (max-width: 640px) { .sc-t th:nth-child(4), .sc-t td:nth-child(4) { display: none; } }
.sc-t a { color: #173d81; font-weight: 600; text-decoration: none; }
.sc-t a:hover { text-decoration: underline; }

/* [TEST-CALL] */
.testcall-msg { align-self: center; font-size: 12px; color: var(--muted, #6b7c8f); max-width: 340px; }
.testcall-msg.ok { color: #1e7a3c; font-weight: 600; }
.testcall-msg.bad { color: #a12a1b; }

/* [LOG-OUTCOME] */
.lo { padding: 0 16px 8px; }
.lo-form { border: 1px solid #e3e9f0; border-radius: 10px; background: #f8fafc; padding: 6px 0 10px; margin-top: 6px; }
.lo-form .fld input[type=datetime-local] { width: 100%; box-sizing: border-box; padding: 8px 11px; border: 1px solid #e3e9f0; border-radius: 8px; font: inherit; background: #fff; }
.lo-btns { padding: 6px 16px 2px; }
.lo-form .note { padding: 6px 16px 0; }

/* [AUDIO-TEST] */
.at-modal { max-width: 520px; }
.at-meter-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; }
.at-lbl { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 52px; }
.at-meter { flex: 1; height: 10px; background: #eef2f6; border-radius: 6px; overflow: hidden; }
.at-bar { height: 100%; width: 0; background: #b9c6d8; transition: width .08s linear; }
.at-bar.good { background: #2f9e57; } .at-bar.hot { background: #d0453a; }
.at-steps { display: grid; gap: 10px; }
.at-step { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.at-step b { grid-column: 1; font-size: 13px; } .at-step span { grid-column: 1; font-size: 12.5px; color: var(--muted); } .at-step .btn { grid-column: 2; grid-row: 1 / span 2; }
.at-result { margin-top: 10px; font-size: 13px; min-height: 18px; }
.at-result.ok { color: #1e7a3c; font-weight: 600; } .at-result.bad { color: #a12a1b; }

/* [INV-IMPORT] */
.imp-kind { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; }
.imp-kind label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* [LEAD-FLOW] notification bell */
.bb-bell{position:relative;margin-left:auto;margin-right:10px}.bb-bell+.bb-prof{margin-left:0}
.bb-bell-btn{position:relative;background:transparent;border:0;padding:6px;cursor:pointer;color:#fff;display:flex;align-items:center;border-radius:50%}.bb-bell-btn:hover{background:rgba(255,255,255,.12)}
.bb-bell-n[hidden]{display:none}.bb-bell-n{position:absolute;top:0;right:0;min-width:16px;height:16px;padding:0 4px;border-radius:999px;background:#e5484d;color:#fff;font-size:10px;font-weight:700;display:flex;align-items:center;justify-content:center;line-height:1}
.bb-bell-menu{position:absolute;right:0;top:calc(100% + 8px);width:360px;max-width:calc(100vw - 24px);background:#fff;color:#1a2433;border-radius:12px;box-shadow:0 10px 30px rgba(0,0,0,.28);z-index:300;overflow:hidden}
.bb-bell-head{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid #e6edf3;font-size:13px}.bb-bell-head span{font-size:12px;color:#6b778c}
.bb-link{background:none;border:0;padding:0;color:#173d81;font:inherit;font-size:12px;cursor:pointer;text-decoration:underline}
.bb-bell-list{max-height:420px;overflow:auto}.bb-bell-empty{padding:18px 14px;color:#6b778c;font-size:13px;line-height:1.45}
.bb-bell-item{display:flex;gap:10px;padding:10px 12px;border-bottom:1px solid #eef2f7;color:inherit;text-decoration:none;font-size:13px}.bb-bell-item:hover{background:#f5f9fd}.bb-bell-item.unread{background:#eef5ff}.bb-bell-item.unread b::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:#3c7af3;margin-right:6px;vertical-align:middle}
.bb-bell-item .ic{font-size:16px;line-height:1.3}.bb-bell-item .tx{display:flex;flex-direction:column;gap:2px;min-width:0}.bb-bell-item .tx b{font-weight:600}.bb-bell-item small{color:#5d7186;line-height:1.35}.bb-bell-item .when{color:#99abbf;font-size:11px}
.bb-bell-prefs{padding:10px 12px;font-size:13px}.bb-bell-prefs label{display:block;padding:5px 0}.bb-bell-prefs input{width:auto;margin-right:6px}.bb-bell-prefs-h{margin-bottom:6px}.bb-bell-prefs-h small{color:#6b778c;font-weight:400}.bb-bell-note{color:#6b778c;font-size:12px;margin-top:8px}
/* [AGENTS] approvals in the bell */
.bb-bell-item.bb-ap{background:#fff8e6;cursor:default}.bb-ap.bb-ap-done{opacity:.35}.bb-ap-btns{display:flex;gap:6px;align-items:center;margin-top:6px;flex-wrap:wrap}
.bb-ap-btns button{font:inherit;font-size:12px;font-weight:600;padding:4px 10px;border-radius:999px;border:1px solid #cfd9e6;background:#fff;cursor:pointer}.bb-ap-btns .bb-ap-ok{background:#173d81;border-color:#173d81;color:#fff}.bb-ap-btns a{font-size:12px;color:#173d81}.bb-ap-msg{font-size:11px;color:#6b778c}
