/* Basic Send Application (BSA) — Marketplace & Applications .Mng → Basic Application.
   Reuses .templates-page grid (org-tree rail + content-panel) and shared chrome. */

/* Full-width page (no org rail — BSA is user-scoped; gives the table room to fit). */
.bsa-page-full { flex: 1; display: flex; min-width: 0; min-height: 0; padding: 20px 16px; }
.bsa-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* Normal User → no hierarchy tree; the content fills the full width (single grid column) */
.basic-app-page.bsa-no-tree { grid-template-columns: minmax(0, 1fr); }

/* ===== Channel tabs (WhatsApp | IVR Voice) — underline tabs, same as Organization Hierarchy ===== */
.bsa-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--border-2, var(--border)); background: #fff; }
.bsa-channel-tabs { display: flex; gap: 28px; }
.bsa-topbar .bsa-switch-btn { margin: 8px 0; }
.bsa-channel-tab { border: 0; background: transparent; padding: 18px 4px 16px; font-size: 14px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.bsa-channel-tab:hover { color: var(--text); }
.bsa-channel-tab.on { color: var(--text); font-weight: 600; border-bottom-color: var(--teal); }

/* ===== Body ===== */
.bsa-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }

/* ===== Header row: client (avatar + name) + Outbox/Scheduled toggle on the left · Send on the right ===== */
.bsa-header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bsa-hr-left { display: flex; align-items: center; gap: 24px; }

/* ===== Sub-tabs (Outbox | Scheduled) — underline tabs, identical to the WhatsApp/IVR Voice tabs on top ===== */
.bsa-subbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bsa-subtabs { display: inline-flex; gap: 28px; align-self: stretch; align-items: flex-end; }
.bsa-subtab { border: 0; background: transparent; padding: 16px 2px 14px; font-size: 14px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.bsa-subtab:hover { color: var(--text); }
.bsa-subtab.on { color: var(--text); font-weight: 600; border-bottom-color: var(--teal); }
.bsa-send-btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
/* Client-view header actions: "Viewing as" role selector + Send button */
.bsa-ch-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

/* ===== Quick Sort ===== */
.bsa-quicksort { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bsa-qs-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.bsa-apply-btn { padding: 9px 26px; }

/* ===== Dropdowns ===== */
.bsa-ddl { position: relative; }
.bsa-ddl-control { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; font-size: 13.5px; color: var(--text); text-align: left; }
.bsa-ddl-control:hover { border-color: #b9c6c4; }
.bsa-ddl.open .bsa-ddl-control { border-color: var(--teal); }
.bsa-ddl-control .ph { color: var(--text-muted); }
.bsa-ddl-pop { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.1); padding: 5px; max-height: 260px; overflow: auto; }
.bsa-ddl-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: transparent; border-radius: 7px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.bsa-ddl-item:hover { background: var(--bg-hover); }
.bsa-ddl-item.on { background: #e7f0ee; color: var(--teal); font-weight: 600; }

/* ===== Message List panel ===== */
.bsa-table-panel { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; flex-shrink: 0; }
.bsa-list-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 18px 0; flex-wrap: wrap; border-bottom: 1px solid var(--border-2, var(--border)); }
.bsa-list-title { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; }
.bsa-list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bsa-search { display: flex; align-items: center; gap: 8px; min-width: 230px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); }
.bsa-search input { border: 0; outline: 0; background: transparent; font-size: 13.5px; width: 100%; color: var(--text); }
.bsa-daterange { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); font-size: 13px; white-space: nowrap; }

/* ===== Grid — identical to Organization Hierarchy users-table (size/weight/height/footer) ===== */
/* Vertical scroll lives on the outer body (like the other pages); the table wrapper only
   scrolls horizontally, and the bar appears only when the columns overflow. */
