/* ==========================================================================
   OMNICHANNEL CS - LAUTAN SOLUSI AIRINDO DESIGN SYSTEM & STYLES
   Colors based on the official Lautan Solusi Airindo / Lautan Air emblem
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Lautan Solusi Airindo Water Theme Colors */
  --primary: #0077c8;          /* Ocean Azure Blue (Lautan Core) */
  --primary-hover: #005fa3;    /* Deep Sea Blue */
  --primary-active: #004d84;
  --primary-light: #e0f2fe;    /* Crystal Clear Water Tint */
  --primary-subtle: #f0f9ff;   /* Soft Ice Blue */
  --primary-border: #7dd3fc;   /* Sky Water Border */
  --primary-gradient: linear-gradient(135deg, #0284c7 0%, #0077c8 60%, #0369a1 100%);
  --water-cyan: #00b4d8;       /* Bright Cyan Highlight */
  
  /* WhatsApp Badge (Kept for channel identity) */
  --wa-color: #25D366;
  --wa-dark: #128C7E;
  --wa-bubble: #e0f2fe;        /* Modern clean aquatic light blue bubble for outbound chat */
  --wa-bubble-border: #bae6fd;

  --secondary: #0284c7;
  --secondary-light: #f0f9ff;

  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --warning-border: #fde68a;

  --danger: #ef4444;
  --danger-light: #fee2e2;

  /* Neutrals & Dark Maritime Sidebar */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #0a192f;        /* Deep Maritime Navy matching symbol darkest curve */
  --bg-sidebar-hover: #162c46;  /* Sleek nautical navy hover */
  --bg-chat-area: #f1f5f9;      /* Modern clean cool slate background */
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Shadows with subtle blue ambient */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 119, 200, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 119, 200, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Dimensions */
  --nav-width: 72px;
  --conv-width: 420px;
  --crm-width: 380px;
  --header-height: 64px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-surface);
}

/* 1. Primary Left Navigation */
.app-nav {
  width: var(--nav-width);
  background-color: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 30;
  flex-shrink: 0;
}

.nav-top, .nav-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-shadow: 0 4px 14px rgba(0, 119, 200, 0.35);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-logo:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(0, 119, 200, 0.5);
}

.nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: #ffffff;
  background-color: var(--bg-sidebar-hover);
}

.nav-btn.active {
  color: #38bdf8;
  background-color: rgba(2, 132, 199, 0.22);
}

.nav-btn svg {
  width: 22px;
  height: 22px;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444 !important;
  color: #ffffff !important;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  border: 2px solid #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.6);
  pointer-events: none;
  line-height: 1;
}

.agent-avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  border: 2px solid #1e3a5f;
}

.agent-avatar-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.agent-avatar-btn .status-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid var(--bg-sidebar);
}

/* ==========================================================================
   2. CONVERSATION LIST COLUMN
   ========================================================================== */

.conversation-sidebar {
  width: var(--conv-width, 420px);
  min-width: 260px;
  max-width: 650px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
}

/* Resizable Splitter between Inbox and Chat Area */
.conv-resizer {
  width: 10px;
  background: transparent;
  cursor: col-resize;
  position: relative;
  z-index: 30;
  flex-shrink: 0;
  margin-left: -5px;
  margin-right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

.conv-resizer::after {
  content: '';
  width: 2px;
  height: 100%;
  background-color: var(--border);
  transition: background-color 0.15s, width 0.15s;
}

.conv-resizer:hover,
.conv-resizer.is-dragging {
  background-color: rgba(0, 119, 200, 0.08);
}

.conv-resizer:hover::after,
.conv-resizer.is-dragging::after {
  background-color: var(--primary);
  width: 4px;
}

.conv-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.conv-brand-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.conv-brand-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #0077c8;
  letter-spacing: -0.2px;
}

.conv-brand-sub {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.conv-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.conv-title-row h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.conv-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--bg-app);
  color: var(--text-main);
  border-color: #cbd5e1;
}

/* Inbox Agent Filter Dropdown (Superadmin Only) */
.inbox-agent-select-wrap {
  position: relative;
  margin-bottom: 10px;
  width: 100%;
}

.inbox-agent-select {
  width: 100%;
  padding: 9px 34px 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  box-sizing: border-box;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  appearance: none;
  -webkit-appearance: none;
}

.inbox-agent-select:hover {
  background-color: #ffffff;
  border-color: #cbd5e1;
}

.inbox-agent-select:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.15);
}

.search-box {
  position: relative;
  margin-bottom: 12px;
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-light);
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #f8fafc;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.15);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  user-select: none;
}

.filter-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

.filter-tab.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  margin-left: 5px;
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.35);
  vertical-align: middle;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.tab-badge.badge-danger {
  background: #ef4444;
  box-shadow: 0 1px 2px rgba(239, 68, 68, 0.35);
}

.tab-badge.badge-warning {
  background: #f59e0b;
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.35);
}

.filter-tab.active .tab-badge {
  filter: brightness(0.92);
}


.channel-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.channel-chip.active {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* Conversation List Scroll */
.conv-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
}

.conv-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background-color 0.15s ease;
  position: relative;
}

.conv-item:hover {
  background-color: #f8fafc;
}

.conv-item.active {
  background-color: var(--primary-light);
  border-left: 3px solid var(--primary);
}

.conv-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.conv-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9 0%, #0077c8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 119, 200, 0.2);
}

.conv-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel-badge-icon {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.channel-badge-icon.whatsapp {
  background: #25D366;
  color: white;
}

.channel-badge-icon.webchat {
  background: #0077c8;
  color: white;
}

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

.conv-info-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.conv-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.conv-time {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
}

.conv-snippet {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.conv-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.agent-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.agent-tag.unassigned {
  background: #fee2e2;
  color: #dc2626;
}

.unread-pill {
  background: var(--primary);
  color: white;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

/* Empty list state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-light);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-light);
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================================================
   3. CHAT ROOM MAIN AREA
   ========================================================================== */

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f0f4f9;
  position: relative;
  height: 100%;
  overflow: hidden;
}

/* Subtle water wave dot background */
.chat-main::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(#cbd5e1 0.75px, transparent 0.75px);
  background-size: 18px 18px;
  opacity: 0.45;
  pointer-events: none;
}

.chat-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
  flex-shrink: 0;
}

.chat-customer-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0077c8;
  font-size: 15px;
}

.header-title-box h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-phone {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
}

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

.badge-channel-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-channel-pill.whatsapp {
  background: #dcfce7;
  color: #166534;
}

.badge-channel-pill.webchat {
  background: #e0f2fe;
  color: #0369a1;
}

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

.select-agent-dropdown {
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  outline: none;
}

.select-agent-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.handoff-action-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-handoff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  height: 32px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #0284c7;
  background-color: #0284c7;
  color: #ffffff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.2);
  white-space: nowrap;
}

.btn-handoff:hover:not(:disabled) {
  background-color: #0369a1;
  border-color: #0369a1;
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.3);
  transform: translateY(-1px);
}

.btn-handoff:active:not(:disabled) {
  transform: translateY(0);
}

.btn-handoff:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-handoff .spin {
  animation: handoffSpin 0.9s linear infinite;
}

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

.btn-resolve {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background-color: var(--primary);
  color: white;
  transition: all 0.2s;
}

.btn-resolve:hover {
  background-color: var(--primary-hover);
}

