/* ══════════════════════════════════════════════════════════════
   components.css — Salesforce 2.0
   Estilos dos componentes JS (chatList, chatView, sidebar, etc.)
   Classes mapeadas 1:1 com os nomes reais usados nos JS.
   ══════════════════════════════════════════════════════════════ */

/* ── Chat List: sf-* classes (chatList.js) ── */

.sf-search-bar { padding: var(--space-sm) var(--space-md); }
.sf-search-input { width: 100%; padding: var(--space-sm) var(--space-md); border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: var(--font-size-sm); outline: none; background: var(--bg-primary); color: var(--text-primary); }
.sf-search-input:focus { border-color: var(--primary); }
.sf-search-input::placeholder { color: var(--text-muted); }

.sf-tag-filters { display: flex; gap: var(--space-xs); overflow-x: auto; padding: var(--space-xs) var(--space-md); scrollbar-width: none; flex-wrap: wrap; }
.sf-tag-filters::-webkit-scrollbar { display: none; }

.sf-tag-pill { padding: 4px 10px; border-radius: var(--radius-full); font-size: var(--font-size-xs); cursor: pointer; white-space: nowrap; border: 1px solid var(--border-color); background: var(--bg-primary); transition: all var(--transition-fast); font-weight: 500; }
.sf-tag-pill.active { color: white; }
.sf-tag-pill:hover { opacity: 0.85; }

.sf-chat-list { flex: 1; overflow-y: auto; }

.sf-chat-item { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); cursor: pointer; border-bottom: 1px solid var(--border-color); transition: background var(--transition-fast); }
.sf-chat-item:hover { background: var(--primary-light); }
.sf-chat-item.active { background: var(--primary-light); border-left: 3px solid var(--primary); }
.sf-chat-item.escalated { border-left: 3px solid var(--danger); }
.sf-chat-item.keyboard-selected { background: var(--primary-light); outline: 2px solid var(--primary); outline-offset: -2px; }

.sf-chat-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--font-size-sm); flex-shrink: 0; }
.sf-chat-avatar.escalated { box-shadow: 0 0 0 2px var(--danger); }

.sf-chat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.sf-chat-name-row { display: flex; justify-content: space-between; align-items: center; }

.sf-chat-name { font-weight: 600; font-size: var(--font-size-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }

.sf-chat-time { font-size: var(--font-size-xs); color: var(--text-muted); flex-shrink: 0; }
.sf-chat-time.urgent { color: var(--danger); font-weight: 600; }

.sf-chat-preview { font-size: var(--font-size-xs); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sf-chat-badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }

.sf-priority-dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex-shrink: 0; }

.sf-chat-tag { padding: 1px 6px; border-radius: var(--radius-full); font-size: 10px; font-weight: 500; white-space: nowrap; }

.sf-label-chip { padding: 1px 6px; border-radius: var(--radius-full); font-size: 10px; font-weight: 500; white-space: nowrap; }

