/* ═══════════════════════════════════════════════════════════════════════════
   FOSA Conversations — Main Stylesheet
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }

/* ── 2. Theme Variables ───────────────────────────────────────────────────── */
.theme-fosa-light {
  --th-app: #F4F1FB; --th-sidebar: #342952; --th-sidebar-hover: #42356A;
  --th-sidebar-icon: rgba(255,255,255,0.55); --th-sidebar-icon-active: #F5A623;
  --th-sidebar-logo-bg: rgba(255,255,255,0.08);
  --th-header: #FFFFFF; --th-header-border: #E5E0F4; --th-header-text: #1A1429;
  --th-list: #FAFAFA; --th-list-item: #FFFFFF; --th-list-hover: #F0EDF8;
  --th-list-active: #EBE5F9; --th-list-active-border: #F5A623;
  --th-accent: #F5A623; --th-accent-text: #FFFFFF; --th-primary: #342952;
  --th-text: #1A1429; --th-text-muted: #6B7280; --th-text-light: #9CA3AF;
  --th-border: #E5E0F4; --th-sent: #342952; --th-sent-text: #FFFFFF;
  --th-received: #FFFFFF; --th-received-text: #1A1429; --th-received-border: #E5E0F4;
  --th-input: #F4F1FB; --th-input-border: #D1C9ED;
  --th-chip-active: #342952; --th-chip-active-text: #FFFFFF;
  --th-chip-inactive: #FFFFFF; --th-chip-inactive-text: #6B7280; --th-chip-border: #D1C9ED;
  --th-badge: #EF4444; --th-scroll: #D1C9ED; --th-panel: #FFFFFF;
  --th-status-bot: #22C55E; --th-status-queued: #F59E0B; --th-status-live: #3B82F6;
}
.theme-fosa-dark {
  --th-app: #0B0914; --th-sidebar: #05040A; --th-sidebar-hover: #130F20;
  --th-sidebar-icon: rgba(184,159,232,0.5); --th-sidebar-icon-active: #B89FE8;
  --th-sidebar-logo-bg: rgba(184,159,232,0.1);
  --th-header: #181326; --th-header-border: #2A2045; --th-header-text: #F0EDF8;
  --th-list: #0E0C18; --th-list-item: #181326; --th-list-hover: #1E1A29;
  --th-list-active: #2A2045; --th-list-active-border: #B89FE8;
  --th-accent: #B89FE8; --th-accent-text: #1A1429; --th-primary: #B89FE8;
  --th-text: #F0EDF8; --th-text-muted: #8B7DB0; --th-text-light: #5C4F84;
  --th-border: #2A2045; --th-sent: #B89FE8; --th-sent-text: #1A1429;
  --th-received: #1E1A29; --th-received-text: #F0EDF8; --th-received-border: #2A2045;
  --th-input: #1E1A29; --th-input-border: #2A2045;
  --th-chip-active: #B89FE8; --th-chip-active-text: #1A1429;
  --th-chip-inactive: #1E1A29; --th-chip-inactive-text: #8B7DB0; --th-chip-border: #2A2045;
  --th-badge: #EF4444; --th-scroll: #2A2045; --th-panel: #181326;
  --th-status-bot: #22C55E; --th-status-queued: #F59E0B; --th-status-live: #60A5FA;
}
.theme-executive {
  --th-app: #0F1117; --th-sidebar: #000000; --th-sidebar-hover: #151A24;
  --th-sidebar-icon: rgba(148,163,184,0.5); --th-sidebar-icon-active: #6366F1;
  --th-sidebar-logo-bg: rgba(99,102,241,0.1);
  --th-header: #1A1D27; --th-header-border: #2D3748; --th-header-text: #F9FAFB;
  --th-list: #141720; --th-list-item: #1A1D27; --th-list-hover: #1E2130;
  --th-list-active: #252A36; --th-list-active-border: #6366F1;
  --th-accent: #6366F1; --th-accent-text: #FFFFFF; --th-primary: #6366F1;
  --th-text: #F9FAFB; --th-text-muted: #9CA3AF; --th-text-light: #6B7280;
  --th-border: #2D3748; --th-sent: #6366F1; --th-sent-text: #FFFFFF;
  --th-received: #252A36; --th-received-text: #F9FAFB; --th-received-border: #2D3748;
  --th-input: #1E2130; --th-input-border: #2D3748;
  --th-chip-active: #6366F1; --th-chip-active-text: #FFFFFF;
  --th-chip-inactive: #1E2130; --th-chip-inactive-text: #9CA3AF; --th-chip-border: #2D3748;
  --th-badge: #EF4444; --th-scroll: #2D3748; --th-panel: #1A1D27;
  --th-status-bot: #22C55E; --th-status-queued: #F59E0B; --th-status-live: #60A5FA;
}
.theme-warm {
  --th-app: #FAFAF8; --th-sidebar: #2C302E; --th-sidebar-hover: #383D3A;
  --th-sidebar-icon: rgba(250,250,248,0.5); --th-sidebar-icon-active: #D96C4A;
  --th-sidebar-logo-bg: rgba(217,108,74,0.1);
  --th-header: #FFFFFF; --th-header-border: #E5E5DF; --th-header-text: #2C302E;
  --th-list: #F5F4F0; --th-list-item: #FFFFFF; --th-list-hover: #F0EDE6;
  --th-list-active: #FBF0EC; --th-list-active-border: #D96C4A;
  --th-accent: #D96C4A; --th-accent-text: #FFFFFF; --th-primary: #2C302E;
  --th-text: #2C302E; --th-text-muted: #5C635F; --th-text-light: #9CA3A7;
  --th-border: #E5E5DF; --th-sent: #D96C4A; --th-sent-text: #FFFFFF;
  --th-received: #FFFFFF; --th-received-text: #2C302E; --th-received-border: #E5E5DF;
  --th-input: #F5F4F0; --th-input-border: #D5D5CE;
  --th-chip-active: #D96C4A; --th-chip-active-text: #FFFFFF;
  --th-chip-inactive: #FFFFFF; --th-chip-inactive-text: #5C635F; --th-chip-border: #D5D5CE;
  --th-badge: #EF4444; --th-scroll: #D5D5CE; --th-panel: #FFFFFF;
  --th-status-bot: #22C55E; --th-status-queued: #F59E0B; --th-status-live: #3B82F6;
}
.theme-ocean {
  --th-app: #051523; --th-sidebar: #020D18; --th-sidebar-hover: #0A2030;
  --th-sidebar-icon: rgba(0,180,216,0.4); --th-sidebar-icon-active: #00B4D8;
  --th-sidebar-logo-bg: rgba(0,180,216,0.1);
  --th-header: #0A1929; --th-header-border: #0D2540; --th-header-text: #E0F7FA;
  --th-list: #051523; --th-list-item: #0A1929; --th-list-hover: #0D2035;
  --th-list-active: #0D2540; --th-list-active-border: #00B4D8;
  --th-accent: #00B4D8; --th-accent-text: #FFFFFF; --th-primary: #00B4D8;
  --th-text: #E0F7FA; --th-text-muted: #4FC3D8; --th-text-light: #2A7A8A;
  --th-border: #0D2540; --th-sent: #00B4D8; --th-sent-text: #FFFFFF;
  --th-received: #0D2035; --th-received-text: #E0F7FA; --th-received-border: #0D2540;
  --th-input: #0D2035; --th-input-border: #0D2540;
  --th-chip-active: #00B4D8; --th-chip-active-text: #FFFFFF;
  --th-chip-inactive: #0D2035; --th-chip-inactive-text: #4FC3D8; --th-chip-border: #0D2540;
  --th-badge: #EF4444; --th-scroll: #0D2540; --th-panel: #0A1929;
  --th-status-bot: #22C55E; --th-status-queued: #F59E0B; --th-status-live: #60A5FA;
}
.theme-emerald {
  --th-app: #F0FFF4; --th-sidebar: #1A2E1A; --th-sidebar-hover: #243724;
  --th-sidebar-icon: rgba(74,222,128,0.45); --th-sidebar-icon-active: #4ADE80;
  --th-sidebar-logo-bg: rgba(74,222,128,0.1);
  --th-header: #FFFFFF; --th-header-border: #D1FAE5; --th-header-text: #1A2E1A;
  --th-list: #F4FDF6; --th-list-item: #FFFFFF; --th-list-hover: #E8F8EE;
  --th-list-active: #DCFCE7; --th-list-active-border: #22C55E;
  --th-accent: #22C55E; --th-accent-text: #FFFFFF; --th-primary: #1A2E1A;
  --th-text: #1A2E1A; --th-text-muted: #4A6A4A; --th-text-light: #6A8A6A;
  --th-border: #D1FAE5; --th-sent: #1A2E1A; --th-sent-text: #FFFFFF;
  --th-received: #FFFFFF; --th-received-text: #1A2E1A; --th-received-border: #D1FAE5;
  --th-input: #F0FFF4; --th-input-border: #BBF7D0;
  --th-chip-active: #1A2E1A; --th-chip-active-text: #FFFFFF;
  --th-chip-inactive: #FFFFFF; --th-chip-inactive-text: #4A6A4A; --th-chip-border: #BBF7D0;
  --th-badge: #EF4444; --th-scroll: #BBF7D0; --th-panel: #FFFFFF;
  --th-status-bot: #22C55E; --th-status-queued: #F59E0B; --th-status-live: #3B82F6;
}
.theme-rose {
  --th-app: #FFF5F7; --th-sidebar: #4A2030; --th-sidebar-hover: #5C2A3C;
  --th-sidebar-icon: rgba(220,160,160,0.5); --th-sidebar-icon-active: #E8A0B0;
  --th-sidebar-logo-bg: rgba(232,160,176,0.12);
  --th-header: #FFFFFF; --th-header-border: #FFE4EC; --th-header-text: #4A2030;
  --th-list: #FFF8FA; --th-list-item: #FFFFFF; --th-list-hover: #FFF0F4;
  --th-list-active: #FFE4EC; --th-list-active-border: #B76E79;
  --th-accent: #B76E79; --th-accent-text: #FFFFFF; --th-primary: #4A2030;
  --th-text: #4A2030; --th-text-muted: #8B5060; --th-text-light: #C098A0;
  --th-border: #FFE4EC; --th-sent: #4A2030; --th-sent-text: #FFFFFF;
  --th-received: #FFFFFF; --th-received-text: #4A2030; --th-received-border: #FFE4EC;
  --th-input: #FFF5F7; --th-input-border: #FFD0DC;
  --th-chip-active: #4A2030; --th-chip-active-text: #FFFFFF;
  --th-chip-inactive: #FFFFFF; --th-chip-inactive-text: #8B5060; --th-chip-border: #FFD0DC;
  --th-badge: #EF4444; --th-scroll: #FFD0DC; --th-panel: #FFFFFF;
  --th-status-bot: #22C55E; --th-status-queued: #F59E0B; --th-status-live: #3B82F6;
}

