/* --------------------------------------------------------------------------
   METAWA HUB - GLOBAL DESIGN SYSTEM
   -------------------------------------------------------------------------- */

:root {
  /* Color Palette */
  --bg-base: #0a0814;
  --bg-surface: #141125;
  --bg-glass: rgba(22, 18, 42, 0.45);
  --border-glass: rgba(255, 255, 255, 0.075);
  --border-glass-focus: rgba(139, 92, 246, 0.4);
  
  --primary: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.25);
  --primary-gradient: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
  
  --accent: #00f2fe;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  
  --success: #00b489;
  --success-glow: rgba(0, 180, 137, 0.2);
  --success-gradient: linear-gradient(135deg, #00e676 0%, #00b489 100%);
  
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-secondary: #cbd5e1;
  --text-on-primary: #ffffff;
  
  /* Layout Metrics */
  --sidebar-width: 260px;
  --header-height: 80px;
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  
  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Space Grotesk', Courier, monospace;
}

/* Base Styles & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-glass) transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  background-image: 
    radial-gradient(at 10% 20%, rgba(124, 58, 237, 0.08) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(0, 242, 254, 0.05) 0px, transparent 50%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-glass-focus);
}

/* Layout Container */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
}

/* --------------------------------------------------------------------------
   SIDEBAR COMPONENT
   -------------------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  z-index: 10;
}

.brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-glass);
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--primary-glow);
}

.glow-icon {
  width: 18px;
  height: 18px;
  color: white;
}

.brand-text h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  display: block;
  margin-top: -2px;
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--border-radius-md);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-item i {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

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

.nav-item:hover i {
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--text-on-primary);
  background: var(--primary-gradient);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.nav-item.active i {
  color: var(--text-on-primary);
}

/* Badges */
.badge {
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 10px;
  margin-left: auto;
}

.badge-unread {
  background-color: var(--success);
  color: white;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  margin-left: auto;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.5s infinite;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-glass);
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.status-dot.connected {
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
}

.status-dot.disconnected {
  background-color: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}

/* --------------------------------------------------------------------------
   MAIN AREA HEADER & CONTENT Layout
   -------------------------------------------------------------------------- */
.main-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
  overflow: hidden;
}

.top-header {
  height: var(--header-height);
  padding: 0 40px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(13, 10, 26, 0.2);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.header-title h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-title p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.active-connection-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 8px 16px;
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
}

.summary-details {
  display: flex;
  flex-direction: column;
}

.summary-details .lbl {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.summary-details .val {
  font-weight: 600;
  color: var(--text-main);
  margin-top: 1px;
}

.number-badge-icon i {
  width: 18px;
  height: 18px;
}

.number-badge-icon i.active-badge {
  color: var(--success);
  filter: drop-shadow(0 0 5px var(--success-glow));
}

.number-badge-icon i.inactive-badge {
  color: var(--text-muted);
}

.content-body {
  padding: 40px;
  flex-grow: 1;
  overflow-y: auto;
  height: calc(100% - var(--header-height));
}

/* Tab Management Visibility */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

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

/* --------------------------------------------------------------------------
   GLASS PANELS & UI ELEMENTS
   -------------------------------------------------------------------------- */
.panel {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  margin-bottom: 30px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s ease;
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
}

.panel-title i {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 14px;
}

.panel-header-actions .panel-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.panel-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 24px;
}

.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

