:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #283548;
  --bg-header: #141e33;
  --border-color: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #38bdf8;
  --accent-purple: #a855f7;
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.top-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
}

.logo-icon {
  font-size: 1.3rem;
}

.version-tag {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-blue);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.niche-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.niche-selector-wrap select {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
}

.status-pills {
  display: flex;
  gap: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.dot.green { background-color: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.dot.blue { background-color: var(--accent-blue); box-shadow: 0 0 6px var(--accent-blue); }

.pill-label {
  color: var(--text-muted);
}
.pill-value {
  color: var(--text-primary);
  font-weight: 500;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background-color: #2563eb;
  color: #fff;
}
.btn-primary:hover {
  background-color: #1d4ed8;
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 7px 10px;
}

/* Dropdowns for clean, uncluttered header navigation */
.header-dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 260px;
  background: #182235;
  border: 1px solid #334155;
  border-radius: 10px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: none;
  z-index: 9999;
  backdrop-filter: blur(12px);
  animation: dropdownAnim 0.15s ease-out;
}

.dropdown-menu-right {
  left: auto;
  right: 0;
}

.header-dropdown.open .dropdown-menu {
  display: block;
}

@keyframes dropdownAnim {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-primary);
  user-select: none;
}

.dropdown-item:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.dropdown-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-title {
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.2;
}

.dropdown-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dropdown-divider {
  height: 1px;
  background: #334155;
  margin: 4px 6px;
}

.dropdown-danger:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

.btn-sm {
  padding: 5px 11px !important;
  font-size: 0.8rem !important;
}

.btn-pulse {
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

/* Pipeline Tabs Bar (amoCRM style) */
.pipeline-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #0b1120;
  border-bottom: 1px solid var(--border-color);
  padding: 6px 20px;
  overflow-x: auto;
  flex-shrink: 0;
}

.tabs-list {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--text-primary);
}

.tab-btn.active {
  background: #1e3a8a;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 0.72rem;
}

.btn-add-tab {
  background: none;
  border: 1px dashed var(--border-color);
  color: var(--accent-blue);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-add-tab:hover {
  border-color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.05);
}

.form-control {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.84rem;
  outline: none;
}

/* Metrics Bar */
.metrics-bar {
  display: flex;
  gap: 12px;
  padding: 10px 20px;
  background-color: #0b1120;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  flex-shrink: 0;
}

.metric-card {
  flex: 1;
  min-width: 130px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
}

.metric-card.highlight-card {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(30, 41, 59, 1) 100%);
}