.btn-resolve.resolved {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border);
}

/* Chat Messages Scroll Window */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 5;
}

.date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
}

.date-divider span {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Message Bubbles */
.message-row {
  display: flex;
  flex-direction: column;
  max-width: 68%;
  animation: fadeIn 0.15s ease-out;
}

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

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

.message-row.outbound {
  align-self: flex-end;
}

.message-row.system-note {
  align-self: center;
  max-width: 80%;
  width: 100%;
}

.message-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  word-break: break-word;
}

.message-row.inbound .message-bubble {
  background: #ffffff;
  color: var(--text-main);
  border-top-left-radius: 2px;
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.message-row.outbound .message-bubble {
  background: var(--wa-bubble);
  color: #0f172a;
  border-top-right-radius: 2px;
  border: 1px solid var(--wa-bubble-border);
}

.message-sender-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.message-text {
  white-space: pre-wrap;
}

.message-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
  font-size: 10.5px;
  color: #64748b;
}

.status-ticks {
  display: inline-flex;
}

.status-ticks.read {
  color: var(--primary); /* Lautan blue ticks */
}

/* Internal Note Bubble (Warm Orange Box Theme) */
.message-row.internal-note .message-bubble,
.message-bubble.note,
.internal-note-box {
  background: #fff7ed !important;
  border: 1px solid #fed7aa !important;
  border-top-right-radius: 2px;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.08);
}

.message-row.internal-note .note-label,
.message-bubble.note .note-label,
.internal-note-header {
  font-size: 11px;
  font-weight: 700;
  color: #ea580c !important;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.2px;
}

.message-row.internal-note .bubble-text,
.message-bubble.note .bubble-text {
  color: #431407 !important;
}

.message-row.internal-note .bubble-time,
.message-bubble.note .bubble-time {
  color: #c2410c !important;
  opacity: 0.85;
}

/* Media preview in bubble */
.message-media-img {
  max-width: 260px;
  max-height: 200px;
  border-radius: 8px;
  margin-top: 4px;
  cursor: pointer;
  object-fit: cover;
  display: block;
}

/* Chat Composer Bar */
.chat-composer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px 14px 16px;
  z-index: 10;
  flex-shrink: 0;
  position: relative;
}

.composer-tabs {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}

.composer-tab {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.composer-tab.active {
  color: var(--primary);
}

.composer-tab.active::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.composer-tab.note.active {
  color: #d97706;
}

.composer-tab.note.active::after {
  background: #d97706;
}

/* Media Preview Bar above Chat Composer Input */
#mediaPreviewBar {
  margin-bottom: 10px;
}

.media-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.media-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  max-width: 100%;
  animation: slideDownFade 0.2s ease-out;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.media-preview-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.media-preview-icon {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: #eff6ff;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.media-preview-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 260px;
}

.media-preview-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-preview-size {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.media-preview-remove {
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  font-size: 13px;
  margin-left: 6px;
  flex-shrink: 0;
  transition: all 0.15s;
}

.media-preview-remove:hover {
  background: #fee2e2;
  color: #ef4444;
}

.composer-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.composer-textarea-wrap {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  transition: all 0.2s;
  position: relative;
}

.composer-textarea-wrap:focus-within {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.15);
}

.composer-textarea-wrap.note-mode:focus-within {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.chat-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-main);
  max-height: 120px;
  min-height: 38px;
}

.composer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.tool-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  transition: all 0.15s;
}

.tool-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.btn-send {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 119, 200, 0.3);
}

.btn-send:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-send.note-mode {
  background-color: #d97706;
}

/* Quick Replies Dropdown Popover */
.quick-replies-popover {
  position: absolute;
  bottom: 100%;
  left: 16px;
  width: 380px;
  max-height: 260px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  padding: 6px;
  z-index: 50;
  display: none;
}

.quick-replies-popover.open {
  display: block;
}

.qr-item {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.qr-item:hover, .qr-item.selected {
  background: #f0f9ff;
}

.qr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.qr-shortcut {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.qr-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.qr-snippet {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   4. CUSTOMER 360 CRM SIDEBAR (RIGHT)
   ========================================================================== */

/* Resizable Splitter between Chat Area and CRM Sidebar */
.crm-resizer {
  width: 10px;
  background: transparent;
  cursor: col-resize;
  position: relative;
  z-index: 30;
  flex-shrink: 0;
  margin-left: -5px;
  margin-right: -5px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

.crm-resizer::after {
  content: '';
  width: 2px;
  height: 100%;
  background-color: var(--border);
  transition: background-color 0.15s, width 0.15s;
}

.crm-resizer:hover,
.crm-resizer.is-dragging {
  background-color: rgba(0, 119, 200, 0.08);
}

.crm-resizer:hover::after,
.crm-resizer.is-dragging::after {
  background-color: var(--primary);
  width: 4px;
}

.crm-sidebar {
  width: var(--crm-width, 380px);
  min-width: 280px;
  max-width: 750px;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
}

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

.crm-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.crm-profile-card {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.crm-big-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9 0%, #0077c8 50%, #0369a1 100%);
  color: white;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0, 119, 200, 0.25);
}

.crm-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.crm-phone {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.btn-open-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-open-wa:hover {
  background: #bbf7d0;
}

.crm-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.crm-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-badge {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-badge .remove-tag {
  cursor: pointer;
  color: #94a3b8;
}

.tag-badge .remove-tag:hover {
  color: #ef4444;
}

.tag-add-input {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  outline: none;
  background: transparent;
  width: 90px;
}

.crm-notes-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-main);
  resize: vertical;
  min-height: 80px;
  outline: none;
  transition: all 0.2s;
}

.crm-notes-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.15);
}

.crm-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 8px;
}

.crm-detail-label {
  color: var(--text-muted);
}

