/* =========================================================
   OMNIWA SENTINEL - MODERN EXECUTIVE DESIGN SYSTEM
   ========================================================= */

:root {
  --bg-app: #090e11;
  --bg-sidebar: #111b21;
  --bg-header: #111b21;
  --bg-card: #182229;
  --bg-card-hover: #202c33;
  --bg-input: #111b21;
  --bg-bubble-in: #202c33;
  --bg-bubble-out: #005c4b;
  --border-subtle: #222e35;
  --border-focus: #00a884;

  --text-primary: #e9edef;
  --text-secondary: #8696a0;
  --text-muted: #667781;

  --emerald: #00a884;
  --emerald-dark: #008069;
  --emerald-glow: rgba(0, 168, 132, 0.2);
  --cyan: #38bdf8;
  --amber: #f59e0b;
  --ruby: #ef4444;
  --purple: #a855f7;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html, body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 14px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------------------------------------------------------
   HEADER
   --------------------------------------------------------- */
/* ---------------------------------------------------------
   HEADER - SLEEK EXECUTIVE NAVIGATION BAR
   --------------------------------------------------------- */
.app-header {
  height: 64px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  flex-shrink: 0;
  z-index: 10;
  gap: 10px;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow: hidden;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  position: relative;
  box-shadow: 0 4px 12px var(--emerald-glow);
  flex-shrink: 0;
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.3);
  flex-shrink: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.auth-logo-img {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  margin: 0 auto 14px;
  display: block;
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.empty-logo-img {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: contain;
  background: #ffffff;
  padding: 6px;
  margin: 0 auto 16px;
  display: block;
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: float-logo 3.5s ease-in-out infinite alternate;
}

@keyframes float-logo {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-6px); }
}

.shield-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  background: #111b21;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  color: var(--cyan);
}

.brand-text h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-text h2 span {
  color: var(--emerald);
}

.brand-text p {
  display: none; /* Keep header brand ultra-clean & prevent layout collision */
}

.connection-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 168, 132, 0.1);
  border: 1px solid rgba(0, 168, 132, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--emerald);
  white-space: nowrap;
  flex-shrink: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

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

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  height: 32px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.stat-badge:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

.stat-badge i {
  font-size: 0.88rem;
  flex-shrink: 0;
}

.stat-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.stat-lbl {
  display: none; /* Hide text label so micro-pills never collide or bleed */
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

@media (min-width: 1750px) {
  .stat-lbl {
    display: inline;
  }
}

@media (max-width: 1150px) {
  #topStatWabaContainer {
    display: none;
  }
}

@media (max-width: 1050px) {
  #topStatGDriveContainer {
    display: none;
  }
  .connection-status-pill span#wsStatusText {
    display: none;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Company Badge */
.company-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--cyan);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  max-width: 380px; /* Leluasa: Nama perusahaan lengkap tampil utuh tanpa terpotong */
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

/* User Profile Badge */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.user-profile-badge:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
}

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

.user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  max-width: 220px; /* Nama pengguna lengkap */
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--emerald);
  white-space: nowrap;
  max-width: 240px; /* Role lengkap */
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 5px;
  border-radius: 4px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  color: var(--ruby);
  background: rgba(239, 68, 68, 0.15);
}

/* ---------------------------------------------------------
   APP LAYOUT & SIDEBAR
   --------------------------------------------------------- */
.app-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
  width: 100%;
  max-width: 100vw;
  min-width: 0;
}

.app-sidebar {
  width: 215px;
  min-width: 200px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 10px;
  flex-shrink: 0;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), padding 0.2s ease;
}

.app-sidebar.collapsed {
  width: 66px;
  min-width: 66px;
  padding: 14px 6px;
}

.app-sidebar.collapsed .nav-item span:not(.nav-badge),
.app-sidebar.collapsed .sidebar-footer-card {
  display: none !important;
}

.app-sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 11px 0;
  gap: 0;
}

.app-sidebar.collapsed .nav-item i {
  margin: 0;
  font-size: 1.25rem;
  width: auto;
}

.app-sidebar.collapsed .nav-item .nav-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.62rem;
  padding: 1px 4px;
  min-width: 14px;
  height: 14px;
  line-height: 12px;
}

.app-sidebar.collapsed .nav-item .nav-pill {
  display: none !important;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  width: 100%;
  position: relative;
}

.nav-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 168, 132, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(0, 168, 132, 0.3);
}