/* Connect System Cards */
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.status-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.indicator-dot.online {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.indicator-dot.offline {
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.indicator-dot.warning {
  background-color: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

.indicator-text {
  font-size: 0.88rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   SETUP INSTRUCTION BANNER
   -------------------------------------------------------------------------- */
.setup-helper-banner {
  background: rgba(139, 92, 246, 0.05);
  border: 1px dashed var(--border-glass-focus);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.helper-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.helper-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.setup-helper-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.code-copy-box {
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-copy-box code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.webhook-display-url {
  font-size: 0.8rem;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.url-text {
  font-family: var(--font-mono);
  color: var(--accent);
  word-break: break-all;
  font-weight: 500;
}

.url-text.highlight {
  color: var(--warning);
}

/* --------------------------------------------------------------------------
   CREDENTIALS METHOD SUBTABS & FORMS
   -------------------------------------------------------------------------- */
.sub-tabs {
  display: flex;
  background-color: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-glass);
  margin-bottom: 24px;
}

.sub-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-tab:hover {
  color: var(--text-main);
}

.sub-tab.active {
  background-color: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.setup-form-container {
  display: none;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.3s ease-out;
}

.setup-form-container.active {
  display: flex;
}

.form-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 4px;
}

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

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

.form-group input {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
  background-color: rgba(0, 0, 0, 0.35);
}

.input-helper {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(139, 92, 246, 0.35);
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

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

.btn-icon {
  padding: 8px;
  border-radius: var(--border-radius-sm);
}

.btn-block {
  width: 100%;
}

.btn i {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   PHONE NUMBERS DATA TABLE
   -------------------------------------------------------------------------- */
.waba-details-card {
  background-color: rgba(0, 242, 254, 0.02);
  border: 1px solid rgba(0, 242, 254, 0.1);
  border-radius: var(--border-radius-md);
  padding: 14px 20px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.waba-details-card .details-title {
  font-weight: 700;
  color: var(--text-muted);
}

.waba-details-card .highlight {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
}

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

.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

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

.table-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px !important;
}

/* Status colors in table */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-pill.warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.status-pill.danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* --------------------------------------------------------------------------
   MESSAGE TEMPLATES LAYOUT
   -------------------------------------------------------------------------- */
.templates-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 30px;
  height: 65vh;
}

.templates-list-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.templates-list-wrapper {
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.template-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-card:hover {
  border-color: var(--primary-glow);
  background-color: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.template-card.active {
  border-color: var(--primary);
  background-color: rgba(139, 92, 246, 0.05);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

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

.template-name {
  font-weight: 700;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-lang {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background-color: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary);
}

.template-card-body {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.template-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 8px;
}

.template-composer-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.composer-empty-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  flex-grow: 1;
  text-align: center;
  padding: 40px;
}

.composer-empty-state i, .empty-state i {
  width: 48px;
  height: 48px;
  opacity: 0.4;
  stroke-width: 1.5px;
}

.composer-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.3s ease-out;
}

/* WhatsApp Bubble Preview Card */
.preview-card {
  background-color: #0b141a; /* Dark whatsapp background */
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 0);
  background-size: 20px 20px;
  position: relative;
}

.preview-badge {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #00a884;
  font-weight: 700;
}

.preview-body {
  background-color: #202c33; /* Dark whatsapp message box */
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: 0 8px 8px 8px;
  max-width: 85%;
  margin-top: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.preview-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 8px;
  height: 12px;
  background-color: #202c33;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.preview-body .param-hl {
  background-color: rgba(0, 242, 254, 0.2);
  color: var(--accent);
  padding: 0 4px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.dynamic-variables-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--border-glass);
  padding-top: 20px;
}

.variables-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   LIVE CHAT LAYOUT
   -------------------------------------------------------------------------- */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
  height: 70vh;
}

.chat-contacts-pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  height: 100%;
}

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

.pane-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.contacts-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
}

.contact-item:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.contact-item.active {
  background-color: rgba(139, 92, 246, 0.05);
  border-left: 3px solid var(--primary);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.avatar i {
  width: 18px;
  height: 18px;
}

.contact-item-details {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.contact-name-txt {
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.contact-snippet {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-count {
  background-color: var(--success);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-window-pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  height: 100%;
}

.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-grow: 1;
  color: var(--text-muted);
}

.chat-empty-state i {
  width: 56px;
  height: 56px;
  stroke-width: 1.5px;
  opacity: 0.3;
}

.chat-active-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(0, 0, 0, 0.15);
}

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

.contact-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.contact-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.chat-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: rgba(0, 0, 0, 0.2);
}

/* Chat bubble aesthetics */
.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--border-radius-md);
  font-size: 0.88rem;
  line-height: 1.45;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-bubble.sent {
  background-color: #005c4b; /* WhatsApp dark sent green */
  color: #e9edef;
  align-self: flex-end;
  border-top-right-radius: 0;
}

.chat-bubble.received {
  background-color: #202c33; /* WhatsApp dark received gray */
  color: #e9edef;
  align-self: flex-start;
  border-top-left-radius: 0;
}

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

.status-icon {
  width: 14px;
  height: 14px;
}

.status-icon.read {
  color: #53bdeb; /* Cyan double check */
}

.status-icon.delivered {
  color: rgba(255, 255, 255, 0.5); /* Double check gray */
}

.status-icon.sent {
  color: rgba(255, 255, 255, 0.5); /* Single check */
}

.status-icon.failed {
  color: var(--danger); /* Red alert */
}

.sticker-drawer {
  position: absolute;
  bottom: 80px;
  right: 24px;
  width: 320px;
  background-color: rgba(18, 27, 34, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-lg);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transition: all 0.3s ease;
}

.sticker-drawer.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

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

.sticker-drawer-header h4 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-main);
}

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

.sticker-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
}

.sticker-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
  background-color: rgba(0, 0, 0, 0.2);
}

.sticker-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.sticker-item:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.1);
}

.sticker-item .delete-sticker-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background-color: var(--danger);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: white;
}

.sticker-item .delete-sticker-btn i {
  width: 12px;
  height: 12px;
}