.crm-detail-val {
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   5. MODAL DIALOGS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 25, 47, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.open,
.modal.open {
  display: flex !important;
}

.modal-box {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafbfc;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

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

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.form-help {
  font-size: 11.5px;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea, .form-control, .wa-form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.15);
}

.copy-field {
  display: flex;
  gap: 6px;
}

.copy-field input {
  flex: 1;
  background: #f1f5f9;
}

.btn-primary {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background-color: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 119, 200, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  background: #0a192f;
  color: white;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideToast 0.25s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success {
  background: #0369a1;
}

.toast.error {
  background: #991b1b;
}

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

/* Analytics Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

/* ==========================================================================
   PUREVE OMNICHANNEL - AUTHENTICATION & LOGIN PORTAL
   ========================================================================== */
.login-portal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Left Column: Pureve Serra Cosmic Visual Experience */
.login-brand-col {
  flex: 1.2;
  background: #020718;
  color: #ffffff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.cosmic-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: #020718;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Full-bleed Edge-to-edge Cosmic Background Plate (No letterbox margins or borders) */
.cosmic-bg-picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.cosmic-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

/* Ambient Moving Cosmic Nebulae - Positioned in corners so text & connecting lines remain 100% crisp */
.cosmic-nebula {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  will-change: transform, opacity;
}

/* Nebula Layer 1: Ambient Cyan Mist (Upper Right Corner) */
.nebula-layer-cyan {
  top: -12%;
  right: -8%;
  width: 55%;
  height: 50%;
  background: radial-gradient(circle at 60% 40%, rgba(6, 182, 212, 0.22) 0%, rgba(14, 165, 233, 0.08) 50%, transparent 70%);
  filter: blur(45px);
  mix-blend-mode: screen;
  animation: nebulaDriftCyan 22s ease-in-out infinite alternate;
  opacity: 0.7;
}

@keyframes nebulaDriftCyan {
  0% {
    transform: translate3d(-15px, -10px, 0) scale(0.96) rotate(0deg);
    opacity: 0.55;
  }
  50% {
    transform: translate3d(20px, 15px, 0) scale(1.08) rotate(4deg);
    opacity: 0.85;
  }
  100% {
    transform: translate3d(-8px, 20px, 0) scale(1.02) rotate(-2deg);
    opacity: 0.65;
  }
}

/* Nebula Layer 2: Deep Azure Wave (Lower Left Corner) */
.nebula-layer-blue {
  bottom: -15%;
  left: -8%;
  width: 60%;
  height: 55%;
  background: radial-gradient(circle at 40% 60%, rgba(37, 99, 235, 0.22) 0%, rgba(29, 78, 216, 0.1) 50%, transparent 70%);
  filter: blur(50px);
  mix-blend-mode: screen;
  animation: nebulaDriftBlue 26s ease-in-out infinite alternate;
  opacity: 0.65;
}

@keyframes nebulaDriftBlue {
  0% {
    transform: translate3d(20px, 18px, 0) scale(1.04) rotate(0deg);
    opacity: 0.5;
  }
  50% {
    transform: translate3d(-18px, -15px, 0) scale(0.95) rotate(-5deg);
    opacity: 0.8;
  }
  100% {
    transform: translate3d(10px, -20px, 0) scale(1.06) rotate(3deg);
    opacity: 0.55;
  }
}

/* Nebula Layer 3: High-Altitude Aurora Stream */
.nebula-layer-aurora {
  top: -5%;
  left: 15%;
  width: 70%;
  height: 30%;
  background: linear-gradient(130deg, rgba(6, 182, 212, 0.1) 0%, rgba(14, 165, 233, 0.16) 45%, transparent 100%);
  filter: blur(35px);
  mix-blend-mode: screen;
  animation: auroraWaveMotion 16s ease-in-out infinite alternate;
  opacity: 0.55;
}

@keyframes auroraWaveMotion {
  0% {
    transform: translateY(-10px) skewX(-3deg);
    opacity: 0.4;
  }
  50% {
    transform: translateY(12px) skewX(4deg);
    opacity: 0.7;
  }
  100% {
    transform: translateY(-5px) skewX(-1deg);
    opacity: 0.45;
  }
}

/* Starfield & Particle Canvas */
.cosmic-starfield-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Subtle Cosmic Vignette & Horizon Fade */
.cosmic-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  box-shadow: inset 0 0 65px rgba(1, 4, 15, 0.4), inset -20px 0 40px rgba(1, 4, 15, 0.6);
}

/* ==========================================================================
   PUREVE SERRA - COSMIC VECTOR INTERFACE & SYMMETRICAL DIAGRAM
   ========================================================================== */
.cosmic-content-layout {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 36px 44px 28px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.cosmic-content-layout::-webkit-scrollbar {
  display: none;
}

/* Top Header */
.cosmic-header {
  width: 100%;
  max-width: 860px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.cosmic-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.25), rgba(2, 132, 199, 0.1) 80%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3), inset 0 0 12px rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cosmic-logo-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8));
}

.cosmic-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cosmic-logo-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.4px;
  line-height: 1.1;
  text-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

.cosmic-logo-subtitle {
  font-size: 9px;
  font-weight: 700;
  color: #7dd3fc;
  margin: 0;
  letter-spacing: 1.4px;
  line-height: 1.2;
}

/* Middle Diagram: 100% Symmetrical Channels, Connecting Lines, Center Orbit & AI Agents */
.cosmic-diagram-container {
  position: relative;
  width: 100%;
  max-width: 860px;
  height: 320px;
  margin: auto 0;
  flex-shrink: 0;
}

.cosmic-svg-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Connecting Line Flow Animations */
@keyframes streamFlowIn {
  to {
    stroke-dashoffset: -36;
  }
}

@keyframes streamFlowOut {
  to {
    stroke-dashoffset: 36;
  }
}

.stream-line {
  animation: streamFlowIn 2.2s linear infinite;
}

.stream-line-rev {
  animation: streamFlowOut 2.2s linear infinite;
}

.cosmic-stage-elements {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* 1. Left Symmetrical Channels Column (Spans X: 35px to 230px, Width: 195px) */
.sym-channels-col {
  position: absolute;
  left: 35px;
  top: 0;
  bottom: 0;
  width: 195px;
  pointer-events: auto;
}

.sym-channel-card,
.sym-agent-card {
  position: absolute;
  left: 0;
  width: 100%;
  height: 38px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 9999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22), 0 0 12px rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  padding: 0 12px 0 6px;
  gap: 8px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  cursor: pointer;
}

.sym-channel-card:hover {
  transform: translateX(-4px) scale(1.03);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3), 0 0 20px rgba(56, 189, 248, 0.5);
  background: #ffffff;
}

.sym-agent-card:hover {
  transform: translateX(4px) scale(1.03);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3), 0 0 20px rgba(56, 189, 248, 0.5);
  background: #ffffff;
}

/* Exact Symmetrical Y Positions matching SVG lines (Y = 48, 104, 160, 216, 272) */
.sym-channel-card:nth-child(1),
.sym-agent-card:nth-child(1) { top: 29px; }

.sym-channel-card:nth-child(2),
.sym-agent-card:nth-child(2) { top: 85px; }

.sym-channel-card:nth-child(3),
.sym-agent-card:nth-child(3) { top: 141px; }

.sym-channel-card:nth-child(4),
.sym-agent-card:nth-child(4) { top: 197px; }

.sym-channel-card:nth-child(5),
.sym-agent-card:nth-child(5) { top: 253px; }