.sf-badge-unread { background: var(--primary); color: white; border-radius: var(--radius-full); min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; padding: 0 5px; }
.sf-unread-new { animation: unreadPulse 0.3s ease; }
@keyframes unreadPulse { 0% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Section labels */
.sf-section-label { display: flex; align-items: center; gap: 6px; padding: var(--space-xs) var(--space-md); font-size: var(--font-size-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.sf-dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex-shrink: 0; }

.sf-section-snoozed { cursor: pointer; }
.sf-snooze-toggle { font-size: 10px; cursor: pointer; }

/* ── Chat View (chatView.js) ── */

.chat-view { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

.chat-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: var(--space-sm); color: var(--text-muted); }
.chat-loading-spinner { width: 32px; height: 32px; border: 3px solid var(--border-color); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chat-loading-text { font-size: var(--font-size-sm); }

.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); gap: var(--space-md); padding: var(--space-lg); }
.chat-empty-icon { font-size: 48px; opacity: 0.3; }
.chat-empty-title { font-size: var(--font-size-lg); font-weight: 600; }
.chat-empty-sub { font-size: var(--font-size-sm); }

/* Chat Header */
.chat-header { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-color); background: var(--bg-primary); min-height: 56px; }
.chat-header-left { display: flex; align-items: center; gap: var(--space-sm); flex: 1; min-width: 0; }
.chat-avatar { width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--font-size-md); flex-shrink: 0; }
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-name { font-weight: 600; font-size: var(--font-size-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-meta { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; }
.chat-header-time { font-size: var(--font-size-xs); color: var(--text-muted); }
.chat-header-actions { display: flex; gap: var(--space-xs); flex-shrink: 0; }
.chat-header-actions button { width: 32px; height: 32px; border-radius: var(--radius-md); border: none; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: all var(--transition-fast); font-size: 16px; }
.chat-header-actions button:hover { background: var(--bg-secondary); color: var(--primary); }

/* Badges (header) */
.badge { padding: 2px 8px; border-radius: var(--radius-full); font-size: var(--font-size-xs); font-weight: 500; }
.badge-specialty { background: var(--primary-light); color: var(--primary); }
.badge-tag { background: var(--bg-secondary); color: var(--text-secondary); }

/* Btn Icon */
.btn-icon { width: 32px; height: 32px; border-radius: var(--radius-md); border: none; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); transition: all var(--transition-fast); font-size: 16px; }
.btn-icon:hover { background: var(--bg-secondary); color: var(--primary); }

/* Btn small */
.btn-sm { padding: 4px 12px; border-radius: var(--radius-md); font-size: var(--font-size-xs); cursor: pointer; transition: all var(--transition-fast); border: 1px solid var(--border-color); }
.btn-sm.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-sm.btn-primary:hover { background: var(--primary-dark); }
.btn-sm.btn-outline { background: transparent; color: var(--text-primary); }
.btn-sm.btn-outline:hover { background: var(--bg-secondary); }
.btn-sm.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-sm.btn-ghost:hover { background: var(--bg-secondary); color: var(--text-primary); }

/* Escalated Banner */
.escalated-banner { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); background: #FEE2E2; border-radius: var(--radius-md); margin: var(--space-xs) var(--space-md); font-size: var(--font-size-sm); color: var(--danger); }
.escalated-icon { font-size: 16px; }

/* Messages Container */
.messages-container { flex: 1; overflow-y: auto; padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); }

/* Date Separator */
.date-separator { display: flex; align-items: center; justify-content: center; padding: var(--space-sm) 0; }
.date-separator span { background: var(--bg-secondary); color: var(--text-muted); font-size: var(--font-size-xs); padding: 4px 12px; border-radius: var(--radius-full); font-weight: 500; }

/* Message Bubbles */
.msg { max-width: 70%; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-lg); margin-bottom: var(--space-xs); position: relative; line-height: 1.45; font-size: var(--font-size-sm); word-wrap: break-word; }
.msg-lead, .msg.msg-lead { background: var(--bg-lead); align-self: flex-start; border-bottom-left-radius: var(--radius-sm); }
.msg-bot, .msg.msg-bot { background: var(--bg-bot); align-self: flex-end; border-bottom-right-radius: var(--radius-sm); }

