/* ================================================================
   WHATSAPP CRM — PRO THEME
   ================================================================ */

:root {
  --oc-primary: #075e54;
  --oc-primary-light: #128c7e;
  --oc-accent: #25d366;
  --oc-bg: #f0f2f5;
  --oc-card-bg: #ffffff;
  --oc-text: #1a1a2e;
  --oc-text-muted: #6c757d;
  --oc-border: #e5e7eb;
  --oc-chat-bg: #e5ddd5;
  --oc-msg-out: #dcf8c6;
  --oc-msg-in: #ffffff;
  --oc-danger: #dc3545;
  --oc-warning: #f59e0b;
  --oc-info: #3b82f6;
  --oc-purple: #8b5cf6;
  --oc-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --oc-shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --oc-shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.05);
  --oc-radius: 12px;
  --oc-bg-subtle: #f8f9fa;
  --oc-bg-muted: #f3f4f6;
  --oc-bg-tertiary: #e5e7eb;
}

/* ================================================================
   DARK MODE — WhatsApp-inspired dark palette
   ================================================================ */
[data-bs-theme="dark"] {
  --oc-primary: #00a884;
  --oc-primary-light: #06cf9c;
  --oc-accent: #25d366;
  --oc-bg: #0b141a;
  --oc-card-bg: #111b21;
  --oc-text: #e9edef;
  --oc-text-muted: #8696a0;
  --oc-border: #233138;
  --oc-chat-bg: #0b141a;
  --oc-msg-out: #005c4b;
  --oc-msg-in: #202c33;
  --oc-danger: #ef4444;
  --oc-warning: #f59e0b;
  --oc-info: #60a5fa;
  --oc-purple: #a78bfa;
  --oc-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.25);
  --oc-shadow-md: 0 4px 6px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.3);
  --oc-shadow-lg: 0 10px 25px rgba(0,0,0,0.4), 0 4px 10px rgba(0,0,0,0.3);
  --oc-bg-subtle: #1a2a33;
  --oc-bg-muted: #233138;
  --oc-bg-tertiary: #2a3942;
  color-scheme: dark;
}

/* --- Global base --- */
body { background: var(--oc-bg); color: var(--oc-text); }

