:root {
  --bg-dark: #0B0F17;
  --bg-card: rgba(22, 27, 34, 0.75);
  --bg-card-hover: rgba(30, 38, 48, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  
  --primary: #6366F1;
  --primary-light: #818CF8;
  --secondary: #06B6D4;
  --accent: #A855F7;
  --online: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;
  
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --font-family: 'Spline Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --shadow-glow: 0 0 40px -10px rgba(99, 102, 241, 0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
input,
button,
select,
textarea,
table,
th,
td,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
div,
a,
label {
  font-family: var(--font-family);
}

/* Explicitly preserve and enforce FontAwesome icon font */
.fa,
.fas,
.far,
.fab,
.fa-solid,
.fa-regular,
.fa-brands,
[class*="fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
}

.fa-brands {
  font-family: "Font Awesome 6 Brands" !important;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Radial Glow */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
  top: -200px;
  left: -200px;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12), transparent 70%);
  bottom: -100px;
  right: -100px;
}

/* 1. Admin Login Gate Screen */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 10;
}

.login-card {
  background: rgba(22, 27, 34, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  text-align: center;
  animation: loginIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-logo-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  margin: 0 auto 18px;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.5);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 24px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.input-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field-wrap i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.input-field-wrap input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  background: rgba(11, 15, 23, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.input-field-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.login-error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.btn-block {
  width: 100%;
  justify-content: center;
  padding: 13px;
  font-size: 14.5px;
  margin-top: 6px;
}

.login-footer-hint {
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* 2. Main Dashboard Application */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 50px;
}

.hidden {
  display: none !important;
}

/* Navigation */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #fff;
}

.brand-title span {
  font-weight: 400;
  color: var(--secondary);
  font-size: 14px;
  letter-spacing: 1px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--online);
}

.status-pill.connecting {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* Stats Section */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.stat-card.highlight {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(6, 182, 212, 0.05));
}

.stat-card.highlight-sms {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(239, 68, 68, 0.05));
}

.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.user-icon { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.contact-icon { background: rgba(6, 182, 212, 0.15); color: var(--secondary); }
.sms-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.message-icon { background: rgba(168, 85, 247, 0.15); color: var(--accent); }
.online-icon { background: rgba(16, 185, 129, 0.15); color: var(--online); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin: 4px 0 2px;
}

.stat-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Main Content */
.main-content {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.content-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.title-wrap h3 {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-wrap h3 i {
  color: var(--primary-light);
}

.title-wrap p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.controls-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  position: relative;
  width: 280px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: rgba(11, 15, 23, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.data-table tbody tr {
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
  border-radius: var(--radius-md);
}

.data-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.08);
  transform: scale(1.002);
}

.data-table td {
  padding: 16px;
  font-size: 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.data-table td:first-child {
  border-left: 1px solid var(--border);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.data-table td:last-child {
  border-right: 1px solid var(--border);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.user-name-tag {
  font-weight: 700;
  color: #fff;
  font-size: 14.5px;
}

.mono-tag {
  font-size: 12.5px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.12);
  color: var(--secondary);
  border: 1px solid rgba(6, 182, 212, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.count-badge:hover {
  background: rgba(6, 182, 212, 0.25);
  transform: translateY(-1px);
}

.sms-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  cursor: pointer;
  transition: all 0.2s;
}

.sms-count-badge:hover {
  background: rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}

.badge-inbox {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-sent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--online);
}

.badge-offline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Pagination Wrap */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-indicator {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--error);
  color: #fff;
}

.btn-action {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.actions-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: #111722;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 18px;
}

.modal-title-group h4 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
}

.btn-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-search {
  position: relative;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.modal-search i {
  position: absolute;
  left: 38px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.modal-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13.5px;
  outline: none;
}

.modal-search input:focus {
  border-color: var(--primary);
}

.modal-body {
  padding: 16px 24px;
  overflow-y: auto;
  flex: 1;
}

/* Delete Card Modal */
.delete-card {
  max-width: 460px;
  text-align: center;
  padding: 28px 24px;
}

.delete-icon-box {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.delete-title {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.delete-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.delete-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1E2638;
  border: 1px solid var(--border-hover);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-state {
  text-align: center;
  padding: 48px 16px !important;
  color: var(--text-secondary);
}

.loading-state span {
  display: block;
  margin-top: 12px;
  font-size: 13.5px;
}

.footer {
  margin-top: 36px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.text-right {
  text-align: right;
}

@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  .nav-status {
    width: 100%;
    justify-content: space-between;
  }
  .search-box {
    width: 100%;
  }
  .controls-wrap {
    width: 100%;
  }
  .pagination-wrap {
    flex-direction: column;
    align-items: center;
  }
}

/* ==========================================================================
   @teenboy Dedicated Live Chatbot & Messenger Console
   ========================================================================== */

/* Floating Launcher Pill */
.chatbot-floating-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 998;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.45), 0 0 20px rgba(139, 92, 246, 0.35);
  cursor: pointer;
  backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.chatbot-floating-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.6), 0 0 25px rgba(139, 92, 246, 0.5);
}

.chatbot-launcher-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
}

.chatbot-online-pulse {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px #10b981;
}

.chatbot-launcher-text {
  display: flex;
  flex-direction: column;
}

.chatbot-launcher-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.chatbot-launcher-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.chatbot-unread-pill {
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 4px;
}

/* Chatbot Floating Window */
.chatbot-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 460px;
  height: 620px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 36px);
  background: rgba(13, 20, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  z-index: 999;
  overflow: hidden;
  animation: chatbotSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: width 0.25s ease, height 0.25s ease, transform 0.25s ease;
}

