/* =====================================================================
   Chatwoot Design System & Styling (cPanel Edition)
   Matches Chatwoot v3 / Radix UI Colors / Tailwind Theme
   ===================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-brand: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  
  /* BizConnect Brand Palette */
  --woot-50: #eff6ff;
  --woot-100: #dbeafe;
  --woot-200: #bfdbfe;
  --woot-300: #93c5fd;
  --woot-400: #60a5fa;
  --woot-500: #1f93ff;
  --woot-600: #0284c7;
  --woot-700: #0369a1;
  --woot-800: #075985;
  --woot-900: #0c4a6e;

  /* WhatsApp Brand Green */
  --wa-green: #25D366;
  --wa-dark-green: #128C7E;
  --wa-teal: #075E54;
  --wa-light: #dcf8c6;

  /* Radix Slate Palette */
  --slate-25: #fcfcfd;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #080d1a;

  /* UI Variables */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --sidebar-bg: #131c2d;
  --sidebar-hover: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Master App Layout Grid */
.cw-app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-primary);
}

/* 1. Primary Left Navigation Rail (Expandable on Hover) */
.cw-rail-container {
  width: 64px;
  height: 100vh;
  flex-shrink: 0;
  position: relative;
  z-index: 150;
}

.cw-rail {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 64px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: width 0.26s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.26s ease;
  overflow: hidden;
  z-index: 150;
}

.cw-rail:hover {
  width: 250px;
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
  overflow-y: auto;
  overflow-x: hidden;
}

.cw-rail::-webkit-scrollbar {
  width: 4px;
}
.cw-rail::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.cw-rail-top {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.cw-rail-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 4px;
  margin-bottom: 20px;
  cursor: pointer;
  text-decoration: none;
}

.cw-rail-logo {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, #1f93ff, #0284c7);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 4px 12px rgba(31, 147, 255, 0.35);
  flex-shrink: 0;
}

.cw-rail-logo-text {
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  white-space: nowrap;
}