/* Note messages */
.msg-note, .msg.msg-note { background: var(--bg-note); align-self: center; border: 1px dashed #E0C97F; max-width: 85%; font-style: normal; }
.msg-note-header { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: var(--font-size-xs); color: #B8860B; font-weight: 600; }
.msg-note-icon { font-size: 12px; }
.msg-note-label { font-size: var(--font-size-xs); }
.msg-note-text { font-size: var(--font-size-sm); color: var(--text-primary); line-height: 1.4; }
.msg-note-footer { display: flex; align-items: center; gap: var(--space-sm); margin-top: 4px; font-size: 10px; color: var(--text-muted); flex-wrap: wrap; }
.msg-note-author { font-weight: 500; }
.msg-note-time { }
.msg-note-mentions { display: flex; gap: 4px; }
.mention-tag { background: #E8F0FE; color: var(--primary); padding: 1px 6px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 500; }

.msg-text { }
.msg-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.msg-sent-by { font-size: 10px; color: var(--text-secondary); font-weight: 500; }
.msg-media-tag { font-size: var(--font-size-xs); color: var(--text-secondary); margin-bottom: 4px; padding: 4px 8px; background: rgba(0,0,0,0.04); border-radius: var(--radius-sm); }

.msg-tick { font-size: 12px; }
.tick-sent { color: var(--text-muted); }
.tick-delivered { color: var(--text-muted); }
.tick-read { color: var(--primary); }
.tick-failed { color: var(--danger); }

/* Tag Change inline */
.tag-change { align-self: center; background: var(--bg-secondary); padding: 4px 12px; border-radius: var(--radius-full); font-size: var(--font-size-xs); color: var(--text-secondary); margin: var(--space-xs) 0; }

/* AI Suggestion Strip */
.ai-suggestion-strip { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-md); background: var(--primary-light); border-bottom: 1px solid var(--border-color); }
.btn-suggestion { padding: 6px 16px; border-radius: var(--radius-md); border: 1px solid var(--primary); background: white; color: var(--primary); cursor: pointer; font-size: var(--font-size-sm); transition: all var(--transition-fast); }
.btn-suggestion:hover { background: var(--primary); color: white; }
.btn-suggestion:disabled { opacity: 0.6; cursor: not-allowed; }
.suggestion-icon { font-size: 20px; }
.suggestion-text { flex: 1; font-size: var(--font-size-sm); color: var(--text-primary); line-height: 1.4; padding: 0 var(--space-sm); }
.suggestion-actions { display: flex; gap: var(--space-xs); flex-shrink: 0; }

/* Composer */
.composer { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-sm) var(--space-md); border-top: 1px solid var(--border-color); background: var(--bg-primary); }
.composer.note-mode { background: var(--bg-note); }

.composer-mode { display: flex; gap: 0; }
.mode-btn { padding: 4px 12px; border: 1px solid var(--border-color); background: var(--bg-secondary); cursor: pointer; font-size: var(--font-size-xs); transition: all var(--transition-fast); color: var(--text-secondary); }
.mode-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.mode-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.mode-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.composer-input-row { display: flex; align-items: flex-end; gap: var(--space-sm); }

.btn-attach { flex-shrink: 0; }

.composer-textarea { flex: 1; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); resize: none; font-family: var(--font-family); font-size: var(--font-size-sm); min-height: 40px; max-height: 120px; outline: none; color: var(--text-primary); background: var(--bg-primary); }
.composer-textarea:focus { border-color: var(--primary); }
.composer-textarea::placeholder { color: var(--text-muted); }

.btn-send { width: 40px; height: 40px; border-radius: var(--radius-full); border: none; background: var(--primary); color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background var(--transition-fast); }
.btn-send:hover { background: var(--primary-dark); }

/* ── Canned Responses Dropdown (cannedResponses.js) ── */
.canned-dropdown { position: absolute; bottom: 100%; left: 0; right: 0; max-height: 280px; overflow-y: auto; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); z-index: 100; }
.canned-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-color); font-size: var(--font-size-xs); color: var(--text-secondary); font-weight: 600; }
.canned-hint { font-weight: 400; opacity: 0.7; }
.canned-item { display: flex; flex-direction: column; gap: 2px; padding: var(--space-sm) var(--space-md); cursor: pointer; transition: background var(--transition-fast); }
.canned-item:hover, .canned-item.selected { background: var(--primary-light); }
.canned-item-top { display: flex; align-items: center; gap: var(--space-sm); }
.canned-shortcode { font-family: var(--font-mono); font-size: var(--font-size-xs); color: var(--primary); background: var(--primary-light); padding: 2px 6px; border-radius: var(--radius-sm); }
.canned-category { font-size: 10px; color: var(--text-muted); }
.canned-preview { font-size: var(--font-size-xs); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.canned-more { padding: var(--space-xs) var(--space-md); font-size: var(--font-size-xs); color: var(--text-muted); text-align: center; }

/* ── Dropdowns (chatView.js priority/actions) ── */
.dropdown { position: absolute; top: 100%; right: 0; z-index: 1000; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 4px 0; min-width: 160px; box-shadow: var(--shadow-lg); }
.dropdown-item { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); cursor: pointer; font-size: var(--font-size-sm); color: var(--text-primary); transition: background var(--transition-fast); }
.dropdown-item:hover { background: var(--primary-light); }
.dropdown-item.active { color: var(--primary); font-weight: 600; }
.priority-dropdown { }
.actions-dropdown { }