.nav-pill {
  margin-left: auto;
  background: var(--bg-app);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nav-badge {
  margin-left: auto;
  background: var(--emerald);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.nav-badge.alert {
  background: var(--ruby);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.sidebar-footer-card {
  background: rgba(0, 168, 132, 0.05);
  border: 1px dashed rgba(0, 168, 132, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-header-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--emerald);
}

.status-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: rgba(0, 168, 132, 0.2);
  border-radius: var(--radius-sm);
  color: var(--emerald);
}

.sidebar-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Sidebar Bottom Expand/Collapse Button */
.sidebar-collapse-wrapper {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.btn-sidebar-collapse {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.app-sidebar.collapsed .sidebar-collapse-wrapper {
  padding-top: 8px;
}

.app-sidebar.collapsed .btn-sidebar-collapse {
  justify-content: center;
  padding: 9px 0;
  gap: 0;
}

.app-sidebar.collapsed .btn-sidebar-collapse span {
  display: none !important;
}

.app-sidebar.collapsed .btn-sidebar-collapse i {
  font-size: 1rem;
}

/* ---------------------------------------------------------
   MAIN WORKSPACE & TABS
   --------------------------------------------------------- */
.app-main {
  flex: 1;
  background: var(--bg-app);
  overflow: hidden;
  position: relative;
  min-width: 0;
  width: 100%;
}

.tab-content {
  display: none;
  height: 100%;
  overflow-y: auto;
  min-width: 0;
  width: 100%;
}

.tab-content.active {
  display: block;
}

.section-container {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header-bar h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.section-header-bar p {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* ---------------------------------------------------------
   1. INBOX MONITOR STYLES
   --------------------------------------------------------- */
.inbox-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.inbox-filter-bar {
  height: 52px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filter-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  flex: 1;
  min-width: 0;
  max-width: 450px;
}

.search-input-wrapper i {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.search-input-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
  min-width: 0;
}

.filter-toggle {
  flex-shrink: 0;
}

.inbox-split-view {
  display: flex;
  flex: 1;
  height: calc(100% - 52px);
  overflow: hidden;
  min-width: 0;
  width: 100%;
}

.chat-list-panel {
  width: 480px;
  min-width: 440px;
  max-width: 580px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-list-header {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.chat-items-scroll {
  flex: 1;
  overflow-y: auto;
}

.chat-item-row {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.chat-item-row:hover {
  background: var(--bg-card);
}

.chat-item-row.active {
  background: rgba(0, 168, 132, 0.12);
  border-left: 4px solid var(--emerald);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  background: #233138;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--cyan);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.chat-row-info {
  flex: 1;
  min-width: 0;
}

.chat-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.chat-row-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.chat-row-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

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

.chat-row-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.chat-staff-badge {
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.unread-badge-pill {
  background: var(--emerald);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.chat-stream-panel {
  flex: 1;
  background: #080d10;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

.stream-header {
  min-height: 60px;
  height: auto;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  gap: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.stream-contact-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.contact-header-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
  max-width: 100%;
}

.contact-header-top h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  flex-shrink: 1;
}

.contact-header-top .btn-edit-name {
  padding: 2px 4px;
  font-size: 0.82rem;
  color: var(--cyan);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.contact-header-top .btn-edit-name:hover {
  opacity: 1;
}

.contact-header-bottom p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.contact-avatar {
  width: 44px;
  height: 44px;
  background: var(--emerald-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.messages-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: radial-gradient(circle at center, rgba(32, 44, 51, 0.25) 0%, transparent 80%);
}

/* Top Chat History Pagination & Fetch Bar */
.chat-top-history-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 16px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.chat-top-history-bar.is-complete {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.25);
}

.top-history-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.top-history-info strong {
  color: var(--text-main);
  font-weight: 600;
}

.top-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-top-history {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: var(--cyan);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-top-history:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: var(--cyan);
  transform: translateY(-1px);
}

.btn-top-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-top-phone:hover {
  background: rgba(0, 168, 132, 0.15);
  border-color: var(--emerald);
  color: var(--emerald);
  transform: translateY(-1px);
}

body.theme-light .chat-top-history-bar {
  background: #f8fafc;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.theme-light .btn-top-phone {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.theme-light .btn-top-phone:hover {
  background: #f1f5f9;
  border-color: #00a884;
  color: #008069;
}


.empty-conversation {
  margin: auto;
  text-align: center;
  max-width: 360px;
  color: var(--text-muted);
}

.empty-conversation .icon-circle {
  width: 70px;
  height: 70px;
  background: rgba(0, 168, 132, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--emerald);
  margin: 0 auto 16px;
}

.empty-conversation h3 {
  color: #fff;
  margin-bottom: 6px;
}

.empty-conversation p {
  font-size: 0.85rem;
  line-height: 1.4;
}

/* Shared Omnichannel Chat Reply Bar */
.chat-reply-bar {
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.reply-bar-channel-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 168, 132, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(0, 168, 132, 0.25);
  flex-shrink: 0;
}

.channel-badge.waba {
  background: rgba(6, 182, 212, 0.12);
  color: var(--cyan);
  border-color: rgba(6, 182, 212, 0.3);
}

.reply-tip {
  color: var(--text-muted);
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.reply-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.reply-input-wrapper textarea {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  resize: none;
  min-height: 40px;
  max-height: 120px;
  line-height: 1.4;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.reply-input-wrapper textarea:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 2px var(--emerald-glow);
}

.btn-reply-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reply-send:hover {
  transform: scale(1.04);
}

/* Chat Message Bubbles */
.chat-bubble {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.chat-bubble.inbound {
  align-self: flex-start;
  background: var(--bg-bubble-in);
  border-bottom-left-radius: 2px;
}

.chat-bubble.outbound {
  align-self: flex-end;
  background: var(--bg-bubble-out);
  border-bottom-right-radius: 2px;
}

.chat-bubble.flagged {
  border: 1px solid var(--ruby);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.bubble-sender {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan);
  margin-bottom: 4px;
}

.bubble-text {
  color: var(--text-primary);
}

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 6px;
}

.flag-pill {
  background: var(--ruby);
  color: #fff;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
}

.media-image-preview {
  max-width: 320px;
  max-height: 280px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.media-image-preview:hover {
  transform: scale(1.02);
}

.media-doc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--cyan);
  font-weight: 600;
  margin-top: 6px;
}

/* ---------------------------------------------------------
   2. DEVICE MANAGER CARDS
   --------------------------------------------------------- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.device-card:hover {
  border-color: rgba(0, 168, 132, 0.4);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.device-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.device-avatar {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f2c34, #2a3942);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--emerald);
  font-weight: 700;
}

.device-card-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.device-card-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.device-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
}

.device-metric-item {
  display: flex;
  flex-direction: column;
}

.metric-k {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.metric-v {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.device-card-actions {
  display: flex;
  gap: 8px;
}

/* ---------------------------------------------------------
   3. BACKUP & GOOGLE DRIVE HUB
   --------------------------------------------------------- */
.backup-status-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.card-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.bg-emerald-light { background: rgba(0, 168, 132, 0.15); }
.bg-cyan-light { background: rgba(56, 189, 248, 0.15); }
.bg-amber-light { background: rgba(245, 158, 11, 0.15); }
.bg-ruby-light { background: rgba(239, 68, 68, 0.15); }
.bg-purple-light { background: rgba(168, 85, 247, 0.15); }

.card-info {
  flex: 1;
}

.card-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.card-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 2px 0;
}

.card-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.backup-tables-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.table-responsive {
  max-height: 440px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ---------------------------------------------------------
   4. WATCHDOG & ALERTS STYLES
   --------------------------------------------------------- */
.watchdog-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}

.alerts-stream {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 600px;
  overflow-y: auto;
}

.alert-card-item {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition-fast);
}

.alert-card-item.read {
  opacity: 0.65;
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-subtle);
}

.alert-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-rule-tag {
  background: var(--ruby);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.alert-snippet {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  border-left: 3px solid var(--ruby);
  font-style: italic;
}

.rules-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 600px;
  overflow-y: auto;
}

.rule-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

/* ---------------------------------------------------------
   5. ANALYTICS STYLES
   --------------------------------------------------------- */
.analytics-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.metric-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.metric-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.metric-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------------------------------------------------------
   6. SETTINGS & FORM STYLES
   --------------------------------------------------------- */
.settings-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.card-body {
  padding: 20px;
}

.settings-help-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition-fast);
  box-sizing: border-box;
}

/* Radio & Checkbox reset */
.form-group input[type="radio"],
.form-group input[type="checkbox"] {
  width: auto;
  padding: 0;
  margin: 0;
  cursor: pointer;
  accent-color: var(--emerald);
}

/* Storage Option Cards */
.storage-option-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.storage-option-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.storage-option-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.storage-option-card.active {
  background: rgba(0, 168, 132, 0.08);
  border-color: var(--emerald);
  box-shadow: 0 0 16px rgba(0, 168, 132, 0.15);
}

.storage-option-card input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  margin-top: 3px;
  flex-shrink: 0;
}

.storage-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.storage-card-content {
  flex: 1;
}

.storage-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.storage-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
}

.storage-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.form-group textarea {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.setup-guide {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.setup-guide summary {
  font-weight: 600;
  color: var(--cyan);
  cursor: pointer;
  font-size: 0.85rem;
}

.guide-steps {
  padding-top: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.guide-steps ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-steps a {
  color: var(--cyan);
  text-decoration: underline;
}

/* ---------------------------------------------------------
   BUTTONS & COMMON UI
   --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  text-decoration: none;
}

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

.btn-xs {
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--emerald);
  color: #fff;
}
.btn-primary:hover {
  background: var(--emerald-dark);
  box-shadow: 0 4px 12px var(--emerald-glow);
}

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

.btn-outline-emerald {
  background: transparent;
  color: var(--emerald);
  border: 1px solid var(--emerald);
}
.btn-outline-emerald:hover {
  background: rgba(0, 168, 132, 0.1);
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.15);
  color: var(--ruby);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-danger-sm:hover {
  background: var(--ruby);
  color: #fff;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px;
}
.btn-icon:hover {
  color: #fff;
}

.btn-text-action {
  background: transparent;
  border: none;
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

/* Badge Status Styles */
.badge-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-status.online { background: rgba(0, 168, 132, 0.15); color: var(--emerald); }
.badge-status.offline { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.badge-status.connecting { background: rgba(245, 158, 11, 0.15); color: var(--amber); }

/* Checkbox Container */
.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
}
.checkbox-container input {
  display: none;
}
.checkmark {
  width: 16px;
  height: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  display: inline-block;
  position: relative;
}
.checkbox-container input:checked ~ .checkmark {
  background: var(--emerald);
  border-color: var(--emerald);
}
.checkbox-container input:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------------------------------------------------------
   MODALS & TOAST NOTIFICATIONS
   --------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease-out;
  overflow: hidden;
  margin: auto;
}

.modal-dialog.modal-qr {
  max-width: 420px;
}

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

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

.modal-header h3 {
  font-size: 1.05rem;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #fff; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  max-height: 100%;
  box-sizing: border-box;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.qr-box-wrapper {
  width: 250px;
  height: 250px;
  background: #fff;
  border-radius: var(--radius-md);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.qr-box-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-loading-spinner {
  color: #111;
  font-size: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.qr-loading-spinner p {
  font-size: 0.8rem;
  color: #555;
}

.qr-instruction-steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.step-num {
  width: 20px;
  height: 20px;
  background: rgba(0, 168, 132, 0.2);
  color: var(--emerald);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
}

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

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  animation: toastIn 0.3s ease;
  min-width: 280px;
}

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

.toast.success { border-left: 4px solid var(--emerald); }
.toast.error { border-left: 4px solid var(--ruby); }
.toast.info { border-left: 4px solid var(--cyan); }

/* Color utilities */
.text-emerald { color: var(--emerald) !important; }
.text-cyan { color: var(--cyan) !important; }
.text-amber { color: var(--amber) !important; }
.text-ruby { color: var(--ruby) !important; }
.text-purple { color: var(--purple) !important; }
.text-center { text-align: center; }

/* ==========================================
   AUTHENTICATION & USER PROFILE STYLES
========================================== */

/* Auth Lock Body */
body.auth-locked {
  overflow: hidden;
}

/* User Profile Badge in Header */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-full);
  margin-left: 8px;
}

.user-profile-badge .user-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--cyan), #0284c7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
}

.user-profile-badge .user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.user-profile-badge .user-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.user-profile-badge .user-role {
  font-size: 0.65rem;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.btn-logout:hover {
  color: var(--ruby);
  background: rgba(239, 68, 68, 0.1);
}

/* Auth Modal Overlay */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 8, 11, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeInAuth 0.35s ease;
}

@keyframes fadeInAuth {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, rgba(17, 27, 33, 0.95), rgba(11, 20, 26, 0.98));
  border: 1px solid rgba(0, 168, 132, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 168, 132, 0.15);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  animation: slideUpAuth 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--emerald), var(--cyan), var(--emerald));
}

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

.auth-header {
  text-align: center;
  margin-bottom: 26px;
}

.auth-logo {
  display: inline-flex;
  position: relative;
  font-size: 2.8rem;
  color: var(--emerald);
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px rgba(0, 168, 132, 0.4));
}

.auth-logo .shield-badge {
  position: absolute;
  bottom: -4px;
  right: -8px;
  font-size: 1.2rem;
  color: var(--cyan);
}

.auth-header h2,
.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff !important;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.auth-header h2 span,
.auth-title span {
  color: var(--emerald, #00a884) !important;
  text-shadow: 0 0 16px rgba(0, 168, 132, 0.5);
}

.auth-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-alert {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--ruby);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: shakeAuth 0.3s ease;
}

@keyframes shakeAuth {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.auth-form .form-group {
  margin-bottom: 18px;
}

.auth-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.auth-form input {
  width: 100%;
  background: var(--bg-input) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 14px !important;
  color: #fff !important;
  font-size: 0.9rem !important;
  outline: none;
  transition: var(--transition-fast);
  box-sizing: border-box;
}

.auth-form input:focus {
  border-color: var(--emerald) !important;
  box-shadow: 0 0 0 3px var(--emerald-glow) !important;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 42px !important;
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  transition: color 0.2s ease;
  z-index: 2;
}

.btn-toggle-pwd:hover {
  color: #fff;
}

.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus,
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0px 1000px #0b141a inset !important;
  box-shadow: 0 0 0px 1000px #0b141a inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

.auth-meta {
  margin-bottom: 22px;
}

.default-cred-pill {
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  color: var(--amber);
  font-size: 0.76rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-login {
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 18px rgba(0, 168, 132, 0.35);
}

.btn-login:hover {
  box-shadow: 0 6px 24px rgba(0, 168, 132, 0.5);
  transform: translateY(-1px);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.security-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* =========================================================
   WHATSAPP BUSINESS CLOUD API & BROADCAST STYLES
   ========================================================= */

.bcast-header-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.bcast-waba-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.waba-avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #00a884, #005c4b);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 168, 132, 0.3);
}

.waba-avatar .verified-check {
  position: absolute;
  bottom: -3px;
  right: -3px;
  background: #111b21;
  border-radius: 50%;
  color: var(--emerald);
  font-size: 0.9rem;
}

.waba-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.waba-title-row h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.badge-tier {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: var(--purple);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.bcast-subnav {
  display: flex;
  gap: 8px;
}

.bcast-subnav-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.bcast-subnav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.bcast-subnav-btn.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
  box-shadow: 0 4px 14px var(--emerald-glow);
}

.bcast-subtab-view {
  display: none;
}

.bcast-subtab-view.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* Creator Grid (Split view of form vs phone) */
.bcast-creator-grid {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1200px) {
  .bcast-creator-grid {
    grid-template-columns: 1fr;
  }
}

.bcast-form-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-step-card {
  padding: 20px;
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.step-badge {
  width: 28px;
  height: 28px;
  background: rgba(0, 168, 132, 0.15);
  border: 1px solid var(--emerald);
  color: var(--emerald);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.form-sub-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.audience-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.audience-stats-chips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.chip-emerald {
  background: rgba(0, 168, 132, 0.12);
  border: 1px solid rgba(0, 168, 132, 0.3);
  color: var(--emerald);
}

.chip-ruby {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--ruby);
}

.chip-amber {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber);
}

/* Message Type Selector */
.message-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .message-type-selector {
    grid-template-columns: 1fr;
  }
}

.type-option {
  position: relative;
  cursor: pointer;
}

.type-option input {
  position: absolute;
  opacity: 0;
}

.option-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: var(--transition-fast);
}

.option-content i {
  font-size: 1.3rem;
  margin-top: 2px;
}

.option-content strong {
  display: block;
  font-size: 0.88rem;
  color: #fff;
  margin-bottom: 2px;
}

.option-content span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.type-option input:checked + .option-content {
  background: rgba(0, 168, 132, 0.08);
  border-color: var(--emerald);
  box-shadow: 0 0 0 1px var(--emerald);
}

.tag-inserters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag-inserters span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-tag {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-tag:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--cyan);
}