.sticker-item:hover .delete-sticker-btn {
  opacity: 1;
}

body.light-mode .sticker-drawer {
  background-color: rgba(255, 255, 255, 0.95);
}

body.light-mode .sticker-drawer-header h4 {
  color: #111b21;
}

.chat-composer {
  padding: 16px 24px;
  background-color: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 12px;
  align-items: center;
  position: relative;
}

.chat-composer input {
  flex-grow: 1;
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 12px 18px;
  font-family: var(--font-sans);
  color: var(--text-main);
  outline: none;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.chat-composer input:focus {
  border-color: var(--primary-glow);
  background-color: rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   WEBHOOK LOGS TERMINAL VIEWER
   -------------------------------------------------------------------------- */
.logs-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.log-entry {
  background-color: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.4;
  animation: slideUp 0.3s ease-out;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.log-meta-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-method {
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
}

.log-method.GET {
  background-color: rgba(0, 242, 254, 0.15);
  color: var(--accent);
}

.log-method.POST {
  background-color: rgba(139, 92, 246, 0.15);
  color: var(--primary);
}

.log-url {
  color: var(--text-secondary);
}

.log-time {
  color: var(--text-muted);
}

.log-body {
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #10b981; /* Terminal green */
}

/* --------------------------------------------------------------------------
   MODALS & BACKDROPS
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.25s ease-out;
}

.modal {
  width: 460px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass-focus);
  border-radius: var(--border-radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

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

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-glass);
  background-color: rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-close {
  background: transparent;
  color: var(--text-muted);
}

.btn-close:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

/* Helpers & Utilities */
.hidden {
  display: none !important;
}

.empty-state-small {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 10px;
  font-size: 0.85rem;
}

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

/* --------------------------------------------------------------------------
   KEYFRAME ANIMATIONS
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.5; box-shadow: 0 0 0 0 rgba(0, 242, 254, 0.4); }
  70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 8px rgba(0, 242, 254, 0); }
  100% { transform: scale(0.9); opacity: 0.5; box-shadow: 0 0 0 0 rgba(0, 242, 254, 0); }
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-glass);
  z-index: 1000;
  animation: slideUp 0.3s ease-out;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.toast-notification.success {
  border-color: rgba(0, 180, 137, 0.3);
}

.toast-notification.warning {
  border-color: rgba(245, 158, 11, 0.3);
}

.toast-notification.danger {
  border-color: rgba(239, 68, 68, 0.3);
}

/* --------------------------------------------------------------------------
   LIGHT THEME VARIABLES OVERRIDE
   -------------------------------------------------------------------------- */
body.light-mode {
  --bg-base: #efeae2;
  --bg-surface: #ffffff;
  --bg-glass: rgba(245, 246, 248, 0.85);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-glass-focus: rgba(0, 180, 137, 0.4);
  
  --primary: #008069;
  --primary-glow: rgba(0, 128, 105, 0.15);
  --primary-gradient: linear-gradient(135deg, #00a884 0%, #008069 100%);
  
  --accent: #0066cc;
  --accent-gradient: linear-gradient(135deg, #0066cc 0%, #3399ff 100%);
  
  --text-main: #111b21;
  --text-muted: #667781;
  --text-secondary: #3a4b53;
  --text-on-primary: #ffffff;
  
  background-image: 
    radial-gradient(at 10% 20%, rgba(0, 128, 105, 0.04) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(0, 102, 204, 0.03) 0px, transparent 50%);
}

body.light-mode .sidebar {
  background-color: #f0f2f5;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .nav-item {
  color: #54656f;
}

body.light-mode .nav-item:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

body.light-mode .top-header {
  background-color: rgba(240, 242, 245, 0.6);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .sub-tab {
  color: #667781;
}

body.light-mode .sub-tab.active {
  background-color: #ffffff;
  color: #111b21;
}

body.light-mode .status-card,
body.light-mode .form-group input,
body.light-mode .code-copy-box,
body.light-mode .data-table th,
body.light-mode .chat-composer input,
body.light-mode .log-entry {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .data-table tr:hover td {
  background-color: rgba(0, 0, 0, 0.01);
}

/* --------------------------------------------------------------------------
   ADMIN LOGIN SCREEN
   -------------------------------------------------------------------------- */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-base);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

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

.login-box {
  width: 380px;
  padding: 40px;
  border-radius: var(--border-radius-lg);
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.login-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 15px 0 5px 0;
  font-family: var(--font-sans);
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.login-header .logo-icon {
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   PROFILE PICKER DROPDOWN
   -------------------------------------------------------------------------- */
.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-picker-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-glass);
}

.profile-picker-box select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding-right: 8px;
}

.profile-picker-box select option {
  background-color: var(--bg-surface);
  color: var(--text-main);
}

.profile-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   WHATSAPP UI BUBBLES & WALLPAPER
   -------------------------------------------------------------------------- */
.whatsapp-wallpaper {
  background-color: #0b141a;
  background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
  background-repeat: repeat;
  opacity: 0.96;
}

body.light-mode .whatsapp-wallpaper {
  background-color: #efeae2;
  opacity: 1;
  filter: contrast(0.92) brightness(1.02);
}

.whatsapp-logo-large {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: rgba(0, 180, 137, 0.05);
  margin-bottom: 20px;
}

/* Quote Reply box inside bubble */
.quoted-reply-box {
  background-color: rgba(0, 0, 0, 0.08);
  border-left: 3px solid var(--primary);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.light-mode .quoted-reply-box {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Message Bubble modifications for tails */
.chat-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 12px;
  display: block;
}

.chat-bubble.sent::before {
  right: -6px;
  background-color: #005c4b;
  clip-path: polygon(0 0, 0 100%, 100% 0);
}

body.light-mode .chat-bubble.sent::before {
  background-color: #d9fdd3;
}

.chat-bubble.received::before {
  left: -6px;
  background-color: #202c33;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

body.light-mode .chat-bubble.received::before {
  background-color: #ffffff;
}

body.light-mode .chat-bubble.sent {
  background-color: #d9fdd3;
  color: #111b21;
}

body.light-mode .chat-bubble.received {
  background-color: #ffffff;
  color: #111b21;
}

body.light-mode .bubble-footer {
  color: rgba(17, 27, 33, 0.5);
}

/* Large text bubble truncation rules */
.bubble-text.truncated {
  max-height: 150px;
  position: relative;
  overflow: hidden;
}

.bubble-text.truncated::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(transparent, rgba(32, 44, 51, 0.95));
}

.chat-bubble.sent .bubble-text.truncated::after {
  background: linear-gradient(transparent, rgba(0, 92, 75, 0.95));
}

body.light-mode .chat-bubble.received .bubble-text.truncated::after {
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.95));
}

body.light-mode .chat-bubble.sent .bubble-text.truncated::after {
  background: linear-gradient(transparent, rgba(217, 253, 211, 0.95));
}

.read-more-link {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 4px;
  display: inline-block;
  text-decoration: underline;
}

/* Media styling inside bubble */
.bubble-media-container {
  margin-bottom: 6px;
  max-width: 100%;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

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

.bubble-media-container video {
  max-width: 100%;
  max-height: 200px;
  display: block;
}

.bubble-media-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(0,0,0,0.15);
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--text-main);
  text-decoration: none;
}

.bubble-media-doc i {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

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

body.light-mode .bubble-buttons-container {
  border-top-color: rgba(0,0,0,0.05);
}

.bubble-quick-reply-btn {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.bubble-quick-reply-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

body.light-mode .bubble-quick-reply-btn {
  background-color: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .bubble-quick-reply-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Hover Reply button on chat bubble */
.chat-bubble .bubble-reply-trigger {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.3);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: white;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.chat-bubble:hover .bubble-reply-trigger {
  opacity: 1;
}

.chat-bubble .bubble-reply-trigger i {
  width: 12px;
  height: 12px;
}

/* --------------------------------------------------------------------------
   REPLY & MEDIA COMPOSER PREVIEWS
   -------------------------------------------------------------------------- */
.reply-preview-bar {
  background-color: rgba(0, 0, 0, 0.2);
  border-left: 4px solid var(--primary);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
}

body.light-mode .reply-preview-bar {
  background-color: rgba(0, 0, 0, 0.03);
}

.reply-preview-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.reply-sender {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
}

.reply-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview-bar {
  background-color: rgba(0, 0, 0, 0.15);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
}

body.light-mode .media-preview-bar {
  background-color: rgba(0, 0, 0, 0.02);
}

.media-preview-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.media-preview-details {
  display: flex;
  flex-direction: column;
}

#media-preview-name {
  font-size: 0.85rem;
  font-weight: 600;
}

#media-preview-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.media-close-btn,
.reply-close-btn {
  background: transparent;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   WORKFLOW ACTIONS LIST CARDS
   -------------------------------------------------------------------------- */
.action-card-ui {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-md);
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.light-mode .action-card-ui {
  background-color: #ffffff;
}

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

.action-card-title-ui {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   MOBILE NAV & RESPONSIVENESS OVERRIDES
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 60px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-glass);
  z-index: 100;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
}

.mob-nav-item {
  flex: 1;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  gap: 3px;
  font-family: var(--font-sans);
  font-weight: 600;
  transition: color 0.2s ease;
}

.mob-nav-item i {
  width: 20px;
  height: 20px;
}

.mob-nav-item span {
  font-size: 0.62rem;
}

.mob-nav-item.active {
  color: var(--primary);
}

.mob-only {
  display: none !important;
}

@media (max-width: 768px) {
  .hide-mobile, .active-connection-summary {
    display: none !important;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .table-wrapper, .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .terminal-output {
    max-height: 300px;
  }

  .show-mobile-flex {
    display: flex !important;
  }
  
  .mob-only {
    display: inline-flex !important;
  }
  
  .app-container {
    flex-direction: column;
    height: calc(100vh - 60px);
  }
  
  .content-body {
    padding: 16px;
    height: calc(100% - var(--header-height));
  }
  
  .grid-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .top-header {
    padding: 0 16px;
  }
  
  /* Chat layouts for mobile */
  .chat-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 140px);
    position: relative;
    overflow: hidden;
  }
  
  .chat-contacts-pane {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .chat-contacts-pane.hide-on-mobile {
    transform: translateX(-100%);
    pointer-events: none;
  }
  
  .chat-window-pane {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
  }
  
  .chat-composer {
    padding: 10px 14px;
    gap: 8px;
  }
  
  .chat-composer input {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  
  .chat-bubble {
    max-width: 85%;
  }
}

/* --------------------------------------------------------------------------
   VISUAL WORKFLOW Blueprints Canvas Drawing Board
   -------------------------------------------------------------------------- */
.workflows-drawing-interface {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 130px);
  gap: 12px;
}

.workflows-top-controls {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.workflows-top-controls .control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workflows-top-controls select, .workflows-top-controls input[type="text"] {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  padding: 8px 14px;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.88rem;
}

.workflows-canvas-wrapper {
  display: grid;
  grid-template-columns: 260px 1fr;
  flex-grow: 1;
  gap: 16px;
  height: calc(100% - 70px);
  overflow: hidden;
}

.nodes-library-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  border-radius: var(--border-radius-md);
}

.nodes-library-panel h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.nodes-library-panel p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.nodes-toolbox {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolbox-node {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbox-node:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.08);
  border-color: var(--primary-glow);
}

.toolbox-node i {
  width: 20px;
  height: 20px;
}

.toolbox-node.trigger i { color: #10b981; }
.toolbox-node.mark-read i { color: #3b82f6; }
.toolbox-node.auto-reply i { color: #8b5cf6; }
.toolbox-node.webhook i { color: #ec4899; }

.toolbox-node .node-meta h5 {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.toolbox-node .node-meta span {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* MAIN CONNECTORS GRID CANVAS */
.workflows-board-canvas {
  position: relative;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 20px 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-glass);
  overflow: auto;
  cursor: grab;
}

.workflows-board-canvas:active {
  cursor: grabbing;
}

.canvas-zoom-container {
  position: relative;
  width: 2400px;
  height: 2400px;
  transform-origin: 0 0;
}

.svg-connections-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 2400px;
  height: 2400px;
  pointer-events: none;
  z-index: 1;
}

/* WORKFLOW CANVAS NODE CARDS */
.workflow-node-card {
  position: absolute;
  width: 240px;
  background-color: rgba(26, 38, 46, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-main);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  z-index: 5;
  cursor: default;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.workflow-node-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.workflow-node-card.trigger-block { border-top: 4px solid #10b981; }
.workflow-node-card.mark-read-block { border-top: 4px solid #3b82f6; }
.workflow-node-card.auto-reply-block { border-top: 4px solid #8b5cf6; }
.workflow-node-card.webhook-block { border-top: 4px solid #ec4899; }

.node-card-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: move;
}

.node-card-header h5 {
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.node-card-header h5 i {
  width: 14px;
  height: 14px;
}

.node-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.node-card-body p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.node-card-body input, .node-card-body select, .node-card-body textarea {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-glass);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.76rem;
  color: var(--text-main);
  outline: none;
  font-family: var(--font-sans);
}

.node-card-body textarea {
  height: 50px;
  resize: none;
}

/* PIN PORTS SYSTEM */
.pin {
  width: 12px;
  height: 12px;
  background-color: var(--text-muted);
  border: 2px solid #0f172a;
  border-radius: 50%;
  position: absolute;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.pin-in {
  left: -7px;
  top: calc(50% - 6px);
  background-color: #10b981;
}

.pin-out {
  right: -7px;
  top: calc(50% - 6px);
  background-color: #f59e0b;
}

.pin:hover {
  transform: scale(1.3);
  box-shadow: 0 0 8px currentColor;
}

.pin.connecting {
  background-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

/* SVG Connection Paths */
.svg-connection-path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  transition: stroke 0.15s ease, stroke-width 0.15s ease;
  cursor: pointer;
}

.svg-connection-path:hover {
  stroke: var(--accent);
  stroke-width: 4;
}

.svg-connection-path.active {
  stroke: var(--accent);
  stroke-width: 4;
}

/* CHAT BUBBLE OPTIONS CHEVRON BUTTON */
.chat-bubble {
  position: relative;
}

.bubble-reply-trigger {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border-radius: 50%;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.18s ease, color 0.18s ease;
  z-index: 5;
}

.chat-bubble:hover .bubble-reply-trigger {
  opacity: 1;
}

.bubble-reply-trigger:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

.bubble-reply-trigger i {
  width: 14px;
  height: 14px;
}

/* FLOATING CHAT BUBBLE CONTEXT DROP MENU */
.bubble-menu-dropdown {
  position: fixed;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass-focus);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-glass);
  padding: 6px 0;
  min-width: 150px;
  z-index: 999;
  display: flex;
  flex-direction: column;
}

.bubble-menu-dropdown .menu-item {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 10px 16px;
  text-align: left;
  font-size: 0.84rem;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.15s ease;
}

.bubble-menu-dropdown .menu-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.bubble-menu-dropdown .menu-item i {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
}

/* List Menu bubble display */
.bubble-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 8px;
  padding-top: 8px;
}

.bubble-quick-reply-btn {
  text-align: center;
  background-color: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.bubble-quick-reply-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* WhatsApp Bubble Tails */
.chat-bubble.sent::before {
  content: "";
  position: absolute;
  top: 0;
  right: -8px;
  width: 8px;
  height: 13px;
  background-color: inherit;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.chat-bubble.received::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  width: 8px;
  height: 13px;
  background-color: inherit;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

/* Light Theme overrides for speech bubbles */
.light-mode .chat-bubble.sent {
  background-color: #d9fdd3;
  color: #111b21;
}
.light-mode .chat-bubble.received {
  background-color: #ffffff;
  color: #111b21;
}
.light-mode .bubble-footer {
  color: rgba(17, 27, 33, 0.6);
}
.light-mode .status-icon.delivered {
  color: rgba(17, 27, 33, 0.4);
}
.light-mode .status-icon.sent {
  color: rgba(17, 27, 33, 0.4);
}

/* ==========================================================================
   PHASE 6 UPGRADES: ACTIONS SHEETS, REACTIONS, COMPOSERS, DATE Badges, CONDITIONS
   ========================================================================== */

/* 1. EMOJI REACTIONS BADGE ON CHAT BUBBLES */
.bubble-reaction-badge {
  position: absolute;
  bottom: -10px;
  right: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass-focus);
  padding: 2px 6px;
  border-radius: 20px;
  font-size: 0.8rem;
  box-shadow: var(--shadow-glass);
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 8;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bubble-reaction-badge:hover {
  transform: scale(1.15);
}
.light-mode .bubble-reaction-badge {
  background: #ffffff;
  border-color: #e9edef;
  box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}

/* 2. REACTIONS ROW BAR IN BUBBLE DROP CONTEXT MENUS */
.bubble-reactions-row, .sheet-reactions-row {
  display: flex;
  justify-content: space-around;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.03);
}
.bubble-reactions-row span, .sheet-reactions-row span {
  font-size: 1.35rem;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-block;
}
.bubble-reactions-row span:hover, .sheet-reactions-row span:hover {
  transform: scale(1.3) translateY(-4px);
}

/* 3. QUICK REPLIES AUTOCOMPLETE DRAWER IN COMPOSER */
.quick-replies-autocomplete {
  position: absolute;
  bottom: 60px;
  left: 20px;
  right: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass-focus);
  border-radius: var(--border-radius-md);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.3);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
}
.quick-replies-autocomplete.hidden {
  display: none !important;
}
.autocomplete-item {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-glass);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.autocomplete-item:hover, .autocomplete-item.active {
  background-color: rgba(255, 255, 255, 0.05);
}
.light-mode .autocomplete-item:hover, .light-mode .autocomplete-item.active {
  background-color: rgba(0, 0, 0, 0.03);
}
.autocomplete-item .shortcut {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 2px;
}
.autocomplete-item .snippet {
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 4. VOICE RECORDING INDICATORS IN CHAT COMPOSER */
.voice-recording-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--border-radius-sm);
  margin: 6px 14px;
}
.voice-recording-indicator.hidden {
  display: none !important;
}
.recording-dot {
  width: 10px;
  height: 10px;
  background-color: #ef4444;
  border-radius: 50%;
  animation: pulse 1.2s infinite alternate;
}
.recording-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ef4444;
}
#voice-duration {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text-main);
  font-weight: 600;
}
@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

/* 5. MOBILE BOTTOM SHEET SLIDING ACTION DRAWER */
.mobile-bottom-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.3s ease;
}
.mobile-bottom-sheet-backdrop.hidden {
  display: none !important;
}
.mobile-bottom-sheet {
  width: 100%;
  max-width: 500px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-glass-focus);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
  animation: slideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  flex-direction: column;
}
.sheet-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 6px 0;
  border-bottom: 1px solid var(--border-glass);
}
.sheet-drag-handle {
  width: 40px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  margin-bottom: 8px;
}
.sheet-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.sheet-body {
  display: flex;
  flex-direction: column;
  padding: 8px 0 24px 0;
}
.sheet-item {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 14px 20px;
  text-align: left;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background-color 0.15s ease;
}
.sheet-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.sheet-item i {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}
@keyframes slideUp {
  0% { transform: translateY(100%); }
  100% { transform: translateY(0); }
}

/* 6. CHAT DATE LOGSPLITTING BADGE */
.chat-date-divider {
  display: flex;
  justify-content: center;
  margin: 15px 0;
  width: 100%;
}
.chat-date-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius-sm);
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-transform: capitalize;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.light-mode .chat-date-badge {
  background: #ffffff;
  border-color: #e1e9eb;
  color: #54656f;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* 7. CONDITION VISUAL FLOW CANVAS NODES BLOCK */
.canvas-node.condition {
  border-left: 4px solid var(--accent);
}
.canvas-node.condition .port-out[data-port="true"] {
  bottom: 30px;
  background-color: #10b981;
  border-color: #047857;
}
.canvas-node.condition .port-out[data-port="true"]::after {
  content: "True";
  position: absolute;
  left: 15px;
  top: -4px;
  font-size: 0.65rem;
  color: #10b981;
  font-weight: 700;
  font-family: var(--font-sans);
}
.canvas-node.condition .port-out[data-port="false"] {
  bottom: 8px;
  background-color: #ef4444;
  border-color: #b91c1c;
}
.canvas-node.condition .port-out[data-port="false"]::after {
  content: "False";
  position: absolute;
  left: 15px;
  top: -4px;
  font-size: 0.65rem;
  color: #ef4444;
  font-weight: 700;
  font-family: var(--font-sans);
}

/* Media previews and quotation display adjustments */
.reply-preview-bar, .media-preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.04);
  border-left: 4px solid var(--primary);
  padding: 8px 16px;
  margin: 4px 14px;
  border-radius: var(--border-radius-sm);
  z-index: 10;
}
.reply-preview-bar.hidden, .media-preview-bar.hidden {
  display: none !important;
}
.reply-preview-content, .media-preview-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reply-sender {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
}
.reply-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 350px;
}
.media-preview-content {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.media-preview-details {
  display: flex;
  flex-direction: column;
}
#media-preview-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}
#media-preview-size {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.light-mode .reply-preview-bar, .light-mode .media-preview-bar {
  background-color: #f0f2f5;
  border-left-color: #00a884;
}
.light-mode .reply-sender {
  color: #00a884;
}

/* --- Phase 7 Custom Styling Additions --- */

/* Clickable response field keys */
.json-key-badge {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #c084fc;
  cursor: pointer;
  transition: all 0.2s ease;
}
.json-key-badge:hover {
  background: rgba(139, 92, 246, 0.35);
  border-color: rgba(139, 92, 246, 0.8);
  transform: translateY(-1px);
}
.light-mode .json-key-badge {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #7c3aed;
}

/* Contact Tags */
.contact-tag-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.contact-tag-badge.tag-vip {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}
.contact-tag-badge.tag-lead {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}
.contact-tag-badge.tag-support {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

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

/* Mobile workflows alert cover */
@media (max-width: 767px) {
  #section-workflows {
    position: relative !important;
  }
}


/* Visual Canvas blocks colors styling */
.workflow-node-card.extract {
  border-left: 4px solid #3b82f6;
}
.workflow-node-card.media-reply {
  border-left: 4px solid #ec4899;
}
.workflow-node-card.url-reply {
  border-left: 4px solid #10b981;
}
.workflow-node-card.interactive-reply {
  border-left: 4px solid #f59e0b;
}
.workflow-node-card.carousel-reply {
  border-left: 4px solid #8b5cf6;
}
.workflow-node-card.tag-add {
  border-left: 4px solid #10b981;
}
.workflow-node-card.tag-remove {
  border-left: 4px solid #ef4444;
}

/* Node toolbox icons color */
.nodes-toolbox .toolbox-node.extract i {
  color: #3b82f6 !important;
}
.nodes-toolbox .toolbox-node.media-reply i {
  color: #ec4899 !important;
}
.nodes-toolbox .toolbox-node.url-reply i {
  color: #10b981 !important;
}
.nodes-toolbox .toolbox-node.interactive-reply i {
  color: #f59e0b !important;
}
.nodes-toolbox .toolbox-node.carousel-reply i {
  color: #8b5cf6 !important;
}
.nodes-toolbox .toolbox-node.tag-add i {
  color: #10b981 !important;
}
.nodes-toolbox .toolbox-node.tag-remove i {
  color: #ef4444 !important;
}





/* --------------------------------------------------------------------------
   PHASE 8: INTERACTIVE UI OVERHAUL (LIGHT THEME BLOCKS)
   -------------------------------------------------------------------------- */

.light-ui-container {
  background: #ffffff;
  color: #1f2937;
  border-radius: 8px;
  font-family: var(--font-sans);
  padding: 10px;
}

.light-ui-container input, 
.light-ui-container textarea, 
.light-ui-container select {
  background: #ffffff !important;
  color: #1f2937 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 4px;
  padding: 8px 12px;
  width: 100%;
}

.light-ui-container input:focus, 
.light-ui-container textarea:focus, 
.light-ui-container select:focus {
  border-color: #8b5cf6 !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.light-ui-container label {
  color: #374151 !important;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  margin-top: 10px;
  display: block;
}

.light-ui-container .input-helper {
  color: #6b7280 !important;
  font-size: 0.75rem;
  margin-top: 4px;
  display: block;
}

/* Rich Text Toolbar */
.rt-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  margin-bottom: 4px;
  align-items: center;
}