/* ── Priority (priority.js) ── */
.priority-badge { width: 10px; height: 10px; border-radius: var(--radius-full); flex-shrink: 0; display: inline-block; }
.priority-badge.urgent { background: var(--priority-urgent); }
.priority-badge.high { background: var(--priority-high); }
.priority-badge.medium { background: var(--priority-medium); }
.priority-badge.low { background: var(--priority-low); }
.priority-flag { font-size: 18px !important; }

/* ── Labels (sidebar.js) ── */
.label-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: var(--font-size-xs); font-weight: 500; gap: 4px; }

/* ── Sidebar (sidebar.js) — inline styles used, minimal CSS needed ── */
.sidebar-content { display: flex; flex-direction: column; height: 100%; overflow-y: auto; }
.sidebar-section { border-bottom: 1px solid var(--border-color); }
.sidebar-section-title { font-size: 11px; font-weight: 600; color: var(--text-secondary); padding: 12px 12px 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-field-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font-size: 12px; cursor: pointer; border-radius: 4px; transition: background 0.15s; }
.sidebar-field-row:hover { background: var(--bg-secondary); }

/* ── Notes (privateNotes.js) ── */
.notes-panel-header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border-color); }
.notes-panel-header h3 { font-size: var(--font-size-sm); font-weight: 600; }
.notes-list { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-sm); }
.notes-empty, .notes-error { padding: var(--space-md); text-align: center; font-size: var(--font-size-sm); color: var(--text-muted); }
.note-card { background: var(--bg-secondary); border-radius: var(--radius-md); padding: var(--space-sm); }
.note-card-text { font-size: var(--font-size-sm); color: var(--text-primary); line-height: 1.4; }
.note-card-meta { display: flex; justify-content: space-between; margin-top: var(--space-xs); font-size: var(--font-size-xs); color: var(--text-muted); }
.quick-note-input { padding: var(--space-sm) var(--space-md); }
.quick-note-input textarea { width: 100%; padding: var(--space-sm); border-radius: var(--radius-md); border: 1px solid var(--primary); font-family: var(--font-family); font-size: var(--font-size-sm); resize: vertical; outline: none; }
.quick-note-hint { font-size: var(--font-size-xs); color: var(--text-muted); margin-top: 4px; }

/* ── Modal / Overlay ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: var(--bg-primary); border-radius: var(--radius-lg); padding: var(--space-lg); box-shadow: var(--shadow-lg); min-width: 360px; max-width: 480px; }
.modal-title { font-size: var(--font-size-lg); font-weight: 600; margin-bottom: var(--space-md); }

/* ── Connection Status ── */
.status-dot { width: 8px; height: 8px; border-radius: var(--radius-full); display: inline-block; }
.status-dot.online { background: var(--success); }
.status-dot.offline { background: var(--danger); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── Agenda Panel (agenda.js) ── */
.sf-agenda-panel { border-bottom: 1px solid var(--border-color); overflow: hidden; transition: max-height var(--transition-normal); }
.sf-agenda-panel.expanded { max-height: 400px; }
.sf-agenda-panel.collapsed { max-height: 36px; }
.sf-agenda-panel.collapsed .sf-agenda-week,
.sf-agenda-panel.collapsed .sf-agenda-patients,
.sf-agenda-panel.collapsed .sf-agenda-sync-btn,
.sf-agenda-panel.collapsed .sf-agenda-resize { display: none; }

.sf-agenda-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; cursor: pointer; user-select: none; font-size: var(--font-size-sm); font-weight: 600; color: var(--text-primary); background: var(--bg-secondary); }
.sf-agenda-header:hover { background: var(--border-color); }
.sf-ah-toggle { font-size: 10px; color: var(--text-muted); }