.chatbot-window.minimized {
  height: 56px !important;
  width: 290px !important;
  overflow: hidden;
}

.chatbot-window.expanded {
  width: 880px !important;
  height: 85vh !important;
  right: calc(50vw - 440px) !important;
  bottom: 5vh !important;
}

@keyframes chatbotSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Messenger Container */
.chatbot-split-layout {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* In standard compact mode: Inbox and Thread alternate */
.chatbot-window:not(.expanded) .chatbot-sidebar {
  width: 100%;
  flex: 1;
}

.chatbot-window:not(.expanded) .chatbot-chat-canvas {
  width: 100%;
  flex: 1;
}

/* Screen state switching */
.chatbot-window:not(.expanded).show-thread .chatbot-sidebar {
  display: none;
}

.chatbot-window:not(.expanded).show-inbox .chatbot-chat-canvas {
  display: none;
}

/* In expanded mode: Dual Pane Side-by-Side */
.chatbot-window.expanded .chatbot-sidebar {
  width: 320px;
  display: flex !important;
  border-right: 1px solid var(--border);
}

.chatbot-window.expanded .chatbot-chat-canvas {
  flex: 1;
  display: flex !important;
}

.chatbot-window.expanded .chatbot-back-btn {
  display: none;
}

/* Left Sidebar / Inbox View */
.chatbot-sidebar {
  background: rgba(10, 15, 28, 0.85);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
}

.chatbot-sidebar-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 20, 36, 0.9);
}

.chatbot-sidebar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-me-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-me-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.chatbot-me-text {
  display: flex;
  flex-direction: column;
}

.chatbot-me-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.chatbot-me-badge {
  font-size: 11px;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.chatbot-me-badge .status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.chatbot-sidebar-search {
  padding: 12px 16px;
  position: relative;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 15, 28, 0.5);
}

.chatbot-sidebar-search i {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12.5px;
}

.chatbot-sidebar-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 14px 8px 34px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.chatbot-sidebar-search input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.chatbot-convs-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chatbot-convs-list::-webkit-scrollbar {
  width: 4px;
}

.chatbot-convs-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.chatbot-sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
  gap: 8px;
}

.chatbot-sidebar-empty i {
  font-size: 30px;
  color: rgba(99, 102, 241, 0.4);
}