.bcast-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  gap: 12px;
}

/* =========================================================
   SMARTPHONE MOCKUP PREVIEW
   ========================================================= */

.bcast-preview-panel {
  position: sticky;
  top: 10px;
}

.phone-mockup-wrapper {
  display: flex;
  justify-content: center;
}

.phone-mockup-frame {
  width: 360px;
  background: #0b141a;
  border: 8px solid #2a3942;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  position: relative;
}

.phone-notch {
  height: 24px;
  background: #2a3942;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  width: 140px;
  margin: 0 auto;
}

.notch-camera {
  width: 8px;
  height: 8px;
  background: #111b21;
  border-radius: 50%;
}

.notch-speaker {
  width: 40px;
  height: 4px;
  background: #111b21;
  border-radius: 2px;
}

.phone-wa-header {
  background: #1f2c34;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #aebac1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wa-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wa-contact-pic {
  width: 32px;
  height: 32px;
  background: var(--emerald);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
}

.wa-contact-info {
  display: flex;
  flex-direction: column;
}

.wa-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #e9edef;
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-status {
  font-size: 0.65rem;
  color: #8696a0;
}

.wa-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
}

.phone-screen-body {
  height: 450px;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 16px 16px;
  padding: 14px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-encryption-pill {
  background: rgba(24, 34, 41, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #ffe600;
  font-size: 0.65rem;
  padding: 6px 10px;
  border-radius: 8px;
  text-align: center;
  line-height: 1.3;
}

.wa-preview-bubble {
  max-width: 90%;
  background: #005c4b;
  color: #e9edef;
  border-radius: 12px 12px 12px 0;
  padding: 8px 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  align-self: flex-start;
  position: relative;
  word-wrap: break-word;
}

.bubble-media-header {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}

.bubble-media-header img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  display: block;
}

.mockup-doc-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
}

.bubble-text-header {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.bubble-text-body {
  font-size: 0.8rem;
  line-height: 1.35;
  color: #e9edef;
}

.bubble-text-body code {
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.75rem;
}

.bubble-text-footer {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 6px;
}

.bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.6);
}

.bubble-buttons-container {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
}

.mockup-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--cyan);
  padding: 6px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.phone-bottom-bar {
  height: 16px;
  background: #111b21;
}

/* Progress bar */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.btn-group-sm {
  display: flex;
  gap: 4px;
}

.modal-lg {
  max-width: 800px;
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 440px;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #111b21;
  color: #e9edef;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.88rem;
  line-height: 1.4;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
  border-left: 4px solid #00a884;
}

.toast.error {
  border-left: 4px solid #ea0038;
}

.toast.info {
  border-left: 4px solid #00b4d8;
}

.toast.warning {
  border-left: 4px solid #f59e0b;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================================================
   WHATSAPP TEMPLATE STUDIO (META BUILDER)
   ========================================================= */

.template-builder-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.category-card-option {
  cursor: pointer;
}

.category-card-option input {
  display: none;
}

.category-card-inner {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition-fast);
  height: 100%;
}

.category-card-inner i {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.category-card-inner strong {
  color: #fff;
  font-size: 0.9rem;
}

.category-card-inner span {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.category-card-option input:checked + .category-card-inner {
  border-color: var(--emerald);
  background: rgba(0, 168, 132, 0.1);
  box-shadow: 0 0 0 1px var(--emerald);
}

.header-type-selector-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.header-type-pill {
  cursor: pointer;
}

.header-type-pill input {
  display: none;
}

.header-type-pill span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.header-type-pill input:checked + span {
  background: var(--emerald);
  color: #fff;
  border-color: var(--emerald);
  box-shadow: 0 2px 10px var(--emerald-glow);
}

.builder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
  gap: 8px;
}

.builder-textarea {
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
}

.button-builder-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.guideline-card {
  background: linear-gradient(145deg, #111b21 0%, #182229 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-top: 20px;
}

.guideline-card h4 {
  font-size: 0.88rem;
  color: var(--emerald);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.guideline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guideline-list li {
  font-size: 0.76rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}

.guideline-list li i {
  color: var(--emerald);
  margin-top: 2px;
  font-size: 0.8rem;
  flex-shrink: 0;
}

@media (max-width: 1080px) {
  .template-builder-grid {
    grid-template-columns: 1fr;
  }
  .bcast-preview-panel {
    position: static;
  }
}

/* =========================================================
   AUDIENCE GROUPS & RECIPIENTS MANAGER STYLES
   ========================================================= */
.audience-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.audience-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.audience-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 168, 132, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.audience-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.audience-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.audience-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 4px;
}

.audience-card-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.audience-stat-item {
  display: flex;
  flex-direction: column;
}

.audience-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audience-stat-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--emerald);
}