.metric-val {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.metric-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.highlight-blue { color: var(--accent-blue); }
.highlight-purple { color: var(--accent-purple); }
.highlight-gold { color: var(--accent-gold); }

/* Kanban Board */
.kanban-board {
  display: flex;
  flex: 1;
  padding: 16px 20px;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
}

.kanban-col {
  flex: 1 1 0;
  min-width: 200px;
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.kanban-col.col-gold {
  border-color: rgba(245, 158, 11, 0.35);
}

.col-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.88rem;
}

.col-badge {
  background: var(--bg-card);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
}

.col-cards {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Lead Card */
.lead-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.lead-card:active {
  cursor: grabbing;
}

.lead-card.dragging {
  opacity: 0.4;
  transform: scale(0.97) rotate(1deg);
  border: 1px dashed var(--accent-blue) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6) !important;
}

.kanban-col {
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.kanban-col.drag-over {
  border-color: #38bdf8 !important;
  background-color: rgba(56, 189, 248, 0.09) !important;
  box-shadow: inset 0 0 15px rgba(56, 189, 248, 0.2), 0 0 15px rgba(56, 189, 248, 0.25) !important;
}

.kanban-col.col-gold.drag-over {
  border-color: #f59e0b !important;
  background-color: rgba(245, 158, 11, 0.09) !important;
  box-shadow: inset 0 0 15px rgba(245, 158, 11, 0.2), 0 0 15px rgba(245, 158, 11, 0.25) !important;
}

.col-cards.drag-over {
  background-color: rgba(56, 189, 248, 0.04);
}

.lead-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
  background-color: var(--bg-card-hover);
}

.lead-card.card-qualified {
  border-left: 3px solid var(--accent-gold);
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-phone {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.card-tag {
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.card-highlight-pill {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 6px;
  font-weight: 500;
}

.card-highlight-pill.pill-error {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.lead-card.card-manual-attention {
  border-left: 4px solid #ef4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2) !important;
}

.card-error-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.72rem;
  border-radius: 9999px;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  animation: pulse-attention 2s infinite;
}

@keyframes pulse-attention {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.1); }
}

/* ========================================================
   Centered Lead Modal (CRM Mini style popup)
   ======================================================== */
.lead-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 10000 !important;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lead-modal-overlay.active {
  display: block !important;
  opacity: 1;
}

.lead-card-modal {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) scale(0.96) !important;
  width: 90vw !important;
  max-width: 960px !important;
  height: 84vh !important;
  max-height: 780px !important;
  background: #0f172a !important;
  border: 1px solid #334155 !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
  display: none !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 10001 !important;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.lead-card-modal.open {
  display: flex !important;
  transform: translate(-50%, -50%) scale(1) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Unified Sleek Lead Modal Header */
.lead-modal-header {
  padding: 14px 20px;
  background: #111827;
  border-bottom: 1px solid #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  box-sizing: border-box;
}

.lead-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.lead-header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead-avatar-icon {
  font-size: 1.15rem;
  background: rgba(56, 189, 248, 0.12);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}

.lead-id-pill {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.lead-header-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1;
  font-family: inherit;
}

.lead-meta-phone {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 12.5px;
  color: #38bdf8;
}

.btn-copy-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 12px;
  opacity: 0.7;
  transition: opacity 0.15s;
  display: inline-flex;
  align-items: center;
}

.btn-copy-icon:hover {
  opacity: 1;
}

.lead-meta-divider {
  color: #475569;
}

.lead-meta-city {
  color: #cbd5e1;
  font-size: 12px;
}

.lead-profile-badge {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: #38bdf8;
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.lead-profile-badge strong {
  color: #e0f2fe;
  font-weight: 600;
}

/* Header Action Buttons: Strict Height & Alignment Uniformity */
.lead-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-action-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.header-action-btn.btn-offer {
  background: rgba(147, 51, 234, 0.08);
  border: 1px solid rgba(147, 51, 234, 0.28);
  color: #c084fc;
}

.header-action-btn.btn-offer:hover {
  background: rgba(147, 51, 234, 0.18);
  border-color: #c084fc;
}

.header-action-btn.btn-save {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.28);
  color: #38bdf8;
}

.header-action-btn.btn-save:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
}

.header-action-btn.bot-toggle-btn.bot-active {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.header-action-btn.bot-toggle-btn.bot-active:hover {
  background: rgba(16, 185, 129, 0.18);
}

.header-action-btn.bot-toggle-btn.bot-paused {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.header-action-btn.bot-toggle-btn.bot-paused:hover {
  background: rgba(245, 158, 11, 0.18);
}

.header-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  padding: 0;
  box-sizing: border-box;
}

.header-close-btn:hover {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}

/* Subtle Error / Warning Banner */
.lead-error-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  margin: 10px 16px 0 16px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #fbbf24;
}

.lead-error-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  line-height: 1.3;
}

.lead-error-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.lead-error-dismiss-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.lead-error-dismiss-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.lead-modal-two-col {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.lead-modal-sidebar {
  width: 330px;
  background: #0b1120;
  border-right: 1px solid #1e293b;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meta-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #64748b;
  text-transform: uppercase;
}

.meta-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-field-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.meta-field-group select {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.meta-field-group select:focus {
  border-color: #38bdf8;
}

.meta-details-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meta-detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.meta-detail-k {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}

.meta-detail-v {
  font-size: 0.84rem;
  color: #f1f5f9;
  font-weight: 500;
  word-break: break-word;
}

.gold-text {
  color: #fbbf24;
  font-weight: 600;
}

.lead-modal-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  min-width: 0;
}

.lead-modal-chat .chat-header {
  padding: 14px 20px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: #f8fafc;
}

.chat-channel-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  letter-spacing: 0.5px;
}

