/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #1d1d1f; background: #fff; -webkit-font-smoothing: antialiased; }

/* ── Login ── */
.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; background: #f5f5f7; }
.login-card { background: #fff; border-radius: 18px; padding: 48px 40px; width: 380px; box-shadow: 0 2px 16px rgba(0,0,0,0.07); text-align: center; }
.login-logo { margin-bottom: 16px; }
.login-card h1 { font-size: 22px; font-weight: 600; margin-bottom: 28px; color: #1d1d1f; }
.form-group { margin-bottom: 14px; }
.form-group input, .select-input { width: 100%; padding: 12px 16px; border: 1px solid #d2d2d7; border-radius: 10px; font-size: 15px; background: #f5f5f7; outline: none; transition: border-color 0.2s; }
.form-group input:focus, .select-input:focus { border-color: #007AFF; background: #fff; }
.form-error { color: #ff3b30; font-size: 13px; margin-bottom: 12px; }
.btn-primary { width: 100%; padding: 12px; border: none; border-radius: 10px; background: #007AFF; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-primary:hover { background: #0066d6; }
.btn-primary:disabled { background: #a0a0a5; cursor: not-allowed; }
.btn-small { padding: 6px 14px; border: none; border-radius: 8px; background: #007AFF; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }

/* "Conversation" button in the contact popup header */
.popup-open-conv { padding: 6px 12px; border: 1px solid #d2d2d7; border-radius: 8px; background: #fff; color: #1d1d1f; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.popup-open-conv:hover { background: #f5f5f7; border-color: #007AFF; color: #007AFF; }

/* ── App Layout ── */
.app-layout { display: flex; height: 100vh; overflow: hidden; position: relative; }

/* ── Nav Rail ── */
.nav-rail { width: 68px; min-width: 68px; background: #fafafc; border-right: 1px solid #ececf1; display: flex; flex-direction: column; align-items: center; padding: 12px 0; }
.nav-rail-top { margin-bottom: 8px; }
.nav-rail-tabs { flex: 1; display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 6px; }
.nav-rail-bottom { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 0 6px; }
.nav-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: none; background: transparent; color: #8e8e93; cursor: pointer; border-radius: 10px; transition: all 0.15s; font-size: 10px; font-weight: 500; width: 100%; position: relative; }
.nav-tab svg { stroke-width: 1.8; }
.nav-tab:hover { background: #ececf1; color: #1d1d1f; }
.nav-tab.active { background: #e4e4e9; color: #1d1d1f; }
.notif-badge-count {
    position: absolute; top: 4px; right: 6px;
    background: #FF3B30; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 1;
    min-width: 16px; height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* ── Main Views ── */
.main-view { flex: 1; display: flex; overflow: hidden; }

/* ── Contact List Pane ── */
.contact-list-pane { width: 360px; min-width: 360px; background: #fafafc; border-right: 1px solid #ececf1; display: flex; flex-direction: column; }
.contact-list-header { padding: 16px; border-bottom: 1px solid #ececf1; }
.contact-list-header h2 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.search-input { width: 100%; padding: 8px 12px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; background: #fff; outline: none; }
.search-input:focus { border-color: #007AFF; }
.contact-list { flex: 1; overflow-y: auto; }
.contact-item { display: flex; align-items: center; padding: 10px 16px; cursor: pointer; border-bottom: 1px solid #f2f2f4; transition: background 0.1s; gap: 10px; }
.contact-item:hover { background: #f2f2f5; }
.contact-item.active { background: #e9edf3; color: #1d1d1f; }
.contact-unread { width: 8px; height: 8px; border-radius: 50%; background: #007AFF; flex-shrink: 0; }
.contact-unread.hidden { visibility: hidden; }
.contact-info { flex: 1; min-width: 0; }
.contact-name-row { display: flex; align-items: baseline; gap: 8px; }
.contact-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.contact-time { font-size: 10px; color: #aeaeb2; white-space: nowrap; flex-shrink: 0; }
.contact-subtitle { font-size: 11px; color: #86868b; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Last-message preview (falls back to .contact-subtitle when absent) */
.contact-preview { font-size: 12px; color: #86868b; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-preview-you { color: #aeaeb2; font-weight: 600; }

.list-pager { display: flex; justify-content: center; gap: 8px; padding: 8px; border-top: 1px solid #e5e5ea; }
.list-pager button { padding: 4px 12px; border: 1px solid #d2d2d7; border-radius: 6px; background: #fff; font-size: 12px; cursor: pointer; }
.list-pager button.active { background: #007AFF; color: #fff; border-color: #007AFF; }
.list-pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Message Pane ── */
.message-pane { flex: 1; display: flex; flex-direction: column; background: #fff; min-width: 0; }
.message-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #ececf1; background: #fafafc; min-height: 56px; }
.message-header h3 { font-size: 16px; font-weight: 600; }
.message-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.message-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.msg-header-badges { display: flex; align-items: center; gap: 4px; }
.msg-header-stage { display: flex; align-items: center; }
.message-list { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; background: #fff; }
.empty-state { display: flex; align-items: center; justify-content: center; height: 100%; color: #86868b; font-size: 15px; }

/* iMessage bubbles */
.msg-bubble-row { display: flex; margin-bottom: 4px; }
.msg-bubble-row.outbound { justify-content: flex-end; }
.msg-bubble-row.inbound { justify-content: flex-start; }
.msg-bubble-row > div { max-width: 70%; }
.msg-bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.4; word-break: break-word; white-space: pre-wrap; }
.msg-bubble.sms.outbound { background: #007AFF; color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble.sms.inbound { background: #e9e9eb; color: #1d1d1f; border-bottom-left-radius: 4px; }
.msg-bubble.email.outbound { background: #34c759; color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble.email.inbound { background: #f0f0f0; color: #1d1d1f; border-bottom-left-radius: 4px; }
.msg-bubble.portal.outbound { background: #7c3aed; color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble.portal.inbound { background: #f5f3ff; color: #1d1d1f; border: 1px solid #e0d7fe; border-bottom-left-radius: 4px; }
.msg-channel-tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; opacity: 0.7; }
.msg-channel-tag.portal-tag { color: #7c3aed; opacity: 1; }
.msg-channel-tag.email-tag { color: #34c759; opacity: 1; }
.msg-channel-tag.call-tag { color: #ff9500; opacity: 1; }
.msg-channel-tag.live_chat-tag { color: #30d1c5; opacity: 1; }
.msg-uncertain-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 600;
    background: #facc15;
    color: #422006;
    border-radius: 4px;
    cursor: help;
    letter-spacing: 0.3px;
}
.msg-time { font-size: 10px; color: #86868b; margin-top: 2px; text-align: right; }
.msg-bubble-row.inbound .msg-time { text-align: left; }
.msg-date-divider { text-align: center; color: #86868b; font-size: 12px; margin: 16px 0 8px; }

/* Unified timeline (Phase 3d): stage moves + internal notes */
.msg-stage-event { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; text-align: center; color: #86868b; font-size: 12px; margin: 10px 0; }
.msg-stage-event .msg-stage-text { line-height: 1.4; }
.msg-stage-pipeline { display: inline-block; padding: 1px 7px; border-radius: 8px; background: #f0f0f2; border: 1px solid #e5e5ea; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; color: #86868b; }
.msg-stage-time { font-size: 10px; color: #aeaeb2; }
.msg-note-card { max-width: 70%; margin: 6px auto; padding: 10px 14px; background: #fffaeb; border: 1px solid #fde68a; border-radius: 12px; }
.msg-note-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 11px; }
.msg-note-icon { font-size: 12px; }
.msg-note-author { font-weight: 600; color: #92610a; }
.msg-note-source { display: inline-block; padding: 1px 6px; border-radius: 6px; background: #fef3c7; border: 1px solid #fde68a; font-size: 10px; font-weight: 600; color: #92610a; }
.msg-note-time { margin-left: auto; color: #b45309; opacity: 0.7; font-size: 10px; }
.msg-note-body { font-size: 13px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; color: #1d1d1f; }
/* Inline images in SMS bubbles */
.msg-inline-img { max-width: 100%; max-height: 300px; border-radius: 12px; margin: 6px 0; display: block; cursor: pointer; }
.msg-inline-img:hover { opacity: 0.9; }
.msg-bubble a { display: block; }

/* Compose */
.message-compose { padding: 12px 16px; border-top: 1px solid #ececf1; background: #fafafc; }
.compose-toggle { display: flex; gap: 0; margin-bottom: 8px; border-radius: 8px; overflow: hidden; border: 1px solid #d2d2d7; width: fit-content; }
.compose-channel { padding: 6px 16px; border: none; background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; color: #86868b; transition: all 0.15s; }
.compose-channel.active { background: #007AFF; color: #fff; }
.compose-channel[data-channel="note"].active { background: #d97706; color: #fff; }
/* Note mode: internal-note composer — tinted textarea as a visual hint */
.message-compose.note-mode .compose-row textarea { background: #fffaeb; border-color: #fde68a; }
.message-compose.note-mode .compose-row textarea:focus { border-color: #d97706; }
.message-compose.note-mode .btn-send { background: #d97706; }
.message-compose.note-mode .btn-send:hover { background: #b45309; }
.email-subject-row { margin-bottom: 8px; }
.subject-input { width: 100%; padding: 8px 12px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; outline: none; }
.compose-row { display: flex; gap: 8px; align-items: flex-end; }
.compose-row textarea { flex: 1; padding: 10px 14px; border: 1px solid #d2d2d7; border-radius: 18px; font-size: 14px; resize: none; outline: none; max-height: 120px; font-family: inherit; line-height: 1.4; }
.compose-row textarea:focus { border-color: #007AFF; }
.btn-send { width: 38px; height: 38px; border-radius: 50%; border: none; background: #007AFF; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s; }
.btn-send:hover { background: #0066d6; }

/* ── Detail Pane ── */
.detail-pane { width: 340px; min-width: 340px; background: #fafafc; border-left: 1px solid #ececf1; overflow-y: auto; padding: 20px; }
.detail-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: #86868b; }
.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: #86868b; margin-bottom: 8px; font-weight: 600; }
.detail-name { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.detail-name-section { position: relative; }
.detail-badges-row { position: absolute; top: 0; right: 0; display: flex; gap: 4px; }
.detail-name-section .detail-name { padding-right: 80px; }
.detail-field { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.detail-field .label { color: #86868b; }
.detail-field .value { font-weight: 500; text-align: right; max-width: 60%; word-break: break-all; }
.detail-field .value a { color: #007AFF; text-decoration: none; }
.note-item { padding: 10px; background: #fff; border-radius: 10px; margin-bottom: 8px; border: 1px solid #ececf1; }
.note-item .note-body { font-size: 13px; line-height: 1.4; white-space: pre-wrap; }
.note-item .note-date { font-size: 11px; color: #86868b; margin-top: 4px; }
.opp-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.opp-badge.open { background: #e8f5e9; color: #2e7d32; }
.opp-badge.won { background: #e3f2fd; color: #1565c0; }
.opp-badge.lost { background: #fce4ec; color: #c62828; }
.opp-badge.abandoned { background: #f5f5f5; color: #757575; }
.outcome-history-item { padding: 10px; background: #fff; border-radius: 10px; margin-bottom: 8px; border: 1px solid #e5e5ea; }
.outcome-status-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.outcome-status-badge.APPROVED { background: #d4edda; color: #155724; }
.outcome-status-badge.REJECTED { background: #f8d7da; color: #721c24; }
.outcome-status-badge.OPT-OUT { background: #fff3cd; color: #856404; }
.outcome-status-badge.HOLD { background: #cce5ff; color: #004085; }
.outcome-status-badge.INCOMPLETE { background: #e2e3e5; color: #383d41; }
.outcome-status-badge.NO-SHOW { background: #f5c6cb; color: #721c24; }
.rating-stars-display { color: #ff9500; font-size: 13px; letter-spacing: 1px; }

/* ── Next Steps Dropdown ── */
.next-steps-wrapper { position: relative; }
.btn-next-steps { padding: 8px 16px; border: 1px solid #007AFF; border-radius: 8px; background: #fff; color: #007AFF; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.btn-next-steps:hover { background: #007AFF; color: #fff; }
.next-steps-dropdown { display: none; position: absolute; top: 100%; right: 0; margin-top: 4px; background: #fff; border: 1px solid #ececf1; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.10); overflow: hidden; z-index: 100; min-width: 180px; }
.next-steps-dropdown.open { display: block; }
.next-steps-dropdown button { display: block; width: 100%; padding: 10px 16px; border: none; background: transparent; text-align: left; font-size: 14px; cursor: pointer; transition: background 0.1s; }
.next-steps-dropdown button:hover { background: #f5f5f7; }

/* ── Outcome Modal ── */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #fff; border-radius: 16px; max-width: 520px; width: 90%; max-height: 85vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.modal-content.modal-outcome { max-width: 560px; }
.modal-content.modal-small { max-width: 400px; padding: 24px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 12px; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { width: 28px; height: 28px; border-radius: 50%; border: none; background: #e8e8ed; color: #86868b; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #d2d2d7; }

/* Outcome steps */
.outcome-step { padding: 0 24px 24px; }
.outcome-step .modal-header { padding: 20px 0 12px; }
.outcome-choice { display: flex; gap: 12px; margin-top: 12px; }
.btn-choice { flex: 1; padding: 16px; border: 2px solid #e5e5ea; border-radius: 12px; background: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.btn-showed:hover { border-color: #34c759; background: #f0faf3; }
.btn-noshow:hover { border-color: #ff3b30; background: #fff5f5; }

/* Rating form */
.rating-form { margin-top: 8px; }
.rating-category { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0; }
.rating-category:last-of-type { border-bottom: none; }
.rating-cat-header h4 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.rating-desc { font-size: 12px; color: #86868b; margin-bottom: 8px; }
.star-picker { display: flex; gap: 4px; }
.star-picker .star { width: 32px; height: 32px; cursor: pointer; font-size: 24px; color: #d2d2d7; transition: color 0.1s; user-select: none; }
.star-picker .star.filled { color: #ff9500; }
.star-picker .star:hover { color: #ffb340; }
.rating-comment { margin-top: 8px; }
.rating-comment textarea { width: 100%; padding: 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; resize: vertical; min-height: 60px; font-family: inherit; outline: none; }
.rating-comment textarea:focus { border-color: #007AFF; }
.char-count { font-size: 11px; color: #86868b; float: right; margin-top: 4px; }

/* Confirm form */
.confirm-form { padding: 0 0 4px; }
.confirm-status { padding: 12px; background: #f5f5f7; border-radius: 10px; margin-bottom: 16px; font-size: 14px; text-align: center; }
.confirm-form textarea { width: 100%; padding: 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; resize: vertical; font-family: inherit; outline: none; margin-bottom: 16px; }

/* ── Admin ── */
.admin-container { flex: 1; padding: 24px; overflow-y: auto; max-width: 900px; margin: 0 auto; }
.admin-tabs { display: flex; gap: 0; margin-bottom: 24px; border-radius: 10px; overflow: hidden; border: 1px solid #d2d2d7; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.admin-tab { padding: 10px 20px; border: none; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; color: #86868b; transition: all 0.15s; }
.admin-tab.active { background: #007AFF; color: #fff; }
.admin-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.admin-panel-header h3 { font-size: 16px; font-weight: 600; }

/* User cards */
.user-card { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: #fff; border: 1px solid #ececf1; border-radius: 12px; margin-bottom: 8px; }
.user-card-info { display: flex; align-items: center; gap: 12px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: #007AFF; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.user-card-name { font-weight: 600; font-size: 14px; }
.user-card-meta { font-size: 12px; color: #86868b; }
.user-card-actions { display: flex; gap: 8px; }
.user-card-actions button { padding: 6px 12px; border: 1px solid #d2d2d7; border-radius: 6px; background: #fff; font-size: 12px; cursor: pointer; }
.user-card-actions button:hover { background: #f5f5f7; }
.user-card-actions .btn-view-as { border-color: #007AFF; color: #007AFF; }

/* Logs */
.log-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.log-time { color: #86868b; white-space: nowrap; flex-shrink: 0; }
.log-user { font-weight: 600; flex-shrink: 0; }
.log-action { flex: 1; }
.log-action-type { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; background: #e8e8ed; margin-right: 4px; }

/* Assign form */
.assign-form { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.assign-form .search-input { width: 250px; }
.assign-form .select-input { width: 200px; }
.assign-result-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #fff; border: 1px solid #e5e5ea; border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.assign-result-item:hover { background: #f5f5f7; }

/* View-as banner */
.view-as-banner { position: fixed; top: 0; left: 68px; right: 0; background: #ff9500; color: #fff; padding: 8px 20px; display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 13px; font-weight: 600; z-index: 500; }
.view-as-banner .btn-small { background: rgba(255,255,255,0.25); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #b5b5ba; }

/* ── Spinner ── */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid #e5e5ea; border-top-color: #007AFF; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }


/* ── Message View Tabs ── */
.msg-view-tabs { display: flex; gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid #d2d2d7; }
.msg-view-tab { padding: 5px 14px; border: none; background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; color: #86868b; transition: all 0.15s; }
.msg-view-tab.active { background: #007AFF; color: #fff; }

/* ── Email Thread View ── */
.email-thread-list { padding: 12px; }
.email-thread-item { background: #fff; border: 1px solid #ececf1; border-radius: 12px; margin-bottom: 8px; overflow: hidden; cursor: pointer; transition: box-shadow 0.15s; }
.email-thread-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.email-thread-item.expanded { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.email-thread-header { display: flex; align-items: center; padding: 12px 14px; gap: 10px; }
.email-thread-indicator { width: 4px; height: 32px; border-radius: 2px; background: #007AFF; flex-shrink: 0; }
.email-thread-indicator.inbound { background: #34c759; }
.email-thread-info { flex: 1; min-width: 0; }
.email-thread-subject { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-thread-preview { font-size: 12px; color: #86868b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.email-thread-meta { text-align: right; flex-shrink: 0; }
.email-thread-date { font-size: 11px; color: #86868b; }
.email-thread-count { font-size: 10px; background: #e8e8ed; color: #636366; padding: 1px 6px; border-radius: 8px; margin-top: 2px; display: inline-block; }
.email-thread-body { border-top: 1px solid #f0f0f0; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.email-thread-item.expanded .email-thread-body { max-height: 2000px; }
.email-msg { padding: 14px; border-bottom: 1px solid #f5f5f7; }
.email-msg:last-child { border-bottom: none; }
.email-msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.email-msg-dir { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.email-msg-dir.outbound { background: #007AFF; color: #fff; }
.email-msg-dir.inbound { background: #e8f5e9; color: #2e7d32; }
.email-msg-time { font-size: 11px; color: #86868b; }
.email-msg-content { font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; color: #333; }
.email-reply-bar { padding: 12px 14px; border-top: 1px solid #e5e5ea; background: #fafafa; }
.email-reply-bar textarea { width: 100%; padding: 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; resize: vertical; min-height: 60px; font-family: inherit; outline: none; }
.email-reply-bar textarea:focus { border-color: #007AFF; }
.email-reply-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.email-reply-actions button { padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-reply { border: none; background: #007AFF; color: #fff; }
.btn-reply:hover { background: #0066d6; }
.btn-reply:disabled { background: #a0a0a5; }

/* Admin panel header */
.admin-panel-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.admin-panel-header h3 { margin:0; font-size:16px; font-weight:600; }

/* Modal small variant */
.modal-small { max-width:380px; padding:24px; }

/* App Switcher */
.app-switcher-wrap { position: relative; }
.app-switcher-dropdown {
    display: none; position: absolute; top: 44px; left: 0;
    background: #fff; border: 1px solid #ececf1; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.10); min-width: 180px; z-index: 9999;
    padding: 6px 0; overflow: hidden;
}
.app-switcher-dropdown.open { display: block; }
.app-switcher-title {
    font-size: 11px; font-weight: 600; color: #86868b; text-transform: uppercase;
    letter-spacing: .5px; padding: 8px 14px 4px;
}
.app-switcher-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 14px;
    font-size: 14px; color: #1d1d1f; text-decoration: none; transition: background .15s;
}
.app-switcher-item:hover { background: #f5f5f7; }
.app-switcher-item.active { font-weight: 600; color: #007AFF; }
.app-switcher-icon { font-size: 16px; width: 22px; text-align: center; }

/* Contact Filters — filter bar + custom filter builder (Phase 3f) */
.list-filter-bar { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.fb-btn {
    padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 500;
    border: 1px solid #d2d2d7; background: #fff; color: #86868b; cursor: pointer;
    transition: all .15s; white-space: nowrap;
}
.fb-btn:hover { border-color: #007AFF; color: #007AFF; }
.fb-btn-primary { background: #007AFF; color: #fff; border-color: #007AFF; }
.fb-btn-primary:hover { background: #0066d6; color: #fff; }
.fb-active {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px 6px 3px 12px;
    border-radius: 16px; font-size: 12px; font-weight: 500;
    background: #e8f0fe; color: #007AFF; border: 1px solid #c7dbfc;
}
.fb-active-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-active-clear { border: none; background: none; color: #007AFF; font-size: 14px; cursor: pointer; padding: 0 4px; line-height: 1; }
.fb-active-clear:hover { color: #0055b3; }
.fb-saved-wrap { position: relative; }
.fb-menu {
    position: absolute; top: calc(100% + 4px); left: 0; min-width: 230px;
    background: #fff; border: 1px solid #e5e5ea; border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 500; padding: 4px;
}
.fb-menu-item { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 8px; font-size: 13px; color: #1d1d1f; }
.fb-menu-item:hover { background: #f5f5f7; }
.fb-menu-item.active { background: #e8f0fe; }
.fb-menu-item.active .fb-menu-name { color: #007AFF; font-weight: 600; }
.fb-menu-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.fb-menu-act { border: none; background: none; cursor: pointer; font-size: 12px; padding: 2px 5px; color: #86868b; border-radius: 4px; }
.fb-menu-act:hover { background: #e8e8ed; color: #1d1d1f; }
.fb-menu-empty { padding: 12px; font-size: 12px; color: #86868b; text-align: center; line-height: 1.5; }
/* Filter builder modal */
.fb-card { max-width: 640px; width: 92%; }
.fb-body { padding: 16px; max-height: 50vh; overflow-y: auto; }
.fb-cond { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.fb-cond select, .fb-cond input {
    font-size: 13px; padding: 6px 8px; border: 1px solid #d1d1d6; border-radius: 8px;
    background: #fff; color: #1d1d1f; max-width: 220px;
}
.fb-cond select:focus, .fb-cond input:focus { border-color: #007AFF; outline: none; }
.fb-inputs { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fb-num { width: 72px; }
.fb-unit, .fb-between-arrow { font-size: 12px; color: #86868b; }
.fb-cond-remove {
    border: none; background: #e8e8ed; color: #86868b; width: 24px; height: 24px;
    border-radius: 50%; cursor: pointer; font-size: 14px; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.fb-cond-remove:hover { background: #ffd6d3; color: #ff3b30; }
.fb-footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid #e5e5ea; }
.fb-footer .search-input { flex: 1; margin: 0; }
.fb-footer-btns { display: flex; gap: 8px; }
.fb-error { padding: 0 16px 12px; color: #ff3b30; font-size: 12px; }
.filter-chip {
    padding: 4px 12px; border-radius: 16px; font-size: 12px; font-weight: 500;
    border: 1px solid #d2d2d7; background: #fff; color: #86868b; cursor: pointer;
    transition: all .15s; white-space: nowrap;
}
.filter-chip:hover { border-color: #007AFF; color: #007AFF; }
.filter-chip.active { background: #007AFF; color: #fff; border-color: #007AFF; }

/* ── Pipeline Board ── */
.pipeline-container { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.pipeline-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid #ececf1; background: #fafafc; flex-shrink: 0; }
.pipeline-header h2 { font-size: 18px; font-weight: 600; }
.pipeline-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.pipeline-board { flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding: 16px 20px; background: #fff; }
.pipeline-col { width: 290px; flex-shrink: 0; display: flex; flex-direction: column; max-height: 100%; background: #fafafc; border: 1px solid #ececf1; border-radius: 12px; }
.pipeline-col-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid #ececf1; flex-shrink: 0; }
.pipeline-col-name { font-size: 13px; font-weight: 600; color: #1d1d1f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline-col-count { font-size: 11px; font-weight: 600; color: #86868b; background: #ececf1; border-radius: 999px; padding: 2px 8px; flex-shrink: 0; }
.pipeline-col-cards { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.pipeline-card { background: #fff; border: 1px solid #ececf1; border-radius: 10px; padding: 10px 12px; cursor: grab; transition: border-color 0.15s, box-shadow 0.15s; }
.pipeline-card:hover { border-color: #d2d2d7; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.pipeline-card:active { cursor: grabbing; }
.pipeline-card.dragging { opacity: 0.5; }
.pipeline-card-name { font-size: 13px; font-weight: 600; color: #1d1d1f; display: flex; align-items: center; gap: 6px; }
.pipeline-card-time { font-size: 11px; color: #86868b; margin-top: 4px; }
.pipeline-card-unread { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #007AFF; flex-shrink: 0; }
.pipeline-col.drop-target { border-color: #007AFF; background: rgba(0,122,255,0.06); }
.pipeline-col.drop-target .pipeline-col-header { border-bottom-color: rgba(0,122,255,0.25); }
.pipeline-col-loading, .pipeline-col-empty, .pipeline-col-more { font-size: 12px; color: #86868b; text-align: center; padding: 12px 8px; }
.pipeline-col-more { border-top: 1px dashed #ececf1; }

/* Admin → Settings: custom field + pipeline/stage editors (Phase 3g) */
.settings-pipeline { margin-bottom: 16px; }
.settings-stages { margin-left: 20px; padding-left: 12px; border-left: 2px solid #ececf1; }
.settings-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 14px; background: #fff; border: 1px solid #ececf1; border-radius: 10px; margin-bottom: 6px;
}
.settings-stage-row { background: #fafafc; }
.settings-new-row { border-style: dashed; }
.settings-row-info { min-width: 0; }
.settings-row-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.settings-row-meta { font-size: 12px; color: #86868b; margin-top: 2px; }
.settings-row-meta code { background: #f5f5f7; border: 1px solid #ececf1; border-radius: 4px; padding: 0 4px; font-size: 11px; }
.settings-badge {
    display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 6px;
    border-radius: 4px; background: #ececf1; color: #636366;
}
.settings-badge-active { background: rgba(52,199,89,.12); color: #248a3d; }
.settings-badge-inactive { background: rgba(255,59,48,.10); color: #d70015; }
.settings-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.settings-row-actions button {
    padding: 5px 10px; border: 1px solid #d2d2d7; border-radius: 6px;
    background: #fff; font-size: 12px; cursor: pointer; color: #1d1d1f;
}
.settings-row-actions button:hover:not(:disabled) { border-color: #007AFF; color: #007AFF; }
.settings-row-actions button:disabled { opacity: 0.35; cursor: not-allowed; }
.settings-row-actions .settings-btn-danger:hover:not(:disabled) { border-color: #ff3b30; color: #ff3b30; }

/* ── Settings View (top-level admin tab) ── */
.settings-container { flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px 32px; }
.settings-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.settings-header h2 { font-size: 20px; font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.settings-section { background: #fafafc; border: 1px solid #ececf1; border-radius: 12px; padding: 20px; min-width: 0; }
.settings-section-desc { color: #86868b; font-size: 13px; line-height: 1.45; margin: 0 0 16px; }
#settingsView .settings-row { padding: 14px 16px; gap: 16px; }
#settingsView .settings-row-actions { gap: 8px; }
@media (max-width: 1100px) {
    .settings-grid { grid-template-columns: 1fr; }
}

/* Detail pane: custom field values (Phase 3g) */
.cf-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.cf-row:last-child { border-bottom: none; }
.cf-label { color: #86868b; flex-shrink: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-control { flex: 1; display: flex; justify-content: flex-end; }
.cf-input {
    width: 100%; max-width: 170px; font-size: 12px; padding: 5px 8px;
    border: 1px solid #d2d2d7; border-radius: 6px; background: #fff; color: #1d1d1f; outline: none;
}
.cf-input:focus { border-color: #007AFF; }
.cf-input:disabled { opacity: 0.5; }
.cf-input[type="checkbox"] { width: auto; max-width: none; }
.cf-select { cursor: pointer; }
.cf-status { font-size: 10px; color: #86868b; min-width: 44px; text-align: right; flex-shrink: 0; }
.cf-status-ok { color: #248a3d; }
.cf-status-err { color: #ff3b30; }
.cf-empty { font-size: 12px; color: #86868b; }
.cf-settings-link { background: none; border: none; padding: 0; font-size: 12px; color: #007AFF; cursor: pointer; }
.cf-settings-link:hover { text-decoration: underline; }

.contact-done-tag {
    display: inline-block; margin-left: 6px; font-size: 10px; color: #34c759;
    background: rgba(52,199,89,.1); border-radius: 4px; padding: 1px 4px; font-weight: 600;
}
.contact-dnd-tag {
    display: inline-block; margin-left: 6px; font-size: 10px; color: #ff3b30;
    background: rgba(255,59,48,.12); border-radius: 4px; padding: 1px 4px; font-weight: 700;
}
.contact-canada-tag {
    display: inline-block; margin-left: 6px; font-size: 10px; color: #d70022;
    background: rgba(215,0,34,.08); border-radius: 4px; padding: 1px 4px; font-weight: 700;
}

/* Pipeline stage chip on contact rows — muted by default, subtle tint per pipeline */
.contact-stage-row { margin-top: 3px; }
.stage-chip {
    display: inline-block; max-width: 100%; font-size: 10px; font-weight: 500;
    padding: 1px 7px; border-radius: 8px; background: #ececf1; color: #636366;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.stage-chip[data-pipeline="recruiting"] { background: rgba(0,122,255,.10); color: #0a64c8; }
.stage-chip[data-pipeline="fulfillment"] { background: rgba(88,86,214,.10); color: #5856d6; }

/* Template Picker Button */
.compose-template-btn {
    padding: 4px 12px; border-radius: 8px; font-size: 12px; font-weight: 500;
    border: 1px solid #d2d2d7; background: #fff; color: #007AFF; cursor: pointer;
    transition: all .15s; margin-left: auto;
}
.compose-template-btn:hover { background: #007AFF; color: #fff; }

/* Template Picker Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 10000; display: flex; align-items: center; justify-content: center; }
.modal-card { background: #fff; border-radius: 16px; box-shadow: 0 12px 36px rgba(0,0,0,.14); width: 90%; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #e5e5ea; }
.modal-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: #86868b; padding: 0 4px; }
.modal-close:hover { color: #1d1d1f; }

/* Template list items */
.tpl-pick-item {
    display: flex; align-items: flex-start; gap: 10px; padding: 10px 0;
    border-bottom: 1px solid #f0f0f2; cursor: pointer; transition: background .1s;
}
.tpl-pick-item:hover { background: #f5f5f7; margin: 0 -16px; padding: 10px 16px; }
.tpl-pick-item:last-child { border-bottom: none; }
.tpl-pick-badge {
    display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 6px;
    border-radius: 4px; color: #fff; flex-shrink: 0; margin-top: 2px;
}
.tpl-pick-badge.sms { background: #34c759; }
.tpl-pick-badge.email { background: #5856d6; }
.tpl-pick-name { font-size: 14px; font-weight: 500; color: #1d1d1f; }
.tpl-pick-preview { font-size: 12px; color: #86868b; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }

/* Variable picker button (// in composer) */
.compose-var-btn {
    padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
    border: 1px solid #d2d2d7; background: #fff; color: #86868b; cursor: pointer;
    transition: all .15s; margin-left: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.compose-var-btn:hover { background: #f5f5f7; color: #1d1d1f; }

/* Variable picker popover (// in composer) */
#varPicker {
    position: fixed; z-index: 10001; min-width: 240px; max-height: 260px; overflow-y: auto;
    background: #fff; border: 1px solid #e5e5ea; border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.12); padding: 4px; font-size: 13px;
}
.var-pick-group {
    padding: 6px 10px 2px; font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .6px; color: #86868b;
}
.var-pick-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 6px 10px; border-radius: 8px; cursor: pointer; color: #1d1d1f;
}
.var-pick-item.active { background: #f0f6ff; box-shadow: inset 0 0 0 1px rgba(0,122,255,.35); }
.var-pick-item.active .var-pick-key { color: #007AFF; }
.var-pick-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.var-pick-key {
    flex-shrink: 0; font-size: 11px; color: #86868b;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.var-pick-empty { padding: 12px 14px; text-align: center; font-size: 12px; color: #86868b; }

/* Email reply button in all-messages view */
.msg-reply-btn {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
    font-size: 11px; color: #007AFF; background: none; border: 1px solid #007AFF;
    border-radius: 6px; padding: 3px 10px; cursor: pointer; transition: all .15s;
}
.msg-reply-btn:hover { background: #007AFF; color: #fff; }

/* Confirmation blobs */
.confirm-blob {
    display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px;
    border-radius: 10px; color: #fff; line-height: 1.3;
}
.confirm-blob.confirmed { background: #34c759; }
.confirm-blob.canceled { background: #ff3b30; }
.confirm-blob.rescheduled { background: #ff9500; }
.confirm-blob.no-response { background: #8e8e93; }
.confirm-blob.awaiting { background: #007AFF; }
.confirm-blob.pending { background: #d2d2d7; color: #636366; }
.contact-blob-row { margin-bottom: 2px; }

/* Time moved to bottom */
.contact-item.active .confirm-blob { opacity: 0.9; }
.confirm-blob.skipped { background: #c7c7cc; color: #48484a; }
.confirm-blob.error { background: #ff453a; }
.confirm-blob.no-booking { background: #e5e5ea; color: #8e8e93; }


/* DND & Blacklist badges */
.dnd-badge { display:inline-block; font-size:10px; font-weight:700; padding:2px 6px; border-radius:4px; background:#ff3b30; color:#fff; margin-left:6px; vertical-align:middle; }
.blacklist-badge { display:inline-block; font-size:10px; font-weight:700; padding:2px 6px; border-radius:4px; background:#1c1c1e; color:#fff; margin-left:6px; vertical-align:middle; }
.lost-badge { display:inline-block; font-size:10px; font-weight:700; padding:2px 6px; border-radius:4px; background:#ff9500; color:#fff; margin-left:6px; vertical-align:middle; }
.canada-badge { display:inline-block; font-size:10px; font-weight:700; padding:2px 6px; border-radius:4px; background:#fff; color:#d70022; border:1px solid #d70022; margin-left:6px; vertical-align:middle; }
.referral-badge { display:inline-block; font-size:12px; font-weight:600; padding:5px 12px; border-radius:6px; background:#f0effc; color:#5856d6; margin-left:6px; vertical-align:middle; cursor:pointer; }
.referral-badge:hover { background:#e4e2f8; }

/* Referrer modal */
.referrer-modal-section { padding:12px 16px; border-bottom:1px solid #f0f0f0; }
.referrer-modal-section:last-child { border-bottom:none; }
.referrer-modal-label { font-size:11px; text-transform:uppercase; letter-spacing:0.8px; color:#86868b; font-weight:600; margin-bottom:6px; }
.referrer-modal-name { font-size:16px; font-weight:600; color:#1c1c1e; margin-bottom:4px; }
.referrer-modal-meta { display:flex; align-items:center; gap:8px; margin-bottom:4px; flex-wrap:wrap; }
.referral-stage-badge { display:inline-block; font-size:10px; font-weight:600; padding:2px 8px; border-radius:10px; background:#e5e5ea; color:#1c1c1e; white-space:nowrap; }
.referral-date { font-size:12px; color:#86868b; }
.referral-stat { font-size:13px; color:#1c1c1e; font-weight:500; }
.referral-row { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid #f5f5f5; gap:8px; }
.referral-row:last-child { border-bottom:none; }
.referral-row.current { background:#f0f0ff; margin:0 -16px; padding:8px 16px; border-radius:6px; }
.referral-row-name { font-size:13px; color:#1c1c1e; font-weight:500; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.referral-row-right { display:flex; align-items:center; gap:6px; flex-shrink:0; }
.referral-stat-inline { font-size:12px; color:#86868b; font-weight:500; min-width:28px; text-align:right; }

/* Tag chips */
.tag-chip { display:inline-flex; align-items:center; gap:2px; font-size:11px; background:#e5e5ea; color:#1c1c1e; padding:2px 8px; border-radius:12px; margin:2px 4px 2px 0; white-space:nowrap; }
.tag-remove { border:none; background:none; color:#86868b; cursor:pointer; font-size:10px; padding:0 0 0 2px; line-height:1; }
.tag-remove:hover { color:#ff3b30; }
.detail-tags-row .value { display:flex; flex-wrap:wrap; align-items:center; }
.tag-add-wrap { display:inline-flex; align-items:center; gap:2px; margin:2px 0; }
.tag-add-input { width:90px; padding:3px 6px; border:1px solid #d2d2d7; border-radius:8px; font-size:11px; outline:none; }
.tag-add-input:focus { border-color:#007AFF; }
.tag-add-btn { border:none; background:#007AFF; color:#fff; width:20px; height:20px; border-radius:50%; font-size:14px; line-height:20px; text-align:center; cursor:pointer; padding:0; }
.tag-add-btn:hover { background:#005ecb; }

/* Blacklist button */
.blacklist-btn { border:none; background:#ff3b30; color:#fff; font-size:11px; font-weight:600; padding:4px 10px; border-radius:6px; cursor:pointer; }
.blacklist-btn:hover { background:#d63029; }

/* Tag dropdown select */
.tag-add-select { padding:3px 6px; border:1px solid #d2d2d7; border-radius:8px; font-size:11px; outline:none; background:#fff; color:#1c1c1e; cursor:pointer; max-width:140px; }
.tag-add-select:focus { border-color:#007AFF; }


/* ── Info Session Overlays ── */
.btn-conduct-session {
    background: #007AFF;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    width: 100%;
}
.btn-conduct-session:hover { opacity: .85; }

.is-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.is-overlay-content {
    background: #fff;
    border-radius: 16px;
    width: 94vw;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.25);
}
.is-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e5ea;
    flex-shrink: 0;
}
.is-overlay-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}
.is-overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

/* Pre-session checklist */
.is-checklist-section { margin-bottom: 24px; }
.is-checklist-section h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.is-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.is-checklist li {
    padding: 8px 12px;
    border-radius: 8px;
    background: #f5f5f7;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.5;
}
.is-checklist li a {
    color: #007aff;
    text-decoration: none;
    font-weight: 600;
}
.is-checklist li a:hover { text-decoration: underline; }
.is-review-list li {
    padding-left: 24px;
    position: relative;
}
.is-review-list li::before {
    content: '•';
    position: absolute;
    left: 10px;
    font-size: 18px;
    line-height: 1.3;
    color: #1d1d1f;
}
.is-sidebar-body .is-review-list li::before {
    color: #e5e5e7;
}
.is-sidebar-body .is-review-list li {
    padding-left: 24px;
}

.btn-conduct {
    padding: 12px 40px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: #007AFF;
    color: #fff;
    transition: opacity .15s;
}
.btn-conduct:hover { opacity: .85; }

/* 2-pane layout */
.is-2pane {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.is-pane-left {
    width: 45%;
    border-right: 1px solid #e5e5ea;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.is-pane-right {
    width: 55%;
    overflow-y: auto;
    padding: 20px 24px;
}
.is-script-tabs {
    display: flex;
    border-bottom: 1px solid #e5e5ea;
    flex-shrink: 0;
}
.is-script-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f5f5f7;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #86868b;
    transition: all .15s;
}
.is-script-tab.active {
    background: #fff;
    color: #1d1d1f;
    box-shadow: inset 0 -2px 0 #007aff;
}
.is-script-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
    font-size: 14px;
    line-height: 1.7;
}
.is-script-placeholder {
    color: #86868b;
    font-style: italic;
    text-align: center;
    margin-top: 40px;
}

/* Form sections */
.is-form-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f2f2f7;
}
.is-form-section:last-child { border-bottom: none; }
.is-form-section h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1d1d1f;
}
.is-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.is-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    background: #f5f5f7;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}
.is-radio-group label:hover { background: #e8e8ed; }
.is-radio-group input[type=radio] { accent-color: #007aff; }
.is-outcome-group { flex-direction: column; }
.is-outcome-group label { padding: 10px 14px; }

.is-textarea {
    width: 100%;
    border: 1px solid #d1d1d6;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    background: #fafafa;
    transition: border-color .15s;
    box-sizing: border-box;
}
.is-textarea:focus { outline: none; border-color: #007aff; }

/* Casino table */
.is-casino-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 13px;
}
.is-casino-table th {
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: #86868b;
    background: #f5f5f7;
    border-bottom: 2px solid #e5e5ea;
}
.is-casino-table th:first-child { text-align: left; padding-left: 12px; }
.is-casino-table td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid #f2f2f7;
}
.is-casino-table td:first-child {
    text-align: left;
    font-weight: 500;
    padding-left: 12px;
}
.is-casino-table tr:hover { background: #fafafe; }
.is-casino-table input[type=radio] { accent-color: #007aff; }

/* No-show box */
.is-noshow-box {
    margin-top: 10px;
    padding: 12px 16px;
    background: #fff3cd;
    border-radius: 10px;
    border: 1px solid #ffc107;
}
.is-noshow-box p { margin: 0 0 8px; font-size: 13px; color: #856404; }
.btn-noshow-mark {
    background: #ff9500;
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.btn-noshow-mark:hover { opacity: .85; }

/* Session overlay specific sizing */
.is-session-2pane {
    max-width: 1400px;
    width: 96vw;
    height: 92vh;
}


/* FAQ toggle button */
.is-faq-toggle-wrap {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    padding: 6px 0 8px;
    border-bottom: 1px solid #f2f2f7;
    text-align: center;
}
.is-faq-toggle-btn {
    background: #f5f5f7;
    border: 1px solid #d1d1d6;
    padding: 6px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: #007aff;
    transition: all .15s;
}
.is-faq-toggle-btn:hover {
    background: #e8e8ed;
}

/* Script content styling */
.is-script-content {
    font-size: 14px;
    line-height: 1.7;
    color: #1d1d1f;
}
.is-script-content p {
    margin: 0 0 8px;
}
.is-script-content strong {
    color: #1d1d1f;
}
.is-script-content ul {
    margin: 4px 0 12px 0;
    padding-left: 20px;
}
.is-script-content ul li {
    margin-bottom: 4px;
}
.is-script-content hr {
    border: none;
    border-top: 1px solid #e5e5ea;
    margin: 16px 0;
}
.is-script-content a {
    color: #007aff;
    text-decoration: none;
}
.is-script-content a:hover {
    text-decoration: underline;
}
.is-script-content del {
    color: #86868b;
}


/* Conduct Info Session header button */
.btn-conduct-session-header {
    background: #007AFF;
    color: #fff;
    border: none;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s;
    white-space: nowrap;
}
.btn-conduct-session-header:hover { opacity: .85; }
.btn-onboarding-session {
    background: #34c759;
    margin-left: 6px;
}

/* Acknowledgment items */
.is-ack-item {
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #f9f9fb;
    border-radius: 10px;
    border: 1px solid #e5e5ea;
}
.is-ack-item p {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #1d1d1f;
}
.is-ack-item:last-child { margin-bottom: 0; }


/* Info Session Results */
.is-result-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e5ea;
}
.is-result-section {
    margin-bottom: 18px;
}
.is-result-section h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: #1d1d1f;
    padding-bottom: 6px;
    border-bottom: 1px solid #f2f2f7;
}
.is-result-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    font-size: 13px;
    gap: 12px;
}
.is-result-label {
    color: #86868b;
    flex-shrink: 0;
    max-width: 55%;
}
.is-result-value {
    text-align: right;
    color: #1d1d1f;
    font-weight: 500;
    word-break: break-word;
}
.is-res-yes {
    color: #34c759;
    font-weight: 600;
}
.is-res-no {
    color: #ff3b30;
    font-weight: 600;
}
.is-res-neutral {
    color: #007aff;
    font-weight: 600;
}
.is-result-casino-table {
    margin-bottom: 10px;
}
.is-result-casino-table th:last-child,
.is-result-casino-table td:last-child {
    text-align: right;
}
.is-result-ts {
    font-size: 12px;
    padding: 3px 0;
    color: #636366;
}
.is-result-ts-time {
    color: #86868b;
    margin-right: 8px;
    font-variant-numeric: tabular-nums;
}
.outcome-history-item[data-is-idx] {
    cursor: pointer;
    transition: background .15s;
    padding: 6px 8px;
    border-radius: 8px;
    margin: 0 -8px;
}
.outcome-history-item[data-is-idx]:hover {
    background: #f5f5f7;
}

/* Inline email thread cards in All view */
.msg-inline-thread { background: #fff; border: 1px solid #e5e5ea; border-radius: 12px; margin: 8px 12px; overflow: hidden; transition: box-shadow 0.15s; }
.msg-inline-thread:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.msg-inline-thread.expanded { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.msg-inline-thread-header { display: flex; align-items: center; padding: 10px 14px; gap: 10px; cursor: pointer; }
.msg-inline-thread-icon { font-size: 20px; flex-shrink: 0; }
.msg-inline-thread-info { flex: 1; min-width: 0; }
.msg-inline-thread-subject { font-size: 13px; font-weight: 600; color: #1d1d1f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-inline-thread-preview { font-size: 12px; color: #86868b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.msg-inline-thread-meta { text-align: right; flex-shrink: 0; }
.msg-inline-thread-time { font-size: 11px; color: #86868b; display: block; }
.msg-inline-thread-count { font-size: 10px; background: #34c759; color: #fff; padding: 1px 7px; border-radius: 8px; margin-top: 2px; display: inline-block; }
.msg-inline-thread-chevron { font-size: 18px; color: #c7c7cc; font-weight: 300; transition: transform 0.2s; flex-shrink: 0; }
.msg-inline-thread.expanded .msg-inline-thread-chevron { transform: rotate(90deg); }
.msg-inline-thread-body { border-top: 1px solid #f0f0f0; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.msg-inline-thread.expanded .msg-inline-thread-body { max-height: 3000px; overflow-y: auto; }

/* Email thread readability */
.email-msg.older { opacity: 0.7; border-left: 2px solid #e0e0e0; padding-left: 10px; margin-left: 4px; }
.email-msg.latest { border-left: 2px solid #34c759; padding-left: 10px; margin-left: 4px; }
.email-expand-btn { background: none; border: none; color: #007AFF; cursor: pointer; font-size: 12px; padding: 0; margin-left: 4px; }
.email-expand-btn:hover { text-decoration: underline; }

/* Editable contact fields */
/* Pencil affordance is a ::after data-URI SVG so it survives the inline-edit
   textContent swaps in renderDetail (an in-DOM icon node would be wiped). */
.editable-field { cursor: pointer; position: relative; padding-right: 16px; transition: background 0.15s, padding 0.15s; border-radius: 4px; }
.editable-field::after {
    content: ''; position: absolute; right: 1px; top: 50%; transform: translateY(-50%);
    width: 11px; height: 11px; opacity: 0.3; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636366' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z'/%3E%3C/svg%3E") no-repeat center / contain;
}
.editable-field:hover { background: #f0f0f5; padding: 2px 22px 2px 6px; margin: -2px -6px; }
.editable-field:hover::after { opacity: 0.6; right: 7px; }
.editable-field:focus-within::after, .editable-field:has(input)::after { display: none; }
.edit-hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: #aeaeb2; font-size: 10px; margin-left: 8px; }
.edit-inline-input { font-size: 13px; font-weight: 500; border: 1px solid #007AFF; border-radius: 4px; padding: 2px 6px; outline: none; width: 100%; text-align: right; background: #fff; color: #1d1d1f; }
.edit-save-bar { position: sticky; bottom: 0; background: #f9f9fb; border-top: 1px solid #e0e0e5; padding: 12px 16px; display: flex; justify-content: flex-end; gap: 8px; z-index: 10; }
.edit-save-btn { background: #007AFF; color: #fff; border: none; border-radius: 6px; padding: 8px 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.edit-save-btn:hover { background: #0066d6; }
.edit-save-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.edit-cancel-btn { background: #e8e8ed; color: #1d1d1f; border: none; border-radius: 6px; padding: 8px 20px; font-size: 13px; font-weight: 500; cursor: pointer; }
.edit-cancel-btn:hover { background: #d8d8dd; }

/* Contact Info field groups (registry-driven) */
.detail-group-header { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: #aeaeb2; margin: 10px 0 2px; }
.detail-group-header:first-child { margin-top: 0; }
.detail-tag-chip { display: inline-block; font-size: 10px; font-weight: 500; padding: 1px 7px; border-radius: 8px; background: #ececf1; color: #636366; margin: 1px 0; }
.detail-status-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; text-transform: capitalize; }
.detail-status-open { background: rgba(52,199,89,0.12); color: #248a3d; }
.detail-status-lost { background: rgba(255,59,48,0.12); color: #d70015; }
.detail-status-abandoned { background: rgba(255,149,0,0.12); color: #c93400; }

/* Settings → Contact Fields visibility toggle */
.contact-field-row { padding: 10px 16px !important; }
.field-visibility-toggle { position: relative; display: inline-block; width: 36px; height: 22px; flex-shrink: 0; cursor: pointer; }
.field-visibility-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.field-visibility-track { position: absolute; inset: 0; background: #d2d2d7; border-radius: 22px; transition: background 0.2s; }
.field-visibility-track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s; }
.field-visibility-toggle input:checked + .field-visibility-track { background: #34c759; }
.field-visibility-toggle input:checked + .field-visibility-track::after { transform: translateX(14px); }
.field-visibility-toggle input:disabled + .field-visibility-track { opacity: 0.5; }
.msg-contact-link { font-size: 16px; font-weight: 700; color: #1d1d1f; }

/* Minimize button */
.is-header-btns { display: flex; gap: 4px; align-items: center; }
.is-minimize-btn { background: none; border: none; font-size: 24px; font-weight: 700; color: #86868b; cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; line-height: 1; }
.is-minimize-btn:hover { background: #f0f0f5; color: #1d1d1f; }
/* Minimized overlay state */
.is-overlay.is-minimized { align-items: flex-end; justify-content: flex-end; background: transparent; pointer-events: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.is-overlay.is-minimized .is-overlay-content { pointer-events: auto; position: fixed; bottom: 20px; right: 20px; width: auto; max-width: 280px; min-width: 200px; height: auto; max-height: 50px; overflow: hidden; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.18); cursor: pointer; transition: all 0.2s ease; }
.is-overlay.is-minimized .is-overlay-content:hover { box-shadow: 0 6px 32px rgba(0,0,0,0.25); transform: translateY(-2px); }
.is-overlay.is-minimized .is-overlay-header { padding: 12px 16px; }
.is-overlay.is-minimized .is-overlay-header h2 { font-size: 14px; }
.is-overlay.is-minimized .is-2pane { display: none; }
.is-overlay.is-minimized .is-header-btns { display: none; }

.is-noshow-warning { background: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; padding: 8px 12px; color: #856404; font-size: 12px; font-weight: 600; margin-bottom: 8px; }

/* Add Note */
.add-note-wrap { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-start; }
.add-note-input { flex: 1; font-size: 13px; border: 1px solid #d1d1d6; border-radius: 6px; padding: 8px 10px; resize: vertical; font-family: inherit; min-height: 36px; }
.add-note-input:focus { border-color: #007AFF; outline: none; }
.add-note-btn { background: #007AFF; color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.add-note-btn:hover { background: #0066d6; }
.add-note-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Stage filter dropdown */
.stage-filter-select { font-size: 11px; padding: 4px 8px; border: 1px solid #d1d1d6; border-radius: 6px; background: #fff; color: #1d1d1f; cursor: pointer; max-width: 130px; }
.stage-filter-select:focus { border-color: #007AFF; outline: none; }

/* Skip rejection email toggle */
.skip-email-wrap { margin-top: 12px; padding: 10px 12px; background: #fff3cd; border: 1px solid #ffc107; border-radius: 6px; }
.skip-email-label { font-size: 13px; font-weight: 500; color: #856404; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.skip-email-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: #ff3b30; }

/* Internal comments */
.internal-comment-item { padding: 10px 12px; margin-bottom: 8px; background: #f5f5f7; border-radius: 8px; border: 1px solid #e8e8ed; }
.internal-comment-item .note-body { font-size: 13px; color: #1d1d1f; line-height: 1.5; }
.internal-comment-item .note-date { font-size: 11px; color: #86868b; margin-top: 6px; }

/* Opportunity stage rows */
.opp-stage-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.opp-stage-row:last-child { border-bottom: none; }
.opp-pipeline-label { font-size: 12px; color: #86868b; font-weight: 500; min-width: 80px; }
.opp-stage-select { font-size: 13px; font-weight: 500; padding: 4px 8px; border: 1px solid #d1d1d6; border-radius: 6px; background: #fff; color: #1d1d1f; cursor: pointer; max-width: 200px; }
.opp-stage-select:focus { border-color: #007AFF; outline: none; }
.opp-stage-select:disabled { opacity: 0.5; cursor: not-allowed; }

/* Info Session Checklist Sidebar */
.is-sidebar { width: 320px; min-width: 320px; background: #fafafc; border-left: 1px solid #ececf1; display: flex; flex-direction: column; overflow-y: auto; }
.is-sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid #ececf1; }
.is-sidebar-header h3 { font-size: 16px; font-weight: 600; margin: 0; }
.is-sidebar-body { padding: 16px 18px; overflow-y: auto; flex: 1; }
.is-sidebar-body .is-checklist-section { margin-bottom: 20px; }
.is-sidebar-body .is-checklist-section h4 { font-size: 14px; font-weight: 600; margin: 0 0 10px; }
.is-sidebar-body .is-checklist { list-style: none; padding: 0; margin: 0; }
.is-sidebar-body .is-checklist li { padding: 6px 0; font-size: 13px; }
.is-sidebar-check { margin-top: 2px; flex-shrink: 0; accent-color: #34c759; width: 16px; height: 16px; }
.is-sidebar-check-label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.is-sidebar-active .message-pane { max-width: calc(100% - 360px - 320px); }

/* ── Info Session Inline 3-Pane Layout ── */
.is-session-inline { display: flex; flex-direction: column; flex: 1; overflow: hidden; background: #fff; }
.is-session-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid #ececf1; background: #fafafc; }
.is-session-header-left { display: flex; align-items: center; gap: 16px; }
.is-session-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.is-session-contact-name { font-size: 15px; color: #1d1d1f; font-weight: 500; }
.btn-meet { display: inline-flex; align-items: center; gap: 6px; background: #1a73e8; color: #fff; border: none; border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-meet:hover { background: #1557b0; }
.btn-end-session { background: #ff3b30; color: #fff; border: none; border-radius: 8px; padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-end-session:hover { background: #d63029; }

.is-3pane { display: flex; flex: 1; overflow: hidden; }
.is-3pane .is-pane-left { width: 50%; border-right: 1px solid #e5e5ea; display: flex; flex-direction: column; overflow: hidden; }
.is-3pane .is-pane-center { width: 25%; overflow-y: auto; padding: 20px 18px; border-right: 1px solid #e5e5ea; }
.is-3pane .is-pane-contact { width: 25%; overflow-y: auto; padding: 20px 18px; background: #fafafa; }

/* Presentation Controls */
.is-presentation-bar { border-top: 1px solid #e5e5ea; padding: 12px 16px; background: #f5f5f7; flex-shrink: 0; }
.is-presentation-btns { display: flex; gap: 8px; justify-content: center; }
.btn-presentation { background: #0071e3; color: #fff; border: none; border-radius: 8px; padding: 10px 24px; font-size: 14px; font-weight: 600; cursor: pointer; width: 100%; }
.btn-presentation:hover { background: #005bb5; }
.btn-slide-nav { background: #2a2a2e; color: #fff; border: none; border-radius: 8px; padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; flex: 1; }
.btn-slide-nav:hover { background: #3a3a3e; }
#isPresentationPreview { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.is-slide-thumb { width: 120px; height: auto; border-radius: 6px; border: 1px solid #e5e5ea; }
.is-slide-counter { font-size: 14px; font-weight: 600; color: #333; }

/* Session contact pane inherits detail-pane styles */

/* Filmstrip */
.is-filmstrip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.is-film-slide { flex-shrink: 0; width: 100px; cursor: pointer; border-radius: 6px; border: 2px solid transparent; position: relative; opacity: 0.6; transition: all .15s; }
.is-film-slide:hover { opacity: 0.9; }
.is-film-slide.is-film-current { border-color: #0071e3; opacity: 1; }
.is-film-slide img { width: 100%; height: auto; border-radius: 4px; display: block; }
.is-film-num { position: absolute; bottom: 2px; right: 4px; font-size: 10px; font-weight: 700; color: #fff; background: rgba(0,0,0,0.6); padding: 1px 5px; border-radius: 4px; }

/* Appointment cards */
.apt-card { background: #f5f5f7; border: 1px solid #e5e5ea; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.apt-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.apt-name { font-size: 13px; font-weight: 600; }
.apt-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.apt-canceled { background: rgba(255,59,48,0.12); color: #ff3b30; }
.apt-noshow { background: rgba(255,149,0,0.12); color: #ff9500; }
.apt-upcoming { background: rgba(0,113,227,0.12); color: #0071e3; }
.apt-shown { background: rgba(52,199,89,0.12); color: #34c759; }
.apt-host { font-size: 12px; color: #86868b; margin-bottom: 4px; }
.apt-dates { display: flex; gap: 16px; font-size: 12px; color: #86868b; }
.apt-dates strong { color: #333; }
.apt-cancel-reason { font-size: 11px; color: #ff3b30; font-style: italic; margin-top: 4px; }
.apt-card-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #e5e5ea; }
.apt-cancel-btn { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 4px; border: 1px solid #ff3b30; background: #fff; color: #ff3b30; cursor: pointer; transition: all 0.15s; }
.apt-cancel-btn:hover { background: #ff3b30; color: #fff; }
.apt-cancel-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-toggle-view { background: #f0f0f5; color: #1d1d1f; border: 1px solid #d9d9de; padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.btn-toggle-view:hover { background: #e4e4ea; }

/* Back to session small button in message header */
.btn-back-to-session-sm { background: #f0f0f5; color: #1d1d1f; border: 1px solid #d9d9de; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.btn-back-to-session-sm:hover { background: #e4e4ea; }

/* ── Todos ── */
.todos-container { padding: 24px; max-width: 900px; margin: 0 auto; width: 100%; flex: 1; overflow-y: auto; }
.todos-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; padding: 16px 20px; background: #fff; border: 1px solid #ececf1; border-radius: 12px; }
.todos-header h2 { margin: 0; font-size: 18px; font-weight: 600; color: #1d1d1f; }
.todos-filter-bar { display: flex; gap: 6px; }
.todo-filter-chip {
    padding: 6px 14px; border-radius: 20px; border: 1px solid #d9d9de; background: transparent;
    color: #86868b; font-size: 12px; cursor: pointer; transition: all .15s;
}
.todo-filter-chip.active, .todo-filter-chip:hover { background: #007AFF; color: #fff; border-color: #007AFF; }
.todos-list { display: flex; flex-direction: column; gap: 8px; }
.todo-card {
    display: flex; justify-content: space-between; align-items: flex-start;
    background: #fff; border: 1px solid #ececf1; border-radius: 10px; padding: 14px 16px;
    transition: border-color .15s;
}
.todo-card:hover { border-color: #d9d9de; }
.todo-card.completed { opacity: 0.6; }
.todo-card-left { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; font-weight: 600; color: #1d1d1f; margin-bottom: 4px; }
.todo-body { font-size: 12px; color: #86868b; margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: #86868b; }
.todo-meta span { display: inline-flex; align-items: center; gap: 2px; }
.todo-contact-link { color: #007AFF; text-decoration: none; }
.todo-contact-link:hover { text-decoration: underline; }
.todo-overdue { color: #ff453a !important; font-weight: 600; }
.todo-card-actions { display: flex; gap: 6px; margin-left: 12px; flex-shrink: 0; }
.todo-complete-btn {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid #34c759; background: transparent;
    color: #34c759; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.todo-complete-btn:hover { background: #34c759; color: #fff; }
.todo-delete-btn {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid #d9d9de; background: transparent;
    color: #86868b; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.todo-delete-btn:hover { background: #ff453a; border-color: #ff453a; color: #fff; }

/* Todo contact search results in modal */
.todo-contact-results { max-height: 150px; overflow-y: auto; margin-top: 4px; }
.todo-contact-result {
    padding: 6px 10px; font-size: 13px; color: #1d1d1f; cursor: pointer; border-radius: 6px;
    transition: background .1s;
}
.todo-contact-result:hover { background: #f2f2f5; }
.todo-contact-selected {
    display: inline-flex; align-items: center; padding: 4px 10px; background: #ececf1;
    border-radius: 6px; font-size: 13px; color: #1d1d1f; margin-top: 4px;
}

/* Contact detail todos */
.todo-detail-item {
    padding: 10px 12px; background: #fff; border: 1px solid #ececf1; border-radius: 10px; margin-bottom: 8px;
    display: flex; align-items: flex-start; gap: 10px;
}
.todo-detail-item.completed { opacity: 0.6; }
.todo-detail-content { flex: 1; min-width: 0; }
.todo-detail-item .todo-title { color: #1d1d1f; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.todo-detail-item .todo-body { color: #6e6e73; font-size: 12px; margin-bottom: 4px; white-space: pre-wrap; word-break: break-word; }
.todo-detail-meta {
    display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: #86868b; margin-top: 6px;
}
.todo-detail-meta span { display: inline-flex; align-items: center; gap: 2px; }
.todo-status-badge {
    font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; text-transform: uppercase;
}
.todo-status-badge.pending { background: #ff9f0a22; color: #cc7700; }
.todo-status-badge.completed { background: #34c75922; color: #248a3d; }
.todo-detail-complete-btn {
    width: 28px; height: 28px; border-radius: 7px; border: 1px solid #34c759; background: transparent;
    color: #34c759; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px; transition: all .15s;
}
.todo-detail-complete-btn:hover { background: #34c759; color: #fff; }

/* ── Todo modal form fixes ── */
.form-group textarea {
    width: 100%; padding: 12px 16px; border: 1px solid #d2d2d7; border-radius: 10px;
    font-size: 15px; background: #f5f5f7; outline: none; transition: border-color 0.2s;
    font-family: inherit; resize: vertical; color: #1d1d1f;
}
.form-group textarea:focus { border-color: #007AFF; background: #fff; }

/* Fix todo modal text colors for white-background modals */
#newTodoModal .modal-content label { color: #1d1d1f; }
#newTodoModal .search-input { color: #1d1d1f; }
#newTodoModal .select-input { color: #1d1d1f; }
#newTodoModal .form-group input { color: #1d1d1f; }
.todo-contact-results { background: #f5f5f7; border-radius: 8px; }
.todo-contact-result { color: #1d1d1f !important; }
.todo-contact-result span { color: #86868b !important; }
.todo-contact-selected { background: #ececf1; color: #1d1d1f; }
#newTodoError { color: #ff3b30; }

/* Breakup email toggle button */
.btn-breakup-toggle.active { background: #30d158 !important; border-color: #30d158 !important; color: #000 !important; }
.btn-breakup-toggle:hover { background: #3a3a3e; }
.btn-breakup-toggle.active:hover { background: #28a745 !important; }

/* ── Notifications View ── */
.notif-container { padding: 24px; max-width: 900px; margin: 0 auto; width: 100%; overflow-y: auto; }
.notif-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.notif-header h2 { font-size: 18px; font-weight: 600; }
.notif-filter-bar { display: flex; gap: 8px; }
.notif-list { display: flex; flex-direction: column; gap: 8px; }

.notif-card {
    display: flex; align-items: flex-start; gap: 12px;
    background: #fff; border: 1px solid #ececf1; border-radius: 12px;
    padding: 14px 16px; transition: border-color .15s, opacity .15s;
}
.notif-card:hover { border-color: #d9d9de; }
.notif-card-dismissed { opacity: .4; }

.notif-card-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.notif-card-body { flex: 1; min-width: 0; }
.notif-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.notif-card-title { font-size: 14px; font-weight: 600; color: #1d1d1f; }
.notif-card-text { font-size: 12px; color: #86868b; margin-top: 4px; word-break: break-word; }

.notif-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    padding: 2px 8px; border-radius: 4px;
}
.notif-badge-msg { background: rgba(0,122,255,.1); color: #007AFF; }
.notif-badge-session { background: rgba(255,149,0,.1); color: #ff9500; }

.notif-time { font-size: 11px; color: #86868b; }

.notif-card-actions { flex-shrink: 0; }
.notif-action { background: #f5f5f7 !important; color: #86868b !important; border: 1px solid #d2d2d7 !important; margin-left: 4px; }
.notif-action:hover { background: #e8e8ed !important; color: #1d1d1f !important; }
.notif-view-btn { background: #007AFF !important; color: #fff !important; border-color: #007AFF !important; }
.notif-view-btn:hover { background: #0063d1 !important; border-color: #0063d1 !important; }


/* Handoff button */
.apt-handoff-btn { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 4px; border: 1px solid #007aff; background: #fff; color: #007aff; cursor: pointer; transition: all 0.15s; margin-right: 4px; }
.apt-handoff-btn:hover { background: #007aff; color: #fff; }
.apt-handoff-btn:disabled { opacity: 0.6; cursor: default; border-color: #86868b; color: #86868b; background: #fff; }
.apt-join-btn { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 4px; border: 1px solid #30d158; background: #fff; color: #30d158; cursor: pointer; transition: all 0.15s; margin-right: 4px; }
.apt-join-btn:hover { background: #30d158; color: #fff; }

/* PDF Zoom Controls */
.pdf-zoom-controls { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #f5f5f7; border-radius: 8px; margin-bottom: 6px; }
.pdf-zoom-btn { padding: 4px 12px; border: 1px solid #d2d2d7; border-radius: 6px; background: #fff; color: #1d1d1f; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s; line-height: 1; }
.pdf-zoom-btn:hover { background: #007AFF; color: #fff; border-color: #007AFF; }
.pdf-zoom-reset { font-size: 12px; font-weight: 500; padding: 4px 10px; }
.pdf-zoom-level { font-size: 12px; color: #86868b; min-width: 40px; text-align: center; }
.pdf-zoom-wrapper { overflow: auto; border-radius: 8px; }

/* ── Analytics ── */
.analytics-container { padding: 24px; max-width: 1400px; margin: 0 auto; width: 100%; overflow-y: auto; height: 100%; }
.analytics-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; padding: 16px 20px; background: #1c1c1e; border: 1px solid #2c2c2e; border-radius: 12px; }
.analytics-header h2 { margin: 0; font-size: 20px; font-weight: 600; color: #f5f5f7; }
.analytics-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.analytics-select { padding: 8px 12px; border: 1px solid #3a3a3e; border-radius: 8px; background: #2c2c2e; color: #f5f5f7; font-size: 13px; outline: none; cursor: pointer; }
.analytics-select:focus { border-color: #007AFF; }
.analytics-date-input { padding: 8px 12px; border: 1px solid #3a3a3e; border-radius: 8px; background: #2c2c2e; color: #f5f5f7; font-size: 13px; outline: none; width: 150px; }
.analytics-date-input:focus { border-color: #007AFF; }

.analytics-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; margin-bottom: 24px; }
.analytics-kpi-card { background: #1c1c1e; border: 1px solid #2c2c2e; border-radius: 12px; padding: 18px 14px; text-align: center; transition: border-color 0.15s; }
.analytics-kpi-card:hover { border-color: #3a3a3e; }
.analytics-kpi-value { font-size: 26px; font-weight: 700; color: #007AFF; line-height: 1.2; }
.analytics-kpi-value.green { color: #30d158; }
.analytics-kpi-value.red { color: #ff453a; }
.analytics-kpi-value.orange { color: #ff9f0a; }
.analytics-kpi-label { font-size: 11px; color: #86868b; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 500; }

.analytics-charts-row { display: flex; gap: 16px; margin-bottom: 24px; }
.analytics-chart-card { background: #1c1c1e; border: 1px solid #2c2c2e; border-radius: 12px; padding: 20px; flex: 1; min-width: 0; }
.analytics-chart-card h4 { font-size: 14px; font-weight: 600; color: #f5f5f7; margin: 0 0 16px 0; }
.analytics-chart-wide { flex: 2; }
.analytics-chart-full { flex: 1; width: 100%; }

/* Queue Depth chart card controls */
.qd-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.qd-head h4 { margin: 0; }
.qd-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qd-toggle { display: inline-flex; border: 1px solid #3a3a3e; border-radius: 8px; overflow: hidden; }
.qd-tab { padding: 8px 14px; background: #2c2c2e; color: #86868b; font-size: 13px; border: none; cursor: pointer; outline: none; }
.qd-tab + .qd-tab { border-left: 1px solid #3a3a3e; }
.qd-tab.active { background: #007AFF; color: #fff; }
.qd-hint { margin: 0 0 12px 0; font-size: 11px; color: #555; }

.analytics-kpi-source { font-size: 10px; color: #555; margin-top: 4px; font-style: italic; }
.analytics-kpi-section { grid-column: 1 / -1; margin-top: 18px; padding: 10px 2px 6px; border-bottom: 1px solid #2c2c2e; color: #86868b; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

.analytics-table-summary { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.analytics-table-total { font-size: 32px; font-weight: 700; color: #007AFF; }
.analytics-table-total-label { font-size: 13px; color: #86868b; }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.analytics-table thead th { color: #86868b; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px; border-bottom: 1px solid #3a3a3e; text-align: left; }
.analytics-table tbody td { padding: 10px 12px; border-bottom: 1px solid #2c2c2e; color: #f5f5f7; }
.analytics-table tbody tr:hover { background: #2c2c2e; }
.analytics-bar-bg { height: 8px; background: #2c2c2e; border-radius: 4px; overflow: hidden; }
.analytics-bar-fill { height: 100%; background: #007AFF; border-radius: 4px; transition: width 0.3s ease; }

@media (max-width: 900px) {
    .analytics-charts-row { flex-direction: column; }
    .analytics-kpi-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .analytics-header { flex-direction: column; align-items: flex-start; }
}

/* ── SMS Feed ── */
#smsFeedView { flex: 1; min-height: 0; }
.sms-feed-header { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid #e5e5ea; background: #fff; }
.sms-feed-header h2 { font-size: 18px; font-weight: 600; color: #1d1d1f; }
.sms-feed-filter { display: inline-flex; background: #f0f0f2; border-radius: 8px; padding: 2px; }
.sms-filter-btn { padding: 6px 14px; border: none; background: transparent; color: #5e5e63; cursor: pointer; border-radius: 6px; font-size: 13px; font-weight: 500; transition: all 0.15s; }
.sms-filter-btn:hover { color: #1d1d1f; }
.sms-filter-btn.active { background: #fff; color: #007AFF; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.sms-feed-source { padding: 6px 10px; border: none; background: #f0f0f2; color: #5e5e63; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; }
.sms-feed-source:hover { color: #1d1d1f; }
.sms-feed-contact { position: relative; display: inline-flex; align-items: center; }
#smsFeedContactInput { padding: 7px 12px; border: none; background: #f0f0f2; color: #1d1d1f; border-radius: 8px; font-size: 13px; width: 180px; outline: none; }
#smsFeedContactInput:focus { box-shadow: 0 0 0 2px rgba(0,122,255,0.25); }
.sms-feed-contact-drop { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid #e5e5ea; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 50; }
.sms-feed-contact-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; cursor: pointer; }
.sms-feed-contact-item:hover { background: #f5f5f7; }
.sms-feed-contact-item-name { font-size: 13px; font-weight: 600; color: #1d1d1f; }
.sms-feed-contact-item-detail { font-size: 11px; color: #86868b; }
.sms-feed-contact-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; background: #e8f1fd; color: #007AFF; border-radius: 14px; font-size: 13px; font-weight: 500; }
.sms-feed-contact-chip-x { border: none; background: transparent; color: #007AFF; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; }
.sms-feed-contact-chip-x:hover { color: #0051a8; }
.sms-feed-count { margin-left: auto; color: #86868b; font-size: 12px; }
.sms-feed-list { flex: 1; overflow-y: auto; background: #f5f5f7; min-height: 0; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.sms-blob-row { display: flex; flex-direction: column; max-width: 70%; cursor: pointer; }
.sms-blob-row.outbound { align-self: flex-end; align-items: flex-end; }
.sms-blob-row.inbound { align-self: flex-start; align-items: flex-start; }
.sms-blob-meta { font-size: 12px; color: #86868b; margin: 0 12px 4px; display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.sms-blob-name { font-weight: 600; color: #1d1d1f; }
.sms-blob-time { font-variant-numeric: tabular-nums; }
.sms-badge-channel { font-size: 10px; font-weight: 700; letter-spacing: 0.4px; padding: 1px 6px; border-radius: 4px; }
.sms-badge-channel.sms { background: #e8f1fd; color: #007AFF; }
.sms-badge-channel.email { background: #f3e8fd; color: #7d2ae8; }
.sms-badge-source { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #f0f0f2; color: #5e5e63; }
.sms-blob-staff { color: #86868b; font-style: italic; }
.sms-blob-subject { font-size: 13px; font-weight: 700; color: #1d1d1f; margin: 0 12px 4px; }
.sms-blob { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; max-width: 100%; box-shadow: 0 1px 1px rgba(0,0,0,0.04); transition: transform 0.12s, box-shadow 0.12s; }
.sms-blob-row:hover .sms-blob { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.08); }
.sms-blob.outbound { background: #007AFF; color: #fff; border-bottom-right-radius: 5px; }
.sms-blob.inbound { background: #fff; color: #1d1d1f; border-bottom-left-radius: 5px; border: 1px solid #e5e5ea; }
.sms-blob.failed { background: #fff1f0; color: #8b1a15; border: 1px solid #f5b7b2; text-decoration: line-through; text-decoration-color: rgba(139,26,21,0.4); text-decoration-thickness: 1px; }
.sms-blob.outbound.failed { background: #fff1f0; color: #8b1a15; border: 1px solid #f5b7b2; }
.sms-blob-fail { color: #c62828; font-weight: 600; background: #ffebee; padding: 1px 6px; border-radius: 4px; font-size: 11px; }
.sms-feed-sentinel { height: 1px; }
.sms-feed-empty { padding: 48px; text-align: center; color: #86868b; font-size: 14px; }

/* Failed SMS in contact message thread */
.msg-bubble.sms.outbound.failed,
.msg-bubble.email.outbound.failed { background: #fff1f0; color: #8b1a15; border: 1px solid #f5b7b2; text-decoration: line-through; text-decoration-color: rgba(139,26,21,0.35); text-decoration-thickness: 1px; }
.msg-failed-badge { color: #c62828; font-weight: 600; background: #ffebee; padding: 1px 6px; border-radius: 4px; font-size: 11px; margin-left: 6px; }

/* ── Referrals view ── */
.ref-kpi-sub { font-size: 11px; color: #86868b; margin-top: 4px; }
.ref-range-buttons { display: flex; gap: 4px; }
.ref-range-btn { background: transparent; border: 1px solid #3a3a3e; color: #86868b; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 4px; cursor: pointer; transition: all 0.15s; }
.ref-range-btn:hover { color: #fff; border-color: #555; }
.ref-range-btn.active { color: #0a84ff; border-color: #0a84ff; }
.intake-dist-toggle { display: flex; gap: 6px; }
.intake-dist-controls-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.intake-dist-axis-btn, .intake-dist-view-btn { background: transparent; border: 1px solid #3a3a3e; color: #86868b; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 4px; cursor: pointer; transition: all 0.15s; }
.intake-dist-axis-btn:hover, .intake-dist-view-btn:hover { color: #fff; border-color: #555; }
.intake-dist-axis-btn.active, .intake-dist-view-btn.active { color: #0a84ff; border-color: #0a84ff; }
/* Clickable intake KPI cards → distribution popup */
.analytics-kpi-clickable { cursor: pointer; transition: border-color 0.15s, transform 0.1s; }
.analytics-kpi-clickable:hover { border-color: #0a84ff; transform: translateY(-1px); }
.analytics-kpi-chartcue { font-size: 10px; font-weight: 600; color: #0a84ff; margin-top: 6px; }
/* Intake distribution popup (dark, to match the analytics charts) */
.modal-content.intake-dist-modal { background: #1c1c1e; border: 1px solid #2c2c2e; color: #f5f5f7; max-width: 760px; }
.intake-dist-modal .modal-header { border-bottom: 1px solid #2c2c2e; }
.intake-dist-modal .modal-header h3 { color: #f5f5f7; }
.intake-dist-modal .modal-close { background: #2c2c2e; color: #86868b; }
.intake-dist-modal .modal-close:hover { background: #3a3a3e; color: #fff; }
.intake-dist-modal-body { padding: 16px 24px 24px; }
.intake-dist-modal-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 28px; }
.intake-dist-modal-reviewer { display: flex; align-items: center; gap: 8px; }
.intake-dist-modal-revlabel { color: #86868b; font-size: 13px; }
.intake-dist-modal-note { color: #86868b; font-size: 12px; margin: 10px 0; }
.intake-dist-chart-wrap { position: relative; height: 360px; }
.intake-dist-modal-stats { color: #86868b; font-size: 12px; margin-top: 10px; text-align: center; }
.intake-dist-modal-pcts { color: #6e6e73; font-size: 11px; margin-top: 3px; }
.intake-dist-modal-empty { color: #86868b; font-size: 13px; padding: 40px 0; text-align: center; }
.ref-table-wrap { overflow-x: auto; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ref-table thead th { color: #86868b; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding: 10px 12px; border-bottom: 1px solid #3a3a3e; text-align: left; white-space: nowrap; background: #1c1c1e; position: sticky; top: 0; z-index: 1; }
.ref-table tbody td { padding: 10px 12px; border-bottom: 1px solid #2c2c2e; color: #f5f5f7; vertical-align: middle; }
.ref-row { cursor: pointer; transition: background 0.12s; }
.ref-row:hover { background: #232326; }
.ref-cell-idx { color: #86868b; width: 40px; }
.ref-cell-stage { color: #fbbf24; }
.ref-cell-num { text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.ref-cell-chevron { text-align: center; width: 32px; color: #86868b; }
.ref-chevron { display: inline-block; transition: transform 0.15s; font-size: 12px; }
.ref-contact-link { color: #0a84ff; text-decoration: none; }
.ref-contact-link:hover { text-decoration: underline; }
.ref-detail-row td { background: #161618; padding: 0 !important; border-bottom: 1px solid #2c2c2e; }
.ref-detail-wrap { padding: 12px 16px 12px 36px; display: flex; flex-direction: column; gap: 8px; border-left: 2px solid rgba(10,132,255,0.3); margin: 8px 16px 12px 32px; }
.ref-detail-card { background: #1c1c1e; border: 1px solid #2c2c2e; border-radius: 8px; padding: 10px 12px; }
.ref-detail-card.ref-detail-click { opacity: 0.6; }
.ref-detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ref-detail-name { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.ref-detail-date { font-size: 11px; color: #86868b; flex-shrink: 0; }
.ref-detail-pills { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 6px; }
.ref-pill { font-size: 11px; color: #d1d5db; }
.ref-pill b { color: #f5f5f7; }
.ref-pill-stage b { color: #fbbf24; }
.ref-pill-ok { color: #34d399; }
.ref-pill-offer { color: #818cf8; font-weight: 600; }
.ref-pill-m2 { color: #4ade80; font-weight: 600; }
.ref-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; border: 1px solid transparent; white-space: nowrap; }
.ref-badge-submitted { background: rgba(16,185,129,0.15); color: #34d399; border-color: rgba(16,185,129,0.4); }
.ref-badge-progress { background: rgba(245,158,11,0.15); color: #fbbf24; border-color: rgba(245,158,11,0.4); }
.ref-badge-click { background: #2c2c2e; color: #86868b; border-color: #3a3a3e; }
.ref-muted { color: #86868b; font-style: italic; font-size: 12px; }
.ref-chart-scroll { display: flex; align-items: flex-end; gap: 4px; overflow-x: auto; padding-bottom: 4px; min-height: 170px; }
.ref-chart-day { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.ref-chart-bars { display: flex; align-items: flex-end; justify-content: center; gap: 1px; width: 100%; }
.ref-chart-bar { width: 33%; border-radius: 2px 2px 0 0; transition: opacity 0.15s; }
.ref-chart-bar-click { background: rgba(59,130,246,0.7); }
.ref-chart-bar-start { background: rgba(245,158,11,0.7); }
.ref-chart-bar-sub { background: rgba(16,185,129,0.7); }
.ref-chart-label { font-size: 9px; color: #86868b; margin-top: 4px; white-space: nowrap; }
.ref-chart-tooltip { display: none; position: fixed; pointer-events: none; z-index: 50; background: #1c1c1e; border: 1px solid #3a3a3e; border-radius: 8px; padding: 8px 10px; font-size: 11px; color: #d1d5db; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.ref-chart-tooltip .ref-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }

/* ── Rejection Reason Picker (shown on submit for RC/OB rejections) ── */
.modal-content.modal-rejection { max-width: 640px; }
.rej-reason-body { padding: 4px 24px 8px; }
.rej-reason-sub { font-size: 13px; color: #86868b; margin: 0 0 16px; }
.rej-cat { margin-bottom: 18px; }
.rej-cat-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #86868b; margin: 0 0 8px; }
.rej-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .rej-cards { grid-template-columns: 1fr; } }
.rej-card { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 34px 12px 14px; border: 1.5px solid #e5e5ea; border-radius: 10px; background: #fafafa; cursor: pointer; transition: all .15s; font-family: inherit; }
.rej-card:hover { border-color: #ffb3ae; background: #fff; }
.rej-card.selected { border-color: #ff3b30; background: #fff5f4; box-shadow: 0 0 0 1px #ff3b30 inset; }
.rej-card-title { font-size: 14px; font-weight: 600; color: #1d1d1f; }
.rej-card-desc { font-size: 12px; line-height: 1.45; color: #6e6e73; }
.rej-card-check { position: absolute; top: 10px; right: 10px; width: 18px; height: 18px; border-radius: 50%; background: #ff3b30; color: #fff; font-size: 11px; line-height: 18px; text-align: center; opacity: 0; transform: scale(.6); transition: all .15s; }
.rej-card.selected .rej-card-check { opacity: 1; transform: scale(1); }
.rej-reason-notes { margin-top: 4px; }
.rej-reason-notes label { display: block; font-size: 13px; font-weight: 600; color: #1d1d1f; margin-bottom: 6px; }
.rej-reason-notes textarea { width: 100%; box-sizing: border-box; border: 1px solid #d1d1d6; border-radius: 8px; padding: 10px 12px; font-size: 13px; font-family: inherit; resize: vertical; background: #fafafa; }
.rej-reason-notes textarea:focus { outline: none; border-color: #ff3b30; }
.rej-reason-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px 20px; border-top: 1px solid #f2f2f7; margin-top: 6px; }
.rej-reason-cancel { padding: 10px 18px; border-radius: 8px; border: 1px solid #d1d1d6; background: #fff; color: #1d1d1f; font-size: 14px; font-weight: 600; cursor: pointer; }
.rej-reason-cancel:hover { background: #f5f5f7; }
.rej-reason-confirm { padding: 10px 20px; border-radius: 8px; border: none; background: #ff3b30; color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s; }
.rej-reason-confirm:hover { background: #e0342a; }
.rej-reason-confirm:disabled { background: #f0a6a1; cursor: not-allowed; }

/* Rejection reason chips (inline summary + results viewer) */
.rej-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rej-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #fff0ef; border: 1px solid #ffc4bf; color: #c0271d; font-size: 12px; font-weight: 600; }
.rej-inline-notes { margin-top: 8px; font-size: 12px; color: #6e6e73; font-style: italic; }
.rej-inline-edit { margin-top: 10px; padding: 6px 14px; border-radius: 8px; border: 1px solid #d1d1d6; background: #fff; color: #1d1d1f; font-size: 12px; font-weight: 600; cursor: pointer; }
.rej-inline-edit:hover { background: #f5f5f7; border-color: #ff3b30; color: #ff3b30; }

/* ── Contact Popup (Data & Docs view — conversation lives inline in .message-pane) ── */
.contact-popup {
    background: #fff;
    border-radius: 16px;
    width: 94vw;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.25);
}
.contact-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #ececf1;
    background: #fafafc;
    flex-shrink: 0;
}
.contact-popup-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.contact-popup-badges { display: flex; align-items: center; gap: 4px; }
.contact-popup-stage { display: flex; align-items: center; }
.contact-popup-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.contact-popup-body { flex: 1; min-height: 0; overflow: hidden; }
.contact-popup-data { overflow-y: auto; padding: 20px; background: #fafafc; container-type: inline-size; }

/* Data pane layout — two-column grid when the data pane is ≥900px wide (popup
   on wide screens), single column otherwise. The container query only matches
   inside .contact-popup-data, so the session-overlay contact panel (which
   renders the same markup via _populateSessionContactPane) always gets the
   single-column fallback. */
.popup-data-layout { max-width: 1100px; margin: 0 auto; }
.popup-data-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 0 28px; align-items: start; }
@container (min-width: 900px) {
    .popup-data-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}
/* Edit save bar sticks to the bottom of the scrolling data pane */
.contact-popup-data .edit-save-bar { margin: 0 -20px -20px; padding: 12px 20px; }

/* ── Contact Popup display modes ──
   Mode toggle button in the popup header (icon swapped by JS per mode) */
.popup-mode-toggle {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: #e8e8ed; color: #86868b; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.popup-mode-toggle:hover { background: #d2d2d7; color: #1d1d1f; }

/* Sidebar mode: the overlay becomes a non-dimming, click-through backdrop so
   the conversation stays fully usable; the card docks right and slides in/out. */
#contactPopup.mode-sidebar {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
    justify-content: flex-end;
    align-items: stretch;
}
#contactPopup.mode-sidebar .contact-popup {
    pointer-events: auto;
    width: 460px;
    max-width: 90vw;
    height: 100%;
    border-radius: 0;
    box-shadow: -12px 0 40px rgba(0,0,0,.18);
    transform: translateX(105%);
    transition: transform 0.28s ease;
}
#contactPopup.mode-sidebar.cp-open .contact-popup { transform: translateX(0); }

/* While the data sidebar is open, shrink the message pane out from under it —
   same idiom as .is-sidebar-active (list 360px + sidebar 460px). */
#contactsView.data-sidebar-active .message-pane {
    max-width: calc(100% - 360px - 460px);
    transition: max-width 0.28s ease;
}

.conv-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid #ececf1;
    background: #fafafc;
    flex-shrink: 0;
}
.conv-toolbar-right { display: flex; align-items: center; gap: 8px; }

/* ── Documents section (contact popup data pane) ── */
.doc-drive-row { margin-bottom: 8px; }
.doc-ext-link { color: #007AFF; text-decoration: none; font-size: 12px; white-space: nowrap; }
.doc-ext-link:hover { text-decoration: underline; }
.doc-sub { background: #fff; border: 1px solid #ececf1; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.doc-sub-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #86868b; margin-bottom: 8px; }
.doc-sub-head .doc-ext-link { margin-left: auto; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.doc-thumb { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; cursor: pointer; text-decoration: none; min-width: 0; }
.doc-thumb-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid #e5e5ea; background: #f5f5f7; display: block; }
.doc-thumb:hover .doc-thumb-img { border-color: #007AFF; }
.doc-thumb-file { width: 100%; aspect-ratio: 1; border-radius: 8px; border: 1px solid #e5e5ea; background: #f5f5f7; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.doc-thumb-label { font-size: 11px; color: #1d1d1f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.doc-chip { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 4px; }
.doc-chip-pass { background: rgba(52,199,89,0.12); color: #248a3d; }
.doc-chip-pending { background: rgba(255,149,0,0.12); color: #ff9500; }
.doc-chip-fail { background: rgba(255,59,48,0.12); color: #ff3b30; }
.doc-subheading { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: #86868b; font-weight: 600; margin: 14px 0 6px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; color: #1d1d1f; text-decoration: none; }
.doc-row:last-child { border-bottom: none; }
.doc-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row-date { font-size: 12px; color: #86868b; white-space: nowrap; }
.doc-row-link:hover .doc-row-name { color: #007AFF; }
.doc-answers { margin-top: 8px; }
.doc-answers summary { font-size: 12px; color: #007AFF; cursor: pointer; user-select: none; }
.doc-answers-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #86868b; font-weight: 600; margin: 8px 0 2px; }
.doc-answers-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 12px; }
.doc-answers-key { color: #86868b; flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-secret { background: none; border: none; padding: 0; font: inherit; color: #1d1d1f; cursor: pointer; border-bottom: 1px dashed #d2d2d7; word-break: break-all; text-align: left; }
.doc-secret.revealed { border-bottom-color: #007AFF; }

/* Document lightbox — above .modal-overlay (z-index 10000) and its dropdown
   layer (10001) so it paints over the contact popup */
.doc-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 10002; display: flex; align-items: center; justify-content: center; }
.doc-lightbox-inner { position: relative; display: flex; flex-direction: column; align-items: center; max-width: 92vw; max-height: 92vh; }
.doc-lightbox-inner img { max-width: 92vw; max-height: 84vh; border-radius: 8px; background: #fff; display: block; }
.doc-lightbox-close { position: absolute; top: -34px; right: 0; background: none; border: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.doc-lightbox-caption { color: #fff; font-size: 12px; margin-top: 8px; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Automations (workflow builder) ── */
.auto-container { flex: 1; min-height: 0; overflow-y: auto; width: 100%; max-width: 900px; margin: 0 auto; padding: 24px; }
.auto-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 16px 20px; background: #fff; border: 1px solid #ececf1; border-radius: 12px; }
.auto-header h2 { margin: 0; font-size: 18px; font-weight: 600; color: #1d1d1f; flex: 1; }
.auto-header-actions { display: flex; align-items: center; gap: 8px; }
.auto-back-btn { border: none; background: none; color: #007AFF; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0; white-space: nowrap; }
.auto-back-btn:hover { text-decoration: underline; }
.auto-builder-meta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; background: #fff; border: 1px solid #ececf1; border-radius: 12px; padding: 16px; }
.auto-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #1d1d1f; cursor: pointer; }
.auto-card { background: #fff; border: 1px solid #ececf1; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.auto-card-title { font-size: 13px; font-weight: 700; color: #1d1d1f; margin-bottom: 12px; }
.auto-field-row { margin-bottom: 12px; }
.auto-field-row:last-child { margin-bottom: 0; }
.auto-field-row > label { display: block; font-size: 11px; color: #86868b; margin-bottom: 4px; }
.auto-field-row textarea { width: 100%; padding: 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; box-sizing: border-box; outline: none; }
.auto-field-row textarea:focus { border-color: #007AFF; }
.auto-field-row.auto-inline { display: flex; align-items: center; gap: 10px; }
.auto-inline { display: flex; align-items: center; gap: 12px; }
.auto-num { max-width: 100px; }
.auto-hint { font-size: 12px; color: #86868b; }
.auto-err { color: #ff3b30 !important; }
.auto-var-select { margin-bottom: 6px; padding: 6px 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 12px; color: #007AFF; background: #fff; cursor: pointer; }
.auto-preview { background: #fafafc; border: 1px solid #ececf1; border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #1d1d1f; min-height: 40px; white-space: pre-wrap; word-break: break-word; }
.auto-var-token { background: rgba(0,122,255,0.1); color: #007AFF; border-radius: 4px; padding: 0 3px; }
.auto-sms-count { font-weight: 400; color: #86868b; margin-left: 6px; }
#automationsView .select-input { font-size: 13px; padding: 8px 12px; }
#automationsView .auto-field-row .search-input { box-sizing: border-box; }

/* List screen */
.auto-wf-list { display: flex; flex-direction: column; gap: 10px; }
.auto-wf-row { display: flex; align-items: center; gap: 16px; background: #fff; border: 1px solid #ececf1; border-radius: 12px; padding: 14px 18px; }
.auto-wf-main { flex: 1; min-width: 0; }
.auto-wf-name { font-size: 15px; font-weight: 600; color: #1d1d1f; }
.auto-wf-trigger { font-size: 12px; color: #007AFF; margin-top: 2px; }
.auto-wf-desc { font-size: 12px; color: #86868b; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-wf-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.auto-wf-stats { font-size: 11px; color: #86868b; }
.auto-wf-actions { display: flex; gap: 6px; flex-shrink: 0; }
.auto-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.auto-badge-draft { background: #f5f5f5; color: #757575; }
.auto-badge-published { background: #e8f5e9; color: #2e7d32; }
.auto-badge-paused { background: #fff3cd; color: #856404; }
.auto-badge-active { background: #e3f2fd; color: #1565c0; }
.auto-badge-finished { background: #e8f5e9; color: #2e7d32; }
.auto-badge-removed { background: #f5f5f5; color: #757575; }
.auto-badge-error { background: #fce4ec; color: #c62828; }
.auto-btn-ghost { background: #f5f5f7; color: #1d1d1f; }
.auto-btn-ghost:hover { background: #e8e8ed; }
.auto-btn-danger { background: #fff; color: #ff3b30; border: 1px solid #ffd2cf; }
.auto-btn-danger:hover { background: #fff5f4; }

/* Builder step list */
.auto-step-card { background: #fff; border: 1px solid #ececf1; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.auto-step-card.open { border-color: #007AFF; }
.auto-step-head { display: flex; align-items: center; gap: 10px; }
.auto-step-num { width: 22px; height: 22px; border-radius: 50%; background: #f5f5f7; color: #86868b; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auto-step-type { font-size: 13px; font-weight: 700; color: #1d1d1f; white-space: nowrap; }
.auto-step-summary { flex: 1; min-width: 0; font-size: 12px; color: #86868b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-step-actions { display: flex; gap: 4px; flex-shrink: 0; }
.auto-icon-btn { border: 1px solid #e5e5ea; background: #fff; border-radius: 6px; padding: 3px 8px; font-size: 12px; color: #1d1d1f; cursor: pointer; }
.auto-icon-btn:hover:not(:disabled) { border-color: #007AFF; color: #007AFF; }
.auto-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.auto-icon-btn.auto-danger:hover { border-color: #ff3b30; color: #ff3b30; }
.auto-step-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.auto-insert-step { display: block; margin: -4px auto 10px; width: 24px; height: 24px; border-radius: 50%; border: 1px dashed #d2d2d7; background: #fff; color: #86868b; font-size: 14px; line-height: 1; cursor: pointer; }
.auto-insert-step:hover { border-color: #007AFF; color: #007AFF; }
.auto-add-step-btn { display: block; margin: 0 auto; padding: 8px 20px; border: 1px dashed #d2d2d7; border-radius: 10px; background: #fff; color: #007AFF; font-size: 13px; font-weight: 600; cursor: pointer; }
.auto-add-step-btn:hover { border-color: #007AFF; }
.auto-add-branch-step { margin-top: 8px; padding: 5px 12px; border: 1px dashed #d2d2d7; border-radius: 8px; background: #fff; color: #007AFF; font-size: 12px; font-weight: 600; cursor: pointer; }
.auto-add-branch-step:hover { border-color: #007AFF; }
.auto-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.auto-branch { background: #fafafc; border: 1px solid #ececf1; border-radius: 10px; padding: 10px; min-width: 0; }
.auto-branch-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #86868b; margin-bottom: 8px; }
.auto-add-cond-btn { margin-top: 4px; padding: 5px 12px; border: 1px dashed #d2d2d7; border-radius: 8px; background: #fff; color: #007AFF; font-size: 12px; font-weight: 600; cursor: pointer; }
.auto-add-cond-btn:hover { border-color: #007AFF; }
.auto-cond-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.auto-cond-row .select-input, .auto-cond-row .search-input { flex: 1; min-width: 110px; width: auto; }
.auto-add-menu { position: fixed; z-index: 10003; background: #fff; border: 1px solid #e5e5ea; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); padding: 6px; display: flex; flex-direction: column; min-width: 200px; max-height: 320px; overflow-y: auto; }
.auto-add-menu-item { border: none; background: none; text-align: left; padding: 8px 10px; font-size: 13px; color: #1d1d1f; border-radius: 6px; cursor: pointer; }
.auto-add-menu-item:hover { background: #f5f5f7; }

/* Runs screen */
.auto-enroll-box { background: #fff; border: 1px solid #ececf1; border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.auto-enroll-box textarea { width: 100%; min-height: 70px; padding: 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; box-sizing: border-box; outline: none; }
.auto-enroll-box textarea:focus { border-color: #007AFF; }
.auto-enroll-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.auto-status-filter { max-width: 180px; }
.auto-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #ececf1; border-radius: 12px; overflow: hidden; }
.auto-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #86868b; padding: 10px 12px; border-bottom: 1px solid #ececf1; background: #fafafc; }
.auto-table td { padding: 10px 12px; font-size: 13px; color: #1d1d1f; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.auto-table tbody tr { cursor: pointer; }
.auto-table tbody tr:hover { background: #fafafc; }
.auto-table tbody tr.active { background: rgba(0,122,255,0.06); }
.auto-table tbody tr:last-child td { border-bottom: none; }
.auto-contact-link { color: #007AFF; text-decoration: none; font-weight: 600; }
.auto-contact-link:hover { text-decoration: underline; }
.auto-sub { font-size: 11px; color: #86868b; margin-top: 2px; }
.auto-log-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.auto-log-row:last-child { border-bottom: none; }
.auto-log-badge { flex-shrink: 0; padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.auto-log-ok { background: #e8f5e9; color: #2e7d32; }
.auto-log-skipped { background: #f5f5f5; color: #757575; }
.auto-log-waiting { background: #fff3cd; color: #856404; }
.auto-log-branched { background: #e3f2fd; color: #1565c0; }
.auto-log-disabled { background: #f5f5f5; color: #757575; }
.auto-log-error { background: #fce4ec; color: #c62828; }
.auto-log-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.auto-log-step { font-size: 13px; font-weight: 600; color: #1d1d1f; }
.auto-log-detail { font-size: 12px; color: #86868b; word-break: break-word; }
.auto-log-time { font-size: 11px; color: #86868b; white-space: nowrap; }

/* ── Automations: SMTP relays panel + HTML email preview ── */
.auto-list-toggle { display: inline-flex; gap: 0; margin-bottom: 16px; border-radius: 10px; overflow: hidden; border: 1px solid #d2d2d7; }
.auto-list-toggle-btn { padding: 8px 18px; border: none; background: #fff; font-size: 13px; font-weight: 600; cursor: pointer; color: #86868b; transition: all 0.15s; }
.auto-list-toggle-btn.active { background: #007AFF; color: #fff; }
.auto-relays-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.auto-relay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auto-relay-form-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.auto-relay-result { display: block; font-size: 12px; margin-top: 4px; color: #86868b; }
.auto-relay-result.ok { color: #2e7d32; }
.auto-relay-result.err { color: #ff3b30; }
.auto-html-preview { width: 100%; min-height: 240px; border: 1px solid #ececf1; border-radius: 8px; background: #fff; }
.auto-snap-flash { animation: autoSnapFlash .8s ease-out; }
@keyframes autoSnapFlash { from { background: rgba(10,132,255,.18); } to { background: transparent; } }

/* ── Automations: HTML editor modal (side-by-side source + snap preview) ── */
.auto-html-modal { max-width: 1200px; width: 95vw; height: 85vh; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
.auto-html-modal .modal-header { padding-bottom: 8px; }
.auto-html-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 0; padding: 0 24px 8px; }
.auto-html-split textarea { width: 100%; height: 100%; box-sizing: border-box; padding: 12px; border: 1px solid #d2d2d7; border-radius: 8px; font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; resize: none; outline: none; white-space: pre; overflow: auto; }
.auto-html-split textarea:focus { border-color: #007AFF; }
.auto-html-split .auto-html-preview { height: 100%; min-height: 0; }
.auto-html-footer { padding: 0 24px 16px; }

/* ── Automations: spot editor popover (click-to-edit text in HTML previews) ── */
#autoSpotEditor { position: fixed; z-index: 11000; width: 340px; background: #fff; border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.18); border: 1px solid #ececf1; padding: 12px; }
.auto-spot-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.auto-spot-crumbs { display: flex; flex-wrap: wrap; gap: 4px; }
.auto-spot-crumb { border: 1px solid #e5e5ea; background: #f5f5f7; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-family: Menlo, Consolas, monospace; color: #1d1d1f; cursor: pointer; }
.auto-spot-crumb:hover { border-color: #0a84ff; color: #0a84ff; }
.auto-spot-crumb.active { border-color: #0a84ff; color: #0a84ff; background: rgba(10,132,255,.08); }
#autoSpotHint { margin-bottom: 6px; }
#autoSpotTa { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; outline: none; }
#autoSpotTa:focus { border-color: #007AFF; }
#autoSpotTa.auto-spot-raw { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }
.auto-spot-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.auto-spot-actions #autoSpotVarWrap { flex: 1; }
.auto-spot-var-select { width: 100%; padding: 6px 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 12px; color: #007AFF; background: #fff; cursor: pointer; }
.auto-spot-toast { display: none; position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 11000; background: #1d1d1f; color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.auto-spot-url-row { margin-top: 6px; }
.auto-spot-url-row label { display: block; margin-bottom: 3px; }
.auto-spot-url-row input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 12px; font-family: 'SF Mono', Menlo, Consolas, monospace; outline: none; }
.auto-spot-url-row input:focus { border-color: #007AFF; }
.contact-id-chip { display: inline-block; margin-top: 4px; font-family: Menlo, Consolas, monospace; font-size: 11px; color: #86868b; background: #f5f5f7; border: 1px solid #e5e5ea; border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.contact-id-chip:hover { border-color: #0a84ff; color: #0a84ff; }

/* ── Automations: AI variable-placement row (HTML editor modal) ── */
.auto-ai-bar { display: flex; align-items: center; gap: 8px; }
.auto-ai-bar .search-input { flex: 1; }
.auto-ai-spark { font-size: 15px; }

/* ── Automations: email capture modal ── */
.auto-cap-address { font-family: monospace; font-size: 13px; background: #f5f5f7; border: 1px solid #e5e5ea; border-radius: 8px; padding: 10px 12px; margin: 12px 0 8px; word-break: break-all; color: #1d1d1f; }
.auto-cap-spinner { display: flex; align-items: center; gap: 8px; color: #86868b; font-size: 13px; margin-top: 12px; }
.auto-cap-recent-row { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.auto-cap-recent-row:hover { background: #f5f5f7; }
.auto-cap-recent-subj { font-size: 13px; font-weight: 600; color: #1d1d1f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-cap-recent-meta { font-size: 11px; color: #86868b; }
.auto-notice { font-size: 12px; color: #2e7d32; font-weight: 600; }

/* ── Automations: email template library + inbox import ── */
.auto-tpl-select { padding: 6px 10px; border: 1px solid #d2d2d7; border-radius: 8px; font-size: 12px; color: #007AFF; background: #fff; cursor: pointer; }
.auto-inbox-list { display: flex; flex-direction: column; border: 1px solid #ececf1; border-radius: 10px; margin-top: 10px; max-height: 260px; overflow-y: auto; }
.auto-inbox-row { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: none; border-bottom: 1px solid #f0f0f0; background: none; padding: 8px 12px; cursor: pointer; font-family: inherit; }
.auto-inbox-row:last-child { border-bottom: none; }
.auto-inbox-row:hover { background: #f5f5f7; }
.auto-inbox-row.active { background: rgba(0,122,255,0.08); }
.auto-inbox-subj { font-size: 13px; font-weight: 600; color: #1d1d1f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-inbox-meta { font-size: 11px; color: #86868b; }
.auto-inbox-pager { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.auto-inbox-preview { max-height: 340px; overflow-y: auto; }
iframe.auto-inbox-preview { height: 340px; }
#autoTplPreviewWrap .auto-html-preview { min-height: 300px; }