/* ── 3. Chat Backgrounds (per channel + dark themes) ────────────────────── */
.chat-bg-whatsapp  { background: #ECF8F1; }
.chat-bg-instagram { background: #FDF0F5; }
.chat-bg-messenger { background: #EFF4FD; }
.chat-bg-sms       { background: #F5F5F5; }
.chat-bg-phone     { background: #EEF8F7; }
.chat-bg-website   { background: #F0EFFF; }

.theme-fosa-dark .chat-bg-whatsapp,
.theme-executive .chat-bg-whatsapp,
.theme-ocean .chat-bg-whatsapp  { background: #0D1F12; }
.theme-fosa-dark .chat-bg-instagram,
.theme-executive .chat-bg-instagram,
.theme-ocean .chat-bg-instagram { background: #1A0A10; }
.theme-fosa-dark .chat-bg-messenger,
.theme-executive .chat-bg-messenger,
.theme-ocean .chat-bg-messenger { background: #0A1020; }
.theme-fosa-dark .chat-bg-sms,
.theme-executive .chat-bg-sms,
.theme-ocean .chat-bg-sms       { background: #111318; }
.theme-fosa-dark .chat-bg-phone,
.theme-executive .chat-bg-phone,
.theme-ocean .chat-bg-phone     { background: #081818; }
.theme-fosa-dark .chat-bg-website,
.theme-executive .chat-bg-website,
.theme-ocean .chat-bg-website   { background: #0E0D1F; }

/* ── 4. Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--th-scroll, #D1D5DB); border-radius: 99px; }

/* ── 5. Animations ───────────────────────────────────────────────────────── */
@keyframes fadeSlideIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulseDot { 0%,100% { transform:scale(1); opacity:1; } 50% { transform:scale(1.4); opacity:.7; } }
@keyframes slideIn { from { opacity:0; transform:translateX(-8px); } to { opacity:1; transform:translateX(0); } }
.anim-in { animation: fadeSlideIn .28s ease both; }
.anim-slide { animation: slideIn .25s ease both; }
.live-dot { animation: pulseDot 1.5s ease-in-out infinite; }

/* ── 6. LOGIN PAGE ───────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #342952 0%, #1A1429 55%, #0B0914 100%);
  overflow: hidden; position: relative;
}
.login-blob { position: absolute; border-radius: 50%; pointer-events: none; }
.login-blob-1 { width:400px; height:400px; top:-10%; right:-10%; background:radial-gradient(circle, rgba(184,159,232,.15) 0%, transparent 70%); }
.login-blob-2 { width:300px; height:300px; bottom:-10%; left:-5%; background:radial-gradient(circle, rgba(245,166,35,.1) 0%, transparent 70%); }

.login-card {
  position:relative; width:100%; max-width:420px; margin:16px;
  background:rgba(255,255,255,.06); backdrop-filter:blur(24px);
  border:1px solid rgba(255,255,255,.1); border-radius:24px; padding:44px 40px;
  box-shadow:0 32px 64px rgba(0,0,0,.4);
}
.login-brand { text-align:center; margin-bottom:28px; }
.login-logo { width:80px; height:80px; border-radius:16px; object-fit:contain; margin-bottom:10px; box-shadow:0 8px 24px rgba(0,0,0,.3); background:#1A1429; }
.login-brand-sub { color:rgba(255,255,255,.45); font-size:13px; margin-top:4px; }
.login-title-wrap { margin-bottom:24px; }
.login-title { font-family:'Cabinet Grotesk',sans-serif; font-size:22px; font-weight:800; color:#FFF; letter-spacing:-.3px; }
.login-subtitle { color:rgba(255,255,255,.45); font-size:13px; margin-top:4px; }

.login-error { background:rgba(239,68,68,.15); border:1px solid rgba(239,68,68,.3); border-radius:10px; padding:10px 14px; margin-bottom:18px; color:#FCA5A5; font-size:13px; }
.hidden { display:none !important; }

.form-group { margin-bottom:16px; }
.form-label { display:block; color:rgba(255,255,255,.6); font-size:11px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; margin-bottom:8px; }
.form-input {
  width:100%; background:rgba(0,0,0,.25); border:1px solid rgba(255,255,255,.12);
  border-radius:10px; padding:12px 14px; color:#FFF; font-size:15px; font-family:inherit;
  outline:none; transition:border-color .2s;
}
.form-input::placeholder { color:rgba(255,255,255,.3); }
.form-input:focus { border-color:#F5A623; }
.input-wrap { position:relative; }
.input-wrap .form-input { padding-right:44px; }
.toggle-pwd-btn { position:absolute; right:12px; top:50%; transform:translateY(-50%); background:none; border:none; cursor:pointer; color:rgba(255,255,255,.4); opacity:.5; padding:0; display:flex; }

.login-btn {
  width:100%; background:linear-gradient(135deg,#F5A623,#E0941A); border:none; border-radius:10px;
  padding:13px; cursor:pointer; color:#FFF; font-size:15px; font-weight:700; font-family:inherit;
  letter-spacing:.02em; transition:opacity .2s, transform .1s;
  box-shadow:0 4px 16px rgba(245,166,35,.3); margin-top:8px;
}
.login-btn:hover:not(:disabled) { transform:translateY(-1px); opacity:.92; }
.login-btn:disabled { opacity:.5; cursor:not-allowed; }
.login-footer { text-align:center; color:rgba(255,255,255,.2); font-size:11px; margin-top:24px; }

/* ── 7. DASHBOARD LAYOUT ─────────────────────────────────────────────────── */
.app-wrapper { height:100vh; display:flex; flex-direction:column; overflow:hidden; background:var(--th-app); }
.main-content { flex:1; display:flex; overflow:hidden; }

/* ── 8. HEADER ───────────────────────────────────────────────────────────── */
.app-header {
  height:60px; display:flex; align-items:center; gap:12px; padding:0 14px;
  background:var(--th-header); border-bottom:1px solid var(--th-border); flex-shrink:0; z-index:100;
}
.header-brand { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.header-logo { width:36px; height:36px; border-radius:10px; object-fit:contain; background:var(--th-sidebar); }
.brand-text .brand-name { font-family:'Cabinet Grotesk',sans-serif; font-size:17px; font-weight:800; color:var(--th-text); line-height:1.1; letter-spacing:-.3px; }
.brand-text .brand-sub { font-size:10px; color:var(--th-text-muted); letter-spacing:.05em; text-transform:uppercase; }
.header-divider { width:1px; height:28px; background:var(--th-border); flex-shrink:0; }
.header-spacer { flex:1; }

.stats-pills { display:flex; gap:6px; }
.stat-pill { display:flex; align-items:center; gap:5px; background:var(--th-input); border:1px solid var(--th-border); border-radius:99px; padding:4px 10px; }
.stat-dot { width:7px; height:7px; border-radius:50%; }
.stat-pill span { font-size:11px; font-weight:600; color:var(--th-text-muted); }
.stat-pill strong { font-size:11px; font-weight:700; color:var(--th-text); }

.icon-btn { background:transparent; border:1px solid var(--th-border); border-radius:8px; padding:6px 8px; cursor:pointer; color:var(--th-text-muted); display:flex; align-items:center; justify-content:center; transition:all .2s; }
.icon-btn:hover { border-color:var(--th-accent); color:var(--th-text); }
.icon-btn.active { background:var(--th-accent); color:var(--th-accent-text); border-color:var(--th-accent); }
.icon-btn svg { width:16px; height:16px; }

.user-menu { display:flex; align-items:center; gap:8px; }
.user-avatar { width:32px; height:32px; border-radius:50%; background:var(--th-accent); color:var(--th-accent-text); font-size:13px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.user-name { font-size:13px; font-weight:600; color:var(--th-text); }
.logout-btn:hover { color:#EF4444 !important; border-color:#EF4444 !important; }

/* ── 9. LOCATION SELECTOR ────────────────────────────────────────────────── */
.location-selector { position:relative; }
.location-btn {
  display:flex; align-items:center; gap:6px; padding:6px 12px;
  background:var(--th-input); border:1px solid var(--th-border); border-radius:99px;
  cursor:pointer; max-width:240px; transition:border-color .2s;
  font-family:inherit; font-size:13px; font-weight:600; color:var(--th-text);
}
.location-btn:hover { border-color:var(--th-accent); }
.location-btn svg { width:13px; height:13px; }
.icon-accent { color:var(--th-accent); }
.loc-clear { display:flex; align-items:center; color:var(--th-text-muted); cursor:pointer; }
.loc-clear svg { width:11px; height:11px; }
.loc-dropdown {
  position:absolute; left:0; top:calc(100% + 8px); z-index:999; min-width:240px;
  background:var(--th-header); border:1px solid var(--th-border); border-radius:14px;
  box-shadow:0 12px 36px rgba(0,0,0,.15); overflow:hidden;
}
.dropdown-search-wrap { padding:10px 10px 6px; }
.dropdown-search-input { width:100%; background:var(--th-input); border:1px solid var(--th-input-border); border-radius:8px; padding:7px 10px; font-size:13px; font-family:inherit; color:var(--th-text); outline:none; }
.dropdown-options { max-height:220px; overflow-y:auto; padding-bottom:6px; }
.dropdown-divider { height:1px; background:var(--th-border); margin:4px 10px; }
.dropdown-option {
  display:flex; align-items:center; gap:10px; padding:8px 12px;
  cursor:pointer; transition:background .15s; font-family:inherit;
  background:transparent; border:none; width:100%; text-align:left;
}
.dropdown-option:hover { background:var(--th-list-hover); }
.dropdown-option.active { background:var(--th-list-active); }
.dropdown-option svg { width:13px; height:13px; color:var(--th-text-muted); }
.dropdown-option.active svg { color:var(--th-accent); }
.dropdown-option .opt-label { font-size:13px; font-weight:600; color:var(--th-text); display:block; }
.dropdown-option .opt-sub { font-size:11px; color:var(--th-text-muted); display:block; }
.dropdown-option .opt-check { margin-left:auto; color:var(--th-accent); }
.dropdown-option .opt-check svg { width:13px; height:13px; }

/* ── 10. THEME SWITCHER ──────────────────────────────────────────────────── */
.theme-switcher-wrap { position:relative; }
.theme-dropdown {
  position:absolute; right:0; top:calc(100% + 8px); z-index:999; min-width:200px;
  background:var(--th-header); border:1px solid var(--th-border); border-radius:14px;
  padding:10px; box-shadow:0 12px 36px rgba(0,0,0,.2);
}
.dropdown-label { font-size:10px; font-weight:700; color:var(--th-text-muted); text-transform:uppercase; letter-spacing:.08em; margin-bottom:8px; padding:0 4px; }
.theme-option {
  display:flex; align-items:center; gap:10px; padding:8px; border-radius:10px;
  cursor:pointer; border:none; background:transparent; width:100%; text-align:left; font-family:inherit;
  transition:background .15s;
}
.theme-option:hover { background:var(--th-list-hover); }
.theme-option.active { background:var(--th-list-active); }
.theme-swatches { display:flex; gap:3px; flex-shrink:0; }
.swatch { width:12px; height:24px; border-radius:4px; border:1px solid rgba(0,0,0,.1); }
.theme-opt-name { font-size:12px; font-weight:700; color:var(--th-text); display:block; }
.theme-opt-desc { font-size:11px; color:var(--th-text-muted); display:block; }
.theme-check { margin-left:auto; color:var(--th-accent); }
.theme-check svg { width:14px; height:14px; }

/* ── 11. CHANNEL SIDEBAR ─────────────────────────────────────────────────── */
.channel-sidebar {
  width:76px; background:var(--th-sidebar); border-right:1px solid rgba(0,0,0,.1);
  display:flex; flex-direction:column; align-items:center; padding:16px 0; flex-shrink:0; z-index:40;
}
.sidebar-logo-wrap { padding:3px; border-radius:14px; background:var(--th-sidebar-logo-bg); margin-bottom:16px; }
.sidebar-logo { width:44px; height:44px; border-radius:11px; object-fit:contain; display:block; background:#1A1429; }
.sidebar-divider { width:36px; height:1px; background:rgba(255,255,255,.1); margin-bottom:14px; }
.channel-nav { display:flex; flex-direction:column; align-items:center; gap:8px; }
.channel-btn {
  width:52px; height:52px; border-radius:14px; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; position:relative;
  background:transparent; color:var(--th-sidebar-icon); transition:all .2s;
}
.channel-btn:hover { background:var(--th-sidebar-hover); }
.channel-btn.active { background:rgba(255,255,255,.15); }
.channel-btn svg { width:24px; height:24px; }
.channel-active-bar { position:absolute; left:0; top:22%; bottom:22%; width:3px; border-radius:0 3px 3px 0; }

/* ── 12. CONVERSATION PANEL ──────────────────────────────────────────────── */
.conv-panel { width:320px; background:var(--th-list); border-right:1px solid var(--th-border); display:flex; flex-direction:column; flex-shrink:0; }
.conv-panel-header { padding:12px 16px 8px; border-bottom:1px solid var(--th-border); flex-shrink:0; }
.conv-panel-title-row { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.conv-panel-title { font-family:'Cabinet Grotesk',sans-serif; font-size:14px; font-weight:700; color:var(--th-text); }
.conv-panel-title span { font-size:11px; font-weight:600; color:var(--th-text-muted); }
.conv-count { font-size:11px; font-weight:600; color:var(--th-text-muted); background:var(--th-input); border:1px solid var(--th-border); border-radius:99px; padding:2px 8px; }
.conv-search-wrap { position:relative; margin-bottom:10px; }
.conv-search-icon { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--th-text-muted); pointer-events:none; width:14px; height:14px; }
.conv-search-input { width:100%; background:var(--th-input); border:1px solid var(--th-input-border); border-radius:8px; padding:7px 10px 7px 30px; font-size:13px; color:var(--th-text); font-family:inherit; outline:none; }
.conv-filters { display:flex; gap:6px; overflow-x:auto; padding-bottom:2px; }
.filter-chip { flex-shrink:0; padding:4px 10px; border-radius:99px; font-size:11px; font-weight:600; cursor:pointer; transition:all .15s; font-family:inherit; background:var(--th-chip-inactive); color:var(--th-chip-inactive-text); border:1px solid var(--th-chip-border); }
.filter-chip.active { background:var(--th-chip-active); color:var(--th-chip-active-text); border-color:var(--th-chip-active); }
.conv-list { flex:1; overflow-y:auto; }

/* ── 13. CONVERSATION ITEM ───────────────────────────────────────────────── */
.conv-item { padding:12px 16px; cursor:pointer; border-bottom:1px solid var(--th-border); border-left:3px solid transparent; background:var(--th-list-item); transition:all .15s; }
.conv-item:hover { background:var(--th-list-hover); }
.conv-item.active { background:var(--th-list-active); border-left-color:var(--th-list-active-border); }
.conv-item-inner { display:flex; gap:10px; align-items:flex-start; }
.conv-avatar-wrap { position:relative; flex-shrink:0; }
.avatar-img, .avatar-initials { width:42px; height:42px; border-radius:50%; border:2px solid var(--th-border); }
.avatar-img { object-fit:cover; }
.avatar-initials { display:flex; align-items:center; justify-content:center; font-weight:700; color:#FFF; font-size:14px; }
.conv-channel-dot { position:absolute; bottom:-2px; right:-2px; width:16px; height:16px; border-radius:50%; display:flex; align-items:center; justify-content:center; border:2px solid var(--th-list-item); }
.conv-channel-dot svg { width:8px; height:8px; }
.conv-content { flex:1; min-width:0; }
.conv-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:3px; }
.conv-name { font-size:13px; font-weight:700; color:var(--th-text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.conv-time { font-size:10px; color:var(--th-text-light); flex-shrink:0; margin-left:6px; }
.conv-preview { margin:0; font-size:12px; color:var(--th-text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.unread-badge { background:var(--th-badge); color:#FFF; font-size:10px; font-weight:700; border-radius:99px; padding:1px 6px; min-width:18px; text-align:center; flex-shrink:0; }
.status-badge { display:inline-flex; align-items:center; gap:4px; font-size:10px; font-weight:600; border-radius:99px; padding:1px 7px; margin-top:5px; }
.status-badge .status-dot { width:5px; height:5px; border-radius:50%; }

/* ── 14. CHAT VIEW ───────────────────────────────────────────────────────── */
.chat-view { flex:1; display:flex; flex-direction:column; min-width:0; background:var(--th-app); overflow:hidden; }
.chat-empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; }
.chat-empty-icon { width:64px; height:64px; border-radius:20px; background:var(--th-input); border:1px solid var(--th-border); display:flex; align-items:center; justify-content:center; margin:0 auto 16px; }
.chat-empty-icon svg { width:28px; height:28px; color:var(--th-text-muted); }
.chat-empty h3 { font-family:'Cabinet Grotesk',sans-serif; font-size:17px; font-weight:700; color:var(--th-text); margin-bottom:8px; }
.chat-empty p { font-size:13px; color:var(--th-text-muted); max-width:260px; line-height:1.6; }
.chat-content { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.chat-header { height:60px; display:flex; align-items:center; gap:12px; padding:0 20px; background:var(--th-header); border-bottom:1px solid var(--th-border); flex-shrink:0; }
.chat-header-avatar-wrap { position:relative; flex-shrink:0; }
.chat-header-avatar-wrap .avatar-img,
.chat-header-avatar-wrap .avatar-initials { width:40px; height:40px; }
.chat-header-channel-dot { position:absolute; bottom:-1px; right:-1px; width:14px; height:14px; border-radius:50%; display:flex; align-items:center; justify-content:center; border:2px solid var(--th-header); }
.chat-header-channel-dot svg { width:7px; height:7px; }
.chat-header-info { flex:1; min-width:0; }
.chat-header-name { font-size:14px; font-weight:700; color:var(--th-text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-header-meta { font-size:11px; color:var(--th-text-muted); }
.chat-header-badges { display:flex; gap:6px; flex-shrink:0; }
.channel-badge { display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; border-radius:99px; padding:3px 10px; }
.channel-badge svg { width:11px; height:11px; }

.chat-messages { flex:1; overflow-y:auto; padding:16px 20px; }
.msg-row { display:flex; align-items:flex-end; gap:8px; margin-bottom:14px; }
.msg-row.customer { flex-direction:row; }
.msg-row.bot, .msg-row.agent { flex-direction:row-reverse; }
.msg-icon { width:28px; height:28px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.msg-icon svg { width:13px; height:13px; }
.msg-icon.customer { background:var(--th-border); color:var(--th-text-muted); }
.msg-icon.bot, .msg-icon.agent { background:var(--th-accent); color:var(--th-accent-text); }
.msg-bubble-wrap { max-width:68%; display:flex; flex-direction:column; }
.msg-row.customer .msg-bubble-wrap { align-items:flex-start; }
.msg-row.bot .msg-bubble-wrap, .msg-row.agent .msg-bubble-wrap { align-items:flex-end; }
.msg-sender { font-size:10px; color:var(--th-text-muted); font-weight:600; text-transform:capitalize; margin-bottom:3px; }
.msg-bubble { padding:9px 13px; font-size:13px; line-height:1.5; word-break:break-word; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.msg-row.customer .msg-bubble { border-radius:16px 16px 16px 4px; background:var(--th-received); color:var(--th-received-text); border:1px solid var(--th-received-border); }
.msg-row.bot .msg-bubble, .msg-row.agent .msg-bubble { border-radius:16px 16px 4px 16px; background:var(--th-sent); color:var(--th-sent-text); }
.msg-time { font-size:10px; color:var(--th-text-light); margin-top:3px; }

.chat-input-area { padding:12px 16px; background:var(--th-header); border-top:1px solid var(--th-border); flex-shrink:0; }
.chat-input-wrap { display:flex; gap:10px; align-items:flex-end; }
.chat-input { flex:1; background:var(--th-input); border:1px solid var(--th-input-border); border-radius:12px; padding:10px 14px; font-size:13px; color:var(--th-text); font-family:inherit; outline:none; resize:none; line-height:1.5; max-height:120px; overflow-y:auto; transition:border-color .2s; }
.chat-input:focus { border-color:var(--th-accent); }
.send-btn { width:40px; height:40px; border-radius:10px; border:none; cursor:pointer; background:var(--th-accent); color:var(--th-accent-text); display:flex; align-items:center; justify-content:center; transition:all .2s; flex-shrink:0; }
.send-btn:disabled { background:var(--th-input); color:var(--th-text-muted); cursor:not-allowed; }
.send-btn svg { width:16px; height:16px; }
.chat-input-hint { font-size:10px; color:var(--th-text-light); margin-top:6px; padding-left:4px; }

/* ── 15. CONTACT PANEL ───────────────────────────────────────────────────── */
.contact-panel { width:272px; background:var(--th-panel); border-left:1px solid var(--th-border); display:flex; flex-direction:column; overflow-y:auto; flex-shrink:0; }
.contact-panel.hidden { display:none; }
.contact-panel-header { display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--th-border); flex-shrink:0; }
.contact-panel-title { font-size:11px; font-weight:700; color:var(--th-text); letter-spacing:.05em; text-transform:uppercase; }
.icon-btn-sm { background:none; border:none; cursor:pointer; color:var(--th-text-muted); padding:4px; border-radius:6px; display:flex; transition:color .15s; }
.icon-btn-sm:hover { color:var(--th-text); }
.icon-btn-sm svg { width:14px; height:14px; }
.contact-avatar-section { padding:16px 14px 12px; text-align:center; border-bottom:1px solid var(--th-border); }
.contact-avatar-wrap { position:relative; display:inline-block; margin-bottom:10px; }
.contact-avatar-wrap .avatar-img,
.contact-avatar-wrap .avatar-initials { width:60px; height:60px; border-radius:50%; }
.contact-online-dot { position:absolute; bottom:1px; right:1px; width:13px; height:13px; border-radius:50%; background:#22C55E; border:2px solid var(--th-panel); }
.contact-name { font-family:'Cabinet Grotesk',sans-serif; font-size:14px; font-weight:700; color:var(--th-text); margin:0 0 2px; }
.contact-handle { font-size:11px; color:var(--th-text-muted); margin:0; }
.contact-tags { display:flex; flex-wrap:wrap; gap:4px; justify-content:center; margin-top:8px; }
.contact-tag { font-size:10px; font-weight:600; color:var(--th-text-muted); background:var(--th-input); border:1px solid var(--th-border); border-radius:99px; padding:2px 7px; }
.contact-details { padding:10px 14px; border-bottom:1px solid var(--th-border); }
.contact-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px 8px; }
.contact-detail-full { grid-column:1/-1; display:flex; align-items:center; gap:5px; }
.contact-detail-half { display:flex; align-items:center; gap:5px; }
.contact-detail-full svg, .contact-detail-half svg { width:11px; height:11px; color:var(--th-text-muted); flex-shrink:0; }
.detail-value { font-size:11px; color:var(--th-text); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.detail-channel-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.detail-status-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.contact-actions { padding:10px 14px 12px; }
.contact-section-label { font-size:10px; font-weight:700; color:var(--th-text-light); text-transform:uppercase; letter-spacing:.08em; margin-bottom:8px; }
.action-btn { display:flex; align-items:center; gap:8px; padding:7px 10px; background:var(--th-input); border:1px solid var(--th-border); border-radius:8px; cursor:pointer; font-size:11px; font-weight:600; color:var(--th-text); transition:all .15s; text-align:left; width:100%; font-family:inherit; margin-bottom:5px; }
.action-btn:hover { background:rgba(0,0,0,.04); }
.action-btn svg { width:12px; height:12px; }
.contact-notes { padding:0 14px 14px; flex:1; }
.notes-textarea { width:100%; height:80px; resize:none; background:var(--th-input); border:1px solid var(--th-input-border); border-radius:8px; padding:7px 10px; font-size:11px; color:var(--th-text); font-family:inherit; outline:none; line-height:1.5; }