.chatbot-sidebar-empty p {
  font-size: 12.5px;
}

/* Conversation Card (Messenger Style) */
.chatbot-conv-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  position: relative;
  border: 1px solid transparent;
}

.chatbot-conv-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.chatbot-conv-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.15));
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.18);
}

.chatbot-conv-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #334155, #475569);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chatbot-conv-item.active .chatbot-conv-avatar {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.chatbot-conv-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #64748b;
  border: 2px solid #0d1424;
}

.chatbot-conv-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.chatbot-conv-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chatbot-conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-conv-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-conv-time {
  font-size: 11px;
  color: var(--text-muted);
}

.chatbot-conv-snippet {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

/* Right Chat Canvas (Thread View) */
.chatbot-chat-canvas {
  display: flex;
  flex-direction: column;
  background: rgba(13, 20, 36, 0.98);
  min-width: 0;
  height: 100%;
}

/* Top Canvas Header */
.chatbot-canvas-header {
  padding: 12px 16px;
  background: rgba(10, 15, 28, 0.9);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbot-current-partner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chatbot-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.chatbot-back-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  border-color: var(--primary);
  transform: scale(1.05);
}

.chatbot-partner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14.5px;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.chatbot-partner-info {
  display: flex;
  flex-direction: column;
}

.chatbot-partner-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.chatbot-partner-status {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.chatbot-partner-status.online {
  color: #10b981;
}

.chatbot-partner-status.online .status-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.chatbot-partner-status .status-dot.offline {
  background: #64748b;
  box-shadow: none;
}

.chatbot-canvas-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chatbot-canvas-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.chatbot-canvas-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: var(--primary);
}

.chatbot-btn-ctrl {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s;
}

.chatbot-btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Chatbot Messages Canvas */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

.chatbot-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: 30px;
}

.chatbot-empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  color: rgba(99, 102, 241, 0.4);
}

.chatbot-empty-state p {
  font-size: 13px;
  line-height: 1.5;
}

/* Message Bubble Styling */
.chat-row {
  display: flex;
  width: 100%;
}

.chat-row.sent {
  justify-content: flex-end;
}

.chat-row.received {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 76%;
  padding: 9px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
}

.chat-bubble.sent {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.chat-bubble.received {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.85;
}

.chat-bubble.received .chat-meta {
  justify-content: flex-start;
  color: var(--text-muted);
}

/* Telegram / WhatsApp Style Read Receipts */
.chat-receipt {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
  font-size: 11px;
}

.chat-receipt.sending {
  color: #94a3b8;
  animation: receiptSpin 1.2s infinite linear;
}

.chat-receipt.sent {
  color: #cbd5e1;
}

.chat-receipt.delivered {
  color: #cbd5e1;
}

.chat-receipt.read {
  color: #38bdf8;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.7);
}

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

.chat-img-thumb {
  max-width: 100%;
  border-radius: 10px;
  margin-top: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}

.chat-img-thumb:hover {
  transform: scale(1.02);
}

/* Quick Response Chips */
.chatbot-quick-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(10, 15, 28, 0.5);
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chatbot-quick-chips::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: #cbd5e1;
  padding: 4px 11px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.quick-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

/* Typing Indicator */
.chatbot-typing {
  padding: 6px 18px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.15);
}

.typing-dots span {
  animation: typingDot 1.4s infinite;
  opacity: 0;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* Chatbot Input Footer */
.chatbot-input-bar {
  padding: 10px 16px;
  background: rgba(10, 15, 28, 0.95);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot-input-bar input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.chatbot-input-bar input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.chatbot-attach-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chatbot-attach-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  color: #fff;
  transform: scale(1.06);
}

.chatbot-send-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.chatbot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 580px) {
  .chatbot-window {
    width: calc(100vw - 16px) !important;
    right: 8px !important;
    bottom: 8px !important;
    height: 85vh !important;
  }
}