.sf-agenda-week { display: flex; gap: 3px; padding: 6px 6px; overflow-x: auto; scrollbar-width: thin; }
.sf-day-card { flex: 1; min-width: 44px; padding: 5px 2px; border-radius: var(--radius-md); background: var(--bg-primary); border: 1px solid var(--border-color); text-align: center; cursor: pointer; transition: all var(--transition-fast); font-size: var(--font-size-xs); }
.sf-day-card:hover { border-color: var(--primary); background: var(--primary-light); }
.sf-day-card.today { border-color: var(--primary); border-width: 2px; }
.sf-day-card.selected { background: var(--primary-light); border-color: var(--primary); }
.sf-day-weekday { font-weight: 600; font-size: 10px; text-transform: uppercase; color: var(--text-secondary); }
.sf-day-date { font-size: var(--font-size-md); font-weight: 700; margin: 1px 0; }
.sf-day-count { font-size: 10px; color: var(--text-secondary); }
.sf-day-count strong { color: var(--text-primary); }
.sf-day-status { font-size: 9px; margin-top: 2px; }
.sf-day-status.ok { color: var(--success); }
.sf-day-status.warn { color: var(--warning); }
.sf-day-status.alert { color: var(--danger); }

.sf-agenda-patients { max-height: 180px; overflow-y: auto; border-top: 1px solid var(--border-color); }
.sf-agenda-patient { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: var(--font-size-xs); border-bottom: 1px solid var(--border-color); transition: background var(--transition-fast); flex-wrap: wrap; cursor: pointer; }
.sf-agenda-patient:hover { background: var(--primary-light); }
.sf-ap-time { font-weight: 600; color: var(--text-primary); min-width: 40px; }
.sf-ap-name { font-weight: 500; color: var(--text-primary); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-ap-type { padding: 1px 6px; border-radius: var(--radius-full); font-size: 9px; font-weight: 600; text-transform: uppercase; }
.sf-ap-type.diu { background: #E8F0FE; color: #1B73E8; }
.sf-ap-type.cirurgia { background: #FEE2E2; color: #D93025; }
.sf-ap-type.emag { background: #E8F5E9; color: #0D904F; }

.sf-confirm-badge { padding: 1px 6px; border-radius: var(--radius-full); font-size: 9px; white-space: nowrap; }
.sf-confirm-badge.ok { background: #E8F5E9; color: #0D904F; }
.sf-confirm-badge.warn { background: #FFF3E0; color: #E37400; }
.sf-confirm-badge.danger { background: #FEE2E2; color: #D93025; }
.sf-confirm-badge.info { background: #E8F0FE; color: #1B73E8; }
.sf-confirm-badge.muted { background: var(--bg-secondary); color: var(--text-muted); }

.sf-agenda-resize { height: 4px; cursor: ns-resize; background: transparent; transition: background var(--transition-fast); }
.sf-agenda-resize:hover, .sf-agenda-resize.dragging { background: var(--primary); }

/* ── Metrics Panel (metrics.js) ── */
.sf-metrics-section { border-bottom: 1px solid var(--border-color); }
.sf-metrics-toggle { font-family: var(--font-family); }
.sf-metrics-toggle:hover { background: var(--bg-secondary) !important; }
.sf-metrics-panel { max-height: 0; overflow: hidden; transition: max-height var(--transition-normal); }
.sf-metrics-panel.open { max-height: 200px; }
.sf-metric-card { text-align: center; }

/* ── Shortcuts Help ── */
.shortcuts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.shortcut-item { display: flex; justify-content: space-between; align-items: center; padding: var(--space-xs) 0; }
.shortcut-key { font-family: var(--font-mono); font-size: var(--font-size-xs); background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 2px 8px; }

/* ── Kanban Tag Strip (tagManager.js) ── */
.sf-kanban-strip { display: flex; gap: 6px; padding: 6px 12px; overflow-x: auto; border-bottom: 1px solid var(--border-color); scrollbar-width: none; }
.sf-kanban-strip::-webkit-scrollbar { display: none; }

/* ── Collapsible Tag Sections ── */
.sf-section-collapsible { cursor: pointer; user-select: none; }
.sf-section-collapsible:hover { background: rgba(0,0,0,0.03); border-radius: var(--radius-sm); }
.sf-collapse-toggle { font-size: 10px; margin-right: 4px; display: inline-block; transition: transform var(--transition-fast); }
.sf-tag-pills-header { display: flex; align-items: center; justify-content: space-between; padding: 4px var(--space-md) 0; cursor: pointer; user-select: none; }
.sf-tag-pills-header:hover { background: rgba(0,0,0,0.02); }
.sf-tag-pills-label { font-size: var(--font-size-xs); font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.sf-tag-pills-toggle { font-size: 10px; color: var(--text-muted); }

/* Search clear button */
.sf-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #8696a0;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}
.sf-search-clear:hover {
  color: #e9edef;
  background: rgba(134,150,160,0.15);
}
.sf-search-bar {
  position: relative;
}

/* ── Context Menu ─────────────────────────────────────────────────────────── */
.sf-context-menu {
  position: fixed;
  z-index: 9999;
  background: var(--bg-primary, #0b141a);
  border: 1px solid var(--border-color, #2a3a4a);
  border-radius: 8px;
  padding: 4px 0;
  min-width: 180px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  animation: ctxFadeIn 0.12s ease;
}
@keyframes ctxFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.sf-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-primary, #e9edef);
  cursor: pointer;
  transition: background 0.1s;
}
.sf-ctx-item:hover {
  background: var(--bg-hover, #182229);
}
.sf-ctx-item.danger {
  color: #ef4444;
}
.sf-ctx-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}
.sf-ctx-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

/* Inline edit mode */
.msg-editing .msg-text {
  background: var(--bg-secondary, #1a2332);
  border: 1px solid var(--primary, #00a884);
  border-radius: 6px;
  padding: 6px 8px;
  outline: none;
}
.msg-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.msg-edit-actions button {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
}
.msg-edit-actions .btn-save {
  background: var(--primary, #00a884);
  color: #fff;
}
.msg-edit-actions .btn-cancel {
  background: transparent;
  color: var(--text-secondary, #8696a0);
  border: 1px solid var(--border-color, #2a3a4a);
}

/* Forward modal */
.sf-forward-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sf-forward-modal {
  background: var(--bg-primary, #0b141a);
  border: 1px solid var(--border-color, #2a3a4a);
  border-radius: 12px;
  width: 360px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
}
.sf-forward-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color, #2a3a4a);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sf-forward-search {
  margin: 8px 12px;
  padding: 8px 12px;
  background: var(--bg-secondary, #1a2332);
  border: 1px solid var(--border-color, #2a3a4a);
  border-radius: 6px;
  color: var(--text-primary, #e9edef);
  font-size: 13px;
  width: calc(100% - 24px);
  box-sizing: border-box;
}
.sf-forward-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
  max-height: 350px;
}
.sf-forward-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.1s;
}
.sf-forward-item:hover {
  background: var(--bg-hover, #182229);
}
.sf-forward-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #00a884;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.sf-forward-name {
  font-size: 13px;
  color: var(--text-primary, #e9edef);
}

/* Load history button */
.chat-load-history {
  text-align: center;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-secondary, #8696a0);
  cursor: pointer;
  border-radius: 6px;
  margin: 4px 8px;
  border: 1px solid var(--border-color, #2a3a4a);
  transition: background 0.1s, color 0.1s;
}
.chat-load-history:hover {
  background: var(--bg-hover, #182229);
  color: var(--text-primary, #e9edef);
}