.sym-channel-icon,
.agent-badge-icon {
  position: relative !important;
  bottom: auto !important;
  right: auto !important;
  border: none !important;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sym-channel-icon svg,
.agent-badge-icon svg {
  display: block;
}

/* Channel Brand Icons */
.icon-wa      { background: #25D366; }
.icon-fb      { background: #0084FF; }
.icon-ig      { background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045); }
.icon-tg      { background: #229ED9; }
.icon-webchat { background: #0284c7; }

/* AI Agent Icons */
.icon-sales   { background: #e0f2fe; }
.icon-maint   { background: #ede9fe; }
.icon-billing { background: #e0f2fe; }
.icon-crm     { background: #dbeafe; }
.icon-webhook { background: #fef3c7; }

.channel-badge-text,
.agent-badge-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.15;
}

.channel-title,
.agent-title {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.channel-sub,
.agent-sub {
  font-size: 8.5px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.sym-channels-label {
  position: absolute;
  top: 300px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #7dd3fc;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  white-space: nowrap;
}

/* 2. Center Stage (Centered at exactly X = 430px, Y = 160px in 860px stage) */
.sym-center-stage {
  position: absolute;
  left: 430px;
  top: 160px;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  pointer-events: auto;
}

/* Core Orb */
.sym-core-orb {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #38bdf8 0%, #0284c7 40%, #034f84 80%, #021a36 100%);
  border: 2px solid rgba(186, 230, 253, 0.85);
  box-shadow: 0 0 35px rgba(56, 189, 248, 0.7), inset 0 0 16px rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: coreOrbPulse 3.5s ease-in-out infinite;
}

@keyframes coreOrbPulse {
  0%, 100% {
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.6), inset 0 0 14px rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    box-shadow: 0 0 45px rgba(56, 189, 248, 0.9), inset 0 0 20px rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.sym-core-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sym-core-symbol {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px #ffffff);
}

/* 5 Orbit Nodes with Equidistant Symmetry (r = 82px, 72-degree angles, centered at 110, 110) */
.sym-orbit-node {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(10, 25, 55, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 14px rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.25s, box-shadow 0.25s;
}

.sym-orbit-node:hover {
  transform: translate(-50%, -50%) scale(1.2) !important;
  border-color: #38bdf8;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 22px rgba(56, 189, 248, 0.8);
}

.sym-orbit-node svg {
  display: block;
}

/* Exact Coordinates (center is 110, 110 with radius 82) */
.node-pos-top {
  left: 110px;
  top: 28px;
  transform: translate(-50%, -50%);
}

.node-pos-tr {
  left: 188px;
  top: 85px;
  transform: translate(-50%, -50%);
}

.node-pos-br {
  left: 158px;
  top: 176px;
  transform: translate(-50%, -50%);
}

.node-pos-bl {
  left: 62px;
  top: 176px;
  transform: translate(-50%, -50%);
}

.node-pos-tl {
  left: 32px;
  top: 85px;
  transform: translate(-50%, -50%);
}

/* 3. Right Symmetrical AI Agent Cards Column (Starts at X = 630px, Width: 195px) */
.sym-agents-col {
  position: absolute;
  left: 630px;
  top: 0;
  bottom: 0;
  width: 195px;
  pointer-events: auto;
}

/* 4. Bottom Footer */
.cosmic-footer {
  width: 100%;
  max-width: 860px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cosmic-welcome {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #94a3b8;
  margin-bottom: 1px;
}

.cosmic-footer-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.4px;
  line-height: 1.15;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.45);
}

.text-serra-cyan {
  color: #38bdf8;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.8);
}

.cosmic-footer-sub {
  font-size: 12px;
  font-weight: 600;
  color: #e0f2fe;
  margin-top: 2px;
}

.cosmic-footer-desc {
  font-size: 11px;
  color: #94a3b8;
  margin: 2px 0 0;
  max-width: 480px;
}

/* Scaling adaptivity for smaller desktop / laptop viewports */
@media (max-width: 1440px) {
  .cosmic-diagram-container {
    transform: scale(0.92);
    transform-origin: center center;
  }
}

@media (max-width: 1240px) {
  .cosmic-diagram-container {
    transform: scale(0.82);
    transform-origin: center center;
  }
}

@media (max-height: 800px) {
  .cosmic-content-layout {
    padding: 24px 36px 20px;
  }
  .cosmic-diagram-container {
    transform: scale(0.85);
    transform-origin: center center;
    margin: 4px 0;
  }
}

/* Right Column: Clean Authentication Form Card */
.login-card-col {
  flex: 0.95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 64px;
  background: #ffffff;
  overflow-y: auto;
}

.login-box {
  width: 100%;
  max-width: 400px;
}

.login-box-header {
  margin-bottom: 28px;
}

.login-box-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0077c8, #00b4d8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0, 119, 200, 0.25);
}

.login-box-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: capitalize;
}

.login-box-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

/* Login Error Alert Banner */
.login-alert-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  margin-top: 16px;
  margin-bottom: 20px;
  animation: loginShake 0.4s ease-in-out;
}

.login-alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.form-input.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fffaf0;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

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

.login-form .form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  display: block;
}

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

.password-input-wrap input {
  padding-right: 42px;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.password-toggle-btn:hover {
  color: #475569;
}

.btn-login {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  background: #0077c8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 119, 200, 0.25);
  margin-top: 8px;
}

.btn-login:hover {
  background: #005fa3;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 119, 200, 0.3);
}

.btn-login:active {
  transform: translateY(0);
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.login-divider span {
  padding: 0 12px;
}

.btn-sso {
  width: 100%;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 700;
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-sso:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.login-role-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #64748b;
}

.login-role-switch a {
  color: #0077c8;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.login-role-switch a:hover {
  text-decoration: underline;
}

.login-footer-help {
  margin-top: 28px;
  text-align: center;
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.5;
}

/* ==========================================================================
   USER MANAGEMENT MODULE STYLES
   ========================================================================== */
.user-mgmt-view {
  position: fixed;
  inset: 0;
  left: var(--nav-width);
  background: #f8fafc;
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.user-mgmt-view.open {
  display: flex;
}

.user-mgmt-header {
  height: var(--header-height);
  padding: 0 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-mgmt-title-group h1 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  margin: 0;
}

.user-mgmt-title-group p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.user-mgmt-toolbar {
  padding: 16px 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.user-mgmt-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 680px;
}

.user-search-wrap {
  position: relative;
  flex: 1;
}

.user-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.user-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

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

.user-filter-select {
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  font-family: inherit;
  color: #334155;
  outline: none;
  cursor: pointer;
}

.user-mgmt-body {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
}

.user-table-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.user-table th {
  padding: 14px 18px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.user-table td {
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #334155;
}

.user-table tr:hover td {
  background: #f8fafc;
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
}

.user-cell-name {
  font-weight: 700;
  color: #0f172a;
}

.user-cell-sub {
  font-size: 11.5px;
  color: #94a3b8;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-superadmin {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-agent {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-active {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.badge-inactive {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

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

.btn-icon-action {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-action:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn-icon-action.delete:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* User sidebar profile footer widget */
.sidebar-user-widget {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 0 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--water-cyan, #38bdf8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.sidebar-user-avatar:hover {
  transform: scale(1.06);
  border-color: #ffffff;
}

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

.btn-logout-icon {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-logout-icon:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

/* Mobile responsive for Login Portal */
@media (max-width: 960px) {
  .login-brand-col {
    display: none;
  }
  .login-card-col {
    flex: 1;
    padding: 32px 24px;
  }
}

/* ==========================================================================
   SETTINGS FULL PAGE VIEW & SUB-MENUS
   ========================================================================== */
.settings-view {
  position: fixed;
  inset: 0;
  left: var(--nav-width);
  background: #f8fafc;
  z-index: 50;
  display: none;
  flex-direction: row;
  overflow: hidden;
}

.settings-view.open {
  display: flex;
}

/* Settings Sidebar */
.settings-sidebar {
  width: 290px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
  flex-shrink: 0;
  overflow-y: auto;
}

.settings-sidebar-header h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 6px 0;
  letter-spacing: -0.3px;
}

.settings-sidebar-header p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 24px 0;
}

.settings-nav-group {
  margin-bottom: 24px;
}

.settings-nav-group-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 14px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
}

.settings-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.settings-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.settings-nav-item.active {
  background: #f0fdf4;
  color: #0d9488;
  border-color: #14b8a6;
}

/* Specific theme matching Pureve ocean azure */
.settings-nav-item.active {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary);
}

/* Settings Main Content Pane */
.settings-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #f8fafc;
}

.settings-content-header {
  padding: 24px 36px 18px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-header-titles h1 {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.3px;
}

.settings-header-titles p {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0;
}

.settings-main-pane {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px;
}

/* Settings Pill Tabs */
.settings-tab-pills {
  display: inline-flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  margin-bottom: 24px;
}

.settings-tab-pill {
  padding: 7px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-tab-pill.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Avatar Upload Box */
.avatar-profile-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.avatar-upload-box {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  border: 2px dashed var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--primary-subtle);
  position: relative;
  flex-shrink: 0;
}

.avatar-upload-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  border-radius: 10px;
}

.avatar-upload-box:hover .avatar-upload-overlay {
  opacity: 1;
}

.avatar-info-text h4 {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.avatar-info-text p {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 8px 0;
  line-height: 1.45;
}

/* Card container for forms */
.settings-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: .25s ease;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* ==========================================================================
   META WHATSAPP 24-HOUR CUSTOMER SERVICE WINDOW & ERROR 131047 STYLES
   ========================================================================== */

/* 24h Window Countdown Badges in Chat Header */
.badge-window {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.badge-window-active {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-window-warning {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-window-expired {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  animation: pulseExpired 2.5s infinite;
}

@keyframes pulseExpired {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* 24-Hour Window Expired Warning Alert Banner */
.window-expired-banner {
  background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
  border-top: 1px solid #fca5a5;
  border-bottom: 1px solid #fecaca;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.05);
  animation: bannerSlideIn 0.3s ease-out;
  position: relative;
  z-index: 10;
}

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

.window-expired-banner .banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fecaca;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.window-expired-banner .banner-content {
  flex: 1;
}

.window-expired-banner .banner-title {
  font-size: 13px;
  font-weight: 700;
  color: #991b1b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.window-expired-banner .banner-desc {
  font-size: 12px;
  color: #7f1d1d;
  margin-top: 2px;
  line-height: 1.45;
}

.window-expired-banner .banner-action {
  flex-shrink: 0;
}

.btn-template-action {
  background: #16a34a;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}

.btn-template-action:hover {
  background: #15803d;
  transform: translateY(-1px);
}

/* Locked Chat Input State */
.chat-composer.window-locked .chat-input {
  background-color: #f8fafc;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #cbd5e1;
}

.chat-composer.window-locked .chat-input::placeholder {
  color: #94a3b8;
  font-style: italic;
}

.chat-composer.window-locked .btn-send {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.chat-composer.window-locked #btnAttachment {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Failed Message Indicator & Tooltip */
.msg-status-failed {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ef4444;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}

.msg-status-failed-badge {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.msg-status-failed:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: normal;
  max-width: 250px;
  width: max-content;
  line-height: 1.35;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 100;
  pointer-events: none;
}

.msg-status-failed:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  right: 8px;
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  z-index: 100;
  pointer-events: none;
}

/* ==========================================================================
   CUSTOMER / LEAD PROFILE CARD & RESOLVE ACTIONS
   ========================================================================== */

.crm-lead-profile-container {
  padding: 12px 14px;
}

.crm-lead-header-title {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #25a172;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.crm-lead-card {
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-lead-field-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.crm-lead-label {
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.lead-form-input,
.lead-form-select {
  width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.lead-form-input:focus,
.lead-form-select:focus {
  background-color: #ffffff;
  border-color: #25a172;
  box-shadow: 0 0 0 2px rgba(37, 161, 114, 0.15);
}

.lead-form-input[readonly],
.lead-form-input.input-readonly,
.lead-form-select:disabled,
.lead-form-select.input-readonly {
  background-color: #f1f5f9 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  border-color: #cbd5e1 !important;
  user-select: none;
  font-weight: 500;
  opacity: 0.9;
}

.lead-form-input.is-invalid,
.lead-form-select.is-invalid,
.lead-multi-select-trigger.is-invalid {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
  animation: shakeInput 0.3s ease;
}

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

/* Multi-Select Problem Component */
.lead-multi-select-wrap {
  position: relative;
  width: 100%;
}

.lead-multi-select-trigger {
  width: 100%;
  min-height: 33px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 500;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
  box-sizing: border-box;
}

.lead-multi-select-trigger:hover {
  border-color: #25a172;
  background-color: #ffffff;
}

.lead-multi-select-wrap.active .lead-multi-select-trigger {
  background-color: #ffffff;
  border-color: #25a172;
  box-shadow: 0 0 0 2px rgba(37, 161, 114, 0.15);
}

.lead-multi-select-trigger[readonly],
.lead-multi-select-trigger.input-readonly,
.lead-multi-select-wrap.disabled .lead-multi-select-trigger {
  background-color: #f1f5f9 !important;
  color: #64748b !important;
  cursor: not-allowed !important;
  border-color: #cbd5e1 !important;
  user-select: none;
  font-weight: 500;
  opacity: 0.9;
}

.lead-multi-select-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.lead-multi-select-placeholder {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  font-style: italic;
}

.lead-multi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.lead-multi-badge-remove {
  cursor: pointer;
  font-size: 13px;
  color: #047857;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  line-height: 1;
  transition: all 0.15s;
}

.lead-multi-badge-remove:hover {
  background-color: #059669;
  color: #ffffff;
}

.lead-multi-select-arrow {
  color: #64748b;
  font-size: 11px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.lead-multi-select-wrap.active .lead-multi-select-arrow {
  transform: rotate(180deg);
}

.lead-multi-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  overflow: hidden;
}

.lead-multi-select-search-box {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.lead-multi-select-search-input {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.lead-multi-select-search-input:focus {
  border-color: #25a172;
  box-shadow: 0 0 0 2px rgba(37, 161, 114, 0.15);
}

.lead-multi-select-items {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.lead-multi-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.lead-multi-select-item:hover {
  background-color: #f1f5f9;
}

.lead-multi-select-item.selected {
  background-color: #f0fdf4;
  color: #166534;
  font-weight: 600;
}

.lead-multi-select-checkbox {
  width: 14px;
  height: 14px;
  accent-color: #25a172;
  cursor: pointer;
  margin: 0;
}

.crm-lead-actions-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed #e2e8f0;
}

.lead-buttons-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-lead-resolve {
  background: #25a172;
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(37, 161, 114, 0.2);
}

.btn-lead-resolve:hover {
  background: #1f8960;
  transform: translateY(-1px);
}

.btn-lead-resolve.resolved {
  background: #0284c7;
  color: #ffffff;
}

.btn-lead-resolve.resolved:hover {
  background: #0369a1;
}

.btn-lead-note {
  background: #1e3a5f;
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(30, 58, 95, 0.2);
}

.btn-lead-note:hover {
  background: #162c46;
  transform: translateY(-1px);
}

/* Bot & AI Live Monitoring Notice Bar */
.bot-ai-monitoring-bar {
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  box-sizing: border-box;
}

.bot-ai-monitoring-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  border-radius: 10px;
}

.bot-ai-monitoring-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #ede9fe;
  border-radius: 8px;
  color: #7c3aed;
  flex-shrink: 0;
}

.bot-ai-monitoring-text {
  font-size: 13px;
  line-height: 1.5;
  color: #4c1d95;
}

.bot-ai-monitoring-text strong {
  color: #6d28d9;
}

/* ==========================================================================
   CUSTOMER PROFILE: SEGMENTED TAB SWITCHER & JOURNEY MILESTONE TIMELINE
   ========================================================================== */

.crm-tab-switcher {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 10px;
  margin: 12px 16px 14px;
  gap: 4px;
  border: 1px solid #e2e8f0;
}

.crm-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-tab-btn:hover {
  color: #0f172a;
}

.crm-tab-btn.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.crm-tab-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 10px;
  background: #e0f2fe;
  color: #0284c7;
}

.crm-tab-btn.active .crm-tab-badge {
  background: #0284c7;
  color: #ffffff;
}

/* Milestone Timeline Container */
.milestone-container {
  padding: 0 16px 24px;
}

.milestone-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.milestone-filter-chip {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.milestone-filter-chip:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.milestone-filter-chip.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.milestone-timeline {
  position: relative;
  padding-left: 20px;
}

.milestone-timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 7px;
  width: 2px;
  background: #e2e8f0;
}

.milestone-item {
  position: relative;
  margin-bottom: 16px;
}

.milestone-item:last-child {
  margin-bottom: 0;
}

.milestone-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 1.5px #cbd5e1;
  background: #94a3b8;
  z-index: 2;
  transition: transform 0.2s ease;
}

.milestone-item:hover .milestone-dot {
  transform: scale(1.2);
}

.milestone-dot.ai {
  background: #8b5cf6;
  box-shadow: 0 0 0 2px #ddd6fe;
}

.milestone-dot.customer {
  background: #0284c7;
  box-shadow: 0 0 0 2px #bae6fd;
}

.milestone-dot.human {
  background: #10b981;
  box-shadow: 0 0 0 2px #a7f3d0;
}

.milestone-dot.system {
  background: #f59e0b;
  box-shadow: 0 0 0 2px #fde68a;
}

.milestone-dot.handoff {
  background: #ec4899;
  box-shadow: 0 0 0 2px #fbcfe8;
}

.milestone-dot.lead-stage {
  background: #f97316;
  box-shadow: 0 0 0 2px #fed7aa;
}

.milestone-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.milestone-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

.milestone-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.milestone-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}

.milestone-time {
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.milestone-actor-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.milestone-actor-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.milestone-actor-badge.ai {
  background: #ede9fe;
  color: #6d28d9;
}

.milestone-actor-badge.customer {
  background: #e0f2fe;
  color: #0369a1;
}

.milestone-actor-badge.human {
  background: #ecfdf5;
  color: #047857;
}

.milestone-actor-badge.system {
  background: #fef3c7;
  color: #b45309;
}

.milestone-desc {
  font-size: 11.5px;
  color: #475569;
  line-height: 1.45;
  margin-bottom: 6px;
  word-break: break-word;
}

.milestone-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  border-top: 1px dashed #f1f5f9;
  padding-top: 6px;
}

.milestone-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.milestone-jump-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* Pulse animation for jump-to-chat highlight */
@keyframes messageHighlightPulse {
  0% {
    background-color: #fef08a;
    box-shadow: 0 0 0 4px #fde047;
    transform: scale(1.02);
  }
  50% {
    background-color: #fef9c3;
    box-shadow: 0 0 0 2px #fef08a;
  }
  100% {
    background-color: transparent;
    box-shadow: none;
    transform: scale(1);
  }
}

.message-highlight-pulse {
  animation: messageHighlightPulse 2.4s ease-out;
}

/* ==========================================================================
   OUTBOUND OFFICE WHATSAPP WEB FOLLOW-UP
   ========================================================================== */

.btn-wa-web-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #25d366;
  color: #ffffff;
  border: none;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(37, 211, 102, 0.3);
}

.btn-wa-web-mini:hover {
  background: #1eb956;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.45);
}

.btn-lead-followup-wa {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
}

.btn-lead-followup-wa:hover {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(22, 163, 74, 0.35);
}

.milestone-dot.external-followup {
  background: #16a34a;
  box-shadow: 0 0 0 2px #bbf7d0;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}

/* Circular spinning loader */
.circular-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: omniSpin 0.75s linear infinite;
}

.circular-spinner.spinner-sm {
  width: 22px;
  height: 22px;
  border-width: 2.5px;
}

.circular-spinner.spinner-lg {
  width: 42px;
  height: 42px;
  border-width: 3.5px;
}

@keyframes omniSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.conv-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  text-align: center;
  gap: 12px;
}

.conv-loading-text {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  margin: 0;
}

/* ==========================================================================
   CUSTOMERS FULL PAGE OVERLAY VIEW
   ========================================================================== */
.customers-view {
  position: fixed;
  inset: 0;
  left: var(--nav-width);
  background: #f8fafc;
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.customers-view.open {
  display: flex;
}

.customers-header {
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
}

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

.customers-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0077c8, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.customers-header-titles h1 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.customers-header-titles p {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

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

.customers-toolbar {
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.customers-filters-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.customers-search-box {
  position: relative;
  min-width: 260px;
  flex: 1;
  max-width: 380px;
}

.customers-search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.customers-search-box input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  outline: none;
  transition: all 0.2s;
}

.customers-search-box input:focus {
  background: #ffffff;
  border-color: #0077c8;
  box-shadow: 0 0 0 3px rgba(0, 119, 200, 0.12);
}

.customers-select-filter {
  padding: 7px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  outline: none;
  cursor: pointer;
  max-width: 165px;
  transition: all 0.2s;
}

.customers-select-filter:focus {
  background: #ffffff;
  border-color: #0077c8;
}

.customers-stats-pill {
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.customers-body {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.customers-table-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.customers-table-responsive {
  overflow-x: auto;
  flex: 1;
}

.customers-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

.customers-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.customers-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  vertical-align: middle;
}

.customers-table tbody tr {
  transition: background 0.15s ease;
}

.customers-table tbody tr:hover {
  background: #f8fafc;
}

.cust-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cust-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0077c8, #38bdf8);
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cust-name-text {
  font-weight: 600;
  color: #0f172a;
}

.cust-phone-badge {
  font-family: monospace;
  font-size: 12px;
  color: #0077c8;
  background: #f0f9ff;
  padding: 3px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cust-stage-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  display: inline-block;
  white-space: nowrap;
}

.cust-stage-badge.stage-new { background: #e0f2fe; color: #0369a1; }
.cust-stage-badge.stage-qualified { background: #dcfce7; color: #15803d; }
.cust-stage-badge.stage-consultation { background: #fef3c7; color: #b45309; }
.cust-stage-badge.stage-survey { background: #ede9fe; color: #6d28d9; }
.cust-stage-badge.stage-quotation { background: #fce7f3; color: #be185d; }
.cust-stage-badge.stage-won { background: #bbf7d0; color: #166534; }
.cust-stage-badge.stage-lost { background: #fee2e2; color: #991b1b; }
.cust-stage-badge.stage-nurture { background: #f1f5f9; color: #475569; }

.cust-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}

.cust-action-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.cust-action-btn.btn-chat {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
}

.cust-action-btn.btn-chat:hover {
  background: #dbeafe;
}

.cust-action-btn.btn-delete {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #e11d48;
}

.cust-action-btn.btn-delete:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #be123c;
}

.customers-pagination-bar {
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  background: #ffffff;
  font-size: 12.5px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 10px;
}

.customers-pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.import-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f8fafc;
}

.import-dropzone:hover, .import-dropzone.dragover {
  border-color: #0077c8;
  background: #f0f9ff;
}

.import-result-box {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}

.import-result-box.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.import-result-box.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.cust-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  letter-spacing: 0.2px;
}

.cust-source-badge.source-organic {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

.cust-channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #15803d;
  white-space: nowrap;
}

.cust-channel-pill svg {
  flex-shrink: 0;
}

/* ==========================================================================
   3.6 ENTERPRISE ANALYTICS DASHBOARD
   ========================================================================== */
.analytics-view {
  position: fixed;
  inset: 0;
  left: var(--nav-width);
  background: #f8fafc;
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.analytics-view.open {
  display: flex;
}

.analytics-header {
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
}

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

.analytics-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0077c8, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
}

.analytics-header-titles h1 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}

.analytics-header-titles p {
  font-size: 12px;
  color: #64748b;
  margin: 3px 0 0 0;
}

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

.analytics-time-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 11.5px;
  color: #475569;
  font-weight: 500;
}

/* Tabs Bar */
.analytics-tabs-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.analytics-tabs-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.analytics-tab-btn:hover {
  color: #0077c8;
}

.analytics-tab-btn.active {
  color: #0077c8;
  border-bottom-color: #0077c8;
}

/* Body & Grid */
.analytics-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.analytics-tab-content {
  display: none;
}

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

.analytics-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

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

.analytics-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.analytics-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* KPI Grids */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.analytics-split-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.analytics-mau-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}

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

.kpi-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #64748b;
}

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

.kpi-value {
  font-size: 38px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.8px;
  margin: 8px 0 4px 0;
  line-height: 1.1;
}

.kpi-subtext {
  font-size: 11px;
  color: #94a3b8;
}

/* Analytics Table */
.analytics-table-wrap {
  overflow-x: auto;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.analytics-table th {
  padding: 10px 14px;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.analytics-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}

.analytics-table tr:hover td {
  background: #f8fafc;
}

.status-badge-online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #dcfce7;
  color: #166534;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge-offline {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.status-badge-standby {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.persona-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.persona-box-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.persona-box-spec {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
}

.persona-box-metric {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed #cbd5e1;
}

/* Responsiveness */
@media (max-width: 1024px) {
  .analytics-kpi-grid,
  .analytics-mau-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-split-grid {
    grid-template-columns: 1fr;
  }
  .analytics-split-grid > div {
    grid-column: span 12 !important;
  }
}

/* ==========================================================================
   PUREVE PRODUCTS & INVENTORY VIEW (ENGLISH UI & SAP INTEGRATION)
   ========================================================================== */
.products-view {
  position: fixed;
  inset: 0;
  left: var(--nav-width);
  background: #f8fafc;
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.products-view.open {
  display: flex;
}

.products-header {
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
}

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

.products-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

.products-header-titles h1 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.products-header-titles p {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

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

.products-toolbar {
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.products-filters-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}

.products-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 280px;
  max-width: 400px;
  flex: 1;
}

.products-search-box svg {
  color: #94a3b8;
  flex-shrink: 0;
}

.products-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  width: 100%;
  color: #1e293b;
}

.products-select-filter {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 12.5px;
  color: #334155;
  background-color: #ffffff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.products-select-filter:focus {
  border-color: #0284c7;
}

.products-stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prod-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.prod-stat-rental {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.prod-stat-sp {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.prod-stat-val {
  font-weight: 700;
  font-size: 12px;
}

.products-table-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.products-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid var(--border);
}

.products-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #475569;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.products-table td {
  padding: 12px 16px;
  font-size: 12.5px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.products-table tr:hover td {
  background-color: #f8fafc;
}

/* Badges & Tags */
.badge-sap {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid #bae6fd;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.5px;
}

.badge-prod-type {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-type-unit {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.badge-type-sparepart {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.pricing-pills-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pill-price-outright {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #047857;
  background: #ecfdf5;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  width: fit-content;
}

.pill-price-rental {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #1d4ed8;
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  width: fit-content;
}

.tag-water-issue {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10.5px;
  margin: 1px 2px 1px 0;
}

.products-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 10px;
  margin-top: 16px;
  border: 1px dashed #cbd5e1;
}

.switch-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 20px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
  background-color: #059669;
}

.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(16px);
}

/* ==========================================================================
   3.7 QISCUS-STYLE WHATSAPP TEMPLATES MANAGER & BUILDER WIZARD
   ========================================================================== */

/* Info Banner */
.wa-tpl-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.wa-tpl-info-icon {
  color: #2563eb;
  flex-shrink: 0;
  margin-top: 1px;
}

.wa-tpl-info-text strong {
  font-size: 13.5px;
  color: #1e3a8a;
  display: inline-block;
  margin-bottom: 2px;
}

.wa-tpl-info-text p {
  margin: 0;
  font-size: 12.5px;
  color: #3b82f6;
  line-height: 1.45;
}

/* Action Bar */
.wa-tpl-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.wa-tpl-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 360px;
}

.wa-tpl-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.wa-tpl-search-wrap input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #1e293b;
  outline: none;
  transition: all 0.2s;
}

.wa-tpl-search-wrap input:focus {
  border-color: #00a884;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.12);
}

.wa-tpl-filter-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wa-tpl-review-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.wa-tpl-review-pill:hover,
.wa-tpl-review-pill.active {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #b45309;
}

.wa-tpl-review-pill .badge {
  background: #0284c7;
  color: #ffffff;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
}

.wa-tpl-select-filter {
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.wa-tpl-select-filter:focus {
  border-color: #00a884;
}

.wa-tpl-btn-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #00a884 !important;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 168, 132, 0.2);
}

.wa-tpl-btn-new:hover {
  background: #008f6f !important;
  transform: translateY(-1px);
}

/* Status & Quality Badges */
.quality-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 500;
  background: #f1f5f9;
  color: #64748b;
}

.quality-pill.high {
  background: #ecfdf5;
  color: #059669;
}

.quality-pill.medium {
  background: #fffbeb;
  color: #d97706;
}

.quality-pill.low {
  background: #fef2f2;
  color: #dc2626;
}

.category-pill {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.category-pill.marketing {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #dbeafe;
}

.category-pill.utility {
  background: #f0fdf4;
  color: #15803d;
  border-color: #dcfce7;
}

.category-pill.auth {
  background: #faf5ff;
  color: #7e22ce;
  border-color: #f3e8ff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
}

.status-pill.approved {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.status-pill.pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.status-pill.rejected {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Table Card & Responsive Container */
.wa-tpl-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  margin-bottom: 20px;
}

.wa-tpl-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.wa-tpl-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  table-layout: fixed;
}

.wa-tpl-table th {
  padding: 13px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.wa-tpl-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
}

.wa-tpl-table tbody tr {
  transition: background-color 0.15s ease;
}

.wa-tpl-table tbody tr:hover td {
  background: #fbfcfe;
}

.wa-tpl-table tbody tr:last-child td {
  border-bottom: none;
}

/* Action Icon Buttons */
.wa-action-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wa-action-icon-btn.preview:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
  transform: translateY(-1px);
}

.wa-action-icon-btn.delete:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
  transform: translateY(-1px);
}

/* Unified Card Footer Toolbar */
.wa-tpl-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 12px;
}

.wa-tpl-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wa-tpl-pagination .page-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.wa-tpl-pagination .page-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.wa-tpl-pagination .page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ==========================================================================
   WIZARD CREATOR STYLES
   ========================================================================== */
.wa-wizard-header {
  margin-bottom: 24px;
}

.wa-wizard-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #00a884;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
}

.wa-wizard-back-link:hover {
  text-decoration: underline;
}

.wa-wizard-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
}

.wa-wizard-desc {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 20px;
}

.wa-wizard-steps {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  max-width: 480px;
}

.wa-wizard-step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
}

.wa-wizard-step-indicator.active {
  color: #00a884;
}

.wa-wizard-step-indicator .step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.wa-wizard-step-indicator.active .step-num {
  background: #00a884;
  color: #ffffff;
}

.wa-wizard-step-line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
}

.wa-wizard-step-line.active {
  background: #00a884;
}

/* Category Cards Grid */
.wa-category-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.wa-category-card {
  position: relative;
  cursor: pointer;
  display: block;
}

.wa-category-card input {
  position: absolute;
  opacity: 0;
}

.wa-cat-card-body {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  background: #ffffff;
  transition: all 0.2s;
  height: 100%;
}

.wa-category-card input:checked + .wa-cat-card-body {
  border-color: #00a884;
  background: #f0fdf9;
  box-shadow: 0 2px 8px rgba(0, 168, 132, 0.1);
}

.wa-cat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.wa-cat-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.wa-cat-desc {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

/* Language Tag Box */
.wa-lang-tag-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wa-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #00a884;
  color: #ffffff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.wa-lang-select {
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  background: #ffffff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.wa-lang-select:focus {
  border-color: #00a884;
}

/* Notice Banner */
.wa-tpl-notice-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #e6fffa;
  border: 1px solid #b2f5ea;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: #234e52;
}

.wa-tpl-notice-banner svg {
  flex-shrink: 0;
  color: #00a884;
}

/* Form Controls for WhatsApp Wizard */
.form-control,
.wa-form-control {
  width: 100% !important;
  box-sizing: border-box !important;
  display: block;
  padding: 11px 15px;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13.5px;
  color: #1e293b;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  line-height: 1.4;
}

select.form-control,
select.wa-form-control,
select.wa-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 15px;
  padding-right: 38px !important;
  cursor: pointer;
}

.form-control:focus,
.wa-form-control:focus {
  border-color: #00a884 !important;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.15) !important;
}

/* Workspace Split Grid */
.wa-builder-split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 960px) {
  .wa-builder-split-grid {
    grid-template-columns: 1fr;
  }
}

/* Component Navigation Tabs (Sequential Sub-steps) */
.wa-comp-tabs-bar {
  display: flex;
  border: 1px solid #e2e8f0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.wa-comp-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 14px;
  background: #ffffff;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.wa-comp-tab:hover:not(.active) {
  background: #f8fafc;
  color: #1e293b;
}

.wa-comp-tab.active {
  color: #00a884;
  border-bottom-color: #00a884;
  background: #f0fdf9;
}

.tab-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
}

.tab-indicator-dot.required {
  background: #00a884;
}

.comp-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.comp-panel-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 2px;
}

.badge-optional {
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  margin-left: 4px;
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 10px;
}

.badge-required {
  font-size: 11px;
  font-weight: 600;
  color: #ef4444;
  margin-left: 4px;
  background: #fef2f2;
  padding: 2px 7px;
  border-radius: 10px;
}

.comp-panel-desc {
  font-size: 12.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

.char-counter {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 6px;
}

/* Format Toolbar */
.wa-format-toolbar {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 8px 8px 0 0;
}

.wa-format-toolbar .toolbar-btn {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  color: #334155;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.wa-format-toolbar .toolbar-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  background: #cbd5e1;
  margin: 0 4px;
}

.toolbar-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid #b2f5ea;
  background: #e6fffa;
  color: #0d9488;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.toolbar-btn-action:hover {
  background: #ccfbf1;
  border-color: #5eead4;
}

/* Body Textarea */
textarea.wa-body-textarea {
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: 140px;
  display: block;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: none;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-left-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea.wa-body-textarea:focus {
  border-color: #00a884;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.12);
}

/* Sample Values Box */
.wa-sample-values-box {
  width: 100%;
  box-sizing: border-box;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
}

.sample-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.sample-box-desc {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 14px;
  line-height: 1.4;
}

.wa-var-inputs-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.wa-var-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.wa-var-badge {
  font-family: monospace;
  font-weight: 700;
  padding: 9px 12px;
  background: #e2e8f0;
  color: #1e293b;
  border-radius: 7px;
  font-size: 12.5px;
  min-width: 54px;
  text-align: center;
  flex-shrink: 0;
}

.wa-var-row input {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

.wa-btn-input-row {
  margin-bottom: 10px;
}

.wa-wizard-step2-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
}

.wa-btn-back-prev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  border: 1.5px solid #00a884;
  background: #f0fdf9;
  color: #008767;
  cursor: pointer;
  transition: all 0.2s ease;
}

.wa-btn-back-prev:hover {
  background: #e6fcf5;
  border-color: #008767;
  color: #007055;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 168, 132, 0.18);
}

.wa-btn-finish {
  background: #00a884 !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 168, 132, 0.25);
  color: #ffffff;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.wa-btn-finish:hover {
  background: #008f6f !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   LIVE WHATSAPP PHONE MOCKUP
   ========================================================================== */
.wa-phone-mockup {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 20px;
}

.wa-phone-header {
  background: #075e54;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.wa-phone-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #128c7e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.wa-phone-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.wa-phone-status {
  font-size: 10.5px;
  opacity: 0.8;
}

.wa-phone-screen {
  background-color: #efeae2;
  background-image: radial-gradient(#d1d7db 1px, transparent 1px);
  background-size: 16px 16px;
  padding: 20px 14px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* WhatsApp Message Bubble */
.wa-chat-bubble {
  background: #ffffff;
  border-radius: 8px 8px 8px 0;
  padding: 10px 12px 8px;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.13);
  max-width: 100%;
  position: relative;
  word-wrap: break-word;
}

.wa-chat-bubble:before {
  content: "";
  position: absolute;
  bottom: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-bottom: 12px solid #ffffff;
  border-left: 10px solid transparent;
}

.wa-bubble-header {
  font-size: 13px;
  font-weight: 700;
  color: #111b21;
  margin-bottom: 6px;
}

.wa-bubble-header.media-placeholder {
  background: #f0f2f5;
  border-radius: 6px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #667781;
  font-size: 12px;
  gap: 6px;
  margin-bottom: 8px;
}

.wa-bubble-body {
  font-size: 12.5px;
  color: #111b21;
  line-height: 1.45;
  white-space: pre-wrap;
}

.wa-bubble-footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 6px;
  gap: 12px;
}

.wa-bubble-footer-text {
  font-size: 11px;
  color: #667781;
  flex: 1;
}

.wa-bubble-time {
  font-size: 10px;
  color: #667781;
  white-space: nowrap;
}

.wa-bubble-buttons-list {
  margin-top: 8px;
  border-top: 1px solid #f0f2f5;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wa-bubble-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f0f2f5;
  border: none;
  border-radius: 6px;
  padding: 7px 12px;
  color: #00a884;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

/* ==========================================================================
   BROADCAST & CAMPAIGNS FULL PAGE OVERLAY VIEW
   ========================================================================== */
.broadcast-view {
  position: fixed;
  inset: 0;
  left: var(--nav-width);
  background: #f8fafc;
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.broadcast-view.open {
  display: flex !important;
}

.broadcast-header {
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 16px;
}

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

.broadcast-header-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.broadcast-header-titles h1 {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 2px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.broadcast-header-titles p {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

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

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