.cw-rail:hover .cw-rail-logo-text {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.cw-rail-logo-text .logo-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.cw-rail-logo-text .logo-subtitle {
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cw-rail-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.cw-rail-item {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  text-decoration: none;
}

.cw-rail-item:hover {
  color: var(--sidebar-active);
  background: var(--sidebar-hover);
}

.cw-rail-item.active {
  color: #ffffff;
  background: #1f93ff;
  box-shadow: 0 4px 12px rgba(31, 147, 255, 0.35);
}

.cw-rail-icon-wrap {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.cw-rail-item .badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  line-height: 1;
}

.cw-rail-label {
  display: inline-block;
  opacity: 0;
  transform: translateX(-8px);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-rail:hover .cw-rail-label {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.cw-rail-item:hover .cw-rail-label {
  color: #ffffff;
}

.cw-rail-item.active .cw-rail-label {
  color: #ffffff;
  font-weight: 600;
}

.cw-rail-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 12px;
}

.cw-rail-profile:hover {
  background: var(--sidebar-hover);
}

.cw-rail-user-meta {
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}

.cw-rail:hover .cw-rail-user-meta {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.cw-rail-user-name {
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.cw-rail-user-role {
  color: #94a3b8;
  font-size: 11px;
}

.cw-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

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

.cw-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
}

.cw-status-dot.online { background: #10b981; }
.cw-status-dot.busy { background: #f59e0b; }
.cw-status-dot.offline { background: #6b7280; }

/* 2. Conversations Column (Column 1) */
.cw-conv-list-pane {
  width: 360px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  overflow: hidden;
}

.cw-conv-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

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

.cw-conv-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-900);
}

.cw-btn-new-chat {
  background: var(--woot-50);
  color: var(--woot-600);
  border: 1px solid var(--woot-200);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.cw-btn-new-chat:hover {
  background: var(--woot-500);
  color: white;
  border-color: var(--woot-500);
}

/* Tabs: Mine / Unassigned / All */
.cw-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  background: var(--slate-100);
  padding: 3px;
  border-radius: 8px;
}

.cw-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.cw-tab-btn.active {
  background: #ffffff;
  color: var(--slate-900);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Search bar */
.cw-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cw-search-input {
  width: 100%;
  background: var(--slate-50);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  color: var(--slate-900);
  outline: none;
  transition: border-color 0.2s;
}

.cw-search-input:focus {
  border-color: var(--woot-500);
  background: #ffffff;
}

.cw-search-icon {
  position: absolute;
  left: 10px;
  color: var(--slate-400);
  pointer-events: none;
}

/* Conversation Cards Scroll Area */
.cw-conv-scroll {
  flex: 1;
  overflow-y: auto;
}

.cw-conv-card {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  gap: 12px;
  transition: background 0.15s ease;
  position: relative;
}

.cw-conv-card:hover {
  background: var(--slate-50);
}

.cw-conv-card.active {
  background: #eef7ff;
  border-left: 3px solid var(--woot-500);
}

.cw-card-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.cw-wa-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #25D366;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

.cw-card-body {
  flex: 1;
  min-width: 0;
}

.cw-card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.cw-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cw-card-time {
  font-size: 11px;
  color: var(--slate-400);
  flex-shrink: 0;
  margin-left: 6px;
}

.cw-card-snippet {
  font-size: 13px;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.cw-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cw-card-labels {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cw-tag-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  color: white;
}

.cw-unread-badge {
  background: #10b981;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

/* 3. Main Chat Conversation Box (Column 2) */
.cw-chat-pane {
  flex: 1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

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

.cw-chat-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cw-contact-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw-channel-pill {
  background: #e6f9ee;
  color: #128c7e;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cw-contact-sub {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 2px;
}

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

.cw-select-btn {
  background: var(--slate-50);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-700);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}

.cw-btn-resolve {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.cw-btn-resolve:hover {
  background: #10b981;
  color: white;
}

.cw-btn-reopen {
  background: #eff6ff;
  color: #1f93ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.cw-btn-icon {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--slate-600);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.cw-btn-icon:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

/* Chat Messages Feed */
.cw-messages-feed {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #efeae2;
  background-image: radial-gradient(#d6cec4 1px, transparent 1px), radial-gradient(#d6cec4 1px, #efeae2 1px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

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

.cw-date-divider span {
  background: rgba(255, 255, 255, 0.92);
  color: #54656f;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08);
}

/* Message Rows & Bubbles (Authentic WhatsApp Theme) */
.cw-message-row {
  display: flex;
  flex-direction: column;
  max-width: 68%;
}

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

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

.cw-message-row.activity {
  align-self: center;
  max-width: 90%;
  margin: 6px 0;
}

.cw-bubble {
  padding: 8px 12px 6px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(11, 20, 26, 0.12);
}

.cw-message-row.incoming .cw-bubble {
  background: #ffffff;
  color: #111b21;
  border-top-left-radius: 2px;
}

.cw-message-row.outgoing .cw-bubble {
  background: #d9fdd3;
  color: #111b21;
  border-top-right-radius: 2px;
}

/* Private Internal Team Note */
.cw-message-row.private {
  align-self: center;
  max-width: 88%;
  width: 100%;
}

.cw-message-row.private .cw-bubble {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(180, 83, 9, 0.08);
}

.cw-private-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #b45309;
  margin-bottom: 4px;
}

.cw-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 11px;
  margin-top: 4px;
  color: #667781;
}

.cw-message-row.incoming .cw-bubble-meta {
  color: #667781;
}

.cw-message-row.outgoing .cw-bubble-meta {
  color: #667781;
}

/* WhatsApp Double Blue & Gray Ticks */
.cw-tick-read {
  color: #53bdeb;
  display: inline-flex;
}

.cw-tick-delivered {
  color: #8696a0;
  display: inline-flex;
}

/* Rich WhatsApp Catalog Product Card in Chat */
.cw-rich-card {
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 6px;
  max-width: 320px;
}

.cw-rich-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.cw-rich-card-content {
  padding: 10px 12px;
}

.cw-rich-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cw-rich-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 4px;
}

.cw-rich-card-price {
  font-size: 15px;
  font-weight: 800;
  color: #059669;
  margin-bottom: 6px;
}

.cw-rich-card-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 10px;
}

.cw-rich-card-actions {
  display: flex;
  gap: 6px;
}

.cw-rich-card-btn {
  flex: 1;
  background: #25D366;
  color: #ffffff;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.15s;
}

.cw-rich-card-btn:hover {
  background: #1eb857;
}

.cw-rich-card-btn.secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.cw-rich-card-btn.secondary:hover {
  background: #e2e8f0;
}

/* Rich WhatsApp In-Chat Form Card in Chat */
.cw-form-card {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
  padding: 12px;
  margin-bottom: 6px;
  max-width: 320px;
}

.cw-form-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #0284c7;
  background: #eff6ff;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.cw-form-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.cw-form-card-desc {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 10px;
}

.cw-form-card-btn {
  width: 100%;
  background: #0284c7;
  color: white;
  border: none;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.cw-form-card-btn:hover {
  background: #0369a1;
}

/* Rich Meta Template Card in Chat */
.cw-template-card {
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 12px;
  margin-bottom: 6px;
  max-width: 340px;
}

.cw-template-header {
  font-size: 10px;
  font-weight: 700;
  color: #6366f1;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.cw-template-body {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.45;
  margin-bottom: 8px;
}

.cw-template-footer {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 10px;
}

.cw-template-buttons {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
}

.cw-template-btn {
  background: #f8fafc;
  color: #1f93ff;
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.cw-template-btn:hover {
  background: #f1f5f9;
}

/* Attachment Cards */
.cw-media-img {
  max-width: 320px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  display: block;
}

.cw-doc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  text-decoration: none;
  color: inherit;
}

/* Activity message */
.cw-activity-pill {
  font-size: 12px;
  color: var(--slate-500);
  background: var(--slate-100);
  padding: 4px 14px;
  border-radius: 12px;
  display: inline-block;
  text-align: center;
}

/* 4. Chat Composer Area */
.cw-composer-wrap {
  border-top: 1px solid var(--border-color);
  background: #ffffff;
  padding: 12px 20px;
  flex-shrink: 0;
}

.cw-composer-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.cw-composer-tab {
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-500);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cw-composer-tab.active {
  background: var(--woot-50);
  color: var(--woot-600);
}

.cw-composer-tab.private-active {
  background: #fef3c7;
  color: #b45309;
}

.cw-composer-box {
  background: var(--slate-50);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.cw-composer-box.private-mode {
  background: #fffdf5;
  border-color: #fde68a;
}

.cw-composer-box:focus-within {
  border-color: var(--woot-500);
  background: #ffffff;
}

.cw-composer-textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--slate-900);
  resize: none;
  min-height: 48px;
  max-height: 140px;
  outline: none;
}

.cw-composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.cw-composer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw-tool-btn {
  background: transparent;
  border: none;
  color: var(--slate-500);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.cw-tool-btn:hover {
  background: var(--slate-200);
  color: var(--slate-900);
}

.cw-btn-send {
  background: #1f93ff;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.cw-btn-send:hover {
  background: #0284c7;
}

.cw-btn-send.private-send {
  background: #f59e0b;
}

.cw-btn-send.private-send:hover {
  background: #d97706;
}

/* Canned Response Autocomplete Dropdown */
.cw-canned-dropdown {
  position: absolute;
  bottom: 80px;
  left: 20px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  width: 320px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
}

.cw-canned-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}

.cw-canned-item:hover {
  background: var(--woot-50);
}

.cw-canned-code {
  font-size: 13px;
  font-weight: 700;
  color: var(--woot-600);
}

.cw-canned-snippet {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 2px;
}

/* 5. Right Contact CRM Sidebar (Column 3 - Customer 360° Sales Hub) */
.cw-contact-pane {
  width: 360px;
  background: #ffffff;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  height: 100%;
}

.cw-contact-profile-card {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  position: relative;
}

.cw-profile-avatar-lg {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin-bottom: 10px;
  object-fit: cover;
  border: 3px solid #25D366;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

.cw-profile-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cw-profile-phone {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 3px;
  font-family: monospace;
}

.cw-profile-company {
  font-size: 12px;
  color: #0284c7;
  font-weight: 600;
  margin-top: 2px;
}

/* Interactive Lead Stage Pipeline Stepper */
.cw-pipeline-wrap {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  background: #ffffff;
}

.cw-pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cw-pipeline-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-500);
  letter-spacing: 0.5px;
}

.cw-pipeline-current {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.cw-pipeline-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-top: 6px;
  padding: 0 4px;
}

.cw-pipeline-steps::before {
  content: '';
  position: absolute;
  top: 13px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: #e2e8f0;
  z-index: 1;
}

.cw-pipeline-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  group: hover;
}

.cw-step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  transition: all 0.2s;
}

.cw-pipeline-step:hover .cw-step-dot {
  border-color: #1f93ff;
  color: #1f93ff;
  transform: scale(1.1);
}

.cw-pipeline-step.completed .cw-step-dot {
  background: #25D366;
  border-color: #25D366;
  color: #ffffff;
}

.cw-pipeline-step.active .cw-step-dot {
  background: #1f93ff;
  border-color: #1f93ff;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(31, 147, 255, 0.2);
  transform: scale(1.15);
}

.cw-step-label {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  margin-top: 6px;
  white-space: nowrap;
}

.cw-pipeline-step.active .cw-step-label {
  color: #1f93ff;
  font-weight: 700;
}

/* Deal Value Widget (₹ INR) */
.cw-deal-card {
  margin: 12px 18px;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cw-deal-left {
  display: flex;
  flex-direction: column;
}

.cw-deal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #15803d;
  letter-spacing: 0.5px;
}

.cw-deal-amount {
  font-size: 20px;
  font-weight: 800;
  color: #166534;
  margin-top: 2px;
  font-family: 'Outfit', sans-serif;
}

.cw-deal-edit-btn {
  background: #ffffff;
  border: 1px solid #86efac;
  color: #15803d;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.cw-deal-edit-btn:hover {
  background: #22c55e;
  color: white;
  border-color: #22c55e;
}

/* Section styling */
.cw-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--slate-400);
  padding: 14px 18px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cw-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 18px;
  font-size: 13px;
}

.cw-detail-label {
  color: var(--slate-500);
}

.cw-detail-val {
  color: var(--slate-900);
  font-weight: 600;
}

/* Lead stage badges */
.cw-lead-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.cw-lead-badge.new { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.cw-lead-badge.contacted { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.cw-lead-badge.qualified { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.cw-lead-badge.proposal { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.cw-lead-badge.won { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.cw-lead-badge.lost { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Header Quick Actions Toolbar */
.cw-header-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}

.cw-header-quick-btn {
  background: var(--slate-50);
  border: 1px solid var(--border-color);
  color: var(--slate-700);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.cw-header-quick-btn:hover {
  background: #ffffff;
  border-color: #1f93ff;
  color: #1f93ff;
  box-shadow: 0 1px 3px rgba(31, 147, 255, 0.15);
}

.cw-header-quick-btn.active {
  background: #1f93ff;
  color: white;
  border-color: #1f93ff;
}

/* CRM Commerce & Forms Mini Cards */
.cw-crm-card {
  margin: 6px 18px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
}

.cw-crm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cw-crm-row:last-child {
  margin-bottom: 0;
}

/* 6. Full Pages (Contacts, WhatsApp Settings, Campaigns, Reports) */
.cw-full-page {
  flex: 1;
  background: #f8fafc;
  overflow-y: auto;
  padding: 32px;
  height: 100%;
}

.cw-page-container {
  max-width: 1100px;
  margin: 0 auto;
}

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

.cw-page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--slate-900);
}

.cw-page-subtitle {
  font-size: 14px;
  color: var(--slate-500);
  margin-top: 4px;
}

.cw-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.cw-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
}

.cw-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--slate-900);
  outline: none;
  transition: border-color 0.2s;
}

.cw-input:focus {
  border-color: var(--woot-500);
  box-shadow: 0 0 0 3px rgba(31, 147, 255, 0.15);
}

/* Metric Cards */
.cw-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.cw-metric-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cw-metric-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--slate-900);
  margin: 6px 0;
}

.cw-metric-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-500);
}