/* --- Smooth theme transition --- */
body, .card, .card-header, .card-body, .stat-card,
.convo-sidebar, .convo-chat-panel, .convo-chat-area, .convo-input-bar, .convo-chat-header,
.modal-content, .table, .task-card, .form-control, .form-select, .input-group-text,
.badge, .btn, .page-header, .nav-link, .dropdown-menu,
.summary-pill, .task-progress-wrap, .task-section-header .section-count,
.appt-date-text, .appt-tl-client, .convo-name, .timeline-item {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Dark mode: Navbar --- */
[data-bs-theme="dark"] .oc-navbar {
  background: linear-gradient(135deg, #0d1117 0%, #1a2a33 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* --- Dark mode: Theme toggle button --- */
.theme-toggle-btn {
  color: rgba(255,255,255,0.8) !important;
  font-size: 1.1rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}
.theme-toggle-btn:hover {
  color: #fff !important;
  background: rgba(255,255,255,0.12);
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(255,255,255,0.25), 0 0 4px rgba(255,255,255,0.15);
}
[data-bs-theme="dark"] .theme-toggle-btn:hover {
  box-shadow: 0 0 16px rgba(250,204,21,0.35), 0 0 6px rgba(250,204,21,0.2);
}
[data-bs-theme="light"] .theme-toggle-btn:hover,
:root:not([data-bs-theme="dark"]) .theme-toggle-btn:hover {
  box-shadow: 0 0 16px rgba(99,102,241,0.35), 0 0 6px rgba(99,102,241,0.2);
}

/* --- Dark mode: Cards & backgrounds --- */
[data-bs-theme="dark"] .card { background: var(--oc-card-bg); border-color: var(--oc-border); }
[data-bs-theme="dark"] .card-header { border-bottom-color: var(--oc-border); color: var(--oc-text); }
[data-bs-theme="dark"] .page-header h2 { color: var(--oc-text); }

/* --- Dark mode: Form controls --- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background: var(--oc-bg-subtle); color: var(--oc-text); border-color: var(--oc-border);
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background: var(--oc-bg-muted); border-color: var(--oc-primary); box-shadow: 0 0 0 3px rgba(0,168,132,0.25);
}
[data-bs-theme="dark"] .form-control::placeholder { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .input-group-text { background: var(--oc-bg-muted); color: var(--oc-text-muted); border-color: var(--oc-border); }

/* --- Dark mode: Tables --- */
[data-bs-theme="dark"] .table { color: var(--oc-text); --bs-table-bg: var(--oc-card-bg); --bs-table-border-color: var(--oc-border); }
[data-bs-theme="dark"] .table thead th { background: var(--oc-bg-subtle); color: var(--oc-text-muted); border-bottom-color: var(--oc-border); }
[data-bs-theme="dark"] .table tbody tr:hover { background: var(--oc-bg-subtle); }

/* --- Dark mode: Modals --- */
[data-bs-theme="dark"] .modal-content { background: var(--oc-card-bg); color: var(--oc-text); border-color: var(--oc-border); }
[data-bs-theme="dark"] .modal-header { border-bottom-color: var(--oc-border); }
[data-bs-theme="dark"] .modal-footer { border-top-color: var(--oc-border); }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* --- Dark mode: Dropdown --- */
[data-bs-theme="dark"] .dropdown-menu { background: var(--oc-card-bg); border-color: var(--oc-border); }
[data-bs-theme="dark"] .dropdown-item { color: var(--oc-text); }
[data-bs-theme="dark"] .dropdown-item:hover { background: var(--oc-bg-subtle); }

/* --- Dark mode: Status badges --- */
[data-bs-theme="dark"] .badge-new { background: rgba(96,165,250,0.2); color: #93bbfd; }
[data-bs-theme="dark"] .badge-contacted { background: rgba(245,158,11,0.2); color: #fbbf24; }
[data-bs-theme="dark"] .badge-qualified { background: rgba(37,211,102,0.2); color: #4ade80; }
[data-bs-theme="dark"] .badge-converted { background: rgba(167,139,250,0.2); color: #c4b5fd; }
[data-bs-theme="dark"] .badge-lost { background: rgba(239,68,68,0.2); color: #fca5a5; }
[data-bs-theme="dark"] .badge-pending { background: rgba(245,158,11,0.2); color: #fbbf24; }
[data-bs-theme="dark"] .badge-in_progress, [data-bs-theme="dark"] .badge-in-progress { background: rgba(96,165,250,0.2); color: #93bbfd; }
[data-bs-theme="dark"] .badge-completed { background: rgba(37,211,102,0.2); color: #4ade80; }
[data-bs-theme="dark"] .badge-medium { background: rgba(245,158,11,0.15); color: #fbbf24; }
[data-bs-theme="dark"] .badge-low { background: rgba(37,211,102,0.15); color: #4ade80; }

/* --- Dark mode: Stat cards --- */
[data-bs-theme="dark"] .stat-card .stat-icon.leads { background: rgba(96,165,250,0.12); }
[data-bs-theme="dark"] .stat-card .stat-icon.tasks { background: rgba(245,158,11,0.12); }
[data-bs-theme="dark"] .stat-card .stat-icon.convos { background: rgba(0,168,132,0.12); }
[data-bs-theme="dark"] .stat-card .stat-icon.appts { background: rgba(167,139,250,0.12); }

/* --- Dark mode: Conversation UI --- */
[data-bs-theme="dark"] .convo-sidebar { background: var(--oc-card-bg); border-right-color: var(--oc-border); }
[data-bs-theme="dark"] .convo-sidebar-header { background: #1a2a33; border-bottom-color: var(--oc-border); }
[data-bs-theme="dark"] .convo-search-box input { background: var(--oc-bg-subtle); color: var(--oc-text); border-color: var(--oc-border); }
[data-bs-theme="dark"] .convo-search-box input:focus { background: var(--oc-bg-muted); }
[data-bs-theme="dark"] .convo-filter-chip { background: var(--oc-bg-subtle); color: var(--oc-text-muted); }
[data-bs-theme="dark"] .convo-filter-chip:hover, [data-bs-theme="dark"] .convo-filter-chip.active { background: var(--oc-primary); }
[data-bs-theme="dark"] .convo-item { border-bottom-color: #1a2a33; }
[data-bs-theme="dark"] .convo-item:hover { background: #1a2a33; }
[data-bs-theme="dark"] .convo-item.active { background: var(--oc-bg-muted); }
[data-bs-theme="dark"] .convo-item.has-unread { background: rgba(0,168,132,0.08); }
[data-bs-theme="dark"] .convo-group-dot { border-color: var(--oc-card-bg); }
[data-bs-theme="dark"] .convo-chat-panel { background: var(--oc-bg); }
[data-bs-theme="dark"] .convo-chat-area { background: var(--oc-bg); }
[data-bs-theme="dark"] .convo-chat-header { background: #1a2a33; border-bottom-color: var(--oc-border); }
[data-bs-theme="dark"] .convo-header-btn:hover { background: var(--oc-bg-muted); }
[data-bs-theme="dark"] .bubble-out { background: var(--oc-msg-out); }
[data-bs-theme="dark"] .bubble-in { background: var(--oc-msg-in); }
[data-bs-theme="dark"] .msg-body-v2 { color: var(--oc-text); }
[data-bs-theme="dark"] .msg-time-v2 { color: rgba(233,237,239,0.6); }
[data-bs-theme="dark"] .msg-sender-v2 { color: var(--oc-info); }
[data-bs-theme="dark"] .convo-date-sep span { background: var(--oc-bg-muted); color: var(--oc-text-muted); }
[data-bs-theme="dark"] .convo-input-bar { background: #1a2a33; border-top-color: var(--oc-border); }
[data-bs-theme="dark"] .convo-input { background: var(--oc-bg-muted); color: var(--oc-text); }
[data-bs-theme="dark"] .convo-scroll-fab { background: var(--oc-bg-muted); color: var(--oc-text-muted); }
[data-bs-theme="dark"] .convo-scroll-fab:hover { background: var(--oc-bg-tertiary); }
[data-bs-theme="dark"] .convo-empty-icon { background: rgba(0,168,132,0.12); }

/* --- Dark mode: Task cards --- */
[data-bs-theme="dark"] .task-card { background: var(--oc-card-bg); border-color: var(--oc-border); }
[data-bs-theme="dark"] .task-card:hover { background: var(--oc-bg-subtle); }

/* --- Dark mode: Appointment timeline --- */
[data-bs-theme="dark"] .timeline-dot { border-color: var(--oc-card-bg); }
[data-bs-theme="dark"] .timeline-card { background: var(--oc-card-bg); }
[data-bs-theme="dark"] .timeline-card:hover { background: var(--oc-bg-subtle); }

/* --- Dark mode: Terminal (slightly lighter to differentiate) --- */
[data-bs-theme="dark"] .terminal-window { background: #131a22; border-color: var(--oc-bg-tertiary); }
[data-bs-theme="dark"] .terminal-header { background: #1a2a33; border-bottom-color: var(--oc-bg-tertiary); }

/* --- Dark mode: Toast notifications --- */
[data-bs-theme="dark"] .live-toast { background: rgba(17,27,33,0.95) !important; color: var(--oc-text); border-color: var(--oc-border); }

/* --- Dark mode: Scrollbar --- */
[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: var(--oc-bg); }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--oc-bg-muted); }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: var(--oc-bg-tertiary); }

/* --- Dark mode: Links & misc --- */
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.navbar-brand):not(.brand) { color: var(--oc-info); }
[data-bs-theme="dark"] .text-muted { color: var(--oc-text-muted) !important; }
[data-bs-theme="dark"] .field-label { color: var(--oc-text); }
[data-bs-theme="dark"] code { background: var(--oc-bg-subtle); color: #06cf9c; }
[data-bs-theme="dark"] hr { border-color: var(--oc-border); }
[data-bs-theme="dark"] .list-group-item { background: var(--oc-card-bg); color: var(--oc-text); border-color: var(--oc-border); }

/* --- Dark mode: Category badges --- */
[data-bs-theme="dark"] .badge-cat-lead { background: rgba(96,165,250,0.15) !important; color: #93bbfd !important; }
[data-bs-theme="dark"] .badge-cat-appointment { background: rgba(0,168,132,0.15) !important; color: #4ade80 !important; }
[data-bs-theme="dark"] .badge-cat-task { background: rgba(245,158,11,0.15) !important; color: #fbbf24 !important; }
[data-bs-theme="dark"] .badge-cat-general { background: rgba(134,150,160,0.15) !important; color: #8696a0 !important; }

/* --- Dark mode: Buttons --- */
[data-bs-theme="dark"] .btn-outline-secondary { color: var(--oc-text-muted); border-color: var(--oc-border); }
[data-bs-theme="dark"] .btn-outline-secondary:hover { background: var(--oc-bg-subtle); color: var(--oc-text); }
[data-bs-theme="dark"] .btn-light { background: var(--oc-bg-subtle); color: var(--oc-text); border-color: var(--oc-border); }
[data-bs-theme="dark"] .btn-light:hover { background: var(--oc-bg-muted); }

/* --- Dark mode: Summary pills --- */
[data-bs-theme="dark"] .summary-pill { background: var(--oc-bg-subtle); color: var(--oc-text-muted); }
[data-bs-theme="dark"] .summary-pill:hover { background: var(--oc-bg-muted); }
[data-bs-theme="dark"] .summary-pill.active { background: var(--oc-primary); color: #fff; }

/* --- Dark mode: Task elements --- */
[data-bs-theme="dark"] .task-progress-wrap { background: var(--oc-bg-subtle); }
[data-bs-theme="dark"] .task-progress-bar { background: var(--oc-bg-muted); }
[data-bs-theme="dark"] .task-section-header { border-bottom-color: var(--oc-border); }
[data-bs-theme="dark"] .task-section-header .section-count { background: var(--oc-bg-muted); color: var(--oc-text-muted); }
[data-bs-theme="dark"] .task-overdue { background: rgba(239,68,68,0.08) !important; }
[data-bs-theme="dark"] .task-card.task-completed { background: rgba(0,168,132,0.04); border-left-color: rgba(0,168,132,0.3) !important; }
[data-bs-theme="dark"] .task-card.task-completed .task-desc { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .task-toggle .toggle-slider { background: var(--oc-bg-tertiary); }

/* --- Dark mode: Appointment timeline --- */
[data-bs-theme="dark"] .appt-section-today { background: linear-gradient(135deg, rgba(167,139,250,0.06), rgba(0,168,132,0.06)); }
[data-bs-theme="dark"] .appt-section-tomorrow { background: rgba(167,139,250,0.04); }
[data-bs-theme="dark"] .appt-date-header { border-bottom-color: var(--oc-border); }
[data-bs-theme="dark"] .appt-date-text { color: var(--oc-text); }
[data-bs-theme="dark"] .appt-date-count { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .appt-date-tmrw { background: rgba(167,139,250,0.2); color: #c4b5fd; }
[data-bs-theme="dark"] .appt-tl-client { color: var(--oc-text); }
[data-bs-theme="dark"] .appt-tl-type { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .appt-tl-desc { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .appt-tl-end { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .appt-tl-line { background: var(--oc-border); }
[data-bs-theme="dark"] .appt-timeline-item:hover { background: rgba(167,139,250,0.06); }
[data-bs-theme="dark"] .appt-pending { background: rgba(245,158,11,0.06); border-left-color: #f59e0b; }
[data-bs-theme="dark"] .appt-st-scheduled { background: rgba(96,165,250,0.2); color: #93bbfd; }
[data-bs-theme="dark"] .appt-st-confirmed { background: rgba(37,211,102,0.2); color: #4ade80; }
[data-bs-theme="dark"] .appt-st-completed { background: rgba(134,150,160,0.15); color: #8696a0; }
[data-bs-theme="dark"] .appt-st-cancelled { background: rgba(239,68,68,0.15); color: #fca5a5; }
[data-bs-theme="dark"] .appt-st-pending { background: rgba(245,158,11,0.2); color: #fbbf24; }
[data-bs-theme="dark"] .appt-st-conflict { background: rgba(245,158,11,0.2); color: #fbbf24; }
[data-bs-theme="dark"] .bg-purple-subtle { background: rgba(167,139,250,0.15); }
[data-bs-theme="dark"] .text-purple { color: #c4b5fd; }
[data-bs-theme="dark"] .bg-primary-subtle { background: rgba(96,165,250,0.15); }

/* --- Dark mode: Activity timeline --- */
[data-bs-theme="dark"] .timeline-item { border-bottom-color: var(--oc-border); }
[data-bs-theme="dark"] .timeline-item:hover { background: var(--oc-bg-subtle); }

/* --- Dark mode: Conversation sidebar deep fixes --- */
[data-bs-theme="dark"] .convo-search-wrap { background: var(--oc-card-bg); border-bottom-color: var(--oc-border); }
[data-bs-theme="dark"] .convo-search-box input { background: var(--oc-bg-subtle); color: var(--oc-text); }
[data-bs-theme="dark"] .convo-search-box input:focus { background: var(--oc-bg-muted); box-shadow: 0 0 0 2px var(--oc-primary); }
[data-bs-theme="dark"] .convo-search-box i { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .convo-item { border-bottom-color: var(--oc-border); }
[data-bs-theme="dark"] .convo-item:hover { background: #1a2a33; }
[data-bs-theme="dark"] .convo-item.active { background: var(--oc-bg-muted); }
[data-bs-theme="dark"] .convo-item.has-unread { background: rgba(0,168,132,0.06); }
[data-bs-theme="dark"] .convo-time { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .convo-preview { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .convo-header-sub { color: var(--oc-text-muted); }

/* --- Dark mode: Chat panel deep fixes --- */
[data-bs-theme="dark"] .convo-chat-panel { background: var(--oc-bg); }
[data-bs-theme="dark"] .convo-chat-area {
  background: #0b141a;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23233138' fill-opacity='0.3'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
[data-bs-theme="dark"] .convo-chat-header { background: #1a2a33; }
[data-bs-theme="dark"] .convo-header-btn:hover { background: var(--oc-bg-muted); color: var(--oc-text); }
[data-bs-theme="dark"] .convo-input-bar { background: #1a2a33; border-top-color: var(--oc-border); }
[data-bs-theme="dark"] .convo-input { background: var(--oc-bg-muted); color: var(--oc-text); }
[data-bs-theme="dark"] .convo-input:focus { box-shadow: 0 0 0 2px var(--oc-primary); }
[data-bs-theme="dark"] .convo-date-sep span { background: var(--oc-bg-muted); color: var(--oc-text-muted); }
[data-bs-theme="dark"] .msg-body-v2 { color: var(--oc-text); }
[data-bs-theme="dark"] .msg-time-v2 { color: rgba(233,237,239,0.5); }
[data-bs-theme="dark"] .convo-scroll-fab { background: var(--oc-bg-muted); color: var(--oc-text-muted); box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
[data-bs-theme="dark"] .convo-scroll-fab:hover { background: var(--oc-bg-tertiary); }
[data-bs-theme="dark"] .convo-list::-webkit-scrollbar-thumb { background: var(--oc-bg-tertiary); }
[data-bs-theme="dark"] .convo-chat-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

/* --- Dark mode: Message category tags in chat --- */
[data-bs-theme="dark"] .msg-cat-lead { background: rgba(96,165,250,0.2); color: #93bbfd; }
[data-bs-theme="dark"] .msg-cat-task { background: rgba(245,158,11,0.2); color: #fbbf24; }
[data-bs-theme="dark"] .msg-cat-appointment { background: rgba(167,139,250,0.2); color: #c4b5fd; }

/* --- Dark mode: Search bar --- */
[data-bs-theme="dark"] .search-bar input { background: var(--oc-bg-subtle); color: var(--oc-text); border-color: var(--oc-border); }
[data-bs-theme="dark"] .search-bar input:focus { border-color: var(--oc-primary); box-shadow: 0 0 0 3px rgba(0,168,132,0.2); }

/* --- Dark mode: Empty states --- */
[data-bs-theme="dark"] .empty-state i { color: var(--oc-bg-tertiary); }

/* --- Dark mode: Appt card (legacy modal) --- */
[data-bs-theme="dark"] .appt-card { background: var(--oc-card-bg); border-color: var(--oc-border); }
[data-bs-theme="dark"] .appt-card:hover { background: var(--oc-bg-subtle); }

/* --- Dark mode: Lead status dot borders --- */
[data-bs-theme="dark"] .convo-group-dot { border-color: var(--oc-card-bg); }

/* --- Dark mode: Call log --- */
[data-bs-theme="dark"] .call-log-table tr:hover { background: var(--oc-bg-subtle); }

/* --- Dark mode: Tutorial page --- */
[data-bs-theme="dark"] .tutorial-tip { background: rgba(96,165,250,0.08); border-left-color: var(--oc-info); }
[data-bs-theme="dark"] .tutorial-check-row { background: var(--oc-bg-subtle); }
[data-bs-theme="dark"] .tutorial-step:hover { background: rgba(255,255,255,0.02); }
[data-bs-theme="dark"] .tutorial-section .accordion-button { background: var(--oc-card-bg); color: var(--oc-text); }
[data-bs-theme="dark"] .tutorial-section .accordion-button:not(.collapsed) { background: rgba(0,168,132,0.06); color: var(--oc-text); }
[data-bs-theme="dark"] .tutorial-section .accordion-button::after { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme="dark"] .accordion-item { background: var(--oc-card-bg); border-color: var(--oc-border); }
[data-bs-theme="dark"] .accordion-body { background: var(--oc-card-bg); }

/* --- Dark mode: Toast fix --- */
[data-bs-theme="dark"] #toast-container .toast { background: rgba(17,27,33,0.97) !important; border-color: var(--oc-border) !important; backdrop-filter: blur(12px); }
[data-bs-theme="dark"] #toast-container .toast-header { color: var(--oc-text); }
[data-bs-theme="dark"] #toast-container .toast-body { color: var(--oc-text-muted); }

/* --- Dark mode: Live banner --- */
[data-bs-theme="dark"] .live-banner { background: var(--oc-card-bg); border-color: var(--oc-border); box-shadow: 0 8px 32px rgba(0,0,0,0.5); }

/* --- Dark mode: Pagination --- */
[data-bs-theme="dark"] .page-link { background: var(--oc-card-bg); color: var(--oc-text); border-color: var(--oc-border); }
[data-bs-theme="dark"] .page-link:hover { background: var(--oc-bg-subtle); }
[data-bs-theme="dark"] .page-item.active .page-link { background: var(--oc-primary); border-color: var(--oc-primary); }

/* --- Dark mode: Availability Calendar --- */
[data-bs-theme="dark"] .cal-cell { background: var(--oc-bg-subtle); }
[data-bs-theme="dark"] .cal-cell:hover { background: var(--oc-bg-muted); }
[data-bs-theme="dark"] .cal-empty { background: transparent !important; }
[data-bs-theme="dark"] .cal-day-num { color: var(--oc-text); }
[data-bs-theme="dark"] .cal-day-name { color: var(--oc-text-muted); }
[data-bs-theme="dark"] .cal-today { border-color: var(--oc-purple); }
[data-bs-theme="dark"] .cal-blocked-full { background: rgba(239,68,68,0.15) !important; }
[data-bs-theme="dark"] .cal-blocked-full:hover { background: rgba(239,68,68,0.25) !important; }
[data-bs-theme="dark"] .cal-blocked-partial { background: rgba(245,158,11,0.06) !important; border-left: 3px solid rgba(245,158,11,0.4); }
[data-bs-theme="dark"] .cal-blocked-partial:hover { background: rgba(245,158,11,0.1) !important; }

/* --- Dark mode: No Auto-Reply pill (Clients page) --- */
[data-bs-theme="dark"] .summary-pill[data-filter="personal"] {
  border-color: rgba(239,68,68,0.4) !important;
  color: #fca5a5;
}
[data-bs-theme="dark"] .summary-pill[data-filter="personal"].active {
  background: rgba(239,68,68,0.12) !important;
  border-color: rgba(239,68,68,0.5) !important;
  color: #fca5a5;
}

/* --- Dark mode: Misc Bootstrap overrides --- */
[data-bs-theme="dark"] .text-dark { color: var(--oc-text) !important; }
[data-bs-theme="dark"] .bg-light { background: var(--oc-bg-subtle) !important; }
[data-bs-theme="dark"] .border { border-color: var(--oc-border) !important; }
[data-bs-theme="dark"] .border-bottom { border-bottom-color: var(--oc-border) !important; }
[data-bs-theme="dark"] .alert-info { background: rgba(96,165,250,0.1); color: var(--oc-info); border-color: rgba(96,165,250,0.2); }
[data-bs-theme="dark"] .alert-warning { background: rgba(245,158,11,0.1); color: #fbbf24; border-color: rgba(245,158,11,0.2); }
[data-bs-theme="dark"] .alert-success { background: rgba(37,211,102,0.1); color: #4ade80; border-color: rgba(37,211,102,0.2); }
[data-bs-theme="dark"] .alert-danger { background: rgba(239,68,68,0.1); color: #fca5a5; border-color: rgba(239,68,68,0.2); }

/* --- NAVBAR --- */
.oc-navbar {
  background: linear-gradient(135deg, var(--oc-primary) 0%, var(--oc-primary-light) 100%);
  padding: 0.5rem 1.5rem;
  box-shadow: 0 2px 12px rgba(7,94,84,0.25);
  position: sticky; top: 0; z-index: 1030;
}
.oc-navbar .navbar-brand { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.5px; }
.oc-navbar .nav-link { color: rgba(255,255,255,0.75) !important; font-weight: 500; font-size: 0.85rem; padding: 0.45rem 0.85rem !important; border-radius: 8px; transition: all 0.25s; margin: 0 1px; }
.oc-navbar .nav-link:hover { color: #fff !important; background: rgba(255,255,255,0.12); transform: translateY(-1px); }
.oc-navbar .nav-link.active { color: #fff !important; background: rgba(255,255,255,0.2); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }

/* --- CARDS --- */
.card { border: none; border-radius: var(--oc-radius); box-shadow: var(--oc-shadow); transition: box-shadow 0.3s, transform 0.3s; background: var(--oc-card-bg); }
.card:hover { box-shadow: var(--oc-shadow-md); }
.card-header { background: transparent; border-bottom: 1px solid var(--oc-border); font-weight: 700; font-size: 0.9rem; color: var(--oc-text); padding: 1rem 1.25rem; }

/* --- STAT CARDS --- */
.stat-card { border-left: 4px solid var(--oc-primary); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; cursor: default; transition: all 0.3s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--oc-shadow-lg); }
.stat-card .stat-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; transition: transform 0.3s; }
.stat-card:hover .stat-icon { transform: scale(1.1); }
.stat-card .stat-icon.leads { background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05)); color: var(--oc-info); }
.stat-card .stat-icon.tasks { background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(245,158,11,0.05)); color: var(--oc-warning); }
.stat-card .stat-icon.convos { background: linear-gradient(135deg, rgba(7,94,84,0.15), rgba(7,94,84,0.05)); color: var(--oc-primary); }
.stat-card .stat-icon.appts { background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05)); color: var(--oc-purple); }
.stat-card .stat-info .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--oc-text); }
.stat-card .stat-info .stat-label { font-size: 0.78rem; color: var(--oc-text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; font-weight: 600; }

.stat-card.border-blue { border-left-color: var(--oc-info); }
.stat-card.border-orange { border-left-color: var(--oc-warning); }
.stat-card.border-teal { border-left-color: var(--oc-primary); }
.stat-card.border-purple { border-left-color: var(--oc-purple); }

/* --- STATUS BADGES --- */
.badge-status { font-size: 0.72rem; font-weight: 600; padding: 0.3em 0.65em; border-radius: 20px; text-transform: capitalize; }
.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-contacted { background: #fef3c7; color: #b45309; }
.badge-qualified { background: #d1fae5; color: #065f46; }
.badge-converted { background: #ede9fe; color: #6d28d9; }
.badge-lost { background: #fee2e2; color: #991b1b; }

/* --- PRIORITY BADGES --- */
.badge-urgent { background: #dc3545; color: #fff; }
.badge-high { background: #f59e0b; color: #fff; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-low { background: #d1fae5; color: #065f46; }

/* --- TASK STATUS --- */
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-in_progress, .badge-in-progress { background: #dbeafe; color: #1d4ed8; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* --- CATEGORY BADGES --- */
.badge-cat-lead { background: #dbeafe; color: #1d4ed8; }
.badge-cat-task { background: #fef3c7; color: #92400e; }
.badge-cat-appointment { background: #ede9fe; color: #6d28d9; }
.badge-cat-general { background: var(--oc-bg-muted); color: var(--oc-text-muted); }

/* --- APPOINTMENT STATUS --- */
.badge-scheduled { background: #dbeafe; color: #1d4ed8; }
.badge-confirmed { background: #d1fae5; color: #065f46; }

/* --- TABLES --- */
.table { font-size: 0.88rem; }
.table thead th { font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--oc-text-muted); border-bottom: 2px solid var(--oc-border); padding: 0.85rem 1rem; }
.table tbody tr { cursor: pointer; transition: all 0.2s; }
.table tbody tr:hover { background: rgba(7,94,84,0.04); transform: scale(1.002); }
.table tbody td { padding: 0.85rem 1rem; vertical-align: middle; }

/* --- SUMMARY BAR --- */
.summary-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.summary-pill { padding: 0.4rem 0.9rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; background: var(--oc-bg-muted); color: var(--oc-text-muted); cursor: pointer; transition: all 0.25s; border: 1px solid transparent; }
.summary-pill:hover { background: var(--oc-bg-tertiary); transform: translateY(-1px); }
.summary-pill.active { background: var(--oc-primary); color: #fff; box-shadow: 0 2px 8px rgba(7,94,84,0.25); }
.summary-pill .pill-count { font-weight: 800; margin-left: 4px; }

/* --- TASK CARDS --- */
.task-card { border-left: 4px solid var(--oc-border); padding: 1rem 1.25rem; margin-bottom: 0.75rem; cursor: pointer; transition: all 0.25s ease; position: relative; overflow: hidden; }
.task-card:hover { transform: translateX(4px); box-shadow: var(--oc-shadow-md); }
.task-card.priority-urgent { border-left-color: var(--oc-danger); }
.task-card.priority-high { border-left-color: var(--oc-warning); }
.task-card.priority-medium { border-left-color: #fbbf24; }
.task-card.priority-low { border-left-color: #34d399; }
.task-card .task-title { font-weight: 700; font-size: 0.95rem; transition: all 0.3s; }
.task-card .task-desc { font-size: 0.82rem; color: var(--oc-text-muted); margin-top: 4px; transition: all 0.3s; }
.task-card .task-meta { font-size: 0.75rem; color: var(--oc-text-muted); margin-top: 8px; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.task-overdue { background: rgba(220,53,69,0.04) !important; }
.task-overdue .task-meta .due-date { color: var(--oc-danger); font-weight: 700; }
.task-overdue::after { content: 'OVERDUE'; position: absolute; top: 8px; right: -28px; background: var(--oc-danger); color: #fff; font-size: 0.55rem; font-weight: 800; padding: 2px 30px; transform: rotate(45deg); letter-spacing: 1px; }

/* Completed task strikethrough */
.task-card.task-completed { opacity: 0.65; border-left-color: #a3e6c8 !important; background: rgba(0,168,132,0.03); }
.task-card.task-completed .task-title { text-decoration: line-through; text-decoration-color: #065f46; text-decoration-thickness: 2px; color: var(--oc-text-muted); }
.task-card.task-completed .task-desc { text-decoration: line-through; text-decoration-color: #9ca3af; color: #bbb; }
.task-card.task-completed:hover { opacity: 0.85; }
.task-card.task-completed .task-check-done { color: #065f46; font-size: 1.1rem; }

/* Task progress bar */
.task-progress-wrap { background: var(--oc-bg-muted); border-radius: var(--oc-radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 1.5rem; }
.task-progress-bar { flex: 1; height: 8px; background: var(--oc-bg-tertiary); border-radius: 99px; overflow: hidden; }
.task-progress-bar .bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--oc-primary), var(--oc-accent)); transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.task-progress-text { font-size: 0.82rem; font-weight: 700; color: var(--oc-text); white-space: nowrap; }
.task-progress-label { font-size: 0.72rem; color: var(--oc-text-muted); white-space: nowrap; }

/* Task section headers */
.task-section-header { display: flex; align-items: center; gap: 0.5rem; margin: 1.25rem 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--oc-border); }
.task-section-header h6 { margin: 0; font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--oc-text-muted); }
.task-section-header .section-count { background: var(--oc-bg-muted); color: var(--oc-text-muted); font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

/* Task toggle switch */
.task-toggle { position: relative; width: 38px; height: 22px; flex-shrink: 0; cursor: pointer; }
.task-toggle input { opacity: 0; width: 0; height: 0; }
.task-toggle .toggle-slider { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: var(--oc-bg-tertiary); border-radius: 22px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.task-toggle .toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.task-toggle input:checked + .toggle-slider { background: var(--oc-accent); }
.task-toggle input:checked + .toggle-slider::before { transform: translateX(16px); }
.task-toggle:hover .toggle-slider { box-shadow: 0 0 0 3px rgba(37,211,102,0.15); }

/* Task card stagger animation */
.task-card { animation: taskSlideIn 0.3s ease forwards; opacity: 0; }
@keyframes taskSlideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
.task-card.task-completed { animation-name: taskFadeIn; }
@keyframes taskFadeIn { from { opacity: 0; } to { opacity: 0.65; } }

/* ================================================================
   CONVERSATION PAGE — PRO LEVEL
   ================================================================ */

/* Shell */
.convo-shell { background: var(--oc-card-bg); border-radius: var(--oc-radius); box-shadow: var(--oc-shadow-lg); overflow: hidden; margin: 0; }

/* --- SIDEBAR --- */
.convo-sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--oc-border); background: var(--oc-card-bg); height: 100%; }
.convo-sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--oc-bg-subtle); border-bottom: 1px solid var(--oc-border); }
.convo-stat-pill { background: var(--oc-primary); color: #fff; font-size: 0.68rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; }

/* Search + Filters */
.convo-search-wrap { padding: 10px 12px 6px; background: var(--oc-card-bg); border-bottom: 1px solid var(--oc-bg-muted); }
.convo-search-box { position: relative; margin-bottom: 8px; }
.convo-search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--oc-text-muted); font-size: 0.82rem; }
.convo-search-box input { width: 100%; border: none; background: var(--oc-bg); border-radius: 8px; padding: 8px 12px 8px 36px; font-size: 0.82rem; outline: none; transition: all 0.25s; color: var(--oc-text); }
.convo-search-box input:focus { background: var(--oc-card-bg); box-shadow: 0 0 0 2px var(--oc-primary); }
.convo-filters { display: flex; gap: 6px; padding-bottom: 4px; }
.convo-filter-chip { border: none; background: var(--oc-bg); color: var(--oc-text-muted); font-size: 0.72rem; font-weight: 600; padding: 4px 12px; border-radius: 99px; cursor: pointer; transition: all 0.2s; }
.convo-filter-chip:hover { background: var(--oc-bg-tertiary); }
.convo-filter-chip.active { background: var(--oc-primary); color: #fff; }

/* Conversation List */
.convo-list { flex: 1; overflow-y: auto; }
.convo-list::-webkit-scrollbar { width: 3px; }
.convo-list::-webkit-scrollbar-thumb { background: var(--oc-bg-tertiary); border-radius: 99px; }
.convo-empty-list { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem; color: var(--oc-text-muted); }
.convo-empty-list i { font-size: 2.5rem; opacity: 0.3; margin-bottom: 0.5rem; }
.convo-empty-list p { font-size: 0.82rem; margin: 0; }

/* Conversation Item */
.convo-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; transition: all 0.15s ease; border-bottom: 1px solid var(--oc-bg-subtle); animation: fadeInUp 0.25s ease forwards; opacity: 0; }
.convo-item:hover { background: var(--oc-bg-subtle); }
.convo-item.active { background: rgba(7,94,84,0.08); }
.convo-item.has-unread { background: rgba(37,211,102,0.04); }
.convo-avatar-wrap { position: relative; flex-shrink: 0; }
.convo-avatar { width: 44px; height: 44px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; letter-spacing: 0.5px; }
.convo-group-dot { position: absolute; bottom: 0; right: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--oc-info); border: 2px solid var(--oc-card-bg); display: flex; align-items: center; justify-content: center; }
.convo-info { flex: 1; min-width: 0; }
.convo-info-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.convo-name { font-weight: 600; font-size: 0.88rem; color: var(--oc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.convo-name.fw-800 { font-weight: 800; }
.convo-time { font-size: 0.68rem; color: var(--oc-text-muted); white-space: nowrap; flex-shrink: 0; }
.convo-time-unread { color: var(--oc-accent) !important; font-weight: 700; }
.convo-info-bottom { display: flex; align-items: center; gap: 6px; }
.convo-preview { flex: 1; font-size: 0.78rem; color: var(--oc-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.convo-preview-unread { color: var(--oc-text) !important; font-weight: 600; }
.convo-unread-badge { background: var(--oc-accent); color: #fff; font-size: 0.62rem; font-weight: 800; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* --- CHAT PANEL --- */
.convo-chat-panel { background: var(--oc-chat-bg); position: relative; display: flex; flex-direction: column; height: 100%; }
.convo-chat-header { background: var(--oc-bg-subtle); padding: 10px 16px; border-bottom: 1px solid var(--oc-border); min-height: 58px; display: flex; align-items: center; }
.convo-chat-header-empty { color: var(--oc-text-muted); font-size: 0.88rem; }
.convo-chat-header-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.convo-header-text { min-width: 0; }
.convo-header-name { font-weight: 700; font-size: 0.95rem; color: var(--oc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-header-sub { font-size: 0.72rem; color: var(--oc-text-muted); }
.convo-header-actions { display: flex; gap: 4px; }
.convo-header-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: var(--oc-text-muted); font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.convo-header-btn:hover { background: var(--oc-bg-tertiary); color: var(--oc-text); }

/* Chat Area */
.convo-chat-area { flex: 1; overflow-y: auto; padding: 16px 60px; background: var(--oc-chat-bg); background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4cfc4' fill-opacity='0.12'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); position: relative; }
.convo-chat-area::-webkit-scrollbar { width: 5px; }
.convo-chat-area::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 99px; }

/* Empty Chat */
.convo-empty-chat { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; color: var(--oc-text-muted); }
.convo-empty-icon { width: 80px; height: 80px; border-radius: 50%; background: rgba(7,94,84,0.08); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.convo-empty-icon i { font-size: 2.2rem; color: var(--oc-primary); opacity: 0.5; }
.convo-empty-chat h5 { font-weight: 300; font-size: 1.5rem; color: var(--oc-text-muted); margin-bottom: 6px; }
.convo-empty-chat p { font-size: 0.85rem; color: var(--oc-text-muted); max-width: 340px; }
.convo-loading { display: flex; align-items: center; justify-content: center; height: 100%; }

/* Date Separator */
.convo-date-sep { text-align: center; padding: 12px 0; }
.convo-date-sep span { background: var(--oc-bg-muted); color: var(--oc-text-muted); font-size: 0.72rem; font-weight: 600; padding: 5px 14px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,0.08); }

/* Message Rows */
.msg-row { display: flex; padding: 1px 0; animation: fadeInUp 0.2s ease forwards; opacity: 0; }
.msg-row.msg-out { justify-content: flex-end; }
.msg-row.msg-in { justify-content: flex-start; }

/* Message Bubble V2 */
.msg-bubble-v2 { max-width: 65%; padding: 6px 10px 4px; border-radius: 8px; font-size: 0.88rem; line-height: 1.4; position: relative; word-wrap: break-word; overflow-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,0.06); }
.bubble-out { background: var(--oc-msg-out); border-top-right-radius: 0; }
.bubble-in { background: var(--oc-msg-in); border-top-left-radius: 0; }
.msg-sender-v2 { font-weight: 700; font-size: 0.76rem; color: var(--oc-info); margin-bottom: 1px; }
.msg-body-v2 { color: var(--oc-text); white-space: pre-wrap; }
.msg-footer-v2 { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 2px; }
.msg-time-v2 { font-size: 0.62rem; color: var(--oc-text-muted); }
.msg-read-icon { font-size: 0.72rem; color: #53bdeb; }
.msg-cat-tag { font-size: 0.55rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; text-transform: uppercase; letter-spacing: 0.5px; }
.msg-cat-lead { background: #dbeafe; color: #1d4ed8; }
.msg-cat-task { background: #fef3c7; color: #92400e; }
.msg-cat-appointment { background: #ede9fe; color: #6d28d9; }
.msg-bot-tag { font-size: 0.55rem; font-weight: 800; background: var(--oc-primary-light); color: #fff; padding: 1px 5px; border-radius: 3px; margin-left: 4px; }

/* Scroll FAB */
.convo-scroll-fab { position: absolute; bottom: 80px; right: 20px; width: 38px; height: 38px; border-radius: 50%; background: var(--oc-card-bg); border: none; box-shadow: var(--oc-shadow-md); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--oc-text-muted); font-size: 1rem; z-index: 10; transition: all 0.2s; }
.convo-scroll-fab:hover { background: var(--oc-bg-subtle); transform: scale(1.1); }

/* Input Bar */
.convo-input-bar { background: var(--oc-bg-subtle); padding: 10px 16px; border-top: 1px solid var(--oc-border); }
.convo-input-wrap { display: flex; align-items: center; gap: 10px; }
.convo-input { flex: 1; border: none; background: var(--oc-card-bg); color: var(--oc-text); border-radius: 8px; padding: 10px 16px; font-size: 0.88rem; outline: none; transition: all 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.convo-input:focus { box-shadow: 0 0 0 2px var(--oc-primary); }
.convo-send-btn { width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--oc-primary); color: #fff; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.convo-send-btn:hover { background: var(--oc-primary-light); transform: scale(1.08); box-shadow: 0 4px 12px rgba(7,94,84,0.3); }

/* Responsive */
@media (max-width: 768px) {
  .convo-chat-area { padding: 12px 12px; }
  .msg-bubble-v2 { max-width: 85%; }
  .convo-sidebar { max-height: 50vh; }
}

/* --- ACTIVITY TIMELINE --- */
.timeline-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--oc-bg-muted); font-size: 0.85rem; transition: background 0.2s; }
.timeline-item:hover { background: var(--oc-bg-subtle); }
.timeline-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }
.timeline-dot.lead { background: var(--oc-info); }
.timeline-dot.task { background: var(--oc-warning); }
.timeline-dot.appointment { background: var(--oc-purple); }
.timeline-dot.general { background: #d1d5db; }
.timeline-content { flex: 1; }
.timeline-contact { font-weight: 700; }
.timeline-msg { color: var(--oc-text-muted); }
.timeline-time { font-size: 0.7rem; color: var(--oc-text-muted); flex-shrink: 0; }

/* --- APPOINTMENT TIMELINE --- */
.appt-section { margin-bottom: 1.5rem; }
.appt-section-today { background: linear-gradient(135deg, rgba(139,92,246,0.04), rgba(16,185,129,0.04)); border-radius: 12px; padding: 1rem; margin: 0 -1rem 1.5rem; }
.appt-section-tomorrow { background: rgba(139,92,246,0.02); border-radius: 12px; padding: 1rem; margin: 0 -1rem 1.5rem; }

.appt-date-header { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--oc-border); }
.appt-date-badge { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.08em; padding: 3px 10px; border-radius: 20px; }
.appt-date-today { background: var(--oc-primary); color: #fff; }
.appt-date-tmrw { background: #ede9fe; color: #6d28d9; }
.appt-date-text { font-weight: 700; font-size: 0.95rem; color: var(--oc-text); }
.appt-date-count { font-size: 0.75rem; color: var(--oc-text-muted); margin-left: auto; }

/* Timeline layout */
.appt-timeline { position: relative; }
.appt-timeline-item { display: flex; gap: 0; cursor: pointer; padding: 0.5rem 0; transition: background 0.2s; border-radius: 8px; margin: 0 -0.5rem; padding-left: 0.5rem; padding-right: 0.5rem; }
.appt-timeline-item:hover { background: rgba(139,92,246,0.05); }

/* Time column */
.appt-tl-time { width: 70px; min-width: 70px; text-align: right; padding-right: 12px; padding-top: 2px; }
.appt-tl-start { display: block; font-weight: 800; font-size: 0.85rem; color: var(--oc-primary); line-height: 1.2; }
.appt-tl-end { display: block; font-size: 0.7rem; color: var(--oc-text-muted); }

/* Dot + line column */
.appt-tl-dot-col { display: flex; flex-direction: column; align-items: center; width: 24px; min-width: 24px; padding-top: 6px; }
.appt-tl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.appt-tl-line { width: 2px; flex: 1; background: var(--oc-border); margin-top: 4px; min-height: 20px; }
.appt-timeline-item:last-child .appt-tl-line { background: transparent; }

/* Status dot colors */
.appt-dot-scheduled { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.2); }
.appt-dot-confirmed { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }
.appt-dot-completed { background: #9ca3af; }
.appt-dot-cancelled { background: #ef4444; opacity: 0.5; }
.appt-dot-pending { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.25); animation: pulse-warn 2s infinite; }
.appt-dot-conflict { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.25); animation: pulse-warn 2s infinite; }
@keyframes pulse-warn { 0%, 100% { box-shadow: 0 0 0 3px rgba(245,158,11,0.2); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,0.1); } }

/* Content column */
.appt-tl-content { flex: 1; padding: 0 8px 12px; min-width: 0; }
.appt-tl-header { display: flex; align-items: center; gap: 8px; }
.appt-tl-client { font-weight: 700; font-size: 0.92rem; color: var(--oc-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-tl-status { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; }
.appt-st-scheduled { background: #dbeafe; color: #1d4ed8; }
.appt-st-confirmed { background: #d1fae5; color: #065f46; }
.appt-st-completed { background: #f3f4f6; color: #6b7280; }
.appt-st-cancelled { background: #fee2e2; color: #991b1b; }
.appt-st-pending { background: #fef3c7; color: #92400e; font-weight: 800; }
.appt-st-conflict { background: #fef3c7; color: #92400e; }
.appt-tl-type { font-size: 0.78rem; color: var(--oc-text-muted); margin-top: 1px; }
.appt-tl-desc { font-size: 0.78rem; color: var(--oc-text-muted); margin-top: 3px; line-height: 1.4; }

/* Done/cancelled states */
.appt-done { opacity: 0.5; }
.appt-done .appt-tl-client { text-decoration: line-through; }
.appt-pending { border-left: 3px solid #f59e0b; background: rgba(245,158,11,0.06); }
.appt-pending-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.summary-pill-pending .pill-count { background: #f59e0b; color: #fff; }
.appt-conflict { border-left: 3px solid #f59e0b; }

/* Quick stats badges */
.bg-purple-subtle { background: #ede9fe; }
.text-purple { color: #7c3aed; }
.bg-primary-subtle { background: #dbeafe; }

/* Mobile */
@media (max-width: 576px) {
    .appt-tl-time { width: 55px; min-width: 55px; }
    .appt-tl-start { font-size: 0.78rem; }
    .appt-section-today, .appt-section-tomorrow { margin: 0 -0.5rem 1rem; padding: 0.75rem; }
}

/* Legacy card styles (kept for detail modal) */
.appt-card { border-left: 4px solid var(--oc-purple); padding: 1rem 1.25rem; margin-bottom: 0.75rem; cursor: pointer; transition: all 0.25s; position: relative; }
.appt-card:hover { transform: translateX(4px); box-shadow: var(--oc-shadow-md); }

/* --- LEAD STATUS INDICATOR --- */
.lead-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.lead-status-dot.new { background: var(--oc-info); }
.lead-status-dot.contacted { background: var(--oc-warning); }
.lead-status-dot.qualified { background: var(--oc-accent); }
.lead-status-dot.converted { background: var(--oc-purple); }
.lead-status-dot.lost { background: var(--oc-danger); }

/* --- MODALS --- */
.modal-content { border: none; border-radius: var(--oc-radius); box-shadow: var(--oc-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--oc-border); padding: 1.25rem 1.5rem; }
.modal-header .modal-title { font-weight: 800; font-size: 1.1rem; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-body .field-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--oc-text-muted); font-weight: 700; margin-bottom: 4px; }
.modal-body .field-value { font-size: 0.9rem; margin-bottom: 1rem; }
.modal-footer { border-top: 1px solid var(--oc-border); padding: 1rem 1.5rem; }

/* --- SEARCH BAR --- */
.search-bar { position: relative; }
.search-bar input { padding-left: 2.2rem; border-radius: 10px; border: 1px solid var(--oc-border); font-size: 0.88rem; transition: all 0.25s; }
.search-bar input:focus { border-color: var(--oc-primary); box-shadow: 0 0 0 3px rgba(7,94,84,0.1); }
.search-bar .search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--oc-text-muted); font-size: 0.9rem; }

/* --- FORM CONTROLS --- */
.form-control:focus, .form-select:focus { border-color: var(--oc-primary); box-shadow: 0 0 0 3px rgba(7,94,84,0.1); }

/* --- CHARTS --- */
.chart-container { position: relative; height: 220px; }

/* --- PAGE HEADER --- */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.page-header h2 { font-weight: 800; font-size: 1.5rem; margin: 0; }

/* --- BUTTONS --- */
.btn-primary { background: var(--oc-primary); border-color: var(--oc-primary); transition: all 0.25s; }
.btn-primary:hover { background: var(--oc-primary-light); border-color: var(--oc-primary-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(7,94,84,0.3); }
.btn-outline-primary { color: var(--oc-primary); border-color: var(--oc-primary); }
.btn-outline-primary:hover { background: var(--oc-primary); border-color: var(--oc-primary); }

/* --- EMPTY STATES --- */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state i { font-size: 3.5rem; color: var(--oc-bg-tertiary); margin-bottom: 0.75rem; display: block; }
.empty-state p { color: var(--oc-text-muted); font-size: 0.9rem; }

/* --- ANIMATIONS --- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeInUp 0.35s ease; }
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.stat-value { animation: countUp 0.5s ease; }

/* Stagger animation for row items */
.stagger-item { animation: fadeInUp 0.3s ease forwards; opacity: 0; }

/* --- UTILITY --- */
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gap-3 { gap: 1rem !important; }
.cursor-pointer { cursor: pointer; }

/* --- SCROLLBARS --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--oc-bg-tertiary); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--oc-text-muted); }

/* --- TOAST NOTIFICATIONS --- */
#toast-container .toast { border-radius: var(--oc-radius); box-shadow: var(--oc-shadow-lg); margin-bottom: 0.5rem; transition: opacity 0.3s ease; background: var(--oc-card-bg); border: 1px solid var(--oc-border); }
#toast-container .toast-header { font-size: 0.85rem; }
#toast-container .toast-body { color: var(--oc-text-muted); }

/* --- LIVE PULSE (new data indicator) --- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.live-pulse { animation: pulse 1.5s ease-in-out 3; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* --- CALL LOG TABLE --- */
.call-log-table tr td:first-child { text-align: center; font-size: 1.1rem; }
.call-row-sentiment { width: 4px; position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px 0 0 2px; }

/* ===== TERMINAL PAGE ===== */
.terminal-window {
  background: #0d1117;
  border-radius: 12px;
  border: 1px solid #21262d;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}
.terminal-header {
  background: #161b22;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #21262d;
}
.terminal-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }
.terminal-title {
  font-size: 0.75rem;
  color: #8b949e;
  font-weight: 600;
}
.terminal-body {
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.6;
}
.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.term-line {
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 2px;
}
.term-system { color: #58a6ff; font-size: 0.6rem; line-height: 1.15; }
.term-info { color: #3fb950; font-weight: 700; }
.term-muted { color: #484f58; }
.term-data { color: #c9d1d9; }
.term-error { color: #f85149; }
.term-success { color: #3fb950; }
.term-warning { color: #d29922; }
.term-accent { color: #58a6ff; font-weight: 600; }
.term-cmd { color: #e6edf3; }
.term-prompt-echo { color: #3fb950; font-weight: 700; }
.term-cmd-name { color: #d2a8ff; font-weight: 600; }
.term-key { color: #79c0ff; }
.term-val { color: #a5d6ff; }
.term-help { color: #c9d1d9; }
.terminal-input-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #21262d;
  background: #0d1117;
}
.terminal-prompt {
  color: #3fb950;
  font-weight: 700;
  margin-right: 10px;
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}
.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e6edf3;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  caret-color: #3fb950;
}
.terminal-input::placeholder { color: #30363d; }

/* ===== TUTORIAL / GETTING STARTED GUIDE ===== */
.tutorial-pill {
  display: inline-flex; align-items: center;
  padding: 0.35rem 0.75rem; border-radius: 20px;
  font-size: 0.8rem; font-weight: 500;
  background: var(--oc-bg); color: var(--oc-text-muted);
  border: 1px solid var(--oc-border);
  transition: all 0.3s ease;
}
.tutorial-pill.done {
  background: var(--oc-accent); color: #fff;
  border-color: var(--oc-accent);
}
.tutorial-section-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.tutorial-steps { display: flex; flex-direction: column; gap: 0.25rem; }
.tutorial-step {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 0.75rem; border-radius: 8px;
  transition: background 0.2s;
}
.tutorial-step:hover { background: rgba(0,0,0,0.02); }
.tutorial-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700; flex-shrink: 0;
}
.tutorial-step-content { flex: 1; }
.tutorial-step-content strong { display: block; margin-bottom: 0.25rem; }
.tutorial-step-content p { font-size: 0.85rem; }
.tutorial-tip {
  background: rgba(59,130,246,0.06); border-left: 3px solid var(--oc-info);
  padding: 0.75rem 1rem; border-radius: 0 8px 8px 0;
  font-size: 0.85rem; color: var(--oc-text);
}
.tutorial-check-row {
  padding: 0.75rem 1rem; background: var(--oc-bg);
  border-radius: 8px;
}
.tutorial-section .accordion-button:not(.collapsed) {
  background: rgba(7,94,84,0.04); color: var(--oc-text);
}

/* ===== NOTIFICATION CONTROLS ===== */
.notif-control-grid {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 0.5rem; align-items: center;
}
.notif-control-header {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--oc-text-muted); font-weight: 600; padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--oc-border);
}
.notif-type-label {
  font-size: 0.82rem; font-weight: 500; display: flex; align-items: center; gap: 0.4rem;
}

/* --- LIVE BADGES (navbar) --- */
.live-badge {
  display: none;
  position: absolute;
  top: 2px; right: -2px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  font-size: 0.65rem; font-weight: 700;
  color: #fff;
  background: var(--oc-danger);
  border-radius: 10px;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(220,53,69,0.4);
}
.live-badge.show { display: inline-block; }
@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.live-badge.pulse { animation: badgePulse 0.4s ease; }

/* --- LIVE TOAST NOTIFICATIONS --- */
#toast-container {
  position: fixed; top: 12px; right: 12px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px;
}
#toast-container .toast {
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: none;
  overflow: hidden;
  animation: toastSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
}
#toast-container .toast:hover { transform: translateX(-4px); }
@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
.toast-exit { animation: toastSlideOut 0.3s ease forwards; }

/* --- LIVE NOTIFICATION BANNER (pending appointments) --- */
.live-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 9998;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  animation: bannerSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.live-banner .banner-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.live-banner .banner-text { flex: 1; }
.live-banner .banner-text strong { font-size: 0.88rem; }
.live-banner .banner-text small { font-size: 0.78rem; opacity: 0.75; display: block; }
.live-banner .banner-actions { display: flex; gap: 8px; }
.live-banner .btn-banner { padding: 5px 14px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; border: none; cursor: pointer; }
.live-banner .btn-approve { background: var(--oc-accent); color: #fff; }
.live-banner .btn-reject { background: rgba(255,255,255,0.15); color: #fff; }
.live-banner .btn-dismiss { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.2rem; cursor: pointer; padding: 0 4px; }
@keyframes bannerSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* --- SMART REPLY CATEGORY CARDS --- */
.sr-cat-item {
  transition: all 0.2s ease;
}
.sr-cat-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.sr-cat-item .form-check-input:checked {
  background-color: var(--oc-accent);
  border-color: var(--oc-accent);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .stat-card .stat-info .stat-value { font-size: 1.3rem; }
  .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .convo-list { max-height: 300px; }
  .page-header h2 { font-size: 1.2rem; }
  .summary-pill { padding: 0.3rem 0.65rem; font-size: 0.75rem; }
  .oc-navbar .nav-link { font-size: 0.8rem; padding: 0.35rem 0.6rem !important; }
  .terminal-body { max-height: 50vh; font-size: 0.72rem; }
}