.audience-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.audience-source-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.audience-source-btn {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.audience-source-btn.active {
  background: var(--bg-card-hover);
  color: var(--emerald);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Multi-Tenant Auth Tabs & Badges */
.auth-tab-btn {
  transition: all 0.2s ease;
}
.auth-tab-btn:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.08) !important;
}
.auth-tab-btn.active {
  background: var(--bg-card-hover) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.auth-tab-btn.active[data-tab="superadmin"] {
  color: var(--amber) !important;
  background: rgba(245, 158, 11, 0.15) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.chip-superadmin {
  color: var(--amber) !important;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.pulse-badge {
  animation: pulseAmber 1.5s infinite;
}

@keyframes pulseAmber {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.85; color: #f59e0b; }
  100% { transform: scale(1); opacity: 1; }
}

.sa-filter-btn {
  transition: all 0.2s ease;
}
.sa-filter-btn.active {
  background: var(--cyan) !important;
  color: #04080b !important;
  font-weight: 700 !important;
  border-color: var(--cyan) !important;
}
.sa-filter-btn.active[data-filter="pending"] {
  background: var(--amber) !important;
  color: #04080b !important;
  border-color: var(--amber) !important;
}

.btn-emerald {
  background: var(--emerald);
  color: #fff;
  border: 1px solid var(--emerald);
}
.btn-emerald:hover {
  background: var(--emerald-dark);
  color: #fff;
}

.btn-outline-emerald {
  background: transparent;
  color: var(--emerald);
  border: 1px solid var(--emerald);
}
.btn-outline-emerald:hover {
  background: rgba(16, 185, 129, 0.15);
}

.sa-mode-card {
  display: block;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.sa-mode-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}
.sa-mode-card.active-shared {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: var(--emerald) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}
.sa-mode-card.active-custom {
  background: rgba(6, 182, 212, 0.1) !important;
  border-color: var(--cyan) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
}

.btn-outline-ruby {
  background: transparent;
  color: var(--ruby);
  border: 1px solid var(--ruby);
}
.btn-outline-ruby:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* =========================================================
   THEME TOGGLE BUTTON
   ========================================================= */
.btn-theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.08);
}

/* =========================================================
   LIGHT THEME (TEMA WARNA CERAH / PUTIH BERSIH ALA WHATSAPP WEB)
   ========================================================= */
:root[data-theme="light"],
[data-theme="light"],
body.light-theme {
  --bg-app: #f0f2f5;
  --bg-sidebar: #ffffff;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  --bg-bubble-in: #ffffff;
  --bg-bubble-out: #d9fdd3;
  --border-subtle: #e2e8f0;
  --border-focus: #00a884;

  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #64748b;

  --emerald: #00a884;
  --emerald-dark: #008069;
  --emerald-glow: rgba(0, 168, 132, 0.15);
  --cyan: #0284c7;
  --amber: #d97706;
  --ruby: #dc2626;
  --purple: #7c3aed;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.12);
}

/* Base Body & Layout in Light Theme */
body.light-theme {
  background-color: var(--bg-app);
  color: var(--text-primary);
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme strong,
body.light-theme b {
  color: #111827 !important;
}

body.light-theme p {
  color: var(--text-secondary);
}

body.light-theme .text-muted {
  color: #64748b !important;
}

body.light-theme .text-secondary {
  color: #374151 !important;
}

/* App Header & Navbar */
body.light-theme .app-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .brand-text h2 {
  color: #111827 !important;
}

body.light-theme .brand-text h2 span {
  color: var(--emerald) !important;
}

body.light-theme .btn-theme-toggle {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #d97706 !important;
}

body.light-theme .btn-theme-toggle:hover {
  background: #e2e8f0 !important;
  color: #b45309 !important;
}

body.light-theme .stat-badge {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .stat-badge:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

body.light-theme .stat-val {
  color: #111827 !important;
}

body.light-theme .stat-lbl {
  color: #64748b !important;
}

body.light-theme .company-badge {
  background: rgba(2, 132, 199, 0.08) !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
  color: #0284c7 !important;
}

body.light-theme .user-profile-badge {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-theme .user-profile-badge:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

body.light-theme .user-name {
  color: #111827 !important;
}

body.light-theme .user-role {
  color: #008069 !important;
}

body.light-theme .btn-logout {
  color: #64748b !important;
}

body.light-theme .btn-logout:hover {
  color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.1) !important;
}

/* Left Sidebar Navigation */
body.light-theme .app-sidebar {
  background: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
}

body.light-theme .nav-item {
  color: #475569 !important;
}

body.light-theme .nav-item:hover {
  background: #f8fafc !important;
  color: #111827 !important;
}

body.light-theme .nav-item.active {
  background: rgba(0, 168, 132, 0.1) !important;
  color: #008069 !important;
  font-weight: 600 !important;
}

body.light-theme .nav-pill {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-theme .sidebar-footer-card {
  background: #f8fafc !important;
  border: 1px dashed #cbd5e1 !important;
}

body.light-theme .sidebar-footer-card .card-header-mini {
  color: #008069 !important;
}

body.light-theme .sidebar-footer-card .sidebar-desc {
  color: #64748b !important;
}

body.light-theme .sidebar-collapse-wrapper {
  border-top: 1px solid #e2e8f0 !important;
}

body.light-theme .btn-sidebar-collapse {
  background: #f8fafc !important;
  color: #64748b !important;
  border-color: #e2e8f0 !important;
}

body.light-theme .btn-sidebar-collapse:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Main Workspace */
body.light-theme .app-main {
  background: #f0f2f5 !important;
}

body.light-theme .section-header-bar h2 {
  color: #111827 !important;
}

body.light-theme .section-header-bar p {
  color: #4b5563 !important;
}

/* =========================================================
   LIVE CHAT MONITOR (INBOX) - LIGHT THEME
   ========================================================= */
body.light-theme .inbox-container {
  background: #ffffff !important;
}

body.light-theme .inbox-filter-bar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .inbox-filter-bar label {
  color: #374151 !important;
}

body.light-theme .inbox-filter-bar select,
body.light-theme .search-input-wrapper input {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-theme .search-input-wrapper {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-theme .search-input-wrapper i {
  color: #94a3b8 !important;
}

body.light-theme .search-input-wrapper input::placeholder {
  color: #94a3b8 !important;
}

body.light-theme .search-input-wrapper:focus-within {
  border-color: #00a884 !important;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.15) !important;
}

body.light-theme .filter-toggle label {
  color: #374151 !important;
}

body.light-theme .checkmark {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-theme .chat-list-panel {
  background: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
}

body.light-theme .chat-list-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .chat-list-header .section-title {
  color: #111827 !important;
}

body.light-theme .chat-list-header .section-title span {
  color: #008069 !important;
  font-weight: 700 !important;
}

body.light-theme .chat-list-header .btn-icon {
  color: #64748b !important;
}

body.light-theme .chat-list-header .btn-icon:hover {
  color: #111827 !important;
}

body.light-theme .inbox-status-tabs {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .status-tab {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-theme .status-tab:hover {
  background: #f1f5f9 !important;
  color: #111827 !important;
}

body.light-theme .status-tab.active {
  background: #00a884 !important;
  color: #ffffff !important;
  border-color: #00a884 !important;
}

body.light-theme .chat-item-row {
  border-bottom: 1px solid #f1f5f9 !important;
  background: #ffffff;
}

body.light-theme .chat-item-row:hover {
  background: #f8fafc !important;
}

body.light-theme .chat-item-row.active {
  background: #e7f7f3 !important;
  border-left: 4px solid #00a884 !important;
}

body.light-theme .chat-row-name {
  color: #111827 !important;
  font-weight: 600 !important;
}

body.light-theme .chat-row-time {
  color: #64748b !important;
}

body.light-theme .chat-row-preview {
  color: #4b5563 !important;
}

body.light-theme .chat-staff-badge {
  background: #e2e8f0 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-theme .chat-assignee-pill {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

body.light-theme .chat-assignee-pill.unassigned {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fde68a !important;
}

body.light-theme .chat-assignee-pill.resolved {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
}

body.light-theme .flag-pill {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1px solid #fca5a5 !important;
}

/* =========================================================
   CHAT STREAM PANEL & MESSAGE BUBBLES - LIGHT THEME
   ========================================================= */
body.light-theme .chat-stream-panel {
  background: #efeae2 !important;
}

body.light-theme .stream-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .contact-header-top h3 {
  color: #111827 !important;
  font-weight: 700 !important;
}

body.light-theme .contact-header-bottom p {
  color: #64748b !important;
}

body.light-theme .header-assignment-badge.assigned {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #7dd3fc !important;
}

body.light-theme .header-assignment-badge.unassigned {
  background: #fef3c7 !important;
  color: #92400e !important;
  border: 1px solid #fcd34d !important;
}

body.light-theme .header-assignment-badge.resolved {
  background: #dcfce7 !important;
  color: #166534 !important;
  border: 1px solid #86efac !important;
}

body.light-theme .handover-notes-banner {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
}

body.light-theme .handover-author {
  color: #92400e !important;
}

body.light-theme .handover-badge {
  background: #fef3c7 !important;
  color: #b45309 !important;
}

body.light-theme .handover-notes-body {
  color: #374151 !important;
}

body.light-theme .messages-container {
  background: #efeae2 !important;
}

body.light-theme .empty-conversation {
  color: #64748b !important;
}

body.light-theme .empty-conversation h3 {
  color: #111827 !important;
}

body.light-theme .empty-conversation p {
  color: #4b5563 !important;
}

body.light-theme .empty-conversation .icon-circle {
  background: rgba(0, 168, 132, 0.12) !important;
  color: #008069 !important;
}

/* Incoming (Inbound) Message Bubbles: Clean White, Crisp Charcoal Text */
body.light-theme .chat-bubble.inbound {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08) !important;
}

/* Outgoing (Outbound) Message Bubbles: WhatsApp Light Green, Crisp Charcoal Text */
body.light-theme .chat-bubble.outbound {
  background: #d9fdd3 !important;
  color: #111827 !important;
  border: 1px solid #bbf7d0 !important;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08) !important;
}

/* Bubble Text Content - Enforce Deep Readable Color */
body.light-theme .chat-bubble .bubble-text,
body.light-theme .chat-bubble.inbound .bubble-text,
body.light-theme .chat-bubble.outbound .bubble-text {
  color: #111827 !important;
  font-size: 0.88rem !important;
  line-height: 1.45 !important;
}

/* Bubble Sender Header */
body.light-theme .bubble-sender {
  color: #0284c7 !important;
  font-weight: 700 !important;
  font-size: 0.72rem !important;
}

/* Bubble Timestamps & Ticks - High Contrast Slate Gray (No longer invisible white!) */
body.light-theme .bubble-meta {
  color: #64748b !important;
  font-size: 0.68rem !important;
}

body.light-theme .bubble-meta span {
  color: #64748b !important;
}

body.light-theme .bubble-meta i {
  color: #0284c7 !important;
}

/* Flagged message border */
body.light-theme .chat-bubble.flagged {
  border: 1.5px solid #ef4444 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25) !important;
}

/* Media preview cards in messages */
body.light-theme .media-doc-card {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid #cbd5e1 !important;
  color: #0284c7 !important;
}

body.light-theme .media-doc-card span {
  color: #1e293b !important;
}

/* Chat Reply Input Bar */
body.light-theme .chat-reply-bar {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
}

body.light-theme .reply-bar-channel-tag {
  color: #64748b !important;
}

body.light-theme .reply-tip {
  color: #64748b !important;
}

body.light-theme .reply-tip strong {
  color: #111827 !important;
}

body.light-theme .channel-badge {
  background: rgba(0, 168, 132, 0.1) !important;
  color: #008069 !important;
  border: 1px solid rgba(0, 168, 132, 0.25) !important;
}

body.light-theme .channel-badge.waba {
  background: rgba(2, 132, 199, 0.1) !important;
  color: #0284c7 !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
}

body.light-theme .reply-input-wrapper textarea {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #111827 !important;
}

body.light-theme .reply-input-wrapper textarea:focus {
  border-color: #00a884 !important;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.15) !important;
}

body.light-theme .reply-input-wrapper textarea::placeholder {
  color: #94a3b8 !important;
}

body.light-theme .chat-reply-locked-bar {
  background: #fff1f2 !important;
  border-top: 1px solid #fecdd3 !important;
  color: #9f1239 !important;
}

/* =========================================================
   CARDS, TABLES, FORMS & MODALS ACROSS ALL TABS
   ========================================================= */
body.light-theme .card,
body.light-theme .device-card,
body.light-theme .team-card,
body.light-theme .watchdog-card,
body.light-theme .settings-card,
body.light-theme .stat-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #111827 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .card:hover,
body.light-theme .device-card:hover,
body.light-theme .team-card:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .card-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .card-header h3,
body.light-theme .device-name,
body.light-theme .device-info h4,
body.light-theme .team-card h4,
body.light-theme .card-title,
body.light-theme .card-info h3,
body.light-theme .stat-number,
body.light-theme .metric-val,
body.light-theme .storage-card-title {
  color: #111827 !important;
}

body.light-theme .metric-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .metric-val {
  color: #111827 !important;
  font-weight: 800 !important;
}

body.light-theme .metric-lbl {
  color: #475569 !important;
  font-weight: 600 !important;
}

body.light-theme .metric-val.text-ruby {
  color: #dc2626 !important;
}

body.light-theme .metric-val.text-emerald {
  color: #008069 !important;
}

body.light-theme .metric-val.text-cyan {
  color: #0284c7 !important;
}

body.light-theme .metric-val.text-amber {
  color: #d97706 !important;
}

body.light-theme .metric-val.text-purple {
  color: #7c3aed !important;
}

body.light-theme .metric-val.text-pink {
  color: #db2777 !important;
}

body.light-theme .metric-val.text-indigo {
  color: #4f46e5 !important;
}

body.light-theme .device-phone,
body.light-theme .team-member-role,
body.light-theme .team-member-email,
body.light-theme .card-sub,
body.light-theme .card-desc,
body.light-theme .stat-label {
  color: #475569 !important;
}

body.light-theme .card-label,
body.light-theme .field-label {
  color: #64748b !important;
}

/* User Role Badges */
body.light-theme .user-role-badge.badge-owner {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

body.light-theme .user-role-badge.badge-admin {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
}

body.light-theme .user-role-badge.badge-supervisor {
  background: #f3e8ff !important;
  color: #6d28d9 !important;
  border: 1px solid #ddd6fe !important;
}

body.light-theme .user-role-badge.badge-agent {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

/* Tables */
body.light-theme .data-table th {
  background: #f8fafc !important;
  color: #475569 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .data-table td {
  color: #111827 !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

body.light-theme .data-table tr:hover td {
  background: #f8fafc !important;
}

/* Form Inputs, Selects, and Textareas */
body.light-theme input[type="text"],
body.light-theme input[type="password"],
body.light-theme input[type="email"],
body.light-theme input[type="number"],
body.light-theme select,
body.light-theme textarea,
body.light-theme .form-control,
body.light-theme .form-group input,
body.light-theme .form-group select,
body.light-theme .form-group textarea {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1.5px solid #cbd5e1 !important;
}

body.light-theme input:focus,
body.light-theme select:focus,
body.light-theme textarea:focus,
body.light-theme .form-group input:focus,
body.light-theme .form-group select:focus,
body.light-theme .form-group textarea:focus {
  border-color: #00a884 !important;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.15) !important;
}

body.light-theme input::placeholder,
body.light-theme textarea::placeholder {
  color: #94a3b8 !important;
}

/* Autofill styling for Light Mode */
body.light-theme input:-webkit-autofill,
body.light-theme input:-webkit-autofill:hover,
body.light-theme input:-webkit-autofill:focus,
body.light-theme .form-group input:-webkit-autofill {
  -webkit-text-fill-color: #111827 !important;
  -webkit-box-shadow: 0 0 0px 1000px #ffffff inset !important;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
}

/* Modals & Dialogs */
body.light-theme .modal-overlay {
  background: rgba(15, 23, 42, 0.5) !important;
}

body.light-theme .modal-dialog {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.15) !important;
  color: #111827 !important;
}

body.light-theme .modal-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .modal-header h3 {
  color: #111827 !important;
}

body.light-theme .modal-header p,
body.light-theme .modal-desc {
  color: #475569 !important;
}

body.light-theme .modal-body {
  color: #111827 !important;
}

body.light-theme .modal-body label,
body.light-theme .form-group label {
  color: #374151 !important;
  font-weight: 600 !important;
}

body.light-theme .modal-body .help-text,
body.light-theme .form-group .help-text {
  color: #64748b !important;
}

body.light-theme .modal-footer {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
}

body.light-theme .modal-close {
  color: #64748b !important;
}

body.light-theme .modal-close:hover {
  color: #111827 !important;
}

/* Buttons in Light Mode */
body.light-theme .btn-secondary {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-theme .btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-theme .btn-outline-emerald {
  background: transparent !important;
  color: #008069 !important;
  border: 1px solid #00a884 !important;
}

body.light-theme .btn-outline-emerald:hover {
  background: rgba(0, 168, 132, 0.08) !important;
}

body.light-theme .btn-outline-danger {
  background: transparent !important;
  color: #dc2626 !important;
  border: 1px solid #ef4444 !important;
}

body.light-theme .btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.08) !important;
}

body.light-theme .btn-ghost-sm {
  color: #475569 !important;
}

body.light-theme .btn-ghost-sm:hover {
  color: #0284c7 !important;
}

/* Storage & Scope Option Cards */
body.light-theme .storage-option-card {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

body.light-theme .storage-option-card:hover {
  background: #f1f5f9 !important;
}

body.light-theme .storage-option-card.active {
  background: rgba(0, 168, 132, 0.08) !important;
  border-color: #00a884 !important;
}

body.light-theme .storage-option-card h4 {
  color: #111827 !important;
}

body.light-theme .ar-scope-card {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #111827 !important;
}

body.light-theme .ar-scope-card:hover {
  background: #f8fafc !important;
  border-color: #00a884 !important;
}

body.light-theme .ar-scope-card.active,
body.light-theme .ar-scope-card:has(input[type="radio"]:checked) {
  background: rgba(0, 168, 132, 0.08) !important;
  border-color: #00a884 !important;
  box-shadow: 0 0 16px rgba(0, 168, 132, 0.15) !important;
}

body.light-theme .ar-scope-card span,
body.light-theme .ar-scope-card h5 {
  color: #111827 !important;
}

body.light-theme .ar-scope-card p {
  color: #475569 !important;
}

/* Broadcast & Bot Previews in Light Mode */
body.light-theme .wa-preview-screen {
  background: #efeae2 !important;
}

body.light-theme .wa-preview-bubble {
  background: #d9fdd3 !important;
  color: #111827 !important;
  border: 1px solid #bbf7d0 !important;
}

body.light-theme .bubble-text-header {
  color: #111827 !important;
}

body.light-theme .bubble-text-body {
  color: #111827 !important;
}

body.light-theme .bubble-text-footer {
  color: #64748b !important;
}

body.light-theme .sim-msg-bubble.bot {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-theme .sim-msg-bubble.user {
  background: #d9fdd3 !important;
  color: #111827 !important;
  border: 1px solid #bbf7d0 !important;
}

/* Authentication Modal in Light Mode */
body.light-theme .auth-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12), 0 0 25px rgba(0, 168, 132, 0.15) !important;
}

body.light-theme .auth-header h2,
body.light-theme .auth-title {
  color: #0f172a !important;
  text-shadow: none !important;
}

body.light-theme .auth-header h2 span,
body.light-theme .auth-title span {
  color: var(--emerald, #00a884) !important;
  text-shadow: none !important;
}

body.light-theme .auth-header p {
  color: #64748b !important;
}

body.light-theme .auth-form label {
  color: #334155 !important;
}

body.light-theme .auth-form input {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
}

body.light-theme .default-cred-pill {
  background: #fffbeb !important;
  border: 1px dashed #fde68a !important;
  color: #b45309 !important;
}

/* Universal White Text Override for Light Mode (Safely maps inline white styles to crisp charcoal) */
body.light-theme [style*="color:#fff"],
body.light-theme [style*="color: #fff"],
body.light-theme [style*="color:white"],
body.light-theme [style*="color: white"],
body.light-theme [style*="color:#ffffff"],
body.light-theme [style*="color: #ffffff"],
body.light-theme [style*="color: #e9edef"],
body.light-theme [style*="color:#e9edef"] {
  color: #111827 !important;
}

/* Ensure solid badges, danger alerts, and primary buttons stay crisp white text */
body.light-theme .btn-primary,
body.light-theme .btn-primary *,
body.light-theme .btn-danger,
body.light-theme .btn-danger *,
body.light-theme .unread-badge-pill,
body.light-theme .flag-pill,
body.light-theme .nav-badge,
body.light-theme .badge-danger,
body.light-theme .status-dot,
body.light-theme .status-tab.active {
  color: #ffffff !important;
}

/* Fallback avatar background in light mode */
body.light-theme .chat-avatar-container,
body.light-theme .contact-avatar-wrapper {
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1 !important;
}

body.light-theme .chat-avatar-fallback,
body.light-theme .contact-avatar-fallback {
  background: #cbd5e1 !important;
  color: #334155 !important;
}

/* =========================================================
   AUTO REPLY CHANNEL SCOPE SELECTOR CARDS
   ========================================================= */

.ar-scope-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.ar-scope-card {
  position: relative;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  user-select: none;
}

.ar-scope-card:hover {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.06);
  transform: translateY(-1px);
}

.ar-scope-card.active,
.ar-scope-card:has(input[type="radio"]:checked) {
  border-color: var(--cyan) !important;
  background: rgba(6, 182, 212, 0.12) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.18);
}

.ar-scope-radio-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.ar-scope-card.active .ar-scope-radio-icon,
.ar-scope-card:has(input[type="radio"]:checked) .ar-scope-radio-icon {
  border-color: var(--cyan);
  background: var(--cyan);
  color: #0b141a;
}

.ar-scope-radio-icon i {
  font-size: 0.65rem;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.ar-scope-card.active .ar-scope-radio-icon i,
.ar-scope-card:has(input[type="radio"]:checked) .ar-scope-radio-icon i {
  opacity: 1;
  transform: scale(1);
}

.ar-scope-info strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 2px;
}

.ar-scope-card.active .ar-scope-info strong,
.ar-scope-card:has(input[type="radio"]:checked) .ar-scope-info strong {
  color: #ffffff;
}

.ar-scope-info span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Light theme adaptation */
body.light-theme .ar-scope-card,
[data-theme="light"] .ar-scope-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.light-theme .ar-scope-card:hover,
[data-theme="light"] .ar-scope-card:hover {
  background: #f0fdf4;
  border-color: var(--emerald);
}

body.light-theme .ar-scope-card.active,
body.light-theme .ar-scope-card:has(input[type="radio"]:checked),
[data-theme="light"] .ar-scope-card.active,
[data-theme="light"] .ar-scope-card:has(input[type="radio"]:checked) {
  background: #ecfdf5 !important;
  border-color: var(--emerald) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

body.light-theme .ar-scope-card.active .ar-scope-radio-icon,
body.light-theme .ar-scope-card:has(input[type="radio"]:checked) .ar-scope-radio-icon,
[data-theme="light"] .ar-scope-card.active .ar-scope-radio-icon,
[data-theme="light"] .ar-scope-card:has(input[type="radio"]:checked) .ar-scope-radio-icon {
  border-color: var(--emerald);
  background: var(--emerald);
  color: #ffffff;
}

body.light-theme .ar-scope-info strong,
[data-theme="light"] .ar-scope-info strong {
  color: #1e293b;
}

/* =======================================================
   WHATSAPP WEB PROFILE PICTURES & AVATAR SYSTEM
   ======================================================= */

/* 1. Chat List Item Avatar */
.chat-avatar-container {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: #233138;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.chat-avatar-container:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(0, 168, 132, 0.3);
}

.chat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.chat-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #00a884, #008069);
}

/* 2. Active Chat Header Avatar */
.contact-avatar-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--emerald-dark);
  cursor: pointer;
  border: 2px solid rgba(0, 168, 132, 0.4);
  box-shadow: 0 0 10px rgba(0, 168, 132, 0.25);
  transition: all 0.2s ease;
}

.contact-avatar-wrapper:hover {
  transform: scale(1.06);
  border-color: var(--emerald);
  box-shadow: 0 0 16px rgba(0, 168, 132, 0.5);
}

.contact-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.contact-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 1rem;
}

.avatar-zoom-badge {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(1px);
}

.contact-avatar-wrapper:hover .avatar-zoom-badge {
  opacity: 1;
}

/* 3. In-Chat Group Message Bubble Row */
.chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 78%;
  position: relative;
}

.chat-bubble-row.inbound-row {
  align-self: flex-start;
}

.chat-bubble-row.outbound-row {
  align-self: flex-end;
  justify-content: flex-end;
}

.bubble-sender-avatar-wrap {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  margin-bottom: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}

.bubble-sender-avatar-wrap:hover {
  transform: scale(1.18);
  border-color: var(--cyan);
}

.bubble-sender-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.bubble-sender-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
}

.chat-bubble-row .chat-bubble {
  max-width: 100%;
  flex: 1;
}

/* 4. WhatsApp Web High-Resolution Lightbox Modal */
.avatar-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 16, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 20px;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-lightbox-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 168, 132, 0.15);
  width: 100%;
  max-width: 380px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-lightbox-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.avatar-lightbox-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.avatar-lightbox-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.avatar-lightbox-body {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(0, 168, 132, 0.08) 0%, transparent 70%);
}

.avatar-lightbox-img {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 4px rgba(0, 168, 132, 0.3);
  border: 3px solid #111b21;
  transition: transform 0.3s ease;
}

.avatar-lightbox-img:hover {
  transform: scale(1.03);
}

.avatar-lightbox-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Light Theme overrides for Profile Pictures */
body.light-theme .chat-avatar-container {
  background: #e2e8f0;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

body.light-theme .avatar-lightbox-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

body.light-theme .avatar-lightbox-header {
  background: #f8fafc;
}

body.light-theme .avatar-lightbox-info h3 {
  color: #0f172a;
}

body.light-theme .avatar-lightbox-footer {
  background: #f8fafc;
}

/* =========================================================
   CHATBOT & INTERACTIVE MENU FLOW STYLES
   ========================================================= */

.chatbot-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.chatbot-subnav-btn.active {
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
}

.chatbot-subtab-view {
  display: none;
}

.chatbot-subtab-view.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* Tree Builder */
.bot-tree-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bot-tree-node {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: var(--transition-normal);
  position: relative;
}

.bot-tree-node:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.bot-node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.bot-node-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bot-trigger-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 800;
  font-size: 1.05rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.bot-trigger-pill.sub {
  min-width: 32px;
  height: 32px;
  font-size: 0.88rem;
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.35);
  color: var(--cyan);
}

.bot-node-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bot-node-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.bot-node-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.bot-node-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-node-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-node-preview {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.bot-preview-content {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Sub-nodes list */
.bot-subnodes-list {
  margin-top: 16px;
  padding-left: 18px;
  border-left: 2px dashed rgba(6, 182, 212, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bot-subnodes-connector {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.bot-subnode-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.bot-subnode-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-subnode-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f1f5f9;
}

.bot-subnode-snippet {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 450px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-subnode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Simulator Layout */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .simulator-layout {
    grid-template-columns: 1fr;
  }
}

.sim-control-card {
  padding: 20px;
}

.sim-phone-wrapper {
  display: flex;
  justify-content: center;
}

.sim-msg-bubble {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: 8px;
  max-width: 82%;
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.sim-msg-bubble.user {
  align-self: flex-end;
  background: #005c4b;
  color: #e9edef;
  border-bottom-right-radius: 2px;
}

.sim-msg-bubble.bot {
  align-self: flex-start;
  background: #202c33;
  color: #d1d7db;
  border-bottom-left-radius: 2px;
}

.sim-msg-time {
  text-align: right;
  font-size: 0.65rem;
  color: #8696a0;
  margin-top: 3px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

/* WhatsApp Interactive Buttons in Phone Simulator */
.sim-interactive-buttons {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

.sim-interactive-btn {
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #00a884;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background 0.15s ease, color 0.15s ease;
  width: 100%;
}

.sim-interactive-btn:hover {
  background: rgba(0, 168, 132, 0.15);
  color: #25d366;
}

.sim-interactive-btn:first-child {
  border-top: none;
}

.sim-interactive-list-container {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 4px;
}

.sim-interactive-list-toggle {
  background: rgba(0, 168, 132, 0.12);
  border: 1px solid rgba(0, 168, 132, 0.3);
  border-radius: 6px;
  color: #00a884;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  transition: all 0.2s ease;
}

.sim-interactive-list-toggle:hover {
  background: rgba(0, 168, 132, 0.22);
  color: #25d366;
  border-color: #00a884;
}

.sim-interactive-list-dropdown {
  background: #111b21;
  border: 1px solid #2a3942;
  border-radius: 8px;
  margin-top: 6px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.sim-list-section-title {
  padding: 6px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #8696a0;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sim-list-row-item {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.15s ease;
}

.sim-list-row-item:hover {
  background: rgba(0, 168, 132, 0.15);
}

.sim-list-row-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e9edef;
}

.sim-list-row-desc {
  font-size: 0.73rem;
  color: #8696a0;
  margin-top: 2px;
}

.sim-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #202c33;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sim-input-bar input {
  flex: 1;
  background: #2a3942;
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

.sim-send-btn {
  background: #00a884;
  color: #fff;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.sim-send-btn:hover {
  background: #028e6f;
  transform: scale(1.05);
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 2px;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #8696a0;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Light Theme Overrides for Chatbot */
body.light-theme .bot-tree-node {
  background: #ffffff;
  border-color: #e2e8f0;
}

body.light-theme .bot-node-title {
  color: #0f172a;
}

body.light-theme .bot-node-preview {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.light-theme .bot-preview-content {
  color: #334155;
}

body.light-theme .bot-subnode-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.light-theme .bot-subnode-title {
  color: #0f172a;
}

/* =========================================================
   CHAT ASSIGNMENT & CS ROUTING (ALA QONTAK)
   ========================================================= */

.inbox-status-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.status-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex: 1 1 auto;
  text-align: center;
  transition: var(--transition-fast);
}

.status-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.status-tab.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--cyan);
  color: var(--cyan);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.status-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.status-tab.active .status-tab-count {
  background: var(--cyan);
  color: #0b141a;
}

/* Chat Item Assignee Badge */
.chat-assignee-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.25);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-assignee-pill.unassigned {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border-color: rgba(245, 158, 11, 0.25);
}

.chat-assignee-pill.resolved {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border-color: rgba(16, 185, 129, 0.25);
}

/* Header Assignment Badge: sleek, modern rounded pill */
.header-assignment-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.header-assignment-badge.assigned {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.header-assignment-badge.unassigned {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.header-assignment-badge.resolved {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Stream Header Actions: Single clean row of buttons */
.stream-actions {
  display: flex !important;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  height: 31px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-header-action i {
  font-size: 0.85rem;
}

/* Handover Notes Banner */
.handover-notes-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 12px 16px 0 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  animation: fadeIn 0.3s ease;
}

.handover-notes-icon {
  font-size: 1.25rem;
  color: var(--amber);
  margin-top: 2px;
}

.handover-notes-content {
  flex: 1;
}

.handover-notes-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.handover-author {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--amber);
}

.handover-badge {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.handover-notes-body {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.4;
  white-space: pre-wrap;
}

/* Locked Chat Reply Bar */
.chat-reply-locked-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(239, 68, 68, 0.08);
  border-top: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.chat-reply-locked-bar i {
  font-size: 1.1rem;
}

/* ===================================================
   TEAM & CS AGENT MANAGEMENT STYLES
   =================================================== */
.user-role-badge.badge-owner {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.user-role-badge.badge-admin {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.user-role-badge.badge-supervisor {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.user-role-badge.badge-agent {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.team-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.team-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.btn-ghost-sm:hover {
  color: var(--cyan) !important;
}

.btn-outline-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #f87171;
}

/* ===================================================
   RESPONSIVE LAYOUT & WINDOW FITTING OPTIMIZATION
   =================================================== */
@media (max-width: 1280px) {
  .app-sidebar {
    width: 190px;
    min-width: 170px;
    padding: 12px 8px;
  }
  .chat-list-panel {
    width: 450px;
    min-width: 410px;
  }
  .search-input-wrapper {
    max-width: 320px;
  }
  .stream-header {
    padding: 8px 12px;
    gap: 8px;
  }
  .btn-header-action {
    padding: 0 8px;
    font-size: 0.74rem;
    height: 30px;
  }
  .contact-header-top h3 {
    max-width: 150px;
  }
}

@media (max-width: 1024px) {
  .app-sidebar {
    width: 66px;
    min-width: 66px;
    padding: 12px 6px;
  }
  .app-sidebar .nav-item span:not(.nav-badge),
  .app-sidebar .sidebar-footer-card {
    display: none !important;
  }
  .app-sidebar .nav-item {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
  }
  .app-sidebar .nav-item i {
    margin: 0;
    font-size: 1.2rem;
    width: auto;
  }
  .chat-list-panel {
    width: 420px;
    min-width: 380px;
  }
}

/* Mention Tag Styling (Ala WhatsApp Web) */
.chat-mention-tag {
  color: #0284c7;
  font-weight: 600;
  background: rgba(2, 132, 199, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  letter-spacing: 0.2px;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1.35;
}

.chat-mention-tag:hover {
  background: rgba(2, 132, 199, 0.2);
}

.chat-bubble.outbound .chat-mention-tag {
  color: #0369a1;
  background: rgba(3, 105, 161, 0.12);
}

.chat-bubble.outbound .chat-mention-tag:hover {
  background: rgba(3, 105, 161, 0.22);
}

[data-theme="dark"] .chat-mention-tag {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

[data-theme="dark"] .chat-mention-tag:hover {
  background: rgba(56, 189, 248, 0.25);
}

[data-theme="dark"] .chat-bubble.outbound .chat-mention-tag {
  color: #7dd3fc;
  background: rgba(125, 211, 252, 0.18);
}

[data-theme="dark"] .chat-bubble.outbound .chat-mention-tag:hover {
  background: rgba(125, 211, 252, 0.28);
}

/* ===================================================
   OMNICHANNEL HUB (INSTAGRAM, SHOPEE, TOPED, WA)
   =================================================== */

/* Channel Filter Tabs (Inbox Sidebar) */
.inbox-channel-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.channel-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: var(--radius-full);
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap;
  flex: 1 1 auto;
  text-align: center;
  transition: all 0.2s ease;
}

.channel-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.channel-tab.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.channel-tab.tab-wa.active {
  background: rgba(37, 211, 102, 0.15);
  border-color: rgba(37, 211, 102, 0.4);
  color: #25d366;
}

.channel-tab.tab-ig.active {
  background: rgba(225, 48, 108, 0.15);
  border-color: rgba(225, 48, 108, 0.4);
  color: #f43f5e;
}

.channel-tab.tab-shopee.active {
  background: rgba(238, 77, 45, 0.15);
  border-color: rgba(238, 77, 45, 0.4);
  color: #ee4d2d;
}

.channel-tab.tab-toped.active {
  background: rgba(3, 172, 14, 0.15);
  border-color: rgba(3, 172, 14, 0.4);
  color: #03ac0e;
}

/* Chat Item Channel Badges */
.chat-channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-right: 4px;
  vertical-align: middle;
}

.chat-channel-badge.badge-ig {
  background: linear-gradient(135deg, rgba(131, 58, 180, 0.2), rgba(253, 29, 29, 0.2));
  color: #f43f5e;
  border: 1px solid rgba(253, 29, 29, 0.3);
}

.chat-channel-badge.badge-shopee {
  background: rgba(238, 77, 45, 0.15);
  color: #ee4d2d;
  border: 1px solid rgba(238, 77, 45, 0.3);
}

.chat-channel-badge.badge-toped {
  background: rgba(3, 172, 14, 0.15);
  color: #03ac0e;
  border: 1px solid rgba(3, 172, 14, 0.3);
}

.chat-channel-badge.badge-wa {
  background: rgba(37, 211, 102, 0.12);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.25);
}

/* Channel Reply Bar Badges */
.channel-badge.ig {
  background: linear-gradient(135deg, rgba(131, 58, 180, 0.2), rgba(253, 29, 29, 0.2));
  color: #f43f5e;
  border: 1px solid rgba(253, 29, 29, 0.35);
}

.channel-badge.shopee {
  background: rgba(238, 77, 45, 0.15);
  color: #ee4d2d;
  border: 1px solid rgba(238, 77, 45, 0.35);
}

.channel-badge.toped {
  background: rgba(3, 172, 14, 0.15);
  color: #03ac0e;
  border: 1px solid rgba(3, 172, 14, 0.35);
}

/* Omnichannel Channels Grid (Settings Tab) */
.omni-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 10px;
}

.omni-channel-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s ease;
  position: relative;
}

.omni-channel-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.omni-channel-card.is-connected {
  border-color: rgba(6, 182, 212, 0.35);
  background: rgba(6, 182, 212, 0.03);
}

.omni-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.omni-channel-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.omni-card-header-meta {
  flex: 1;
  min-width: 0;
}

.omni-card-header-meta h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.omni-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.omni-status-tag.connected {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.omni-status-tag.disconnected {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.omni-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.channel-connected-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  max-height: 140px;
  overflow-y: auto;
}

.channel-connected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
}

.conn-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.conn-dot-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.conn-dot-status.online {
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}

.conn-dot-status.offline {
  background: var(--text-muted);
}

.conn-item-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conn-item-handle {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-icon-xs {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.btn-icon-xs:hover {
  background: rgba(239, 68, 68, 0.15);
}

.omni-card-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.omni-card-footer .btn {
  flex: 1;
  font-size: 0.78rem;
  padding: 6px 10px;
}

/* Channel Select Pills (Modal Form) */
.channel-connect-selector {
  display: grid;
  gap: 8px;
}

.channel-select-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.channel-select-pill span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.channel-select-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.channel-select-pill.active {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.channel-select-pill.active span {
  color: #fff;
  font-weight: 700;
}

/* ============================================================
   AI CUSTOMER SERVICE & SMART COPILOT STYLES
   ============================================================ */
.ai-subtabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  padding-bottom: 10px;
  overflow-x: auto;
}

.ai-subtab-btn {
  font-weight: 600;
  transition: all 0.2s ease;
}

.ai-subtab-btn.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.15)) !important;
  color: #c084fc !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.ai-subtab-content {
  display: none;
}

.ai-subtab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* Switch Toggle Component */
/* Switch Toggle Component */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
  vertical-align: middle;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  transition: all 0.25s ease;
  border-radius: 24px;
}

.switch-toggle .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2.5px;
  bottom: 2.5px;
  background-color: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: all 0.25s ease;
  border-radius: 50%;
}

.switch-toggle:hover .slider {
  background-color: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.45);
}

.switch-toggle input:checked + .slider {
  background-color: #00a884;
  border-color: #008069;
  box-shadow: 0 0 10px rgba(0, 168, 132, 0.4);
}

.switch-toggle input:checked + .slider:before {
  transform: translateX(20px);
}

/* Switch Toggle in Light Theme */
body.light-theme .switch-toggle .slider {
  background-color: #cbd5e1 !important;
  border: 1.5px solid #94a3b8 !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .switch-toggle:hover .slider {
  background-color: #94a3b8 !important;
  border-color: #64748b !important;
}

body.light-theme .switch-toggle .slider:before {
  background-color: #ffffff !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28) !important;
}

body.light-theme .switch-toggle input:checked + .slider {
  background-color: #00a884 !important;
  border-color: #008069 !important;
  box-shadow: 0 0 10px rgba(0, 168, 132, 0.35) !important;
}

/* AI Simulator Sandbox Chat Window */
.sim-sandbox-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  min-height: 540px;
}

@media (max-width: 992px) {
  .sim-sandbox-grid {
    grid-template-columns: 1fr;
  }
}

.sim-chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 560px;
}

.sim-chat-header {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-chat-stream {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: radial-gradient(circle at center, rgba(139, 92, 246, 0.03) 0%, transparent 70%);
}

.sim-welcome-msg {
  text-align: center;
  margin: auto;
  max-width: 380px;
  color: var(--text-muted);
  padding: 20px;
}

.sim-welcome-msg h4 {
  color: var(--text-bright);
  margin-bottom: 8px;
}

.sim-bubble {
  display: flex;
  max-width: 80%;
  animation: fadeIn 0.2s ease;
}

.sim-bubble.sim-user {
  align-self: flex-end;
}

.sim-bubble.sim-bot {
  align-self: flex-start;
}

.sim-bubble-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sim-user .sim-bubble-content {
  background: linear-gradient(135deg, #005c4b, #008069);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.sim-bot .sim-bubble-content {
  background: #202c33;
  color: #e9edef;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sim-meta-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.sim-meta-badge.alert {
  color: var(--amber);
  font-weight: 600;
}

.sim-chat-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.sim-chat-input-row {
  display: flex;
  gap: 8px;
}

.sim-chat-input-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.typing-dots span {
  animation: blink 1.4s infinite both;
  font-weight: bold;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
  0% { opacity: .2; }
  20% { opacity: 1; }
  100% { opacity: .2; }
}

/* ==========================================
   CS PERFORMANCE & SLA ANALYTICS STYLES
   ========================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.chip-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.chip-cyan {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.chip-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.chip-ruby {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.chip-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.28);
}

.chip-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* Light Theme Overrides for CS Analytics */
body.light-theme .chip-emerald {
  background: #dcfce7 !important;
  color: #15803d !important;
  border-color: #86efac !important;
}

body.light-theme .chip-cyan {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border-color: #7dd3fc !important;
}

body.light-theme .chip-amber {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border-color: #fcd34d !important;
}

body.light-theme .chip-ruby {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
}

body.light-theme .chip-purple {
  background: #f3e8ff !important;
  color: #7e22ce !important;
  border-color: #d8b4fe !important;
}

body.light-theme .chip-secondary {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

body.light-theme #anPeakHoursChartContainer span {
  color: #64748b !important;
}