/* Modals */
.cw-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.cw-modal-card {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  padding: 28px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Responsive Table Container with Direct Viewport Height & Smooth Dual Scrollbars */
.cw-table-responsive {
  width: 100%;
  max-height: calc(100vh - 275px);
  min-height: 380px;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  position: relative;
  border-radius: 0 0 12px 12px;
}

.cw-table-responsive::-webkit-scrollbar {
  width: 8px;
  height: 10px;
}

.cw-table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}

.cw-table-responsive::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}

.cw-table-responsive::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Table styles */
.cw-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.cw-table thead th {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 2px solid var(--border-color);
  color: #475569;
  font-weight: 700;
  background: #f8fafc;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.cw-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--slate-800);
  vertical-align: middle;
  background: #ffffff;
}

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

/* Sticky Right Actions Column */
.cw-table th:last-child {
  position: sticky;
  right: 0;
  background: #f8fafc;
  z-index: 12;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.05);
}

.cw-table td:last-child {
  position: sticky;
  right: 0;
  background: #ffffff;
  z-index: 8;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.05);
}

.cw-table tr:hover td:last-child {
  background: #f8fafc;
}

/* Modern WhatsApp Avatar System */
.cw-avatar-container {
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  user-select: none;
}

.cw-avatar-container:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

.cw-avatar-initials {
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-transform: uppercase;
  font-weight: 700;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
}

.cw-wa-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #25D366;
  border: 2px solid white;
  border-radius: 50%;
}

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

/* WhatsApp Suite Components */
.cw-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.cw-product-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.cw-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.cw-product-img-wrap {
  width: 100%;
  height: 160px;
  background: #f1f5f9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cw-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cw-wa-preview-bubble {
  background: #e7fed7;
  border-radius: 10px 10px 10px 2px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  color: #111b21;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid #cbf4b5;
  position: relative;
  max-width: 380px;
}

.cw-wa-preview-header {
  font-weight: 700;
  font-size: 14px;
  color: #075e54;
  margin-bottom: 6px;
}

.cw-wa-preview-footer {
  font-size: 11px;
  color: #667781;
  margin-top: 8px;
}

.cw-wa-preview-btn {
  background: #ffffff;
  border: 1px solid #d1d7db;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #00a884;
  text-align: center;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cw-token-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s;
  font-family: monospace;
}

.cw-token-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.cw-code-block {
  background: #0b1329;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 16px;
  color: #38bdf8;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  position: relative;
}

.cw-code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
}

.cw-code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