.bsa-table-panel .table-scroll { overflow-x: auto; }
.bsa-table { width: 100%; border-collapse: collapse; table-layout: auto; min-width: 100%; }
.bsa-table thead th { text-align: start; font-weight: 500; font-size: 13px; color: var(--text-muted); background: #F5F5F5; padding: 14px; border-bottom: 1px solid var(--border-2, var(--border)); white-space: nowrap; line-height: 1.4; height: 60px; }
.bsa-table tbody tr { border-bottom: 1px solid var(--border-2, var(--border)); }
.bsa-table tbody td { padding: 16px 14px; font-size: 13px; font-weight: 400; color: var(--text); vertical-align: middle; line-height: 1.5; }
.bsa-table tbody tr:last-child { border-bottom: 0; }
.bsa-table tbody tr:hover { background: #fafbfb; }
.bsa-row-deleted td { opacity: .55; }
.bsa-txnid { white-space: nowrap; font-weight: 500; font-variant-numeric: tabular-nums; }
.bsa-lang-cell { white-space: nowrap; }
.bsa-sender { white-space: nowrap; }
.bsa-name { font-weight: 500; }
.bsa-lang { display: block; font-weight: 400; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.bsa-cost { white-space: nowrap; font-weight: 500; }
.bsa-cost svg { vertical-align: -2px; margin-inline-end: 2px; }
/* Type — plain text, no chip background / colour */
.bsa-type-plain { color: var(--text); white-space: nowrap; }
.bsa-date .d { display: block; white-space: nowrap; }
.bsa-date .tm { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.bsa-recipient { color: var(--text); }
/* Multiple contact groups: first name + "+N" overflow badge */
.bsa-recip-multi { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; vertical-align: bottom; }
.bsa-recip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* "+N" overflow badge — solid dark-teal circle with the count inside (matches the Templates List "Shared With" chip). */
.bsa-more-tag { flex-shrink: 0; font-style: normal; font-size: 11px; font-weight: 600; color: #fff; background: #104c54; border: 0; border-radius: 999px; width: 24px; height: 24px; min-width: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
/* "+N" recipients badge is a button that opens the "All recipients" popover */
.bsa-recip-more { cursor: pointer; font-family: inherit; }
.bsa-recip-more:hover, .bsa-recip-more.on { background: #0d3f44; }
.bsa-recip-pop .cg-shared-pop-name { overflow: hidden; text-overflow: ellipsis; }
/* Recipients KPI card grows to 2 columns when there are several groups / manual recipients */
.bsa-kpi.bsa-kpi-wide { grid-column: span 2; }
.bsa-count { font-weight: 400; }
.bsa-empty { text-align: center; color: var(--text-muted); padding: 34px 0; }
.bsa-col-action { width: 52px; text-align: center; }
/* Footer matches the apps-panel pagination footer */
.bsa-table-panel .table-footer { background: #F5F5F5; }
.bsa-ch-avatar { width: 28px; height: 28px; border-radius: 8px; background: #0d3f44; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }

/* Type chips */
.bsa-type { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.bsa-type.mkt  { background: #eef3ff; color: #3b5bdb; }
.bsa-type.util { background: #fff4e6; color: #c46a00; }
.bsa-type.auth { background: #f0ecff; color: #6741d9; }
.bsa-type.dyn  { background: #e6f7f3; color: #0d7a72; }
.bsa-type.stat { background: #f1f3f5; color: #495057; }

/* Status pills — keep the label on a single line (wider columns ride the table's horizontal scroll). */
.bsa-status { white-space: nowrap; }
.bsa-status.bsa-st-completed { background: var(--green-bg, #e7f6ee); color: #0f7a3a; }
.bsa-status.bsa-st-completed .dot { background: #1aab5a; }
.bsa-status.bsa-st-progress  { background: #e8f1fe; color: #1d5fc4; }
.bsa-status.bsa-st-progress .dot { background: #3b82f6; }
.bsa-status.bsa-st-partial   { background: #fff4e6; color: #c46a00; }
.bsa-status.bsa-st-partial .dot { background: #f08c00; }
.bsa-status.bsa-st-failed    { background: #ffeded; color: #a1191d; }
.bsa-status.bsa-st-failed .dot { background: #d92d20; }
.bsa-status.bsa-st-canceled  { background: #f1f3f5; color: #5a6470; }
.bsa-status.bsa-st-canceled .dot { background: #adb5bd; }
.bsa-status.bsa-st-scheduled { background: #fff8e1; color: #a67c00; }
.bsa-status.bsa-st-scheduled .dot { background: #f2b705; }
.bsa-status.bsa-st-deleted   { background: #f1f3f5; color: #868e96; }
.bsa-status.bsa-st-deleted .dot { background: #ced4da; }

/* Row action menu */
.bsa-row-menu { position: absolute; top: 36px; right: 8px; z-index: 30; min-width: 150px; }

/* Pager */
.bsa-pager { padding: 6px 16px 10px; border-top: 1px solid var(--border); background: #fafbfb; }

/* ============================================================
   BSA — Compose / Details / Conversation takeover screens
   ============================================================ */
.bsa-takeover { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; margin: 16px; border: 1px solid var(--border); border-radius: 16px; padding: 22px 26px; overflow: auto; gap: 18px; }
.bsa-tk-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.bsa-tk-tabs .bsa-channel-tab:disabled { cursor: default; opacity: 1; }
.bsa-tk-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--text); }
.bsa-tk-actions { display: flex; gap: 10px; }
/* Compose wizard: pin the header (title + Cancel/Send) so it's always visible; the form body scrolls beneath it. */
.bsa-compose { overflow: hidden; }
.bsa-compose > .bsa-tk-top { flex-shrink: 0; }
.bsa-compose > .bsa-compose-2col { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-bottom: 2px; }
.bsa-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.bsa-card-h { font-size: 15px; font-weight: 700; color: var(--text); }
.bsa-card-h2 { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 4px; }
.bsa-field { display: flex; flex-direction: column; gap: 6px; }
.bsa-field > span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.bsa-muted { color: var(--text-muted); }

/* ---- Compose ---- */
.bsa-compose-grid { display: grid; grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) minmax(280px, 330px); gap: 16px; align-items: start; }
/* Voice: no phone-mockup preview column — the IVR flow canvas goes full-width at the bottom instead. */
.bsa-compose-grid.no-preview { grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); }
.bsa-ivr-preview-card .bsa-ivr-flow, .bsa-preview-card .bsa-ivr-flow { height: auto; margin: 0; padding-top: 0; overflow: auto; border: 1px solid var(--border); border-radius: 14px; }
.bsa-ivr-preview-card .ivr-canvas-step, .bsa-preview-card .ivr-canvas-step { min-height: 480px; }
.bsa-msg-retry { border-top: 1px dashed var(--border); }
.bsa-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.bsa-group-chip { display: inline-flex; align-items: center; gap: 6px; background: #eef3f2; border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; font-weight: 500; }
.bsa-group-chip button { border: 0; background: transparent; cursor: pointer; color: var(--text-muted); font-size: 14px; line-height: 1; }
.bsa-info-tools { display: flex; gap: 18px; }
.bsa-link-btn { border: 0; background: transparent; color: var(--teal); font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; }
/* Manually-added recipients — one phone field per "Add Recipient" click. */
.bsa-manual-list { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.bsa-manual-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bsa-manual-input { flex: 1; min-width: 0; height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; font-size: 13.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.bsa-manual-input:focus { outline: none; border-color: var(--teal); }
/* Variable input (e.g. First Name) sits on the same row as the phone, matching its 44px height */
.bsa-manual-var { flex: 1 1 140px; min-width: 120px; height: 44px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; font-size: 14px; color: var(--text); background: #fff; }
.bsa-manual-var:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,63,68,.08); }
.bsa-manual-var::placeholder { color: #9ca3af; }
.bsa-manual-rm { flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all .15s; }
.bsa-manual-rm:hover { border-color: #e89b94; color: #d92d20; background: #fff5f4; }
.bsa-link-btn:disabled { color: var(--text-muted); opacity: .5; cursor: default; }
.bsa-manual-cap { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.bsa-manual-card { background: #f7faf9; /* border: 1px solid var(--border); */ border-radius: 12px; padding: 13px 50% 13px 16px; display: flex; flex-direction: column; gap: 9px; }
.bsa-manual-vars { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bsa-mv { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bsa-mv > span { font-size: 11px; color: var(--text-muted); }
.bsa-mv > input { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; min-width: 0; color: var(--text); }
.bsa-mv > input:focus { outline: none; border-color: var(--teal); }

/* Meta template-status sync indicator */
.bsa-meta-sync { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; border-radius: 9px; padding: 7px 11px; }
.bsa-meta-sync.ok { background: #e7f6ee; color: #0f7a3a; }
.bsa-meta-sync.warn { background: #fff4e6; color: #c46a00; }

/* Variable schema mapping (per contact group) */
.bsa-map-wrap { display: flex; flex-direction: column; gap: 12px; }
.bsa-map-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.bsa-map-h { font-size: 13px; font-weight: 700; color: var(--text); }
.bsa-map-row { display: flex; flex-direction: column; gap: 5px; }
.bsa-map-row > span { font-size: 12px; color: var(--text-muted); }
.bsa-map-grid { display: flex; flex-direction: column; gap: 7px; }
.bsa-map-grid-head { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.bsa-map-grid-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: center; }
.bsa-map-var { font-size: 13px; font-weight: 600; color: var(--teal); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsa-map-novar { font-size: 12.5px; color: var(--text-muted); }
.bsa-map-note { font-size: 12px; color: var(--text-muted); padding: 2px; }

/* ===== Compose — restructured layout (Message → Recipients → Sending time + sticky preview) ===== */
.bsa-compose-2col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.bsa-compose-2col.no-side { grid-template-columns: minmax(0, 1fr); }
.bsa-compose-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.bsa-compose-side { position: sticky; top: 0; }
/* Sending Time + Retry Logic sit in one row on voice: 1/3 · 2/3 */
.bsa-time-retry { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: stretch; }
.bsa-time-retry.two { grid-template-columns: 1fr 2fr; }
.bsa-time-retry > .bsa-card { min-width: 0; }
.bsa-tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
/* ---- WhatsApp compose: 3-column stepped layout (Message 1/4 · Recipients 2/4 · Preview 1/4) ---- */
.bsa-compose-2col.bsa-compose-wa { display: block; }
.bsa-compose-main.bsa-wa-cols { display: grid; grid-template-columns: 1fr 1.85fr 1.15fr; gap: 20px; align-items: start; }
/* Preview collapsed → give the Recipients column the freed space; the collapsed step strip holds the reopen control */
.bsa-compose-main.bsa-wa-cols.no-preview { grid-template-columns: 1fr 2.4fr auto; }
.bsa-wa-cols > .bsa-card { margin: 0; height: 100%; }
/* Each column caps its height; only the BODY scrolls (header stays fixed above the scrollbar) */
.bsa-compose-main.bsa-wa-cols > .bsa-card { max-height: calc(100vh - 296px); overflow: hidden; padding: 0; gap: 0; }
.bsa-wa-cols .bsa-tpl-grid { grid-template-columns: 1fr; }
.bsa-step-card { display: flex; flex-direction: column; }
.bsa-step-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 2px; }
/* Fixed step header with a divider; the scroll region sits BELOW it so the scrollbar never runs past the header */
.bsa-compose-main.bsa-wa-cols > .bsa-step-card > .bsa-step-h { flex: 0 0 auto; background: #fff; margin: 0; padding: 18px 18px 12px; border-bottom: 1px solid var(--border); }
.bsa-compose-main.bsa-wa-cols > .bsa-step-card > .bsa-step-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; }
/* The Preview STEP header itself is the hide/show control (eye on the right) */
.bsa-step-h.is-toggle { cursor: pointer; }
.bsa-step-eye { margin-inline-start: auto; align-self: center; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--text-muted); transition: background .15s, color .15s; }
.bsa-step-h.is-toggle:hover .bsa-step-eye { background: #f0f5f4; color: var(--teal); }
/* Collapsed Preview step → slim strip showing the step badge + eye, click to reveal */
.bsa-step-collapsed { align-self: stretch; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 56px; padding: 18px 0; background: #fff; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; transition: background .15s, border-color .15s; }
.bsa-step-collapsed:hover { background: #f7faf9; border-color: #cfe0db; }
.bsa-step-collapsed-eye { display: inline-flex; color: var(--text-muted); transition: color .15s; }
.bsa-step-collapsed:hover .bsa-step-collapsed-eye { color: var(--teal); }
/* Enlarge the phone preview — sized by the available height so it fits the square (width follows aspect-ratio) */
.bsa-preview-card { padding-left: 16px; padding-right: 16px; }
.bsa-preview-card .bsa-phone { width: auto; height: calc(100vh - 424px); min-height: 360px; max-height: 680px; max-width: 100%; margin: 6px auto 0; }
.bsa-step-num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.bsa-step-htext { display: flex; flex-direction: column; gap: 2px; }
.bsa-step-title { font-size: 15px; font-weight: 700; color: var(--text); }
.bsa-step-sub { font-size: 12px; color: var(--text-muted); }
.bsa-prev-toggle { display: flex; background: #eef1f1; border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.bsa-prev-toggle button { flex: 1; border: 0; background: transparent; border-radius: 8px; padding: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: background .15s, color .15s; }
.bsa-prev-toggle button.on { background: var(--teal); color: #fff; }
.bsa-compose-summary { display: grid; grid-template-columns: 2fr 1.3fr 1.4fr; margin-top: 20px; background: var(--teal); border: 1px solid var(--teal); border-radius: 14px; padding: 16px 22px; }
/* Delivery moved under the phone preview — Date & Time picker */
.bsa-preview-delivery { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.bsa-preview-delivery .bsa-sum-lbl { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.bsa-preview-delivery-ic { display: inline-flex; color: var(--teal); }
.bsa-preview-delivery-ic svg { width: 15px; height: 15px; }
.bsa-delivery-pick { margin-top: 0; }
.bsa-delivery-pick .bsa-sched-row { flex-wrap: wrap; }
.bsa-msg-delivery { border-top: 1px dashed var(--border); }

/* Combined Date & Time picker (single Falcon-styled component) */
.bsa-dtp { position: relative; }
.bsa-dtp-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 0 14px; font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s; }
.bsa-dtp-trigger:hover { border-color: #c3d3cf; }
.bsa-dtp.is-open .bsa-dtp-trigger, .bsa-dtp-trigger:focus-visible { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,63,68,.08); }
.bsa-dtp-trigger .ph { color: #9ca3af; font-weight: 500; }
.bsa-dtp-trigger svg { color: var(--teal); flex-shrink: 0; }
.bsa-dtp-pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.16); padding: 14px; width: 288px; }
.bsa-dtp-pop.up { top: auto; bottom: calc(100% + 6px); }
.bsa-dtp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.bsa-dtp-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.bsa-dtp-nav { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: #f2f5f4; color: var(--teal); cursor: pointer; }
.bsa-dtp-nav:hover { background: #e2eeea; }
.bsa-dtp-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 5px; }
.bsa-dtp-dow span { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em; }
.bsa-dtp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.bsa-dtp-cell { height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 12.5px; cursor: pointer; font-variant-numeric: tabular-nums; }
.bsa-dtp-cell:hover:not(.empty) { background: #eef5f3; }
.bsa-dtp-cell.today { color: var(--teal); font-weight: 700; }
.bsa-dtp-cell.on { background: var(--teal); color: #fff; font-weight: 700; }
.bsa-dtp-cell.empty { cursor: default; }
.bsa-dtp-time { border-top: 1px solid var(--border); margin-top: 11px; padding-top: 12px; }
.bsa-dtp-time-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 9px; }
.bsa-dtp-time-row { display: flex; align-items: center; gap: 8px; }
.bsa-dtp-stepper { display: inline-flex; flex-direction: column; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.bsa-dtp-stepper span { font-size: 15px; font-weight: 700; color: var(--text); padding: 1px 14px; font-variant-numeric: tabular-nums; }
.bsa-dtp-num { width: 44px; text-align: center; border: 0; background: transparent; font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; padding: 3px 0; font-family: inherit; -moz-appearance: textfield; }
.bsa-dtp-num:focus { outline: none; background: #e6f2ec; }
.bsa-dtp-stepper button { width: 100%; height: 17px; border: 0; background: #f2f5f4; color: var(--teal); cursor: pointer; font-size: 8px; line-height: 1; }
.bsa-dtp-stepper button:hover { background: #e2eeea; }
.bsa-dtp-colon { font-size: 17px; font-weight: 700; color: var(--text-muted); }
.bsa-dtp-ampm { display: inline-flex; flex-direction: column; gap: 4px; margin-inline-start: 6px; }
.bsa-dtp-ampm button { border: 1px solid var(--border); background: #fff; color: var(--text-muted); border-radius: 8px; padding: 3px 13px; font-size: 11px; font-weight: 700; cursor: pointer; }
.bsa-dtp-ampm button.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.bsa-dtp-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.bsa-dtp-quick button { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 999px; padding: 5px 11px; font-size: 11.5px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; }
.bsa-dtp-quick button:hover { border-color: var(--teal); color: var(--teal); }
.bsa-dtp-quick button.on { background: #e6f2ec; border-color: var(--teal); color: var(--teal); font-weight: 700; }
.bsa-dtp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; }
.bsa-dtp-clear { border: 0; background: transparent; color: var(--text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.bsa-dtp-clear:hover { color: #d92d20; }
.bsa-dtp-done { border: 0; background: var(--teal); color: #fff; border-radius: 9px; padding: 8px 20px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.bsa-dtp-done:hover { background: var(--teal-hover, #0a3338); }
.bsa-sum-tile { display: flex; align-items: center; gap: 13px; padding-inline: 6px; min-width: 0; }
.bsa-sum-tile + .bsa-sum-tile { border-inline-start: 1px solid rgba(255,255,255,.15); padding-inline-start: 22px; }
.bsa-sum-ic { flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; background: rgb(8 42 46); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.bsa-sum-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bsa-sum-lbl { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.6); text-transform: unset; letter-spacing: .03em; }
.bsa-sum-val { font-size: 13px; color: rgba(255,255,255,.72); line-height: 1.45; }
.bsa-sum-val b { font-weight: 700; color: #fff; }
.bsa-sum-badge { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(255,255,255,.18); border-radius: 999px; padding: 2px 9px; margin-inline-start: 5px; }
.bsa-sum-delivery .bsa-sum-text { flex: 1; }
.bsa-sum-deliverctl .bsa-sched-field { margin-top: 8px; }
.bsa-rec-sub { display: flex; flex-direction: column; gap: 0px; }
.bsa-rec-sub + .bsa-rec-sub { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-2, var(--border)); }
.bsa-rec-sub-h { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.bsa-rec-sub-cap { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.bsa-group-block { border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 16px; background: #fcfdfd; }
.bsa-group-block-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bsa-gb-name { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--text); min-width: 0; }
.bsa-gb-name em { font-style: normal; font-weight: 500; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.bsa-gb-rm { flex-shrink: 0; border: 0; background: transparent; color: #c0524b; font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 0; }
.bsa-gb-rm:hover { text-decoration: underline; }
/* Contact-group section label + tables (match system .bsa-table typography) */
.bsa-gb-section { display: flex; flex-direction: column; }
.bsa-gb-label { font-size: 12px; font-weight: 400; color: #6c7180; margin-bottom: 9px; }
.bsa-xl-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.bsa-xl-scroll { overflow-x: auto; }
.bsa-xl-table { width: 100%; border-collapse: collapse; }
.bsa-xl-table th { text-align: start; font-size: 13px; font-weight: 500; color: var(--text-muted); background: #F5F5F5; padding: 11px 14px; white-space: nowrap; border-bottom: 1px solid var(--border-2, var(--border)); line-height: 1.4; }
.bsa-xl-table td { font-size: 13px; font-weight: 400; color: var(--text); padding: 12px 14px; white-space: nowrap; line-height: 1.5; border-bottom: 1px solid var(--border-2, var(--border)); vertical-align: middle; }
.bsa-xl-table tbody tr:last-child td { border-bottom: 0; }
.bsa-xl-table th.is-dest, .bsa-xl-table td.is-dest { background: #eef5f3; color: var(--teal); font-weight: 600; }

/* Unified column-mapping table (phone + variables in one place) */
.bsa-map2-box { border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.bsa-map2-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.bsa-map2-table th { text-align: start; font-size: 12px; font-weight: 400; color: var(--text-muted); background: #F5F5F5; padding: 11px 14px; border-bottom: 1px solid var(--border-2, var(--border)); line-height: 1.4; }
.bsa-map2-table th:first-child { border-top-left-radius: 10px; }
.bsa-map2-table th:last-child { border-top-right-radius: 10px; }
.bsa-map2-table td { font-size: 13px; font-weight: 400; color: var(--text); padding: 9px 14px; border-bottom: 1px solid var(--border-2, var(--border)); vertical-align: middle; line-height: 1.5; }
.bsa-map2-table tbody tr:last-child td { border-bottom: 0; }
.bsa-map2-table td.bsa-map2-cell { width: 52%; }
.bsa-map2-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.bsa-map2-field svg { color: var(--teal); flex-shrink: 0; }
.bsa-map2-req { font-style: normal; font-size: 14px; font-weight: 700; color: #c0492f; line-height: 1; }
.bsa-map2-var { font-size: 13px; font-weight: 600; color: var(--teal); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.bsa-map2-table .bsa-ddl-control { min-height: 0; padding: 9px 12px; font-size: 13px; }

/* Disabled dropdown (cascading category → language → template) */
.bsa-ddl.is-disabled .bsa-ddl-control { opacity: .6; cursor: not-allowed; background: #f5f7f7; color: var(--text-muted); }

/* Variable mapping rendered as a table — same design as the sheet preview above it */
.bsa-map-table-wrap { border: 1px solid var(--border); border-radius: 10px; background: #fff; max-width: 460px; }
.bsa-map-table-wrap .bsa-xl-cap { border-radius: 10px 10px 0 0; }
.bsa-map-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bsa-map-table th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 7px 10px; white-space: nowrap; border-bottom: 1px solid var(--border-2, var(--border)); }
.bsa-map-table td { padding: 6px 10px; color: var(--text); border-bottom: 1px solid #f1f4f3; vertical-align: middle; }
.bsa-map-table tr:last-child td { border-bottom: 0; }
.bsa-map-table td.bsa-map-var { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--teal); font-weight: 600; white-space: nowrap; }
.bsa-map-table td.bsa-map-cell { width: 56%; }
.bsa-map-table .bsa-ddl-control { padding: 6px 10px; min-height: 0; }
/* Add buttons — teal filled, matching the Create-Template (WhatsApp) "+ Add" buttons. */
/* Uniform with .bsa-gpick-btn (Add Contact Group) */
.bsa-add-recip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--teal); background: var(--teal); color: #fff; border-radius: 10px; padding: 9px 15px; font-size: 12px; font-weight: 400; letter-spacing: .1px; cursor: pointer; transition: background .15s; }
.bsa-add-recip:hover:not(:disabled) { background: var(--teal-hover, #0a3338); border-color: var(--teal-hover, #0a3338); }
.bsa-add-recip:disabled { background: #eef1f1; border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }

/* ---- Retry logic (Voice composer) ---- */
.bsa-retry-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bsa-retry-title { display: inline-flex; align-items: center; gap: 10px; }
.bsa-optional-tag { font-size: 11px; font-weight: 600; color: var(--text-muted); background: #eef1f1; border-radius: 6px; padding: 2px 8px; letter-spacing: .02em; }
.bsa-switch { position: relative; display: inline-flex; cursor: pointer; flex-shrink: 0; }
.bsa-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.bsa-switch-track { width: 42px; height: 24px; border-radius: 999px; background: #ccd5d3; transition: background .15s; display: inline-flex; align-items: center; padding: 2px; }
.bsa-switch input:checked + .bsa-switch-track { background: var(--teal); }
.bsa-switch-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.22); }
.bsa-switch input:checked + .bsa-switch-track .bsa-switch-thumb { transform: translateX(18px); }
.bsa-retry-off { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.bsa-retry-body { display: flex; flex-direction: column; gap: 18px; }
.bsa-retry-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.bsa-retry-sub { display: flex; flex-direction: column; gap: 11px; }
.bsa-retry-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.bsa-retry-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 11px; font-weight: 400; color: var(--text); cursor: pointer; font-family: inherit; transition: border-color .12s, background .12s; }
.bsa-retry-body .bsa-add-recip { align-self: flex-start; }
.bsa-retry-chip:hover { border-color: #b9c6c4; }
.bsa-retry-chip.on { border-color: var(--teal); background: #eef5f3; color: var(--teal); }
.bsa-retry-box { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; }
.bsa-retry-chip.on .bsa-retry-box { background: var(--teal); border-color: var(--teal); }
.bsa-retry-list { display: flex; flex-direction: column; gap: 9px; }
.bsa-retry-row { display: flex; align-items: center; gap: 10px; }
.bsa-retry-num { width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bsa-retry-lbl { font-size: 13px; color: var(--text); }
.bsa-retry-min { width: 64px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 13.5px; font-family: inherit; outline: 0; text-align: center; color: var(--text); }
.bsa-retry-min:focus { border-color: var(--teal); }
.bsa-retry-unit { font-size: 13px; color: var(--text-muted); }
.bsa-retry-rm { margin-inline-start: auto; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--text-muted); font-size: 17px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bsa-retry-rm:hover { color: #c0492f; border-color: #e7b6ab; background: #fdeee9; }

.bsa-add-group-wrap { align-self: flex-start; }
.bsa-add-group-wrap .bsa-ddl-control { width: auto; min-height: 0; background: var(--teal); border-color: var(--teal); color: #fff; padding: 8px 14px; border-radius: 10px; font-size: 12px; font-weight: 500; gap: 8px; }
.bsa-add-group-wrap .bsa-ddl-control:hover { background: var(--teal-hover, #0a3338); border-color: var(--teal-hover, #0a3338); }
.bsa-add-group-wrap .bsa-ddl-control .ph, .bsa-add-group-wrap .bsa-ddl-control svg { color: #fff; }
.bsa-add-group-wrap .bsa-ddl-pop { min-width: 240px; right: auto; }
.bsa-add-group-wrap .bsa-ddl.is-disabled .bsa-ddl-control { background: #eef1f1; border-color: var(--border); }
.bsa-add-group-wrap .bsa-ddl.is-disabled .bsa-ddl-control .ph, .bsa-add-group-wrap .bsa-ddl.is-disabled .bsa-ddl-control svg { color: var(--text-muted); }
/* Hint shown until a template is chosen (recipients locked). */
.bsa-rec-locked { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; background: #f5f7f7; border: 1px solid var(--border); border-radius: 10px; padding: 9px 13px; font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }

/* Constrain recipient/group form controls to a compact width (like the Sender ID field), not full width. */
.bsa-group-block .bsa-map-row { max-width: 300px; }
.bsa-group-block .bsa-map-grid { max-width: 460px; }

/* ---- Contact groups: multi-select picker + chips + column mapping ---- */
.bsa-groups-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bsa-groups-empty { font-size: 12.5px; color: var(--text-muted); }
.bsa-gpick { position: relative; }
.bsa-gpick-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--teal); border: 1px solid var(--teal); color: #fff; font-size: 12px; font-weight: 400; padding: 9px 15px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.bsa-gpick-btn:hover:not(:disabled) { background: var(--teal-hover, #0a3338); border-color: var(--teal-hover, #0a3338); }
.bsa-gpick-btn:disabled { background: #eef1f1; border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }
.bsa-gpick-plus { font-size: 15px; line-height: 1; }
.bsa-gpick-btn svg { transition: transform .15s; }
.bsa-gpick.open .bsa-gpick-btn svg { transform: rotate(180deg); }
.bsa-gpick-pop { position: absolute; top: calc(100% + 6px); right: 0; left: auto; z-index: 80; width: 300px; max-width: calc(100vw - 40px); background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(13,63,68,.16); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.bsa-gpick-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: -2px -2px 4px; }
.bsa-gpick-tabs button { flex: 1; border: 0; background: transparent; padding: 8px 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s; }
.bsa-gpick-tabs button:hover { color: var(--text); }
.bsa-gpick-tabs button.on { color: var(--teal); border-bottom-color: var(--teal); }
.bsa-gpick-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px; color: var(--text-muted); }
.bsa-gpick-search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 13px; color: var(--text); background: transparent; }
.bsa-gpick-list { display: flex; flex-direction: column; max-height: 236px; overflow-y: auto; }
.bsa-gpick-opt { display: flex; align-items: center; gap: 11px; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
.bsa-gpick-opt:hover { background: #f4f8f7; }
.bsa-gpick-opt-single { width: 100%; border: 0; background: transparent; text-align: start; padding: 10px 10px; font: inherit; }
.bsa-gpick-opt-single:hover { background: #f4f8f7; }
.bsa-gpick-name { flex: 1; font-size: 12.5px; color: var(--text); font-weight: 500; }
.bsa-gpick-count { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.bsa-gpick-empty { padding: 16px; text-align: center; font-size: 12.5px; color: var(--text-muted); }
.bsa-gpick-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border-2, var(--border)); padding-top: 9px; }
.bsa-gpick-sel { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.bsa-gpick-sel b { color: var(--text); font-weight: 700; }
.bsa-gpick-apply { padding: 7px 18px; font-size: 13px; flex-shrink: 0; }
.bsa-group-chip { display: inline-flex; align-items: center; gap: 6px; background: #f5f6f7; border: 1px solid #f5f6f7; border-radius: 999px; padding: 5px 7px 5px 14px; }
.bsa-group-chip-name { font-size: 12.5px; font-weight: 400; color: #000000; white-space: nowrap; cursor: pointer; user-select: none; }
.bsa-group-chip-name:hover { text-decoration: unset; }
/* Hover / pointing → soft green (not the dark selected state) */
.bsa-group-chip:not(.is-mapping):hover { background: #dce8e4; border-color: #dce8e4; cursor: pointer; }
.bsa-group-chip-name em { font-style: normal; font-weight: 500; opacity: .82; }
.bsa-group-chip-btn, .bsa-group-chip-x, .bsa-group-chip-eye { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--teal); cursor: pointer; padding: 0; }
.bsa-group-chip-btn:hover, .bsa-group-chip-x:hover, .bsa-group-chip-eye:hover { background: rgba(13,63,68,.12); }
/* Selected chip → dark teal (green) with white text */
.bsa-group-chip.is-mapping { background: #0e3f44; border-color: #0e3f44; }
.bsa-group-chip.is-mapping .bsa-group-chip-name { color: #fff; }
.bsa-group-chip.is-mapping .bsa-group-chip-x { color: #fff; }
.bsa-group-chip.is-mapping .bsa-group-chip-x:hover { background: rgba(255,255,255,.18); }
.bsa-group-chip-x { font-size: 17px; line-height: 1; }
.bsa-prev-tag { font-size: 11.5px; font-weight: 600; color: var(--teal); background: #e6f0ee; border-radius: 999px; padding: 2px 10px; }

/* Manual Recipients — table layout */
.bsa-mr { gap: 12px; }
.bsa-mr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bsa-mr-head-actions { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
/* Section header row: title on the left, Add button on the right */
.bsa-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bsa-sub-head .bsa-rec-sub-h { flex: 1; min-width: 0; }
/* Template variables label under the Template Name field */
.bsa-tpl-vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.bsa-tpl-vars-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.bsa-tpl-var-chip { font-size: 11.5px; font-weight: 600; color: var(--teal); background: #eef5f3; border: 1px solid #d6e7e2; border-radius: 6px; padding: 1px 7px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.bsa-mr-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.bsa-mr-count { font-size: 13px; font-weight: 700; color: var(--teal); white-space: nowrap; }
.bsa-mr-toolbar { display: flex; align-items: center; gap: 10px; }
.bsa-mr-tablewrap { border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow-x: auto; }
.bsa-mr-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.bsa-mr-table th { text-align: start; font-size: 12px; font-weight: 600; color: var(--text-muted); background: #f7faf9; padding: 10px 11px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.bsa-mr-table td { padding: 7px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.bsa-mr-table tbody tr:last-child td { border-bottom: 0; }
.bsa-mr-cbcol { width: 36px; }
.bsa-mr-rmcol { width: 44px; text-align: center; }
.bsa-mr-rm { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-muted); cursor: pointer; padding: 0; transition: all .15s; }
.bsa-mr-rm:hover { border-color: #e89b94; color: #d92d20; background: #fff5f4; }
.bsa-mr-actcol { width: 78px; }
.bsa-mr-namecell { display: inline-flex; align-items: center; gap: 9px; }
.bsa-mr-avatar { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: #dbe7e4; color: var(--teal); font-size: 10.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; letter-spacing: .3px; }
.bsa-mr-input { width: 100%; min-width: 76px; height: 34px; border: 1px solid transparent; border-radius: 8px; padding: 0 9px; font-size: 13px; color: var(--text); background: transparent; font-variant-numeric: tabular-nums; }
.bsa-mr-input:hover { border-color: var(--border); }
.bsa-mr-input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(13,63,68,.08); }
.bsa-mr-input::placeholder { color: #9ca3af; }
.bsa-mr-status { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; color: #b25b17; background: #fdf1e6; border-radius: 999px; padding: 3px 12px; white-space: nowrap; }
.bsa-mr-status.ready { color: var(--teal); background: #e9f5f1; }
.bsa-mr-actions { display: inline-flex; align-items: center; gap: 6px; }
.bsa-mr-act { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-muted); cursor: pointer; padding: 0; transition: all .15s; }
.bsa-mr-act:hover { border-color: var(--teal); color: var(--teal); }
.bsa-mr-act.del:hover { border-color: #e89b94; color: #d92d20; background: #fff5f4; }
.bsa-map-card { border: unset; border-radius: 12px; padding: unset; background: #fcfdfd; display: flex; flex-direction: column; gap: 0px; margin-block-start: 16px; }
.bsa-map-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bsa-map-progress { font-size: 11px; font-weight: 700; color: #b25b17; background: #fdf1e6; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.bsa-map-progress.is-done { color: var(--teal); background: #e9f5f1; }
.bsa-map-hint { font-size: 12px; color: var(--text-muted); margin-top: -4px; }
.bsa-mapx-wrap { border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.bsa-mapx-table { width: 100%; border-collapse: collapse; }
.bsa-mapx-table thead th { text-align: start; vertical-align: top; padding: 9px 11px; background: #F3F8F5; border-bottom: 1px solid var(--border-2, var(--border)); border-inline-start: unset; }
.bsa-mapx-table thead th:first-child { border-inline-start: 0; border-top-left-radius: 10px; }
.bsa-mapx-table thead th:last-child { border-top-right-radius: 10px; }
/* Guided mapping: instruction + field-status chips + dropdown-per-column row */
.bsa-map-guide { font-size: 12px; color: var(--text-muted); margin: -4px 0 10px; }
.bsa-map-fieldchips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.bsa-map-fieldchips-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.bsa-map-fieldchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: var(--text-muted); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 4px 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.bsa-map-fieldchip svg { width: 12px; height: 12px; color: #fff; background: var(--teal); border-radius: 50%; padding: 2px; }
.bsa-map-fieldchip.done { color: var(--teal); background: #e6f2ec; border-color: #cbe5db; }
.bsa-map-dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #c3ccc9; display: inline-block; }
/* Dropdown (map) row — uniform white; selecting a field must NOT tint the cell */
.bsa-mapx-table .bsa-mapx-maprow th,
.bsa-mapx-table .bsa-mapx-maprow th.is-dest,
.bsa-mapx-table .bsa-mapx-maprow th.is-var { padding: 8px 8px; background: #fff; border-bottom: 0; }
.bsa-mapx-maprow .bsa-mapx-assign { display: block; }
.bsa-mapx-maprow .bsa-ddl { width: 100%; }
.bsa-mapx-maprow .bsa-ddl-control { width: 100%; min-height: 0; padding: 7px 10px; font-size: 12px; border-radius: 8px; background: #fff; }
/* Validation: unmapped required dropdown → red border */
.bsa-mapx-assign.is-invalid .bsa-ddl-control { border-color: #d92d20; background: #fff6f5; }
.bsa-mapx-assign.is-invalid .bsa-ddl-control .ph { color: #d92d20; }
.bsa-mapx-namerow th, .bsa-mapx-namerow th.is-dest, .bsa-mapx-namerow th.is-var { padding: 10px 11px; font-size: 13px; font-weight: 500; color: #6c7180; background: #F5F5F5 !important; border-radius: 0 !important; }
.bsa-mapx-table thead th.is-dest, .bsa-mapx-table thead th.is-var { background: #fff; }
.bsa-mapx-head { display: flex; align-items: center; gap: 9px; }
.bsa-mapx-check { flex-shrink: 0; }
.bsa-mapx-colwrap { display: inline-flex; flex-direction: column; gap: 1px; min-width: 0; }
.bsa-mapx-col { font-size: 12.5px; font-weight: 400; color: var(--text); }
.bsa-mapx-assigned { font-size: 11px; font-weight: 500; color: var(--text-muted); line-height: 1.3; white-space: nowrap; }
.bsa-mapx-assign { position: relative; }
.bsa-mapx-assign .bsa-ddl-control { min-height: 0; padding: 5px 9px; font-size: 11.5px; border-radius: 7px; gap: 6px; }
/* Caret trigger: round dark button (value is shown under the column label) */
.bsa-mapx-assign-caret { margin-inline-start: auto; }
.bsa-mapx-assign-caret .bsa-ddl-control { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: #0e3f44; border: 0; justify-content: center; }
.bsa-mapx-assign-caret .bsa-ddl-control > span { display: none; }
.bsa-mapx-assign-caret .bsa-ddl-control svg { color: #fff; }
.bsa-mapx-assign-caret .bsa-ddl-pop { right: 0; left: auto; }
/* Assign dropdown — Falcon design: padded popover, selected option as a green monospace pill */
.bsa-mapx-assign .bsa-ddl-pop { min-width: 190px; z-index: 40; padding: 8px; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.bsa-mapx-assign .bsa-ddl-item { padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--text); }
.bsa-mapx-assign .bsa-ddl-item:hover { background: #f4f8f7; }
.bsa-mapx-assign .bsa-ddl-item.on { background: #e6f2ec; color: var(--teal); font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* "Not mapped" pinned to the bottom of the list, visually separated + highlighted */
.bsa-mapx-assign .bsa-ddl-item.bsa-ddl-none { margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; background: #f5f6f7; color: #6c7180; font-weight: 600; }
.bsa-mapx-assign .bsa-ddl-item.bsa-ddl-none:hover { background: #ececee; color: var(--text); }
.bsa-mapx-assign .bsa-ddl-item.bsa-ddl-none.on { background: #ececee; color: var(--text); font-family: inherit; }
.bsa-mapx-table tbody td { font-size: 12.5px; color: var(--text); padding: 9px 11px; border-bottom: 1px solid var(--border-2, var(--border)); border-inline-start: unset; white-space: nowrap; }
.bsa-mapx-table tbody td:first-child { border-inline-start: 0; }
.bsa-mapx-table tbody tr:last-child td { border-bottom: 0; }
.bsa-mapx-table tbody tr:last-child td:first-child { border-bottom-left-radius: 10px; }
.bsa-mapx-table tbody tr:last-child td:last-child { border-bottom-right-radius: 10px; }
.bsa-mapx-table tbody td.is-dest { background: #eff5f3; color: var(--teal); font-weight: 600; }
.bsa-mapx-table tbody td.is-var { background: #ffffff; }
.bsa-manual-card { max-width: 100%; }
.bsa-manual-row .otp-phone-wrap { flex: 1.3 1 210px; min-width: 200px; }
.bsa-sending-time { display: block; margin-bottom: 6px; }
.bsa-seg { display: inline-flex; align-self: flex-start; background: #f1f4f4; border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
/* Scheduled date & time — reuses the Organization Hierarchy calendar picker (.dp-*) + a time field */
.bsa-sched-field { display: flex; flex-direction: column; gap: 6px; }
.bsa-sched-field > span { font-size: 12px; color: var(--text-muted); }
.bsa-sched-row { display: inline-flex; align-self: flex-start; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 6px 14px; background: #fff; }
.bsa-sched-row .dp-trigger { font-weight: 600; }
.bsa-sched-div { width: 1px; align-self: stretch; background: var(--border); margin: -2px 0; }
.bsa-sched-time-wrap { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); }
/* Falcon-themed time picker (hour / minute / AM-PM columns, teal selection) */
.bsa-tp-wrap { position: relative; display: inline-flex; }
.bsa-tp-trigger { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 0; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; font-family: inherit; padding: 0; }
.bsa-tp-trigger svg { color: var(--text-muted); }
.bsa-tp-trigger:hover svg { color: var(--teal); }
/* Clock time picker — anchored dropdown (like the date picker), with editable HH:MM inputs */
.bsa-tp-pop { position: absolute; top: 100%; left: 0; margin-top: 8px; z-index: 200; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 16px 42px rgba(13,63,68,.2); padding: 16px 18px 12px; width: 300px; }
.bsa-tp-pop.up { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 8px; }
.bsa-tp-h { font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.bsa-tp-display { display: flex; align-items: center; justify-content: center; gap: 6px; }
.bsa-tp-big { width: 66px; height: 52px; border-radius: 10px; border: 1px solid transparent; background: #eceff1; color: var(--text); font-size: 26px; font-weight: 600; font-family: inherit; text-align: center; cursor: pointer; line-height: 1; padding: 0; transition: background .12s, color .12s; }
.bsa-tp-big:hover { background: #e4e8ea; }
.bsa-tp-big:focus, .bsa-tp-big.on { outline: none; background: #dcece7; color: var(--teal); border-color: var(--teal); }
.bsa-tp-colon { font-size: 26px; font-weight: 600; color: var(--text); line-height: 1; padding-bottom: 4px; }
.bsa-tp-ap { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; margin-left: 6px; align-self: stretch; }
.bsa-tp-ap button { flex: 1; border: 0; background: #fff; color: var(--text-muted); font-size: 13px; font-weight: 700; padding: 0 13px; cursor: pointer; font-family: inherit; transition: background .12s, color .12s; }
.bsa-tp-ap button:first-child { border-bottom: 1px solid var(--border); }
.bsa-tp-ap button.on { background: #dcece7; color: var(--teal); }
.bsa-tp-clock { position: relative; width: 220px; height: 220px; margin: 16px auto 4px; }
.bsa-tp-dial { position: absolute; inset: 0; }
.bsa-tp-face { fill: #eceff1; }
.bsa-tp-hand { stroke: var(--teal); stroke-width: 2; }
.bsa-tp-knob { fill: var(--teal); }
.bsa-tp-hub { fill: var(--teal); }
.bsa-tp-num { position: absolute; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 600; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.bsa-tp-num:hover:not(.on) { background: rgba(13,63,68,.08); }
.bsa-tp-num.on { color: #fff; }
.bsa-tp-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.bsa-tp-btn { border: 0; background: transparent; color: var(--teal); font-size: 14px; font-weight: 700; padding: 9px 15px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.bsa-tp-btn:hover { background: #eef4f2; }
.bsa-seg button { border: 0; background: transparent; padding: 6px 20px; border-radius: 8px; font-size: 12px; font-weight: 400; color: var(--text-muted); cursor: pointer; }
.bsa-seg button.on { background: #fff; color: var(--teal); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.bsa-date-input { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); font-size: 13px; }
.bsa-bc-channel { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.bsa-bc-choose { font-weight: 700; font-size: 14px; }
.bsa-bc-hint { font-size: 12.5px; color: var(--text-muted); margin-top: -6px; }
.bsa-link { border: 0; background: transparent; color: var(--teal); font-weight: 700; cursor: pointer; padding: 0; font-size: 12.5px; }
.bsa-bc-selects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bsa-var-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: auto; }
.bsa-var-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bsa-var-table th { text-align: left; background: #fafbfb; padding: 10px 12px; font-weight: 600; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.bsa-var-table td { padding: 8px 12px; border-bottom: 1px solid #f0f2f2; white-space: nowrap; }
.bsa-var-table tr:last-child td { border-bottom: 0; }
.bsa-var-input { width: 110px; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.bsa-var-empty { color: var(--text-muted); font-size: 13px; padding: 14px 4px; }

/* ---- Phone preview ---- */
/* The phone frame is an image asset (transparent screen area) so the live preview shows through.
   To use your own PNG: drop a transparent-screen version at admin/assets/wa-phone-frame.png and
   change the url() below to it. The screen inset %s below map to that image's screen window. */
.bsa-phone { width: 238px; margin: 4px auto 0; position: relative; aspect-ratio: 430 / 880; }
.bsa-phone::before, .bsa-phone::after { content: none; }   /* side buttons now drawn in the frame image */
.bsa-phone-notch { display: none; }                        /* Dynamic Island now drawn in the frame image */
/* iPhone frame image sits ON TOP of the message content (transparent screen cut-out) */
.bsa-phone-frame { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: url('assets/iphone-frame.svg') center / 100% 100% no-repeat; }
.bsa-phone-screen { position: absolute; z-index: 1; top: 2.1%; left: 4.2%; right: 4.2%; bottom: 2.1%; background: #efe7df; border-radius: 34px; overflow: hidden; min-height: 0; display: flex; flex-direction: column; }
.bsa-phone-bar { background: #fff; display: flex; align-items: center; gap: 8px; padding: 26px 14px 10px; font-weight: 600; font-size: 13px; }
.bsa-phone-logo { display: inline-flex; }
.bsa-phone-body { flex: 1; padding: 38px 12px 14px; background-image: radial-gradient(rgba(0,0,0,.04) 1px, transparent 1px); background-size: 16px 16px; }
.bsa-phone-today { text-align: center; }
.bsa-phone-today, .bsa-conv-day, .bsa-window-timer .bsa-timer-lbl { font-size: 11px; }
.bsa-phone-today { display: inline-block; background: #d9e7e4; color: #355; border-radius: 8px; padding: 2px 10px; margin: 0 auto 12px; }
.bsa-phone-empty { background: #fff; border-radius: 10px; padding: 14px; font-size: 12.5px; color: var(--text-muted); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.bsa-phone-bubble { background: #fff; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; box-shadow: 0 1px 2px rgba(0,0,0,.08); position: relative; }
.bsa-bubble-title { font-weight: 700; margin-bottom: 4px; }
.bsa-bubble-text { line-height: 1.45; }
.bsa-bubble-footer { color: rgba(0,0,0,.5); font-size: 11px; margin-top: 6px; }
.bsa-bubble-time { text-align: right; color: rgba(0,0,0,.45); font-size: 10px; margin-top: 4px; }
.bsa-bubble-btn { margin-top: 8px; text-align: center; color: #0288d1; font-weight: 600; border-top: 1px solid #eee; padding-top: 8px; font-size: 12.5px; }

/* ---- Send confirm overlay ---- */
.bsa-sendconfirm { width: 600px; text-align: center; }
.bsa-sendconfirm-ic { background: #e8f0f1; color: var(--teal); }
.bsa-sendconfirm-msg { margin-bottom: 20px; max-width: 460px; margin-left: auto; margin-right: auto; }

/* Unified summary panel — two KPI-style items split by a hairline divider */
.bsa-sc-panel { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 16px; background: #f7faf9; overflow: hidden; margin-top: 36px; margin-bottom: 36px; }
.bsa-sc-item { flex: 1; display: flex; align-items: center; gap: 12px; text-align: start; padding: 15px 16px; min-width: 0; }
.bsa-sc-ic { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: #eaf3f1; color: var(--teal); display: inline-flex; align-items: center; justify-content: center; }
.bsa-sc-cost .bsa-sc-ic { background: #0d3f44; color: #fff; }
.bsa-sc-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bsa-sc-label { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.bsa-sc-value { display: inline-flex; align-items: center; gap: 3px; font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -.01em; color: var(--text); }
.bsa-sc-cost .bsa-sc-value { color: var(--teal); }
.bsa-sc-value svg { flex-shrink: 0; }
.bsa-sc-div { width: 1px; flex-shrink: 0; background: var(--border); margin: 14px 0; }

/* Allow-duplicate — settings-style row with a toggle switch (label left, switch right) */
.bsa-dup-toggle { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 14px; width: 100%; text-align: start; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; cursor: pointer; transition: border-color .15s, background .15s; }
.bsa-dup-toggle:hover { border-color: #c3d3cf; background: #fafcfb; }
.bsa-dup-toggle-txt { font-size: 12.5px; font-weight: 400; color: var(--text); }
.bsa-dup-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.bsa-dup-switch { position: relative; flex-shrink: 0; width: 40px; height: 23px; border-radius: 999px; background: #d7dee0; transition: background .18s ease; }
.bsa-dup-knob { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.28); transition: transform .18s ease; }
.bsa-dup-toggle input:checked + .bsa-dup-switch { background: var(--teal); }
.bsa-dup-toggle input:checked + .bsa-dup-switch .bsa-dup-knob { transform: translateX(17px); }
.bsa-dup-toggle input:focus-visible + .bsa-dup-switch { box-shadow: 0 0 0 3px rgba(13,63,68,.18); }
/* Falcon-style checkbox: hide the native box, show a teal custom mark with a white check */
.bsa-check input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.bsa-check-box { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border); background: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; transition: background .12s, border-color .12s; }
.bsa-check-box svg { opacity: 0; transition: opacity .1s; }
.bsa-check input:checked + .bsa-check-box { background: var(--teal); border-color: var(--teal); }
.bsa-check input:checked + .bsa-check-box svg { opacity: 1; }
.bsa-check input:focus-visible + .bsa-check-box { box-shadow: 0 0 0 3px rgba(13,63,68,.16); }

/* ---- Details ---- */
.bsa-det-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bsa-det-left { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.bsa-back { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.bsa-det-meta { font-size: 13.5px; color: var(--text); }
.bsa-det-meta .lbl { color: var(--text-muted); }
.bsa-det-exports { display: flex; gap: 10px; }
.bsa-det-exports .btn { display: inline-flex; align-items: center; gap: 8px; }

/* ===== Details — redesigned header (title + status + meta) ===== */
.bsa-det-top { align-items: flex-start; }
.bsa-det-head { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.bsa-back-ic { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, border-color .15s; }
.bsa-back-ic:hover { background: #f3f6f5; border-color: #b9c6c4; }
.bsa-det-titlewrap { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding-top: 1px; }
.bsa-det-titlerow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bsa-det-title { margin: 0; font-size: 21px; font-weight: 700; color: var(--text); line-height: 1.2; }
.bsa-det-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }
.bsa-det-subitem { display: inline-flex; align-items: center; gap: 6px; }
.bsa-det-subitem svg { opacity: .85; }
.bsa-det-id { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.bsa-det-subdot { width: 3px; height: 3px; border-radius: 50%; background: #c4cdcb; }

/* ===== Details — KPI tiles ===== */
.bsa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.bsa-kpi { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 13px 15px; min-width: 0; }
.bsa-kpi-ic { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; background: #eaf3f1; color: var(--teal); display: inline-flex; align-items: center; justify-content: center; }
.bsa-kpi-ic.ic-accent { background: #e7f6ee; color: #0f7a3a; }
.bsa-kpi-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bsa-kpi-lbl { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.bsa-kpi-val { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== Details — overview / delivery funnel chart ===== */
.bsa-ov-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bsa-ov-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.bsa-ov-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bsa-ov-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.bsa-ov-chip .d { width: 10px; height: 10px; border-radius: 3px; }
.bsa-ov-chip .d.s1 { background: #0d3f44; } .bsa-ov-chip .d.s2 { background: #2e8b80; } .bsa-ov-chip .d.s3 { background: #6cc0a8; } .bsa-ov-chip .d.s4 { background: #f0a93f; }
.bsa-funnel { margin-top: 30px; }
.bsa-funnel-bars { position: relative; display: flex; align-items: flex-end; justify-content: space-around; gap: 20px; height: 220px; padding: 0 10px 0 34px; border-bottom: 1.5px solid var(--border); }
.bsa-gl { position: absolute; left: 34px; right: 10px; height: 0; border-top: 1px dashed #e9edec; pointer-events: none; }
.bsa-gl em { position: absolute; left: 0; top: 50%; transform: translate(-100%, -50%); font-style: normal; font-size: 10px; color: #aeb8b6; padding-right: 9px; }
.bsa-fcol { position: relative; z-index: 1; flex: 1; max-width: 70px; height: 100%; display: flex; align-items: flex-end; }
.bsa-fbar { position: relative; width: 100%; min-height: 8px; border-radius: 10px 10px 3px 3px; box-shadow: 0 2px 7px rgba(13,63,68,.16); transition: height .85s cubic-bezier(.2,.8,.2,1); }
/* No-data placeholder (scheduled / deleted / failed): a muted stub, no value */
.bsa-fbar.is-empty { background: #eceff1 !important; box-shadow: none; min-height: 6px; }
.bsa-fbar.is-empty .bsa-fpct { color: var(--text-muted); font-weight: 600; }
.bsa-fbar.s1 { background: linear-gradient(180deg, #1a5b62, #0d3f44); }
.bsa-fbar.s2 { background: linear-gradient(180deg, #3a9c8f, #2e8b80); }
.bsa-fbar.s3 { background: linear-gradient(180deg, #84cdb6, #6cc0a8); }
.bsa-fbar.s4 { background: linear-gradient(180deg, #f7c266, #f0a93f); }
.bsa-fbar.s5 { background: linear-gradient(180deg, #ec7161, #e0503f); }
.bsa-fbar.s6 { background: linear-gradient(180deg, #7aa5f2, #5b8def); }
.bsa-ov-chip .d.s5 { background: #e0503f; } .bsa-ov-chip .d.s6 { background: #5b8def; }
.bsa-fpct { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.bsa-funnel-x { display: flex; justify-content: space-around; gap: 20px; padding: 11px 10px 0 34px; }
.bsa-fxcol { flex: 1; max-width: 70px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
/* Rates chart has 6 bars → give labels a bit more room + tighter gaps */
.bsa-funnel-rates .bsa-funnel-bars, .bsa-funnel-rates .bsa-funnel-x { gap: 12px; }
.bsa-funnel-rates .bsa-fxcol { max-width: 96px; }
.bsa-flabel { font-size: 11px; font-weight: 400; color: var(--text); }
.bsa-fcount { font-size: 12px; color: var(--text-muted); }

/* ===== Details — cost summary cards (scoped to WhatsApp details; voice keeps its own) ===== */
.bsa-details .bsa-cost-grid { grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.bsa-details .bsa-cost-item { flex-direction: row; align-items: center; gap: 12px; background: #f6f9f8; border: 1px solid var(--border-2, var(--border)); border-radius: 14px; padding: 13px 14px; }
.bsa-details .bsa-cost-ic { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0; }
.bsa-details .bsa-cost-ic.ic-sent { background: #0d3f44; color: #fff; }
.bsa-details .bsa-cost-ic.ic-avg { background: #e7f6ee; color: #0f7a3a; }
.bsa-cost-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bsa-details .bsa-cost-val { font-size: 22px; font-weight: 800; color: var(--text); display: inline-flex; align-items: center; gap: 5px; }
.bsa-details .bsa-cost-val svg { color: var(--teal); }
.bsa-details .bsa-cost-lbl { font-size: 12.5px; color: var(--text-muted); }

/* ===== Voice details — funnel bar colours (Answer/No Answer/Pending/Reject/Failed) ===== */
.bsa-fbar.va { background: linear-gradient(180deg, #1a5b62, #0d3f44); }
.bsa-fbar.vn { background: linear-gradient(180deg, #aeb8b6, #8f9d9a); }
.bsa-fbar.vp { background: linear-gradient(180deg, #f7c266, #f0a93f); }
.bsa-fbar.vr { background: linear-gradient(180deg, #ef8a52, #e8743b); }
.bsa-fbar.vf { background: linear-gradient(180deg, #e8847c, #d9534f); }

/* ===== Details — KPI action tile (Preview) + overview answered-rate highlight ===== */
.bsa-kpi-btn { cursor: pointer; text-align: left; font: inherit; transition: border-color .15s, background .15s, box-shadow .15s; }
.bsa-kpi-btn:hover { border-color: #b9c6c4; background: #f7faf9; box-shadow: 0 2px 8px rgba(13,63,68,.08); }
.bsa-kpi-btn .bsa-kpi-ic { background: #0d3f44; color: #fff; }
.bsa-ov-hl { display: inline-flex; align-items: center; gap: 10px; background: #eaf3f1; border: 1px solid #d3e5e1; border-radius: 12px; padding: 7px 14px; }
.bsa-ov-hl-lbl { font-size: 12px; color: var(--text-muted); }
.bsa-ov-hl-val { font-size: 18px; font-weight: 800; color: var(--teal); }

/* ===== Voice details — cost summary (icon badges, duration, colour-coded status dots) ===== */
.bsa-voice-details .bsa-cost-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bsa-voice-details .bsa-cost-item { flex-direction: column; align-items: flex-start; gap: 9px; background: #f6f9f8; border: 1px solid var(--border-2, var(--border)); border-radius: 13px; padding: 14px; }
.bsa-voice-details .bsa-cost-ic { width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0; }
.bsa-voice-details .bsa-cost-ic.ic-sent { background: #0d3f44; color: #fff; }
.bsa-voice-details .bsa-cost-ic.ic-avg { background: #e7f6ee; color: #0f7a3a; }
.bsa-cost-ic.ic-dur { background: #eef5f3; color: var(--teal); }
.bsa-cost-grid-4 .bsa-cost-item { padding: 13px 14px; }
.bsa-voice-details .bsa-cost-val { font-size: 20px; font-weight: 800; color: var(--text); display: inline-flex; align-items: center; gap: 5px; }
.bsa-voice-details .bsa-cost-val svg { color: var(--teal); }
.bsa-voice-details .bsa-cost-lbl { font-size: 12px; color: var(--text-muted); }
/* Info (ⓘ) badge in each stat card — top-right, with a tooltip describing the metric */
.bsa-voice-details .bsa-cost-item { position: relative; }
.bsa-cost-info { position: absolute; top: 11px; right: 11px; display: inline-flex; color: var(--text-muted); opacity: .45; cursor: help; }
.bsa-cost-info:hover, .bsa-cost-info:focus-visible { opacity: 1; color: var(--teal); outline: none; }
.bsa-cost-tip { position: absolute; bottom: calc(100% + 9px); right: -6px; width: 200px; background: #16302c; color: #fff; font-size: 11.5px; font-weight: 500; line-height: 1.45; padding: 9px 11px; border-radius: 9px; box-shadow: 0 10px 26px rgba(0,0,0,.24); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .14s ease, transform .14s ease; z-index: 40; pointer-events: none; text-align: start; }
.bsa-cost-tip::after { content: ''; position: absolute; top: 100%; right: 14px; border: 6px solid transparent; border-top-color: #16302c; }
.bsa-cost-info:hover .bsa-cost-tip, .bsa-cost-info:focus-visible .bsa-cost-tip { opacity: 1; visibility: visible; transform: translateY(0); }
.bsa-voice-details .bsa-call-duration { display: flex; align-items: center; gap: 11px; background: #f6f9f8; border: 1px solid var(--border-2, var(--border)); border-radius: 13px; padding: 13px 15px; }
.bsa-cd-ic { color: var(--teal); display: inline-flex; flex-shrink: 0; }
.bsa-cd-lbl { flex: 1; font-size: 13px; color: var(--text-muted); }
.bsa-cd-val { font-size: 15px; font-weight: 700; color: var(--text); }
.bsa-cbs-k { display: inline-flex; align-items: center; gap: 9px; }
.bsa-cbs-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bsa-cbs-dot.va { background: #0d3f44; } .bsa-cbs-dot.vn { background: #8f9d9a; } .bsa-cbs-dot.vp { background: #f0a93f; } .bsa-cbs-dot.vr { background: #e8743b; } .bsa-cbs-dot.vf { background: #d9534f; }
.bsa-voice-details .bsa-cbs-row { padding: 9px 0; }
.bsa-fail-banner { display: flex; align-items: center; gap: 10px; background: #fff8e6; border: 1px solid #f5d98a; color: #8a6100; border-radius: 12px; padding: 12px 16px; font-size: 13px; font-weight: 500; }
/* Alert colour follows the transaction status */
.bsa-fail-banner.st-canceled { background: #f1f3f5; border-color: #dfe3e8; color: #5a6470; }
.bsa-fail-banner.st-partial { background: #fff4e6; border-color: #f3d3a3; color: #c46a00; }
.bsa-fail-banner.st-failed { background: #ffeded; border-color: #f3c3c3; color: #a1191d; }
.bsa-summary { display: flex; align-items: center; gap: 10px; background: #f5f7f7; border-radius: 14px; padding: 16px 20px; flex-wrap: wrap; }
.bsa-sum-item { display: flex; flex-direction: column; gap: 4px; min-width: 90px; flex: 1; }
.bsa-sum-item > span { font-size: 12px; color: var(--text-muted); }
.bsa-sum-item > strong { font-size: 14px; }
.bsa-sum-status { margin-left: auto; }
.bsa-det-mid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.bsa-replies-rate { display: flex; align-items: center; gap: 10px; background: #f5f7f7; border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.bsa-replies-rate strong { font-size: 16px; }
.bsa-chart { display: flex; align-items: flex-end; justify-content: space-around; gap: 18px; height: 190px; padding: 16px 6px 0; }
.bsa-statbar { display: flex; flex-direction: column; align-items: center; gap: 10px; height: 100%; justify-content: flex-end; }
.bsa-statbar-track { width: 46px; height: 150px; display: flex; align-items: flex-end; }
.bsa-statbar-fill { width: 100%; border-radius: 8px 8px 0 0; position: relative; min-height: 14px; }
.bsa-statbar-fill.t1 { background: #0d3f44; } .bsa-statbar-fill.t2 { background: #5b8f8a; } .bsa-statbar-fill.t3 { background: #a9cfc9; } .bsa-statbar-fill.t4 { background: #d7dede; }
.bsa-statbar-pct { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.bsa-statbar-label { font-size: 12.5px; color: var(--text-muted); }
.bsa-cost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bsa-cost-item { display: flex; flex-direction: column; gap: 6px; }
.bsa-cost-ic { font-size: 26px; }
.bsa-cost-val { font-size: 20px; font-weight: 700; color: var(--teal); }
.bsa-cost-lbl { font-size: 12.5px; color: var(--text-muted); }
.bsa-det-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); gap: 16px; align-items: start; }
/* Recipients card: table sits flush to the edges (grey header edge-to-edge), exactly like the
   Outbox/other system tables — the 18px card padding only wraps the title bar, not the grid. */
.bsa-recip-card { padding: 0; gap: 0; overflow: hidden; }
.bsa-recip-table th, .bsa-recip-table td { white-space: nowrap; }
.bsa-recip-table tbody tr { cursor: pointer; }
.bsa-recip-sel { background: #eef5f3 !important; }
/* Details preview header — shows which recipient's message is being previewed. */
.bsa-det-preview-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bsa-det-preview-rn { font-size: 11.5px; font-weight: 600; color: var(--teal); background: #eef5f3; border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Voice details: recipients table beside a live IVR-canvas preview (select a row → its canvas + path) */
.bsa-vdet-bottom { grid-template-columns: minmax(0, 1fr) minmax(340px, 380px); }
.bsa-vcanvas-card { display: flex; flex-direction: column; }
.bsa-vcanvas-hint { font-size: 11.5px; color: var(--text-muted); margin: -2px 0 11px; }
.bsa-vcanvas-flow { height: auto; margin: 0; padding-top: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fbfdfc; }
.bsa-vcanvas-flow .ivr-canvas-step { min-height: 340px; }
.bsa-vcanvas-detail { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 15px; max-height: 340px; overflow-y: auto; }
/* Recipients list: bounded so it scrolls vertically when long; header pinned; horizontal scroll when columns overflow (same as the system tables). */
.bsa-recip-card .table-scroll { max-height: 430px; overflow: auto; }
.bsa-recip-card .bsa-recip-table thead th { position: sticky; top: 0; z-index: 2; }
/* Status — pill badge (dot + label), identical format to the rest of the system. */
.bsa-recip-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.bsa-recip-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.bsa-recip-status.rd { background: #e7f6ee; color: #0f7a3a; } .bsa-recip-status.dl { background: #e6f7f3; color: #0d7a72; } .bsa-recip-status.st { background: #e8f1fe; color: #1d5fc4; } .bsa-recip-status.pd { background: #fff4e6; color: #c46a00; } .bsa-recip-status.fl { background: #ffeded; color: #a1191d; }
.bsa-recip-status.pl { background: #efecfb; color: #6d52d6; } .bsa-recip-status.sn { background: #e7f3fb; color: #1f77b8; }
/* Engagement rate strip (WhatsApp details statistics) */
.bsa-rate-card { padding: 0; }
.bsa-rate-strip { display: flex; flex-wrap: wrap; }
.bsa-rate-tile { flex: 1 1 0; min-width: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 18px 14px; border-inline-end: 1px solid var(--border-2, var(--border)); }
.bsa-rate-tile:last-child { border-inline-end: 0; }
.bsa-rate-val { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; }
.bsa-rate-tile:nth-child(1) .bsa-rate-val { color: #0d7a72; }
.bsa-rate-tile:nth-child(2) .bsa-rate-val { color: #0f7a3a; }
.bsa-rate-tile:nth-child(5) .bsa-rate-val { color: #c0392b; }
.bsa-rate-tile:nth-child(6) .bsa-rate-val { color: var(--teal); }
.bsa-rate-lbl { font-size: 11.5px; color: var(--text-muted); text-align: center; white-space: nowrap; }

/* ---- Scheduled banner (no statistics yet) ---- */
.bsa-sched-banner { display: flex; align-items: flex-start; gap: 11px; background: #eef4fb; border: 1px solid #cfe0f3; color: #2a5a8c; border-radius: 12px; padding: 13px 16px; font-size: 13px; line-height: 1.5; }
.bsa-sched-banner svg { flex-shrink: 0; margin-top: 1px; color: #2f6fed; }
.bsa-sched-banner strong { font-weight: 700; }
/* Deleted scheduled transaction — neutral/muted banner (it won't be processed) */
.bsa-del-banner { display: flex; align-items: flex-start; gap: 11px; background: #f3f4f6; border: 1px solid #dfe3e8; color: #5b6571; border-radius: 12px; padding: 13px 16px; font-size: 13px; line-height: 1.5; }
.bsa-del-banner svg { flex-shrink: 0; margin-top: 1px; color: #8a94a3; }
.bsa-del-banner strong { font-weight: 700; color: #475160; }

/* In-progress banner — live processing indicator + progress bar */
/* In-progress banner is coloured to match the "In Progress" status pill (blue). */
.bsa-progress-banner { display: flex; align-items: center; gap: 16px; background: #e8f1fe; border: 1px solid #c7dbfb; color: #1d5fc4; border-radius: 12px; padding: 12px 16px; font-size: 13px; line-height: 1.5; }
.bsa-progress-txt { flex: 1; display: inline-flex; align-items: center; gap: 9px; }
.bsa-progress-txt strong { font-weight: 700; }
.bsa-progress-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: #3b82f6; box-shadow: 0 0 0 0 rgba(59,130,246,.4); animation: bsaPulse 1.6s ease-out infinite; }
@keyframes bsaPulse { 0% { box-shadow: 0 0 0 0 rgba(13,63,68,.35); } 70% { box-shadow: 0 0 0 7px rgba(13,63,68,0); } 100% { box-shadow: 0 0 0 0 rgba(13,63,68,0); } }
.bsa-progress-bar { flex-shrink: 0; width: 160px; height: 8px; border-radius: 999px; background: #d3e3fc; overflow: hidden; }
.bsa-progress-bar > i { display: block; height: 100%; border-radius: 999px; background: #3b82f6; transition: width .6s ease; }
/* "X of Y" progress hint under the Total Recipients value */
.bsa-kpi-sub { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--text-muted); margin-left: 7px; }

/* ---- Ask AI button + assistant modal ---- */
.bsa-ai-btn { display: inline-flex; align-items: center; gap: 7px; background: #e9f5f1; border: 1px solid #cfe5df; color: var(--teal); font-weight: 600; }
.bsa-ai-btn:hover { background: #ddeee8; border-color: #bcd9cf; }
.bsa-ai-btn svg { color: var(--teal); }
/* Ask AI — right-side drawer */
/* Ask AI opens as a right-side drawer — reuses the shared .drawer chrome (same as the Balance Transfer drawer). */
.bsa-ai-drawer { width: 420px; }
.bsa-ai-drawer .bsa-ai-head { flex-shrink: 0; }
.bsa-ai-name { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--teal); margin-bottom: 6px; }
.bsa-ai-name .bsa-ai-ava { width: 22px; height: 22px; border-radius: 7px; }
.bsa-ai-suggest-h { flex-basis: 100%; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.bsa-ai-title { display: inline-flex; align-items: center; gap: 9px; }
.bsa-ai-spark { display: inline-flex; width: 30px; height: 30px; border-radius: 9px; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--teal), #2f9e8c); color: #fff; }
.bsa-ai-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; background: #fafbfc; }
.bsa-ai-msg { display: flex; gap: 9px; max-width: 90%; }
.bsa-ai-msg.user { align-self: flex-end; }
.bsa-ai-msg.ai { align-self: flex-start; }
.bsa-ai-ava { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--teal), #2f9e8c); color: #fff; }
.bsa-ai-bubble { font-size: 13.5px; line-height: 1.55; border-radius: 13px; padding: 11px 14px; }
.bsa-ai-msg.ai .bsa-ai-bubble { background: #fff; border: 1px solid var(--border); color: var(--text); border-top-left-radius: 4px; }
.bsa-ai-msg.user .bsa-ai-bubble { background: var(--teal); color: #fff; border-top-right-radius: 4px; }
.bsa-ai-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 0; flex-shrink: 0; }
.bsa-ai-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 500; color: var(--text); cursor: pointer; font-family: inherit; }
.bsa-ai-chip:hover { border-color: var(--teal); color: var(--teal); background: #f1f7f6; }
.bsa-ai-input { display: flex; align-items: center; gap: 10px; padding: 14px 20px 18px; flex-shrink: 0; }
.bsa-ai-input input { flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 12px 18px; font-size: 14px; outline: 0; font-family: inherit; min-width: 0; }
.bsa-ai-input input:focus { border-color: var(--teal); }
.bsa-ai-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.bsa-ai-send:hover { background: var(--teal-hover, #0a3338); }
.bsa-replied { color: #0f7a3a; font-size: 16px; }
.bsa-det-preview .bsa-phone { width: 220px; }

/* ---- Voice IVR Conversation — the recipient's call as a WhatsApp-style transcript ---- */
.bsa-vconv { padding: 0; overflow: hidden; gap: 0; display: flex; flex-direction: column; height: calc(100vh - 168px); min-height: 540px; max-height: 780px; }
.bsa-vconv-top { display: flex; align-items: center; gap: 12px; padding: 11px 18px; background: var(--teal); color: #fff; flex-shrink: 0; }
.bsa-vconv-back { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.bsa-vconv-back:hover { background: rgba(255,255,255,.14); }
.bsa-vconv-avatar { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.16); display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.bsa-vconv-peer { flex: 1; min-width: 0; }
.bsa-vconv-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.bsa-vconv-sub { font-size: 12px; opacity: .82; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bsa-vconv-status { flex-shrink: 0; }
.bsa-vconv-body { flex: 1; overflow-y: auto; padding: 20px 22px 26px; background: #efe7df; background-image: radial-gradient(rgba(0,0,0,.045) 1px, transparent 1px); background-size: 18px 18px; display: flex; flex-direction: column; gap: 9px; }
.bsa-vconv-day, .bsa-vconv-note { align-self: center; border-radius: 8px; padding: 4px 12px; font-size: 11.5px; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.bsa-vconv-day { background: #fff; color: var(--text-muted); }
.bsa-vconv-note { background: #fdf3d4; color: #87691c; margin-bottom: 4px; }
.bsa-vconv-row { display: flex; }
.bsa-vconv-row.in { justify-content: flex-start; }
.bsa-vconv-row.out { justify-content: flex-end; }
.bsa-vconv-bubble { max-width: 80%; border-radius: 12px; padding: 9px 11px; box-shadow: 0 1px 1px rgba(0,0,0,.1); position: relative; }
.bsa-vconv-bubble.in { background: #fff; border-top-left-radius: 4px; }
.bsa-vconv-bubble.out { background: #d7f3c8; border-top-right-radius: 4px; display: inline-flex; align-items: center; gap: 10px; }
.bsa-vconv-nodelabel { font-weight: 700; font-size: 13px; color: var(--text); margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.bsa-vconv-sys { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--teal); border-radius: 5px; padding: 2px 6px; }
.bsa-vconv-voice { display: flex; align-items: center; gap: 9px; padding: 2px 0; }
.bsa-vconv-play { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding-left: 2px; }
.bsa-vconv-wave { display: inline-flex; align-items: center; gap: 2px; height: 24px; flex: 1; min-width: 80px; }
.bsa-vconv-wave > i { width: 2px; border-radius: 2px; background: #b5c2bf; transition: background .1s linear; }
.bsa-vconv-wave > i.on { background: var(--teal); }
.bsa-vconv-dur { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.bsa-vconv-readback { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.bsa-vconv-var { font-size: 11.5px; background: #eef5f3; border: 1px solid #d6e7e2; border-radius: 7px; padding: 3px 8px; color: var(--teal); text-transform: capitalize; }
.bsa-vconv-var b { font-weight: 700; }
.bsa-vconv-menu { margin-top: 9px; display: flex; flex-direction: column; gap: 5px; border-top: 1px solid #eef0f1; padding-top: 9px; }
.bsa-vconv-opt { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text); }
.bsa-vconv-optkey { width: 22px; height: 22px; border-radius: 6px; background: #eef1f3; color: var(--text); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bsa-vconv-opt.picked .bsa-vconv-optkey { background: var(--teal); color: #fff; }
.bsa-vconv-opt.picked .bsa-vconv-optlbl { font-weight: 700; color: var(--teal); }
.bsa-vconv-time { display: block; text-align: right; font-size: 10px; color: var(--text-muted); margin-top: 5px; }
.bsa-vconv-time.out { display: inline; margin: 0 0 0 8px; color: #5b8a4e; }
.bsa-vconv-dtmf { width: 32px; height: 32px; border-radius: 8px; background: var(--teal); color: #fff; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bsa-vconv-presslbl { font-size: 12.5px; color: var(--text); }
.bsa-vconv-end { align-self: center; display: inline-flex; align-items: center; gap: 8px; background: #fde8e7; color: #b3261e; border-radius: 8px; padding: 6px 13px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.bsa-vconv-empty { margin: auto; text-align: center; max-width: 400px; background: #fff; border-radius: 16px; padding: 30px 28px; box-shadow: 0 3px 12px rgba(0,0,0,.07); }
.bsa-vconv-empty-ic { display: inline-flex; width: 56px; height: 56px; border-radius: 50%; background: #f3f4f6; color: #8a94a3; align-items: center; justify-content: center; }
.bsa-vconv-empty-h { font-weight: 700; font-size: 15.5px; color: var(--text); margin: 12px 0 6px; }
.bsa-vconv-empty-p { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* Voice-note transcript — the written equivalent of the IVR audio (variables inlined) */
.bsa-vconv-transcript { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: #45534e; background: #f6f8f7; border-left: 2px solid #cfe0db; border-radius: 0 8px 8px 0; padding: 7px 10px; }
.bsa-vconv-tlabel { display: inline; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #8aa39b; margin-right: 7px; }

/* ---- AI-agent handoff: voice call → structured text-chat continuation ---- */
.bsa-aichat { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.bsa-aichat-divider { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; }
.bsa-aichat-line { flex: 1; height: 1px; background: rgba(0,0,0,.1); }
.bsa-aichat-chan { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 13px; border-radius: 999px; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.bsa-aichat-chan.chan-whatsapp { background: #25d366; }
.bsa-aichat-chan.chan-instagram { background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888); }
.bsa-aichat-handnote { align-self: center; text-align: center; font-size: 11.5px; color: var(--text-muted); background: rgba(255,255,255,.65); border-radius: 8px; padding: 4px 12px; }
.bsa-aichat-handnote b { color: var(--text); font-weight: 700; }
.bsa-aichat-bubble { max-width: 80%; padding: 8px 11px 6px; border-radius: 12px; box-shadow: 0 1px 1px rgba(0,0,0,.07); }
.bsa-aichat-bubble.in { background: #fff; border-top-left-radius: 4px; }
.bsa-aichat-bubble.out { background: #d9fdd3; border-top-right-radius: 4px; }
.bsa-aichat-who { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--teal); margin-bottom: 4px; }
.bsa-aichat-badge { font-size: 8.5px; font-weight: 800; letter-spacing: .03em; color: #fff; background: var(--teal); border-radius: 4px; padding: 1px 5px; }
.bsa-aichat-text { font-size: 13px; line-height: 1.45; color: var(--text); white-space: pre-wrap; }
.bsa-aichat.chan-instagram .bsa-aichat-bubble.out { background: linear-gradient(135deg, #5b51d8, #833ab4 42%, #c13584 78%, #e1306c); }
.bsa-aichat.chan-instagram .bsa-aichat-bubble.out .bsa-aichat-text,
.bsa-aichat.chan-instagram .bsa-aichat-bubble.out .bsa-vconv-time.out { color: #fff; }
.bsa-aichat-resolved { align-self: center; display: inline-flex; align-items: center; gap: 7px; background: #e6f4ea; color: #1e7d4a; border-radius: 8px; padding: 6px 13px; font-size: 12px; font-weight: 600; margin-top: 8px; }

/* IVR conversation re-cast in the WhatsApp message structure (recipient left, IVR/AI sender right) */
.bsa-vconv-cvbody { gap: 16px; }
.bsa-vconv-ivrbubble { max-width: 440px; }
.bsa-vconv-ivrbubble .bsa-vconv-nodelabel { margin-bottom: 8px; }
.bsa-vconv-pressbubble { display: inline-flex; align-items: center; gap: 11px; }
.bsa-aichat { gap: 16px; }
/* AI-agent bubble — visually distinct from the IVR/system bubbles */
.bsa-cv-msg.out .bsa-cv-bubble.is-ai { background: #e9f5f1; border-color: #cfe5df; }
.bsa-aichat.chan-instagram .bsa-cv-msg.out .bsa-cv-bubble.is-ai { background: linear-gradient(135deg, #5b51d8, #833ab4 42%, #c13584 78%, #e1306c); border-color: transparent; }
.bsa-aichat.chan-instagram .bsa-cv-msg.out .bsa-cv-bubble.is-ai .bsa-cv-text { color: #fff; }
.bsa-ai-sender { display: inline-flex; align-items: center; gap: 6px; }
.bsa-ai-tag { font-size: 8.5px; font-weight: 800; letter-spacing: .03em; color: #fff; background: var(--teal); border-radius: 4px; padding: 1px 5px; }
.bsa-ai-ava { width: 36px; height: 36px; background: var(--teal); color: #fff; font-size: 11px; font-weight: 800; }
/* The WhatsApp/Instagram continuation is a live chat — its bubbles render in the scrolling thread body
   and its reply bar + composer in the pinned .bsa-cv-foot, exactly like the WhatsApp conversation. */

/* Voice conversation re-housed in the WhatsApp two-column structure (.bsa-conv2) */
.bsa-vconv2 .bsa-vconv-body { min-height: 0; border-radius: 0; padding: 22px 26px 28px; }
.bsa-vconv2-headsub { margin-left: auto; font-size: 12.5px; color: var(--text-muted); }
.bsa-vconv2-readonly { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 12.5px; color: var(--text-muted); background: #f4f7f6; border-radius: 10px; padding: 11px 14px; }
.bsa-vconv2-readonly svg { color: var(--teal); flex-shrink: 0; }
/* Voice conversation footer → two send options instead of a text reply box */
.bsa-vconv2-actions { display: flex; gap: 12px; justify-content: center; }
.bsa-vconv2-act { flex: 1; max-width: 320px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.bsa-vconv2-act svg { flex-shrink: 0; }

/* ---- Conversation (WhatsApp-style) ---- */
.bsa-conv2 { padding: 0; overflow: hidden; gap: 0; }

/* Top bar */
.bsa-cv-topbar { flex-shrink: 0; display: flex; align-items: center; gap: 26px; padding: 16px 26px; border-bottom: 1px solid var(--border); }
.bsa-cv-back { display: inline-flex; align-items: center; gap: 12px; border: 0; background: transparent; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--text-muted); font-family: inherit; padding: 0; }
.bsa-cv-backcircle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.bsa-cv-back:hover .bsa-cv-backcircle { background: #f3f6f5; }
.bsa-cv-topmeta { display: flex; flex-direction: column; gap: 5px; }
.bsa-cv-topmeta > div { font-size: 14px; }
.bsa-cv-topmeta span { color: var(--text-muted); }
.bsa-cv-topmeta strong { color: var(--text); font-weight: 700; margin-left: 8px; }
.bsa-cv-topbar-r { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.bsa-cv-tplbtn { display: inline-flex; align-items: center; gap: 9px; background: #16302c; color: #fff; border: 0; border-radius: 12px; padding: 13px 22px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; }
.bsa-cv-tplbtn:hover { background: #1d403a; }
.bsa-cv-demo { border: 0; background: transparent; color: var(--text-muted); font-size: 12px; cursor: pointer; padding: 4px 6px; text-decoration: underline; flex-shrink: 0; }
.bsa-cv-demo:hover { color: var(--teal); }

/* Two-column grid: Message Info + Conversation */
.bsa-cv-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(248px, 312px) minmax(0, 1fr); gap: 18px; padding: 18px; }
.bsa-cv-info { border: 1px solid var(--border); border-radius: 16px; padding: 22px; overflow-y: auto; }
.bsa-cv-info-h { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.bsa-cv-info-row { display: flex; flex-direction: column; gap: 7px; padding: 13px 0; }
.bsa-cv-info-row > span { font-size: 13px; color: var(--text-muted); }
.bsa-cv-info-row > strong { font-size: 13px; font-weight: 700; color: var(--text); }
.bsa-cv-info-sep { height: 1px; background: var(--border); margin: 10px 0 6px; }
.bsa-cv-info-block { margin-top: 12px; background: #e9f3ee; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 20px; }
.bsa-cv-info-drow { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.bsa-cv-info-dcol { display: flex; flex-direction: column; gap: 6px; }
.bsa-cv-info-dlabel { font-size: 13px; color: var(--text-muted); }
.bsa-cv-info-dval { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.35; display: flex; flex-direction: column; }
.bsa-cv-info-dval em { font-style: normal; }
.bsa-cv-info-drow .bsa-ticks { margin-bottom: 3px; }
/* Selected-message header inside the green box (mirrored via the info icon) */
.bsa-cv-info-msg { display: flex; flex-direction: column; gap: 4px; padding-bottom: 15px; margin-bottom: 0px; border-bottom: 1px solid rgba(13,63,68,.14); }
.bsa-cv-info-msg-from { font-size: 12px; font-weight: 700; color: var(--teal); }
.bsa-cv-info-msg em { font-style: normal; font-size: 12.5px; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bsa-cv-info-clear { align-self: flex-start; margin-top: 4px; border: 0; background: transparent; color: var(--teal); font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; font-family: inherit; }

/* Conversation thread (right card) */
.bsa-cv-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 16px; }

/* Conversation header */
.bsa-cv-head { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); border-radius: 16px 16px 0 0; }
.bsa-cv-title { font-size: 16px; font-weight: 800; color: var(--text); }
.bsa-cv-chev { color: var(--text-muted); display: inline-flex; margin: 0 -2px; }
.bsa-cv-recip { font-size: 13.5px; color: var(--text-muted); }
.bsa-cv-recip strong { color: var(--text); font-weight: 700; margin-left: 3px; }
.bsa-cv-search { margin-left: auto; display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; min-width: 200px; max-width: 280px; color: var(--text-muted); transition: border-color .15s, max-width .15s; }
.bsa-cv-search input { border: 0; outline: 0; background: transparent; font-size: 13.5px; font-family: inherit; flex: 1; color: var(--text); min-width: 0; }
.bsa-cv-search.has-q { max-width: 380px; padding-right: 5px; border-color: #c3d3cf; }
.bsa-cv-search.no-match { border-color: #f0c6c2; }
/* Search controls: count + prev/next + clear */
.bsa-cv-search-tools { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.bsa-cv-search-count { font-size: 11.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; padding: 0 6px; }
.bsa-cv-search.no-match .bsa-cv-search-count { color: #d92d20; }
.bsa-cv-search-nav, .bsa-cv-search-x { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; transition: background .12s, color .12s; }
.bsa-cv-search-nav:hover:not(:disabled), .bsa-cv-search-x:hover { background: #eef3f2; color: var(--teal); }
.bsa-cv-search-nav:disabled { opacity: .35; cursor: not-allowed; }
.bsa-cv-search-x { margin-inline-start: 2px; }
/* Match highlight inside message bubbles */
.bsa-cv-hl { background: #ffe08a; color: #2a2100; border-radius: 3px; padding: 0 1px; scroll-margin: 80px; }
.bsa-cv-msg.is-current .bsa-cv-hl { background: #ffb020; color: #241900; }
.bsa-cv-msg.is-current .bsa-cv-bubble { box-shadow: 0 0 0 2px var(--teal); }

/* Avatar */
.bsa-cv-ava { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; background: #d9e6e2; color: #7d978f; }
.bsa-cv-ava svg { width: 76%; height: 76%; transform: translateY(9%); }
.bsa-cv-ava.cust { background: #dce8f2; color: #7c93ab; }
.bsa-cv-ava.agent { background: #d6e8e1; color: #6d9085; }

/* Thread body */
.bsa-cv-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px 30px; background: #f4f7f6; background-image: radial-gradient(rgba(13,63,68,.022) 1px, transparent 1px); background-size: 22px 22px; display: flex; flex-direction: column; gap: 18px; }
.bsa-cv-body.is-dim { filter: grayscale(.45) opacity(.6); pointer-events: none; }
.bsa-cv-day { align-self: center; display: flex; align-items: center; gap: 16px; width: 100%; max-width: 540px; color: var(--text-muted); font-size: 12.5px; }
.bsa-cv-day::before, .bsa-cv-day::after { content: ''; flex: 1; height: 1px; background: rgba(0,0,0,.1); }

/* Message row */
.bsa-cv-msg { display: flex; align-items: flex-start; gap: 11px; max-width: 82%; }
.bsa-cv-msg.in { align-self: flex-start; }
.bsa-cv-msg.out { align-self: flex-end; }
.bsa-cv-stack { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bsa-cv-msg.out .bsa-cv-stack { align-items: flex-end; }
.bsa-cv-sender { font-size: 12.5px; color: var(--text-muted); padding: 0 2px; }
.bsa-cv-sender strong { color: var(--text); font-weight: 700; }
.bsa-cv-line { display: flex; align-items: center; gap: 9px; }

/* Bubble */
.bsa-cv-bubble { position: relative; padding: 11px 14px; border-radius: 13px; font-size: 13.5px; line-height: 1.5; box-shadow: 0 1px 1.5px rgba(0,0,0,.07); max-width: 470px; }
.bsa-cv-msg.in .bsa-cv-bubble { background: #edf3f0; border-left: 3px solid var(--teal); border-top-left-radius: 5px; }
.bsa-cv-msg.out .bsa-cv-bubble { background: #fff; border: 1px solid var(--border); border-top-right-radius: 5px; }
.bsa-cv-bubble.has-react { margin-bottom: 12px; }
.bsa-cv-bubble.k-image, .bsa-cv-bubble.k-doc { padding: 6px; }
.bsa-cv-bubble.k-voice { padding: 9px 13px; }
.bsa-cv-text { white-space: pre-wrap; word-break: break-word; }
/* Sent-template card shown as the first conversation message (mirrors the Preview bubble) */
.bsa-cv-tpl-title { font-weight: 700; margin-bottom: 4px; }
.bsa-cv-tpl-footer { color: rgba(0,0,0,.5); font-size: 11px; margin-top: 6px; }
.bsa-cv-tpl-btn { margin-top: 8px; text-align: center; color: #0288d1; font-weight: 600; border-top: 1px solid rgba(0,0,0,.1); padding-top: 8px; font-size: 12.5px; }
.bsa-cv-bigemoji { font-size: 42px; line-height: 1.05; margin-bottom: 5px; }

/* Reaction badge on a bubble */
.bsa-cv-reaction { position: absolute; bottom: -13px; right: 9px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 1px 5px 2px; font-size: 13px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.bsa-cv-msg.out .bsa-cv-reaction { right: auto; left: 9px; }

/* Quoted reply inside a bubble */
.bsa-cv-quote { border-left: 3px solid var(--teal); background: rgba(13,63,68,.055); border-radius: 5px; padding: 5px 9px; margin-bottom: 7px; display: flex; flex-direction: column; gap: 1px; }
.bsa-cv-quote span { font-size: 11.5px; font-weight: 700; color: var(--teal); }
.bsa-cv-quote em { font-size: 12px; color: var(--text-muted); font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 250px; }

/* Side actions (info / reply / react) */
.bsa-cv-acts { display: inline-flex; align-items: center; gap: 6px; opacity: .5; transition: opacity .12s; flex-shrink: 0; }
.bsa-cv-msg:hover .bsa-cv-acts, .bsa-cv-acts.open { opacity: 1; }
.bsa-cv-actbtn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: #fff; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.13); transition: color .12s, transform .12s; }
.bsa-cv-actbtn:hover { color: var(--text); transform: translateY(-1px); }
.bsa-cv-actbtn:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.bsa-cv-actbtn:disabled:hover { color: var(--text-muted); transform: none; }
.bsa-cv-actbtn.primary { background: var(--teal); color: #fff; }
.bsa-cv-actbtn.primary:disabled { background: #aebbb9; }
.bsa-cv-actbtn.on { background: var(--teal); color: #fff; box-shadow: 0 0 0 2px rgba(13,63,68,.22), 0 1px 4px rgba(0,0,0,.13); }
.bsa-cv-reactwrap { position: relative; display: inline-flex; }

/* Reaction picker + emoji/attach popovers */
.bsa-cv-pop { position: absolute; z-index: 45; background: #fff; border: 1px solid var(--border); box-shadow: 0 12px 30px rgba(0,0,0,.17); padding: 5px; display: flex; gap: 2px; }
.bsa-cv-reactpop { bottom: calc(100% + 8px); border-radius: 999px; }
.bsa-cv-reactpop.right { left: 0; }
.bsa-cv-reactpop.left { right: 0; }
.bsa-cv-reactpop button, .bsa-cv-emojipop button { border: 0; background: transparent; font-size: 19px; cursor: pointer; border-radius: 50%; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; transition: transform .1s; }
.bsa-cv-reactpop button:hover, .bsa-cv-emojipop button:hover { background: #eef4f2; transform: scale(1.18); }
.bsa-cv-reactpop button.on { background: #d7ede6; }

/* Image message */
.bsa-cv-media { display: flex; flex-direction: column; gap: 6px; }
.bsa-cv-photo { width: 232px; height: 150px; border-radius: 9px; background: linear-gradient(135deg, #cfe5df 0%, #aecbc0 55%, #c9d6d0 100%); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.9); }
.bsa-cv-cap { font-size: 13px; line-height: 1.4; padding: 2px 6px 4px; }

/* Voice message */
.bsa-cv-voice { display: flex; align-items: center; gap: 11px; min-width: 240px; }
.bsa-cv-vplay { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding-left: 2px; }
.bsa-cv-wave { display: inline-flex; align-items: center; gap: 2.5px; flex: 1; height: 24px; }
.bsa-cv-wave i { width: 2.5px; border-radius: 2px; background: #b5c2bf; transition: background .12s linear; }
.bsa-cv-wave i.on { background: var(--teal); }
.bsa-cv-vdur { font-size: 11.5px; color: var(--text-muted); flex-shrink: 0; }

/* Document message */
.bsa-cv-doc { width: 252px; }
.bsa-cv-doc-thumb { height: 98px; border-radius: 8px 8px 0 0; background: linear-gradient(135deg, #f5f8f7, #e6edeb); border: 1px solid var(--border); border-bottom: 0; display: flex; align-items: center; justify-content: center; }
.bsa-cv-doc-brand { display: inline-flex; align-items: baseline; gap: 7px; }
.bsa-cv-doc-brand b { font-size: 27px; font-weight: 900; color: var(--teal); letter-spacing: -1px; }
.bsa-cv-doc-brand i { font-size: 12px; font-style: normal; font-weight: 700; color: var(--text-muted); }
.bsa-cv-doc-file { display: flex; align-items: center; gap: 11px; padding: 11px 12px; background: #f6f8f7; border: 1px solid var(--border); border-radius: 0 0 8px 8px; }
.bsa-cv-doc-pdf { width: 31px; height: 37px; border-radius: 5px; background: #e5392f; color: #fff; font-size: 8.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: .4px; }
.bsa-cv-doc-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bsa-cv-doc-meta strong { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.bsa-cv-doc-meta em { font-size: 11px; font-style: normal; color: var(--text-muted); }

/* Time + ticks */
.bsa-cv-time { font-size: 11px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; padding: 0 2px; }
.bsa-ticks { display: inline-block; vertical-align: middle; }

/* Footer */
.bsa-cv-foot { flex-shrink: 0; border-top: 1px solid var(--border); padding: 14px 22px 16px; display: flex; flex-direction: column; gap: 13px; background: #fff; border-radius: 0 0 16px 16px; }

/* Support-window countdown */
.bsa-cv-window { display: flex; align-items: center; gap: 15px; }
.bsa-cv-clock { display: inline-flex; align-items: flex-start; gap: 9px; }
.bsa-cv-unit { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
/* Compact by default (plenty of time left); enlarges to the emphasised size only in the final hour. */
.bsa-cv-unit b { background: #16302c; color: #fff; border-radius: 8px; padding: 5px 8px; font-size: 14px; font-weight: 800; min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.bsa-cv-unit em { font-size: 10.5px; font-style: normal; color: var(--text-muted); }
.bsa-cv-colon { font-size: 14px; font-weight: 800; color: #16302c; padding-top: 5px; }
.bsa-cv-window.is-final .bsa-cv-unit b { border-radius: 9px; padding: 7px 11px; font-size: 18px; min-width: 44px; }
.bsa-cv-window.is-final .bsa-cv-colon { font-size: 18px; padding-top: 7px; }
.bsa-cv-window-lbl { font-size: 13px; color: var(--text); }

/* Reply bar above composer */
.bsa-cv-replybar { display: flex; align-items: center; gap: 11px; background: #f3f7f6; border-left: 3px solid var(--teal); border-radius: 8px; padding: 8px 13px; }
.bsa-cv-replybar-ic { color: var(--teal); display: inline-flex; flex-shrink: 0; }
.bsa-cv-replybar-q { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.bsa-cv-replybar-q span { font-size: 12px; font-weight: 700; color: var(--teal); }
.bsa-cv-replybar-q em { font-size: 12.5px; font-style: normal; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsa-cv-replybar button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; flex-shrink: 0; }
.bsa-cv-replybar button:hover { color: var(--text); }

/* Composer */
.bsa-cv-composer { display: flex; align-items: center; gap: 10px; }
.bsa-cv-toolwrap { position: relative; display: inline-flex; }
.bsa-cv-tool { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #f0f3f2; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.bsa-cv-tool:hover { background: #e3eae8; color: var(--text); }
.bsa-cv-tool.danger { background: #fdecea; color: #d33; }
.bsa-cv-input { flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 12px 18px; font-size: 14px; outline: 0; font-family: inherit; background: #fff; min-width: 0; }
.bsa-cv-input:focus { border-color: var(--teal); }
.bsa-cv-send { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 11px 22px; flex-shrink: 0; }

/* Recording state */
.bsa-cv-composer.recording { gap: 12px; }
.bsa-cv-reclive { flex: 1; display: flex; align-items: center; gap: 13px; background: #fdecea; border-radius: 999px; padding: 10px 18px; min-width: 0; }
.bsa-cv-recdot { width: 11px; height: 11px; border-radius: 50%; background: #e5392f; flex-shrink: 0; animation: bsaPulse 1s ease-in-out infinite; }
@keyframes bsaPulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.bsa-cv-rectime { font-size: 13.5px; font-weight: 700; color: #b3271d; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.bsa-cv-recwave { display: inline-flex; align-items: center; gap: 2.5px; flex: 1; height: 22px; overflow: hidden; }
.bsa-cv-recwave i { width: 2.5px; border-radius: 2px; background: rgba(179,39,29,.5); }
/* Stop-recording button (WhatsApp-web style) */
.bsa-cv-recstop { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: #e5392f; color: #fff; cursor: pointer; transition: background .15s; }
.bsa-cv-recstop:hover { background: #c62c23; }
/* Stopped → preview (play + waveform + duration), then Send */
.bsa-cv-recprev { flex: 1; display: flex; align-items: center; gap: 13px; background: #eef5f3; border-radius: 999px; padding: 8px 14px; min-width: 0; }
.bsa-cv-recprev .bsa-cv-rectime { color: var(--teal); }
.bsa-cv-recprev .bsa-cv-recwave i { background: rgba(13,63,68,.45); }
.bsa-cv-recplay { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--teal); color: #fff; cursor: pointer; padding-inline-start: 2px; }
/* Staged template (composed from a conversation, ready to send) */
.bsa-cv-staged { display: flex; align-items: center; gap: 12px; }
.bsa-cv-staged-card { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.bsa-cv-staged-lbl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--teal); margin-bottom: 5px; }
.bsa-cv-staged-acts { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
/* Disabled row-menu action (e.g. Conversation for scheduled/deleted messages) */
.bsa-row-menu .row-menu-item:disabled { opacity: .4; cursor: not-allowed; }
.bsa-row-menu .row-menu-item:disabled:hover { background: transparent; color: var(--text-muted); }
.bsa-row-menu .row-menu-item:disabled:hover svg { color: var(--text-muted); }

/* Emoji / attach menus */
.bsa-cv-emojipop { bottom: calc(100% + 10px); left: 0; flex-wrap: wrap; width: 234px; border-radius: 14px; padding: 8px; }
.bsa-cv-attachpop { bottom: calc(100% + 10px); left: 0; flex-direction: column; border-radius: 12px; padding: 6px; min-width: 152px; }
.bsa-cv-attachpop button { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; cursor: pointer; padding: 9px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text); font-family: inherit; }
.bsa-cv-attachpop button:hover { background: #eef4f2; }
.bsa-cv-attachpop svg { color: var(--teal); }

/* Expired notice */
/* Alert (left) + action (right), the button lives OUTSIDE the alert box */
.bsa-cv-expired-row { display: flex; align-items: stretch; gap: 14px; }
.bsa-cv-expired { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: #fff8e6; border: 1px solid #f5d98a; color: #8a6100; border-radius: 12px; padding: 14px 18px; font-size: 13.5px; font-weight: 500; line-height: 1.45; }
.bsa-cv-expired-ic { flex-shrink: 0; display: inline-flex; }
/* Primary action beside the expired-window alert */
.bsa-cv-expired-btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; background: #0e3f44; color: #fff; border: 0; border-radius: 12px; padding: 9px 18px; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; transition: background .15s; }
.bsa-cv-expired-btn:hover { background: #0a3034; }
.bsa-cv-expired-btn svg { width: 17px; height: 17px; }


/* Responsive: stack compose / details columns on narrow widths */
@media (max-width: 1180px) {
  .bsa-compose-grid, .bsa-det-mid, .bsa-det-bottom, .bsa-conv-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   BSA — Voice (IVR) detailed view
   ============================================================ */
.bsa-voice-summary .bsa-preview-btn { margin-left: auto; padding: 9px 26px; }
.bsa-voice-details .bsa-det-mid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }

/* 5-bar chart tones */
.bsa-voice-chart { justify-content: space-between; padding-left: 18px; padding-right: 18px; }
.bsa-statbar-fill.va { background: #0d3f44; } .bsa-statbar-fill.vn { background: #5b8f8a; }
.bsa-statbar-fill.vp { background: #a9cfc9; } .bsa-statbar-fill.vr { background: #d7dede; }
.bsa-statbar-fill.vf { background: #e89b94; }

/* Cost Summary (voice) — left cost items + duration, right cost-by-status */
.bsa-voice-cost-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 0.8fr); gap: 18px; }
.bsa-voice-cost-left { display: flex; flex-direction: column; gap: 16px; }
.bsa-call-duration { display: flex; align-items: center; justify-content: space-between; background: #f5f7f7; border-radius: 10px; padding: 12px 16px; font-size: 13px; color: var(--text-muted); }
.bsa-call-duration strong { color: var(--text); font-size: 15px; }
.bsa-cost-by-status { border-left: 1px solid var(--border); padding-left: 18px; }
.bsa-cbs-h { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.bsa-cbs-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; font-size: 13px; color: var(--text-muted); }
.bsa-cbs-row strong { color: var(--text); font-weight: 600; }

/* IVR Options Summary */
.bsa-ivr-opts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.bsa-ivr-sub { background: #f5f7f7; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.bsa-ivr-sub-h { font-size: 13.5px; font-weight: 700; color: var(--text); }
.bsa-path-row { display: flex; align-items: center; justify-content: space-between; }
.bsa-path { font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.bsa-path-pct { background: #0d3f44; color: #fff; border-radius: 8px; padding: 6px 16px; font-size: 13px; font-weight: 600; min-width: 56px; text-align: center; }
.bsa-behavior-row { display: flex; gap: 10px; }
.bsa-behavior-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.bsa-behavior-item > span:first-child { font-size: 11.5px; color: var(--text-muted); line-height: 1.3; }
.bsa-behavior-val { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 0; width: 100%; font-weight: 700; font-size: 13.5px; }
.bsa-fastest { display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid var(--border); padding-top: 12px; font-size: 13px; font-weight: 500; }
.bsa-fastest-chip { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 6px 16px; font-weight: 700; }
.bsa-perf-row { font-size: 13px; background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; }
.bsa-perf-row strong { font-weight: 700; }

/* Contact details + Filter */
.bsa-recip-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; }
.bsa-filter-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: #fff; border-radius: 9px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.bsa-voice-bottom { grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); }

/* Voice status colours */
.bsa-vstatus { font-weight: 700; font-size: 13px; }
.bsa-vstatus.an { color: #0d7a72; } .bsa-vstatus.na { color: #c46a00; } .bsa-vstatus.rj { color: #5a6470; }
.bsa-vstatus.fl { color: #d92d20; } .bsa-vstatus.pd { color: #0f7a3a; } .bsa-vstatus.bs { color: #a67c00; }
.bsa-vstatus.st { color: #2f6fed; } .bsa-vstatus.rg { color: #6d52d6; } .bsa-vstatus.lv { color: #0f9d58; }
.bsa-vstatus.ur { color: #9a4d4d; } .bsa-vstatus.dr { color: #5a6470; } .bsa-vstatus.cn { color: #6b7280; }
/* Contact Details table — status as a pill (dot + tinted bg), identical to the WhatsApp recipients table. */
.bsa-recip-table .bsa-vstatus { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.bsa-recip-table .bsa-vstatus::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.bsa-recip-table .bsa-vstatus.an { background: #e6f7f3; } .bsa-recip-table .bsa-vstatus.na { background: #fff4e6; } .bsa-recip-table .bsa-vstatus.rj { background: #f1f3f5; }
.bsa-recip-table .bsa-vstatus.fl { background: #ffeded; } .bsa-recip-table .bsa-vstatus.pd { background: #e7f6ee; } .bsa-recip-table .bsa-vstatus.bs { background: #fff8e1; }
.bsa-recip-table .bsa-vstatus.st { background: #eaf1fe; } .bsa-recip-table .bsa-vstatus.rg { background: #efecfb; } .bsa-recip-table .bsa-vstatus.lv { background: #e7f7ee; }
.bsa-recip-table .bsa-vstatus.ur { background: #f7eeee; } .bsa-recip-table .bsa-vstatus.dr { background: #f1f3f5; } .bsa-recip-table .bsa-vstatus.cn { background: #f3f4f6; }

/* Right "Details" panel with Option-to-move keypad */
.bsa-voice-panel { gap: 16px; }
.bsa-vp-head { display: flex; align-items: center; justify-content: space-between; }
.bsa-vp-head > span:first-child { font-size: 15px; font-weight: 700; }
.bsa-vp-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; font-weight: 600; font-size: 12.5px; }
.bsa-vp-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.bsa-vp-meta { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.bsa-vp-meta span { color: var(--text-muted); }
.bsa-vp-meta strong { font-weight: 700; }
.bsa-vp-opt-h { font-size: 14px; font-weight: 700; margin-top: 2px; }
.bsa-opt-levels { display: flex; flex-direction: column; gap: 16px; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.bsa-opt-level { display: flex; flex-direction: column; gap: 10px; }
.bsa-opt-level-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.bsa-keypad { display: flex; flex-wrap: wrap; gap: 8px; }
.bsa-key { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--text); background: #fff; }
.bsa-key.on { background: #0d3f44; color: #fff; border-color: #0d3f44; }

/* ---- Voice details: stat tiles + cost breakdown ---- */
.bsa-vstat-tiles { display: flex; gap: 10px; }
.bsa-vstat-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #f1f7f5; border: 1px solid var(--border-2, var(--border)); border-radius: 12px; padding: 9px 16px; min-width: 86px; }
.bsa-vstat-val { font-size: 19px; font-weight: 800; color: var(--teal); line-height: 1.1; }
.bsa-vstat-lbl { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.bsa-cbreak { display: flex; flex-direction: row; gap: 26px 28px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-2, var(--border)); }
.bsa-cbreak-group { display: flex; flex-direction: column; gap: 13px; flex: 1 1 240px; min-width: 0; }
.bsa-cbreak-h { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.bsa-cbreak-item { display: flex; flex-direction: column; gap: 7px; }
.bsa-cbreak-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bsa-cbreak-label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.bsa-cbreak-val { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 700; color: var(--text); flex-shrink: 0; }
.bsa-cbreak-bar-row { display: flex; align-items: center; gap: 11px; }
.bsa-cbreak-bar { flex: 1; height: 7px; background: #eef1f1; border-radius: 999px; overflow: hidden; }
.bsa-cbreak-bar > i { display: block; height: 100%; background: var(--teal); border-radius: 999px; transition: width .25s ease; }
.bsa-cbreak-pct { font-size: 11.5px; font-weight: 600; color: var(--text-muted); min-width: 32px; text-align: right; flex-shrink: 0; }

/* Donut + ranked list for cost-by-destination (scales to many countries) */
.bsa-dest-chart { display: flex; align-items: center; gap: 18px; }
/* IVR breakdown: donut + ranked list side-by-side. The destination group takes the full width so the
   country names fit beside the donut; "By retry attempt" wraps to the row below it. */
.bsa-voice-cost .bsa-dest-chart { flex-direction: row; }
.bsa-voice-cost .bsa-dest-group { /* flex-basis: 100%; */ }
.bsa-donut { flex-shrink: 0; }
.bsa-donut-total { font-size: 18px; font-weight: 800; fill: var(--text); }
.bsa-donut-sub { font-size: 9px; font-weight: 600; letter-spacing: .06em; fill: var(--text-muted); }
.bsa-dest-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; max-height: 188px; overflow-y: auto; }
.bsa-dest-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.bsa-dest-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.bsa-dest-name { color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsa-dest-val { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--text); flex-shrink: 0; }
.bsa-dest-pct { font-size: 11.5px; font-weight: 600; color: var(--text-muted); min-width: 34px; text-align: right; flex-shrink: 0; }
.bsa-cbreak-empty { color: var(--text-muted); font-size: 14px; }

/* Horizontal bar charts for the IVR Options Summary boxes */
.bsa-barchart { display: flex; flex-direction: column; gap: 13px; }
.bsa-bar-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label label" "track val"; align-items: center; column-gap: 10px; row-gap: 5px; }
.bsa-bar-label { grid-area: label; font-size: 12.5px; color: var(--text); display: flex; align-items: baseline; gap: 7px; }
.bsa-bar-label em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.bsa-bar-track { grid-area: track; height: 8px; background: #e9eded; border-radius: 999px; overflow: hidden; }
.bsa-bar-track > i { display: block; height: 100%; background: var(--teal); border-radius: 999px; transition: width .4s ease; }
.bsa-bar-row.warn .bsa-bar-track > i { background: #e0a458; }
.bsa-bar-val { grid-area: val; font-size: 11.5px; font-weight: 700; color: var(--text); min-width: 34px; text-align: right; }

/* ---- Voice recipients grid: attempts + expansion ---- */
.bsa-vrecip-card { flex-shrink: 0; }
.bsa-retry-on-tag { font-size: 11px; font-weight: 600; color: var(--teal); background: #e9f5f1; border-radius: 7px; padding: 3px 10px; margin-inline-start: 4px; }
.bsa-vrecip-table th.bsa-exp-th, .bsa-vrecip-table td.bsa-exp-cell { width: 34px; padding-inline: 8px 0; }
.bsa-exp-caret { display: inline-flex; color: var(--text-muted); transition: transform .15s; }
.bsa-exp-caret.on { transform: rotate(90deg); color: var(--teal); }
.bsa-vrec-row.has-attempts { cursor: pointer; }
.bsa-vrec-row.is-expanded { background: #f6faf9; }
.bsa-attempt-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: #eef1f1; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.bsa-attempt-badge.multi { background: #e9f5f1; color: var(--teal); }
.bsa-attempt-row > td { padding: 0 0 0 34px; background: #f6faf9; border-bottom: 1px solid var(--border-2, var(--border)); }
.bsa-attempt-wrap { padding: 14px 16px 16px; }
.bsa-attempt-h { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.bsa-attempt-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.bsa-attempt-table th { text-align: start; font-size: 11.5px; font-weight: 600; color: var(--text-muted); background: #f5f5f5; padding: 8px 12px; border-bottom: 1px solid var(--border-2, var(--border)); }
.bsa-attempt-table td { font-size: 12.5px; color: var(--text); padding: 9px 12px; border-bottom: 1px solid var(--border-2, var(--border)); vertical-align: middle; }
.bsa-attempt-table tbody tr:last-child td { border-bottom: 0; }
.bsa-attempt-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 11.5px; font-weight: 700; }

/* Per-recipient expanded detail: description + call transcript (each number is a record) */
.bsa-vrec-detail { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.bsa-vrec-block { display: flex; flex-direction: column; gap: 9px; }
.bsa-vrec-bh { font-size: 12px; font-weight: 700; color: var(--text); }
.bsa-vrec-desc { margin: 0; font-size: 13px; line-height: 1.55; color: #45534e; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; }
.bsa-vrec-tscript { display: flex; flex-direction: column; gap: 8px; }
.bsa-vrec-tline { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; display: flex; flex-direction: column; gap: 5px; }
.bsa-vrec-tnode { font-size: 12.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; }
.bsa-vrec-ttext { font-size: 12.5px; line-height: 1.5; color: #45534e; }
.bsa-vrec-tkey { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--teal); }
.bsa-vrec-tkeycap { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: var(--teal); color: #fff; font-size: 11.5px; font-weight: 800; }

/* ---- Preview / recorded-call modal ---- */
.bsa-modal-overlay { position: fixed; inset: 0; background: rgba(13,30,28,.45); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.bsa-modal { background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.3); width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.bsa-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.bsa-modal-title { font-size: 16px; font-weight: 800; color: var(--text); }
.bsa-modal-sub { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.bsa-modal-sub .bsa-vstatus { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #f1f3f5; }
.bsa-modal-sub .bsa-vstatus::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bsa-modal-sub .bsa-vstatus.an { background: #e6f7f3; }
.bsa-modal-close { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bsa-modal-close:hover { background: #f3f6f5; color: var(--text); }

/* ---- Voice Call Preview pop-up (focused: recording + summary + recipient path) ---- */
.bsa-vprev2 { max-width: 600px; }
.bsa-vprev2-canvasbox { display: flex; flex-direction: column; gap: 9px; }
.bsa-vprev2 .bsa-vprev2-canvas { height: auto; margin: 0; padding-top: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fbfdfc; }
.bsa-vprev2 .bsa-vprev2-canvas .ivr-canvas-step { min-height: 300px; }
.bsa-vprev2-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.bsa-vprev2-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bsa-vprev2-htxt { flex: 1; min-width: 0; }
.bsa-vprev2-title { font-size: 15.5px; font-weight: 800; color: var(--text); }
.bsa-vprev2-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.bsa-vprev2 .bsa-vstatus { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.bsa-vprev2-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.bsa-vprev2-player { display: flex; align-items: center; gap: 12px; background: #f6f9f8; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.bsa-vprev2-player.is-off { opacity: .65; }
.bsa-vprev2-play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding-left: 2px; }
.bsa-vprev2-play:disabled { background: #b6c2c0; cursor: default; }
.bsa-vprev2-pmeta { flex: 1; min-width: 0; }
.bsa-vprev2-player .bsa-vconv-wave { height: 26px; width: 100%; }
.bsa-vprev2-player .bsa-vconv-wave > i { background: var(--teal); opacity: .5; }
.bsa-vprev2-plabel { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.bsa-vprev2-pdur { font-variant-numeric: tabular-nums; }
.bsa-vprev2-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bsa-vprev2-tile { background: #f6f9f8; border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bsa-vprev2-tval { font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsa-vprev2-tout { font-size: 13px; white-space: normal; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bsa-vprev2-tlbl { font-size: 11px; color: var(--text-muted); }
.bsa-vprev2-phead { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 9px; }
.bsa-vprev2-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.bsa-vprev2-step { display: flex; align-items: center; gap: 10px; padding: 7px 0 7px 18px; position: relative; }
.bsa-vprev2-step::before { content: ''; position: absolute; left: 4px; top: 16px; bottom: -7px; width: 2px; background: #dde6e3; }
.bsa-vprev2-step:last-child::before { display: none; }
.bsa-vprev2-step::after { content: ''; position: absolute; left: 0; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--teal); }
.bsa-vprev2-snode { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.bsa-vprev2-spress { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.bsa-vprev2-skey { width: 22px; height: 22px; border-radius: 6px; background: var(--teal); color: #fff; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.bsa-vprev2-send { font-size: 11.5px; font-weight: 600; color: #b3261e; background: #fde8e7; border-radius: 6px; padding: 2px 8px; flex-shrink: 0; }
.bsa-vprev2-conv { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; border-radius: 11px; border: 1px solid #cfe5df; background: #e9f5f1; color: var(--teal); font-weight: 600; font-size: 13.5px; font-family: inherit; cursor: pointer; }
.bsa-vprev2-conv:hover { background: #ddeee8; border-color: #bcd9cf; }
.bsa-vprev2-empty { display: flex; align-items: flex-start; gap: 10px; background: #fff8e6; border: 1px solid #f5d98a; color: #8a6100; border-radius: 12px; padding: 13px 15px; font-size: 13px; line-height: 1.5; }
.bsa-vprev2-empty svg { flex-shrink: 0; margin-top: 1px; }
.bsa-modal-body { padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
/* Send-a-new-template pop-up (opened from a conversation) */
.bsa-modal-foot { flex-shrink: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }
.bsa-sendtpl-modal { max-width: 1120px; min-height: 600px; }
.bsa-sendtpl-modal .bsa-card { border: 1px solid var(--border); border-radius: 14px; padding: 15px 16px; }
/* Recipients (variable mapping) on the left, live phone preview on the right */
.bsa-sendtpl-lower { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.bsa-sendtpl-preview { align-self: stretch; }
.bsa-sendtpl-preview .bsa-phone { margin-top: 8px; }
.bsa-gb-lockchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--text-muted); background: #f1f3f5; border-radius: 999px; padding: 3px 10px; }
.bsa-lock-ic { opacity: .7; flex-shrink: 0; }
.bsa-manual-locked .bsa-manual-num { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); background: #f4f6f7; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; white-space: nowrap; flex-shrink: 0; }
.bsa-gb-novars { font-size: 12.5px; color: var(--text-muted); font-style: italic; padding: 2px 0; }
.bsa-rec-player { display: flex; align-items: center; gap: 14px; background: #f4f7f6; border: 1px solid var(--border); border-radius: 14px; padding: 13px 16px; }
.bsa-rec-play { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--teal); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; padding-left: 3px; }
.bsa-rec-play:disabled { background: #aebbb9; cursor: default; }
.bsa-rec-wave { display: inline-flex; align-items: center; gap: 3px; flex: 1; height: 30px; overflow: hidden; }
.bsa-rec-wave i { width: 3px; border-radius: 2px; background: rgba(13,63,68,.4); }
.bsa-rec-dur { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.bsa-rec-note { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; background: #f8f9f9; border-radius: 10px; padding: 11px 14px; }
.bsa-rec-note svg { flex-shrink: 0; margin-top: 1px; color: var(--teal); }
.bsa-vprev-tree .bsa-vp-opt-h, .bsa-vprev-path .bsa-vp-opt-h { margin-bottom: 10px; }
.bsa-vprev-modal .bsa-ivr-flow.bsa-vprev-canvas { height: auto; margin: 0; padding-top: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; }
.bsa-vprev-modal .bsa-vprev-canvas .ivr-canvas-step { min-height: 320px; }
.bsa-vprev-path .bsa-opt-levels { max-height: none; }

@media (max-width: 1180px) {
  .bsa-voice-cost-grid, .bsa-ivr-opts-grid, .bsa-voice-bottom { grid-template-columns: 1fr; }
}

/* ===== Falcon / Client perspective (picker + rail + Switch perspective) ===== */
.bsa-page-full.bsa-falcon { gap: 16px; }
.bsa-clients-rail { width: var(--clients-w, 260px); flex-shrink: 0; align-self: stretch; }
.bsa-client-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px 12px; }
.bsa-ch-left { display: flex; align-items: center; gap: 12px; }
.bsa-ch-name { font-size: 18px; font-weight: 700; color: var(--text); }
.bsa-switch-btn { display: inline-flex; align-items: center; gap: 7px; }