.lead-modal-chat .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-modal-chat .chat-input-wrap {
  padding: 14px 20px;
  background: #1e293b;
  border-top: 1px solid #334155;
  display: flex;
  gap: 12px;
  align-items: center;
}

.lead-modal-chat .chat-input-wrap textarea {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  padding: 10px 14px;
  font-size: 0.84rem;
  outline: none;
  resize: none;
  transition: border-color 0.15s;
}

.lead-modal-chat .chat-input-wrap textarea:focus {
  border-color: #38bdf8;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.msg-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.msg-badge.out-sms {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.msg-badge.in-sms {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.msg-badge.out-tg {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.msg-badge.in-tg {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}
.msg-badge.out-max {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}
.msg-badge.in-max {
  background: rgba(232, 121, 249, 0.2);
  color: #f0abfc;
  border: 1px solid rgba(232, 121, 249, 0.35);
}
.msg-badge.out-op {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.chat-msg.user {
  align-self: flex-start;
  background: #334155;
  color: #fff;
}

.chat-msg.assistant {
  align-self: flex-end;
  background: #1e3a8a;
  color: #e0f2fe;
}

.chat-msg.operator {
  align-self: flex-end;
  background: #047857;
  color: #d1fae5;
}

.chat-media-wrap {
  margin: 6px 0;
  border-radius: 8px;
  overflow: hidden;
}

.chat-media-img {
  max-width: 260px;
  max-height: 240px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: block;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.chat-media-img:hover {
  transform: scale(1.02);
  filter: brightness(1.08);
}

.chat-msg-time {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
  text-align: right;
}

.chat-input-wrap {
  padding: 10px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

.chat-input-wrap textarea {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: #fff;
  padding: 8px;
  font-size: 0.82rem;
  outline: none;
  resize: none;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 150;
}
.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 24px;
  width: 440px;
  max-width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.modal-card.modal-wide {
  width: 650px;
}

.modal-card h3 {
  margin-bottom: 8px;
}
.modal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group select, .form-group textarea {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.84rem;
  outline: none;
}

.spintax-preview-box {
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  max-height: 120px;
  overflow-y: auto;
  display: none;
}
.spintax-preview-item {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Modal Title Row with Close Button */
.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.modal-title-row h3 {
  margin: 0;
  font-size: 1.15rem;
}

/* MAX Modal Tabs & Elements */
.max-modal-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
  margin-bottom: 16px;
}

.max-modal-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.max-modal-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.max-modal-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.tab-badge-alert {
  background: #f59e0b;
  color: #0b1120;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.max-qr-wrapper {
  background: #ffffff;
  padding: 12px;
  border-radius: 12px;
  display: inline-block;
  margin: 10px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.max-qr-wrapper img {
  width: 230px;
  height: 230px;
  display: block;
  object-fit: contain;
}

/* AI Analyst Chat & Copilot */
.analyst-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.analyst-chip {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 0.72rem;
  padding: 5px 11px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.analyst-chip:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

.analyst-chat-box {
  flex: 1;
  min-height: 280px;
  max-height: 380px;
  overflow-y: auto;
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.analyst-msg {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  word-break: break-word;
}

.analyst-msg.user {
  align-self: flex-end;
  background: #1e3a8a;
  color: #e0f2fe;
}

.analyst-msg.assistant {
  align-self: flex-start;
  background: #1e293b;
  border: 1px solid #334155;
  color: #f1f5f9;
}

.analyst-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.analyst-input-row textarea {
  flex: 1;
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  padding: 8px 12px;
  font-size: 0.84rem;
  outline: none;
  resize: none;
}

/* Report Modal & Metrics Grid */
.report-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.report-metric-tile {
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.report-metric-val {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.report-metric-lbl {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.report-content-box {
  flex: 1;
  min-height: 250px;
  max-height: 380px;
  overflow-y: auto;
  background: #0b1120;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.btn-col-add {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
  padding: 0;
}

.btn-col-add:hover {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
  transform: scale(1.1);
}

/* ========================================================
   CRM-Mini Modal Enhancements & Omni-Feed Styling
   ======================================================== */

.lead-card-modal {
  width: 95vw !important;
  max-width: 1140px !important;
  height: 88vh !important;
  max-height: 870px !important;
}

.lead-modal-sidebar {
  width: 350px !important;
  min-width: 350px !important;
}

/* Header View Mode Switcher */
.view-mode-toggle {
  display: inline-flex;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.view-mode-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-mode-btn:hover {
  color: #f1f5f9;
}

.view-mode-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-copy-icon {
  background: transparent;
  border: none;
  font-size: 11px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
  padding: 0 3px;
}
.btn-copy-icon:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* Stage Stepper */
.stage-stepper-wrap {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-stepper-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.stage-pill-active {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
}

.stage-stepper-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-dot {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #334155;
  transition: all 0.2s ease;
  cursor: pointer;
}

.step-dot:hover {
  transform: scaleY(1.6);
  background: #64748b;
}

.step-dot.active {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
}

.step-dot.done {
  background: #10b981;
}

/* Editable Inputs in Modal */
.lead-title-edit-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 3px 6px;
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
  width: auto;
  min-width: 60px;
  max-width: 280px;
  flex: 0 1 auto;
}
.lead-title-edit-input:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}
.lead-title-edit-input:focus {
  background: rgba(15, 23, 42, 0.9);
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.meta-detail-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  color: #f1f5f9;
  font-size: 0.84rem;
  padding: 6px 10px;
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
.meta-detail-input:hover {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.85);
}
.meta-detail-input:focus {
  border-color: #38bdf8;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Main Note Textarea */
.deal-main-note-textarea {
  width: 100%;
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #f1f5f9;
  outline: none;
  resize: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.deal-main-note-textarea:focus {
  border-color: #f59e0b;
}

/* AI Audit Button & Box */
.btn-ai-audit {
  width: 100%;
  padding: 9px 12px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #9333ea 100%);
  border: 1px solid rgba(168, 85, 247, 0.5);
  border-radius: 10px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  transition: all 0.2s ease;
}

.btn-ai-audit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.ai-sparkle {
  font-size: 14px;
}

.ai-audit-card {
  margin-top: 10px;
  background: linear-gradient(180deg, rgba(30, 27, 75, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.ai-audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
  padding-bottom: 6px;
}

.ai-audit-stage {
  font-size: 11px;
  font-weight: 700;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 2px 7px;
  border-radius: 6px;
}

.ai-audit-readiness {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.readiness-high {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.readiness-med {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.readiness-low {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.ai-audit-section {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-audit-k {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.ai-audit-v {
  font-size: 12px;
  color: #f1f5f9;
  line-height: 1.45;
}

/* Right Main Column Structure */
.lead-modal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  min-width: 0;
  overflow: hidden;
}

/* Top Action Box */
.action-box-wrap {
  padding: 12px 16px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #334155;
  padding-bottom: 8px;
}

.action-tab-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.action-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
}

.action-tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.action-tab-btn.active.tab-note {
  color: #fbbf24;
  border-bottom: 2px solid #f59e0b;
}

.action-tab-btn.active.tab-sms {
  color: #38bdf8;
  border-bottom: 2px solid #0284c7;
}

.action-tab-btn.active.tab-call {
  color: #34d399;
  border-bottom: 2px solid #10b981;
}

.action-tab-btn.active.tab-task {
  color: #fb7185;
  border-bottom: 2px solid #f43f5e;
}

.action-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.template-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.template-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

/* Call Outcome Grid */
.outcome-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.outcome-btn {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #334155;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s;
}

.outcome-btn:hover,
.outcome-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Timeline Feed */
.timeline-feed-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timeline-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.timeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #94a3b8;
}

.timeline-note {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}

.timeline-call {
  border-left-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.05);
}

.timeline-sms-in {
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.06);
}

.timeline-sms-out {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.06);
}

.timeline-msg-tg {
  border-left-color: #60a5fa;
  background: rgba(96, 165, 250, 0.05);
}

.timeline-msg-user {
  border-left-color: #64748b;
  background: rgba(255, 255, 255, 0.02);
}

/* Quick Bottom Chat in Timeline View */
.drawer-bottom-bar {
  padding: 10px 18px;
  background: #1e293b;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-bottom-bar textarea {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  padding: 8px 12px;
  font-size: 12.5px;
  outline: none;
  resize: none;
}

.drawer-bottom-bar textarea:focus {
  border-color: #38bdf8;
}

/* ========================================================= */
/* LIVE ROI CALCULATOR (PRESENTATION COCKPIT)                */
/* ========================================================= */
.live-roi-calc-box {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roi-preset-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.roi-chip {
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #334155;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.roi-chip:hover,
.roi-chip.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
  color: #34d399;
}

.roi-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.roi-input-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.roi-input-group label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
}

.roi-input-group input {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #f1f5f9;
  padding: 4px 8px;
  font-size: 12px;
  font-family: monospace;
  font-weight: 600;
  outline: none;
}

.roi-input-group input:focus {
  border-color: #10b981;
}

.roi-live-results {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.roi-result-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.roi-m-label {
  font-size: 11px;
  color: #cbd5e1;
}

.roi-m-val {
  font-size: 12px;
  font-weight: 700;
  font-family: monospace;
}
.roi-m-val.emerald { color: #34d399; }
.roi-m-val.gold { color: #fbbf24; }
.roi-m-val.sky { color: #38bdf8; }

.roi-pilot-free-pill {
  margin-top: 4px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 5px;
  font-size: 10.5px;
  color: #34d399;
  line-height: 1.35;
}

/* Presentation Trigger Button */
.btn-presentation-open {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-presentation-open:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(59, 130, 246, 0.25));
  border-color: #a855f7;
  transform: translateY(-1px);
}

/* ========================================================= */
/* OMNICHANNEL BOTTOM COCKPIT                                */
/* ========================================================= */
.active-task-reminder-bar {
  padding: 6px 14px;
  background: rgba(244, 63, 94, 0.1);
  border-top: 1px solid rgba(244, 63, 94, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
}

.omni-cockpit-bar {
  background: #1e293b;
  border-top: 1px solid #334155;
  display: flex;
  flex-direction: column;
}

.omni-channel-tabs {
  display: flex;
  background: #0f172a;
  border-bottom: 1px solid #334155;
  padding: 4px 10px;
  gap: 4px;
  overflow-x: auto;
}

/* Chat Top Header & Action Tabs */
.chat-top-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-channel-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.chat-top-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow-x: auto;
}

.top-action-tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #334155;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.top-action-tab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.08);
}

.top-action-tab.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
}

/* Collapsible Top Tool Drawer */
.chat-top-tool-panel {
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
  padding: 10px 14px;
  animation: fadeIn 0.15s ease-out;
}

.btn-close-subpanel {
  background: none;
  border: none;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-close-subpanel:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* SMS Chips Row */
.sms-template-chips-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid #1e293b;
}

/* Minimalist Clean Bottom Input Row */
.chat-bottom-minimal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
}

.chat-minimal-input {
  flex: 1;
  background: #0b1120;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f8fafc;
  padding: 8px 12px;
  font-size: 12.5px;
  outline: none;
  height: 38px;
  transition: border-color 0.15s;
}

.chat-minimal-input:focus {
  border-color: #38bdf8;
}

.chat-minimal-send-btn {
  height: 38px;
  padding: 0 18px;
  font-weight: 600;
  font-size: 12px;
  border-radius: 8px;
  white-space: nowrap;
}

/* ========================================================= */
/* PRESENTATION MODAL (FULLSCREEN / SCREEN SHARE READY)      */
/* ========================================================= */
#presentationModal {
  z-index: 2000 !important;
}

.presentation-modal-card {
  width: 95vw !important;
  max-width: 1160px !important;
  height: 88vh !important;
  max-height: 740px !important;
  background: #0b1120 !important;
  border: 1px solid #334155 !important;
  border-radius: 14px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

.presentation-niche-bar {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  overflow-x: auto;
}

.pres-niche-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #334155;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.pres-niche-btn.active,
.pres-niche-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: #c084fc;
}

.presentation-split-body {
  display: grid;
  grid-template-columns: 440px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.presentation-calc-pane {
  background: #0f172a;
  border-right: 1px solid #1e293b;
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pres-pane-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.pres-live-tag {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.pres-metrics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 4px;
}

.pres-metric-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 8px 12px;
}

.pres-metric-card.emerald {
  border-left: 3px solid #10b981;
}

.pres-metric-card.gold {
  border-left: 3px solid #f59e0b;
}

.pres-metric-card.sky {
  border-left: 3px solid #38bdf8;
}

.pres-m-label {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 500;
}

.pres-metric-card.emerald .pres-m-val {
  color: #34d399;
  font-size: 18px;
  font-weight: 800;
}

.pres-metric-card.gold .pres-m-val {
  color: #fbbf24;
  font-size: 18px;
  font-weight: 800;
}

.pres-metric-card.sky .pres-m-val {
  color: #38bdf8;
  font-size: 16px;
  font-weight: 800;
}

.pres-m-sub {
  font-size: 9.5px;
  color: #64748b;
  margin-top: 2px;
}

.presentation-slides-pane {
  background: #0b1120;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.presentation-slide-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.presentation-footer {
  padding: 10px 20px;
  background: #0f172a;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}






/* ==========================================================================
   AI ORCHESTRATOR CHAT WIDGET & DRAWER
   ========================================================================== */
.orchestrator-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 12px rgba(56, 189, 248, 0.2);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.orchestrator-fab:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.35);
}

.orchestrator-fab-icon {
  font-size: 1.25rem;
  color: #38bdf8;
  animation: pulse-glow 2s infinite ease-in-out;
}

.orchestrator-fab-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.3px;
}

.orchestrator-fab-status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 6px #22c55e;
}

.orchestrator-drawer {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 440px;
  height: 600px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 110px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(56, 189, 248, 0.15);
  z-index: 9995;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawer-fade-up 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawer-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.orchestrator-drawer-header {
  padding: 14px 18px;
  background: rgba(30, 41, 59, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-drawer-ctrl {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.85rem;
}

.btn-drawer-ctrl:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #f8fafc;
}

.orchestrator-chips {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
  white-space: nowrap;
}

.orch-chip {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.orch-chip:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.5);
  color: #fff;
}

.orchestrator-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.orch-msg {
  display: flex;
  gap: 10px;
  max-width: 92%;
}

.orch-msg--assistant {
  align-self: flex-start;
}

.orch-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.orch-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0284c7;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  flex-shrink: 0;
}

.orch-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-word;
}

.orch-msg--assistant .orch-bubble {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.orch-msg--user .orch-bubble {
  background: #0369a1;
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.orch-bubble code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.78rem;
  color: #38bdf8;
}

.orchestrator-drawer-footer {
  padding: 12px 14px;
  background: #111827;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-orch-attach {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.15rem;
  cursor: pointer;
  color: #94a3b8;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-orch-attach:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.orch-input {
  flex: 1;
  background: #0b1120;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 14px;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.4;
  font-family: inherit;
  resize: none;
  min-height: 42px;
  max-height: 120px;
  outline: none;
  box-sizing: border-box;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.orch-input::-webkit-scrollbar {
  display: none;
}

.orch-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.btn-orch-send {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  flex-shrink: 0;
}

.btn-orch-send:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.5);
  transform: translateY(-1px);
}

.btn-orch-send:active {
  transform: translateY(0);
}

/* Bot Active / Paused Toggle Styles */
.bot-toggle-btn {
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.bot-toggle-btn.bot-active {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.bot-toggle-btn.bot-active:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #34d399;
}

.bot-toggle-btn.bot-paused {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.bot-toggle-btn.bot-paused:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #fbbf24;
}

.badge-bot-paused {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-weight: 600;
  margin-top: 3px;
}

.orchestrator-dropzone {
  position: absolute;
  top: 55px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #38bdf8;
  border-radius: 12px;
  margin: 12px;
  z-index: 1002;
  text-align: center;
  color: #f8fafc;
}