.rt-btn {
  background: transparent;
  border: none;
  color: #4b5563;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.rt-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Tabbed Navigation (Carousel) */
.card-tabs-nav {
  display: flex;
  gap: 20px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 15px;
}

.card-tab-btn {
  background: transparent;
  border: none;
  padding: 10px 4px;
  color: #6b7280;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-tab-btn:hover {
  color: #4f46e5;
}

.card-tab-btn.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

/* Block Styling (Buttons & Rows) */
.btn-block-purple {
  background: #ede9fe;
  color: #4c1d95;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  margin-bottom: 8px;
}
.btn-block-purple input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: #4c1d95 !important;
}
.btn-block-purple input::placeholder {
  color: #8b5cf6;
  opacity: 0.7;
}

.section-block-gray {
  background: #f3f4f6;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
}
.section-block-gray > .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.section-block-gray .section-header input {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-weight: 600;
}

/* Hide default scrollbars in textareas if we want to mimic the image exactly, though default is fine */

/* Fix Interactive Composer Fields Visibility */
.int-composer-fields-container:not(.active) {
  display: none !important;
}
/* WhatsApp Mobile UI Overrides */
.mob-only {
  display: none !important;
}

@media (max-width: 768px) {
  .mob-only {
    display: flex !important;
  }
  
  .wa-mobile-header {
    flex-direction: column;
    padding: 12px 16px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-glass);
    gap: 12px;
  }
  
  .wa-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  
  .wa-title {
    color: #25D366; /* WhatsApp Green */
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
  }
  
  .wa-icons {
    display: flex;
    gap: 16px;
    color: var(--text-primary);
  }
  
  .wa-search-bar .search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 6px 12px;
    gap: 8px;
  }
  
  body.light-mode .wa-search-bar .search-input-wrapper {
    background: rgba(0, 0, 0, 0.05);
  }
  
  .wa-search-bar input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.9rem;
    outline: none;
  }
  
  .wa-fab {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    z-index: 20;
    transition: transform 0.2s;
  }
  
  .wa-fab:active {
    transform: scale(0.95);
  }
  
  /* Bottom Nav styling for WA */
  .wa-style-nav {
    background: var(--bg-surface);
    height: 70px;
  }
  
  .wa-style-nav .mob-nav-item {
    color: var(--text-muted);
    gap: 4px;
  }
  
  .wa-style-nav .mob-nav-item.active {
    color: var(--text-primary);
  }
  
  .wa-style-nav .icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 32px;
    border-radius: 16px;
    transition: background 0.3s;
  }
  
  .wa-style-nav .mob-nav-item.active .icon-wrapper {
    background: rgba(37, 211, 102, 0.2);
  }
  
  .wa-style-nav .mob-nav-item.active i {
    color: #25D366;
    fill: rgba(37, 211, 102, 0.2);
  }
  
  .wa-style-nav .badge {
    position: absolute;
    top: -4px;
    right: 10px;
    background: #25D366;
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 10px;
    border: 2px solid var(--bg-surface);
  }
}
@media (max-width: 768px) {
  .top-header {
    display: none !important;
  }
  .chat-contacts-pane {
    background: var(--bg-surface) !important;
  }
  .chat-window-pane {
    background: var(--bg-surface) !important;
  }
}
