:root {
  --bg-color: #ffffff;
  --panel-bg: #ffffff;
  --border-color: rgba(187, 18, 198, 0.16);
  --text-color: #1a153b;
  --text-muted: #5e5873;
  
  --primary-color: #bb12c6;
  --primary-glow: rgba(187, 18, 198, 0.15);
  --success-color: #0f766e;
  --success-glow: rgba(15, 118, 110, 0.15);
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --indigo-gradient: #bb12c6;
  --green-gradient: #0f766e;
  --card-shadow: 0 4px 20px 0 rgba(187, 18, 198, 0.04);
}

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

body {
  font-family: 'Cambria', Georgia, serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  height: 100vh;
}

/* Glassmorphism utility */
.glass {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Common UI Elements */
.badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}
.badge-trial { background: rgba(219, 39, 119, 0.08); color: #db2777; }
.badge-1year { background: rgba(239, 68, 68, 0.08); color: #ef4444; }
.badge-2years { background: rgba(245, 158, 11, 0.08); color: #d97706; }
.badge-5years { background: rgba(16, 185, 129, 0.08); color: #059669; }
.badge-lifetime { background: rgba(139, 92, 246, 0.08); color: #7c3aed; }
.badge-completed { background: rgba(16, 185, 129, 0.08); color: #059669; }
.badge-processing { background: rgba(187, 18, 198, 0.08); color: var(--primary-color); }
.badge-pending { background: rgba(100, 116, 139, 0.08); color: #475569; }
.badge-failed { background: rgba(239, 68, 68, 0.08); color: #ef4444; }
.badge-paused { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.badge-cancelled { background: rgba(239, 68, 68, 0.08); color: #dc2626; }
.badge-scheduled { background: rgba(99, 102, 241, 0.08); color: #4f46e5; }

.btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.85rem;
}
.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(187, 18, 198, 0.2);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(187, 18, 198, 0.35);
  transform: translateY(-1.5px);
}
.btn-success {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(187, 18, 198, 0.2);
}
.btn-success:hover {
  box-shadow: 0 6px 20px rgba(187, 18, 198, 0.35);
  transform: translateY(-1.5px);
}
.btn-warning {
  background: var(--warning-color);
  color: white;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}
.btn-warning:hover {
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.35);
  transform: translateY(-1.5px);
}
.btn-danger {
  background: var(--danger-color);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}
.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
  transform: translateY(-1.5px);
}
.btn-block { width: 100%; justify-content: center; }

.mt-1 { margin-top: 10px; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.color-green { color: var(--success-color); }

/* AUTHENTICATION OVERLAY */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #f2edfd;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.auth-container {
  width: 400px;
  padding: 40px;
  text-align: center;
}
.auth-brand {
  margin-bottom: 30px;
}
.logo-icon {
  font-size: 3rem;
  background: var(--indigo-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}
.auth-container h2 { font-weight: 700; margin-bottom: 5px; color: #581c87; }
.auth-container p { color: var(--text-muted); font-size: 0.9rem; }
.auth-form h3 { margin-bottom: 20px; font-weight: 600; color: #581c87; }
.input-group {
  position: relative;
  margin-bottom: 18px;
}
.input-group i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.input-group input {
  width: 100%;
  padding: 12px 12px 12px 42px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s;
}
.input-group input:focus {
  border-color: var(--primary-color);
}
.auth-switch {
  margin-top: 15px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-switch span {
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 600;
}
.otp-alert {
  background: rgba(147, 51, 234, 0.08);
  border: 1px solid rgba(147, 51, 234, 0.15);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b21a8;
  font-size: 0.85rem;
}

/* MAIN LAYOUT */
.app-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

/* SIDEBAR */
.sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(156, 39, 176, 0.08);
  box-shadow: 2px 0 10px rgba(156, 39, 176, 0.01);
  height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 0 25px 0;
}
.sidebar-brand {
  background: linear-gradient(135deg, #bb12c6, #8b5cf6);
  color: #ffffff;
  padding: 24px;
  margin-bottom: 25px;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.font-logo {
  font-size: 1.6rem;
  color: #ffffff !important;
  -webkit-text-fill-color: initial !important;
  background: none !important;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
  padding: 0 15px 15px 15px;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(147, 51, 234, 0.15);
  border-radius: 4px;
}
.sidebar-section-header {
  font-size: 0.65rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 10px 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.sidebar-section-header i {
  font-size: 0.6rem;
  opacity: 0.6;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.25s ease;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}
.nav-item i {
  font-size: 1.05rem;
  transition: transform 0.25s ease;
  color: #64748b;
}
.nav-item:hover {
  color: var(--primary-color);
  background: rgba(187, 18, 198, 0.05);
}
.nav-item:hover i {
  color: var(--primary-color);
}
.nav-item.active {
  background: var(--primary-color);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(187, 18, 198, 0.2);
}
.nav-item.active i {
  color: #ffffff !important;
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: 20px 20px 0 20px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(187, 18, 198, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.15rem;
  color: var(--primary-color);
  border: 1px solid rgba(187, 18, 198, 0.15);
}

.user-details {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  gap: 2px;
}
.user-details span:first-child { font-weight: 700; color: var(--text-color); }
.user-details span:last-child { font-size: 0.75rem; }
.btn-logout {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s;
}
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.05);
  transform: translateY(-1px);
}

/* CONTENT AREA & TOP HEADER */
.content-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 0 30px 30px 30px;
  overflow-y: auto;
}
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 25px;
  background: transparent;
  border-bottom: 1px solid rgba(156, 39, 176, 0.08);
  border-radius: 0;
}
.top-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: -0.5px;
}
.expiry-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.expiry-text strong {
  color: var(--primary-color);
}

/* TAB PANES */
.tab-pane {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab-pane.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* STATS CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.stat-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -5px rgba(147, 51, 234, 0.06);
  border-color: rgba(147, 51, 234, 0.15);
}
.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  box-shadow: 0 8px 16px rgba(0,0,0,0.02);
}
.icon-purple { background: rgba(139, 92, 246, 0.08); color: var(--primary-color); border: 1px solid rgba(139, 92, 246, 0.1); }
.icon-blue { background: rgba(187, 18, 198, 0.08); color: var(--primary-color); border: 1px solid rgba(187, 18, 198, 0.1); }
.icon-green { background: rgba(16, 185, 129, 0.08); color: var(--success-color); border: 1px solid rgba(16, 185, 129, 0.1); }
.icon-yellow { background: rgba(245, 158, 11, 0.08); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.1); }

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-info h3 { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-info p { font-size: 1.6rem; font-weight: 800; color: var(--text-color); }

/* DASHBOARD WIDGETS */
.dashboard-widgets-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}
.dashboard-hero-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  min-height: 250px;
  overflow: hidden;
  position: relative;
}
.widget-card {
  background: #ffffff;
  border-top: 3px solid var(--primary-color);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(156, 39, 176, 0.02);
  transition: all 0.3s ease;
}
.widget-card:nth-child(even) {
  border-top: 3px solid var(--success-color);
}
.widget-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(156, 39, 176, 0.06);
  padding-bottom: 12px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sys-info-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.sys-info-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.6);
  border: 1px solid rgba(0,0,0,0.01);
}
.sys-info-item span { color: var(--text-muted); font-weight: 600; }
.sys-info-item strong { color: var(--text-color); font-weight: 700; }

.dash-slots-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 30px 0;
  font-size: 0.9rem;
}

/* SLOTS MANAGER */
.section-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.slot-card {
  padding: 24px;
}
.slot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.slot-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}
.slot-badge-connected { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.slot-badge-disconnected { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.slot-badge-connecting { background: rgba(99, 102, 241, 0.15); color: #6366f1; }

.slot-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}
.modal-content {
  width: 450px;
  padding: 25px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header button {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
}
.qr-container {
  background: white;
  width: 250px;
  height: 250px;
  margin: 20px auto;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
}
.qr-container img { width: 100%; height: 100%; }
.qr-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.status-indicator { margin-top: 15px; font-size: 0.9rem; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.pulse-blue {
  background: var(--primary-color);
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* CAMPAIGNS & TABLE */
.campaigns-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 20px;
  width: 100%;
}
.input-wrapper {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-wrapper label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.input-wrapper input, .input-wrapper textarea {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  padding: 10px 12px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s;
}
.input-wrapper input:focus, .input-wrapper textarea:focus {
  border-color: var(--primary-color);
  background: white;
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); }

.table-container {
  overflow-x: auto;
  margin-top: 10px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}
.data-table.compact th, .data-table.compact td {
  padding: 8px 10px;
}
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
.data-table td { font-size: 0.9rem; color: var(--text-color); }

/* CRM INBOX LAYOUT */
.crm-inbox-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 110px);
  overflow: hidden;
}
.inbox-sidebar {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.4);
  min-height: 0;
  height: 100%;
}
.search-bar {
  padding: 15px;
  position: relative;
}
.search-bar i { position: absolute; left: 25px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-bar input {
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  padding: 8px 12px 8px 36px;
  border-radius: 20px;
  color: var(--text-color);
  font-family: inherit;
  outline: none;
}
.chats-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.chat-list-item {
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 1px solid rgba(147, 51, 234, 0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-list-item:hover, .chat-list-item.active {
  background: rgba(147, 51, 234, 0.05);
}
.chat-list-item.active {
  border-left: 4px solid var(--primary-color);
}

.inbox-conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.empty-conversation {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  color: var(--text-muted);
  gap: 15px;
}
.empty-conversation i { font-size: 3rem; color: #c084fc; }

/* Active Chat styles */
.chat-header {
  padding: 15px 25px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.6);
}
.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-bubble {
  max-width: 75%;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  position: relative;
}
.chat-bubble.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}
.chat-bubble.sent {
  align-self: flex-end;
  background: var(--primary-color);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(187, 18, 198, 0.1);
}
.chat-bubble span.time {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 5px;
  text-align: right;
}
.chat-bubble.sent span.time {
  color: rgba(255, 255, 255, 0.8) !important;
}
.chat-footer {
  padding: 15px;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.6);
}
.chat-footer input {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-color);
  padding: 10px 15px;
  font-family: inherit;
  outline: none;
}

/* ═══════════════════════════════════════
   FLOW BUILDER — PREMIUM VISUAL DESIGN
   ═══════════════════════════════════════ */

/* Canvas Layout */
.flow-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  height: 75vh;
}
.flow-sidebar {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.flow-canvas {
  width: 2000px;
  height: 1400px;
  position: relative;
}

/* ── Node Base ── */
.flow-node {
  position: absolute;
  width: 265px;
  border-radius: 14px;
  font-size: 0.84rem;
  cursor: default;
  background: #ffffff;
  border: 1.5px solid rgba(147, 51, 234, 0.12);
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,0.04),
    0 10px 30px -8px rgba(147,51,234,0.14),
    0 0 0 0 rgba(147,51,234,0);
  transition: box-shadow 0.25s, border-color 0.25s, transform 0.15s;
  user-select: none;
  overflow: visible;
}
.flow-node:hover {
  box-shadow:
    0 4px 6px -1px rgba(0,0,0,0.05),
    0 16px 40px -8px rgba(147,51,234,0.22),
    0 0 0 3px rgba(147,51,234,0.07);
  border-color: rgba(147,51,234,0.28);
  transform: translateY(-1px);
}
.flow-node.is-dragging {
  opacity: 0.92;
  box-shadow:
    0 20px 60px -10px rgba(147,51,234,0.35),
    0 0 0 3px rgba(147,51,234,0.15);
  z-index: 999;
  transform: scale(1.02) translateY(-2px);
}

/* ── Trigger Node ── */
.flow-node-trigger {
  border-top: none;
  border-left: none;
}
.flow-node-trigger::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #f43f5e, #ec4899, #db2777);
  border-radius: 14px 14px 0 0;
  margin: 0;
}

/* ── Message Node ── */
.flow-node-message {
  border-top: none;
  border-left: none;
}
.flow-node-message::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #7c3aed, #a855f7, #8b5cf6);
  border-radius: 14px 14px 0 0;
  margin: 0;
}

/* ── Node Header ── */
.flow-node-header {
  font-weight: 700;
  padding: 12px 16px 0 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: move;
}
.flow-node-trigger .flow-node-header { color: #be185d; }
.flow-node-message .flow-node-header { color: #6d28d9; }

/* Node body padding */
.flow-node-body {
  padding: 0 16px 14px 16px;
}

.flow-node-delete {
  cursor: pointer;
  color: #cbd5e1;
  font-size: 1.15rem;
  transition: color 0.2s, transform 0.15s;
  line-height: 1;
  padding: 2px;
  border-radius: 4px;
}
.flow-node-delete:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.08);
  transform: scale(1.15);
}

/* ── Inputs inside nodes ── */
.flow-node textarea, .flow-node input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  font-family: inherit;
  font-size: 0.8rem;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  resize: vertical;
}
.flow-node textarea:focus, .flow-node input[type="text"]:focus {
  border-color: #a855f7;
  background: white;
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}

/* ── Node info chips ── */
.flow-node-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.67rem;
  font-weight: 600;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 20px;
}
.chip-trigger {
  background: rgba(244,63,94,0.07);
  color: #be185d;
  border: 1px solid rgba(244,63,94,0.15);
}
.chip-message {
  background: rgba(124,58,237,0.07);
  color: #6d28d9;
  border: 1px solid rgba(124,58,237,0.15);
}

/* ══════════════════════════════════
   NODE PORTS — Output & Input
   ══════════════════════════════════ */
@keyframes portPulse {
  0%   { box-shadow: 0 0 0 0 rgba(168,85,247,0.5), 0 0 0 2px rgba(168,85,247,0.1); }
  60%  { box-shadow: 0 0 0 7px rgba(168,85,247,0), 0 0 0 2px rgba(168,85,247,0.1); }
  100% { box-shadow: 0 0 0 0 rgba(168,85,247,0), 0 0 0 2px rgba(168,85,247,0.1); }
}
@keyframes inputPortPulse {
  0%   { box-shadow: 0 0 0 0 rgba(236,72,153,0.5), 0 0 0 2px rgba(236,72,153,0.1); }
  60%  { box-shadow: 0 0 0 7px rgba(236,72,153,0), 0 0 0 2px rgba(236,72,153,0.1); }
  100% { box-shadow: 0 0 0 0 rgba(236,72,153,0), 0 0 0 2px rgba(236,72,153,0.1); }
}

.node-port {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.18s;
}
.node-port.output {
  right: -9px;
  background: linear-gradient(135deg, #c084fc, #a855f7);
  border: 2.5px solid #fff;
  cursor: crosshair;
  box-shadow: 0 0 0 2px rgba(168,85,247,0.2), 0 2px 6px rgba(168,85,247,0.3);
  animation: portPulse 2.2s ease-out infinite;
}
.node-port.output:hover {
  transform: translateY(-50%) scale(1.6);
  box-shadow: 0 0 0 5px rgba(168,85,247,0.2), 0 0 16px rgba(168,85,247,0.55);
  animation: none;
}
.node-port.input {
  left: -9px;
  background: linear-gradient(135deg, #f9a8d4, #ec4899);
  border: 2.5px solid #fff;
  cursor: default;
  box-shadow: 0 0 0 2px rgba(236,72,153,0.2), 0 2px 6px rgba(236,72,153,0.25);
  animation: inputPortPulse 2.5s ease-out infinite;
}
.node-port.input.can-connect {
  transform: translateY(-50%) scale(1.8);
  background: linear-gradient(135deg, #f472b6, #ec4899);
  box-shadow: 0 0 0 6px rgba(236,72,153,0.25), 0 0 20px rgba(236,72,153,0.6);
  cursor: crosshair;
  animation: none;
}

/* ══════════════════════════════════
   SVG ARROW ANIMATIONS
   ══════════════════════════════════ */
@keyframes flowDash {
  to { stroke-dashoffset: -24; }
}
@keyframes previewDash {
  to { stroke-dashoffset: -18; }
}
@keyframes dotTravel {
  0%   { offset-distance: 0%; opacity: 0; }
  5%   { opacity: 1; }
  95%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* ── Canvas connecting state ── */
.flow-canvas-container.is-connecting {
  cursor: crosshair;
}
.flow-canvas-container.is-connecting .flow-node {
  cursor: crosshair;
}

/* ── Flow Tip Banner ── */
.flow-tip-banner {
  background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(236,72,153,0.05));
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.72rem;
  color: #5b21b6;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.55;
}
.flow-tip-banner i { margin-top: 1px; flex-shrink: 0; color: #a855f7; font-size: 0.85rem; }

/* ── Empty Canvas Hint ── */
.flow-empty-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  user-select: none;
}
.flow-empty-hint-icon {
  width: 72px; height: 72px;
  background: rgba(147,51,234,0.07);
  border: 2px dashed rgba(147,51,234,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 1.8rem;
  color: rgba(147,51,234,0.35);
}
.flow-empty-hint p {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(100,60,200,0.35);
  margin: 0;
  line-height: 1.6;
}

/* ── Connection count badge on node ── */
.flow-conn-badge {
  position: absolute;
  top: -7px;
  right: 10px;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  border: 1.5px solid white;
  box-shadow: 0 2px 6px rgba(124,58,237,0.35);
  pointer-events: none;
}

/* ── Field label inside node ── */
.fn-label {
  font-size: 0.66rem;
  display: block;
  color: #9ca3af;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ══ NODE TYPE — top bar gradients ══ */
.flow-node-buttons::before   { content:''; display:block; height:4px; background:linear-gradient(90deg,#0ea5e9,#38bdf8); border-radius:14px 14px 0 0; }
.flow-node-delay::before     { content:''; display:block; height:4px; background:linear-gradient(90deg,#f59e0b,#fbbf24); border-radius:14px 14px 0 0; }
.flow-node-image::before     { content:''; display:block; height:4px; background:linear-gradient(90deg,#10b981,#34d399); border-radius:14px 14px 0 0; }
.flow-node-condition::before { content:''; display:block; height:4px; background:linear-gradient(90deg,#f59e0b,#ea580c,#d97706); border-radius:14px 14px 0 0; }
.flow-node-capture::before   { content:''; display:block; height:4px; background:linear-gradient(90deg,#06b6d4,#0284c7,#0369a1); border-radius:14px 14px 0 0; }
.flow-node-webhook::before   { content:''; display:block; height:4px; background:linear-gradient(90deg,#6366f1,#4f46e5,#4338ca); border-radius:14px 14px 0 0; }
.flow-node-end::before       { content:''; display:block; height:4px; background:linear-gradient(90deg,#6b7280,#9ca3af); border-radius:14px 14px 0 0; }

/* ── Node Chips ── */
.chip-buttons {
  background: rgba(14,165,233,0.08);
  color: #0369a1;
  border: 1px solid rgba(14,165,233,0.2);
}
.chip-delay {
  background: rgba(245,158,11,0.08);
  color: #92400e;
  border: 1px solid rgba(245,158,11,0.2);
}
.chip-image {
  background: rgba(16,185,129,0.08);
  color: #065f46;
  border: 1px solid rgba(16,185,129,0.2);
}
.chip-capture {
  background: rgba(6,182,212,0.08);
  color: #0e7490;
  border: 1px solid rgba(6,182,212,0.2);
}

/* ── Port Custom Labels & Tags ── */
.port-tag {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid;
}
.tag-yes {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}
.tag-no {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* ── Image Node Upload Dropzone ── */
.fn-img-upload-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fn-img-dropzone {
  border: 2px dashed #6ee7b7;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(16,185,129,0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}
.fn-img-dropzone:hover {
  border-color: #10b981;
  background: rgba(16,185,129,0.07);
  transform: scale(1.01);
}
.fn-img-dropzone.fn-img-dragover {
  border-color: #059669;
  background: rgba(16,185,129,0.12);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
}

/* ── Selected node state (for keyboard Delete) ── */
.flow-node.is-selected {
  border-color: rgba(147,51,234,0.5) !important;
  box-shadow: 0 0 0 3px rgba(147,51,234,0.2), 0 16px 40px -8px rgba(147,51,234,0.3) !important;
}

/* ══════════════════════════════════
   FLOW LIST SIDEBAR PANEL
   ══════════════════════════════════ */
.flow-sidebar-section {
  border-top: 1px solid rgba(147,51,234,0.1);
  padding-top: 14px;
  margin-top: 2px;
}
.flow-sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: #9ca3af;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.flow-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 180px;
  overflow-y: auto;
}
.flow-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1.5px solid rgba(147,51,234,0.1);
  border-radius: 8px;
  padding: 7px 9px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.flow-list-item:hover {
  border-color: rgba(147,51,234,0.3);
  box-shadow: 0 2px 8px rgba(147,51,234,0.1);
}
.flow-list-current {
  border-color: rgba(147,51,234,0.4) !important;
  background: linear-gradient(135deg, rgba(124,58,237,0.04), rgba(236,72,153,0.03)) !important;
  box-shadow: 0 2px 8px rgba(147,51,234,0.12) !important;
}

/* ══════════════════════════════════
   ZOOM TOOLBAR (bottom of canvas)
   ══════════════════════════════════ */
.flow-canvas-container {
  position: relative;
  overflow: auto;
  height: 100%;
  background-color: #f8f7ff;
  background-image: 
    radial-gradient(circle, rgba(147,51,234,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  border: 1.5px solid rgba(147, 51, 234, 0.12);
  border-radius: 14px;
  box-shadow: inset 0 2px 16px rgba(147,51,234,0.04), 0 0 0 4px rgba(147,51,234,0.03);
}

/* ══════════════════════════════════
   ZOOM TOOLBAR (sticky bottom-right)
   ══════════════════════════════════ */
.flow-zoom-toolbar {
  position: sticky;
  bottom: 14px;
  float: right;
  margin-right: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(147,51,234,0.15);
  border-radius: 10px;
  padding: 5px 8px;
  box-shadow: 0 4px 16px rgba(147,51,234,0.12);
  z-index: 100;
  pointer-events: all;
  /* Clear float after toolbar */
  clear: right;
}
.flow-zoom-btn {
  background: none;
  border: 1px solid rgba(147,51,234,0.2);
  border-radius: 6px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  color: #6d28d9;
  transition: background 0.15s;
}
.flow-zoom-btn:hover { background: rgba(124,58,237,0.08); }
#flow-zoom-level {
  font-size: 0.7rem;
  font-weight: 700;
  color: #6d28d9;
  min-width: 36px;
  text-align: center;
}
.flow-arrange-btn {
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(236,72,153,0.08));
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #6d28d9;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.flow-arrange-btn:hover { background: rgba(124,58,237,0.15); }

/* ── Node type buttons in sidebar ── */
.flow-node-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.btn-node-type {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid;
  transition: all 0.15s;
  background: white;
}
.btn-node-type:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.btn-node-trigger   { border-color: #fda4af; color: #be185d; }
.btn-node-trigger:hover   { background: #fff0f3; }
.btn-node-message   { border-color: #c4b5fd; color: #6d28d9; }
.btn-node-message:hover   { background: #f5f3ff; }
.btn-node-buttons   { border-color: #7dd3fc; color: #0369a1; }
.btn-node-buttons:hover   { background: #f0f9ff; }
.btn-node-delay     { border-color: #fcd34d; color: #92400e; }
.btn-node-delay:hover     { background: #fffbeb; }
.btn-node-image     { border-color: #6ee7b7; color: #065f46; }
.btn-node-image:hover     { background: #f0fdf4; }
.btn-node-condition { border-color: #fed7aa; color: #ea580c; }
.btn-node-condition:hover { background: #fff7ed; }
.btn-node-capture   { border-color: #a5f3fc; color: #0284c7; }
.btn-node-capture:hover   { background: #ecfeff; }
.btn-node-webhook   { border-color: #c7d2fe; color: #4f46e5; }
.btn-node-webhook:hover   { background: #eef2ff; }
.btn-node-end       { border-color: #d1d5db; color: #4b5563; }
.btn-node-end:hover       { background: #f9fafb; }

/* CATALOG GRID */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
.product-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: 12px;
  display: flex;
  gap: 15px;
  align-items: center;
}
.product-card img { width: 70px; height: 70px; border-radius: 8px; object-fit: cover; }
.product-card-info { flex-grow: 1; }
.product-card-info h4 { font-size: 0.95rem; margin-bottom: 5px; color: var(--text-color); }
.product-card-info p { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.product-card-info span { font-weight: 700; color: var(--success-color); }
.product-delete-btn { background: transparent; border: none; color: var(--danger-color); cursor: pointer; font-size: 1rem; }

/* ADMIN SYSTEM */
.admin-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
.col-span-2 { grid-column: span 2; }
.admin-plan-select {
  background: white;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 5px;
  border-radius: 4px;
  font-family: inherit;
}

/* PREMIUM FOOTER DISCLAIMERS */
.disclaimer-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid rgba(147, 51, 234, 0.08);
}
.disclaimer-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.9) 100%);
  border: 1px solid rgba(147, 51, 234, 0.06);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 30px -10px rgba(147, 51, 234, 0.05);
  transition: all 0.3s ease;
  position: relative;
}
.disclaimer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -10px rgba(147, 51, 234, 0.1);
  border-color: rgba(147, 51, 234, 0.15);
}
.disclaimer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
}
.disclaimer-card.warning {
  border-left: 5px solid #f97316;
}
.disclaimer-card.warning .disclaimer-header {
  color: #ea580c;
}
.disclaimer-card.info {
  border-left: 5px solid #3b82f6;
}
.disclaimer-card.info .disclaimer-header {
  color: #2563eb;
}
.disclaimer-body {
  font-size: 0.76rem;
  line-height: 1.6;
  color: #576071;
}
.disclaimer-lang-section {
  background: rgba(255, 255, 255, 0.4);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(0,0,0,0.02);
}
.disclaimer-lang-section:last-child {
  margin-bottom: 0;
}
.lang-badge {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  margin-right: 8px;
  text-transform: uppercase;
}
.lang-badge.en {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}
.lang-badge.hi {
  background: rgba(234, 88, 12, 0.08);
  color: #ea580c;
}

/* FLOW BUILDER PREMIUM BUTTONS */
.btn-trigger {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(219, 39, 119, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}
.btn-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(219, 39, 119, 0.35);
  filter: brightness(1.05);
}

.btn-message-node {
  background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}
.btn-message-node:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(126, 34, 206, 0.35);
  filter: brightness(1.05);
}

.btn-save-flow {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(187, 18, 198, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}
.btn-save-flow:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(187, 18, 198, 0.35);
  filter: brightness(1.05);
}

.btn-clear-flow {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #374151;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 8px;
  padding: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  cursor: pointer;
}
.btn-clear-flow:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  color: #1f2937;
}

/* CRM Advanced Styling */
#crm-tag-filters {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
#crm-tag-filters::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.tag-filter-chip {
  padding: 4px 10px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.tag-filter-chip:hover {
  background: rgba(187, 18, 198, 0.05);
  color: var(--primary-color);
}
.tag-filter-chip.active {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
}

.inbox-details-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 280px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.quick-reply-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: rgba(187, 18, 198, 0.06);
  border: 1px dashed rgba(187, 18, 198, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.2s;
}
.quick-reply-chip:hover {
  background: var(--primary-color);
  color: white;
}

.contact-tag-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  margin-top: 4px;
  margin-right: 4px;
}
.contact-tag-badge.tag-lead { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.contact-tag-badge.tag-pending { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.contact-tag-badge.tag-vip { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.contact-tag-badge.tag-closed { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.quick-reply-btn {
  font-size: 0.75rem;
  padding: 2px 6px;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  margin-right: 5px;
}
.quick-reply-btn:hover {
  background: var(--primary-color);
  color: white;
}

/* Toggle Switch Style */
.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.switch-input {
  display: none;
}
.switch-slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background-color: #cbd5e1;
  border-radius: 20px;
  transition: all 0.3s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s;
}
.switch-input:checked + .switch-slider {
  background-color: var(--primary-color);
}
.switch-input:checked + .switch-slider::before {
  transform: translateX(16px);
}

/* Right Details stats grid style */
.details-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}
.details-stat-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px;
}
.details-stat-box span {
  display: block;
}

/* Chat bottom reply style adjustments */
.reply-tab-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: #f1f5f9;
  color: var(--text-muted);
  outline: none;
  transition: all 0.2s;
}
.reply-tab-btn.active.active-chat {
  background: var(--primary-color) !important;
  color: white !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 3px 8px rgba(187, 18, 198, 0.25);
}
.reply-tab-btn.active.active-note {
  background: #eab308 !important;
  color: white !important;
  border-color: #d97706 !important;
  box-shadow: 0 3px 8px rgba(234, 179, 8, 0.25);
}

/* ==========================================================================
   ATOZ CONNECT - COMPLETE MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================================================== */

/* 1. Mobile Menu Button & Drawer Elements */
.mobile-menu-btn {
  display: none;
  background: #ffffff;
  border: 1.5px solid rgba(187, 18, 198, 0.2);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.mobile-menu-btn:hover {
  background: rgba(187, 18, 198, 0.08);
  transform: translateY(-1px);
}

.mobile-sidebar-close {
  display: none;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mobile-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.4);
}

.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 5, 20, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-sidebar-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.mobile-inbox-back-btn {
  display: none;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.mobile-inbox-back-btn:hover {
  background: #e2e8f0;
}

/* 2. Responsive Breakpoint: Large Tablets & Mobile Screens (<= 992px) */
@media (max-width: 992px) {
  /* Layout transformation: from fixed CSS grid to stacked/viewport */
  #app-layout, .app-layout {
    display: block !important;
    height: 100vh !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative !important;
    overflow-x: hidden !important;
  }

  .mobile-menu-btn {
    display: inline-flex !important;
  }

  .mobile-sidebar-close {
    display: inline-flex !important;
  }

  /* Off-canvas mobile slide-out drawer */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 290px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    z-index: 999 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.3) !important;
    border-right: 1px solid rgba(187, 18, 198, 0.15) !important;
    overflow-y: auto !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
  }

  /* Full-width scrollable content area */
  .content-area {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    height: 100vh !important;
    padding: 8px 12px 40px 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .tab-content, .tab-pane {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .top-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 8px 0 !important;
    margin-bottom: 14px !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .header-title {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
    flex: 1 !important;
  }

  .header-title h2 {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .profile-dropdown-container button {
    padding: 5px 10px !important;
    font-size: 0.8rem !important;
  }

  #header-user-email {
    max-width: 90px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: inline-block !important;
  }

  .expiry-text {
    display: none !important;
  }

  /* Stats grid 2x2 responsive compact grid */
  .stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .stat-card {
    padding: 12px 14px !important;
    gap: 10px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .stat-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1rem !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }

  .stat-info {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .stat-info h3 {
    font-size: 0.65rem !important;
    letter-spacing: 0.2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .stat-info p {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;
  }

  /* General Grid & Columns Collapse */
  /* General Grid & Columns Collapse */
  .dashboard-widgets-grid,
  .campaigns-layout,
  .admin-grid-layout,
  [style*="grid-template-columns: 320px 1fr"],
  [style*="grid-template-columns: 380px 1fr"],
  [style*="grid-template-columns: 385px 1fr"],
  [style*="grid-template-columns: 280px 1fr"],
  [style*="grid-template-columns: 1.5fr 1fr"],
  [style*="grid-template-columns: 1.2fr 0.8fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 16px !important;
    box-sizing: border-box !important;
  }

  /* Dashboard Engine Widget Hero Card */
  .dashboard-hero-card,
  .dashboard-widgets-grid .widget-card {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    padding: 16px 14px !important;
    min-height: auto !important;
    box-sizing: border-box !important;
  }

  .dashboard-hero-card .dashboard-hero-text {
    width: 100% !important;
  }

  .dashboard-hero-card .dashboard-hero-canvas-wrap {
    width: 100% !important;
    height: 140px !important;
    min-height: 140px !important;
    margin-top: 10px !important;
  }

  /* CRM Live Inbox Mobile Adaptations */
  .crm-inbox-layout {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 120px) !important;
    position: relative !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    width: 100% !important;
  }

  /* When on chat list (NO chat open) */
  .crm-inbox-layout:not(.chat-open) .inbox-sidebar {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    border-right: none !important;
  }

  .crm-inbox-layout:not(.chat-open) .inbox-conversation {
    display: none !important;
  }

  .crm-inbox-layout:not(.chat-open) .inbox-details-panel {
    display: none !important;
  }

  /* When CHAT IS OPEN */
  .crm-inbox-layout.chat-open .inbox-sidebar {
    display: none !important;
  }

  .crm-inbox-layout.chat-open .inbox-conversation {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 10 !important;
  }

  .mobile-inbox-back-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 8px !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: var(--text-color) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  /* Details Panel on Mobile: Hidden by default, slides out when Info button is clicked */
  .inbox-details-panel {
    display: none !important;
    position: fixed !important;
    right: 0 !important;
    top: 0 !important;
    width: 320px !important;
    max-width: 90vw !important;
    height: 100vh !important;
    z-index: 1002 !important;
    background: #ffffff !important;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25) !important;
    padding: 20px 16px 40px 16px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
    transform: translateX(100%) !important;
    transition: transform 0.25s ease-in-out !important;
  }

  .inbox-details-panel.mobile-open {
    display: block !important;
    transform: translateX(0) !important;
  }

  /* Slots Grid Mobile 1-Column Responsive */
  .slots-grid {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .slot-card {
    padding: 16px 16px !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .slot-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .slot-card-header h3 {
    font-size: 0.95rem !important;
    margin: 0 !important;
  }

  .slot-actions {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 12px !important;
  }

  .slot-actions .btn {
    flex: 1 !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
  }

  .section-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
  }

  .section-actions h2,
  .section-actions h3 {
    font-size: 1.1rem !important;
    margin: 0 !important;
  }

  /* All Tabs Responsive Grid Collapse */
  #tab-admin [style*="display: grid"],
  #tab-admin [style*="display:grid"],
  #tab-admin [style*="grid-template-columns"],
  #tab-admin .admin-grid-layout,
  #tab-contact-book [style*="display:grid"],
  #tab-contact-book [style*="display: grid"],
  #tab-contact-book [style*="grid-template-columns"],
  #tab-grabber [style*="display: grid"],
  #tab-grabber [style*="grid-template-columns"],
  #tab-parser [style*="display: grid"],
  #tab-parser [style*="grid-template-columns"],
  #tab-slots [style*="grid-template-columns"],
  #tab-campaigns [style*="grid-template-columns"],
  #tab-drip [style*="grid-template-columns"],
  #tab-ai [style*="grid-template-columns"],
  #tab-otp [style*="grid-template-columns"],
  #tab-guide [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Table Horizontal Scrolling & Container Containment */
  .table-container,
  .cmp-wrap,
  .widget-card div[style*="overflow-x"],
  .widget-card div[style*="overflow-x: auto"],
  .widget-card div[style*="overflow-x:auto"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  .widget-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Modals & Dialogs responsiveness */
  .modal-content,
  .auth-container,
  #template-picker-modal > div,
  #edit-user-modal > div,
  #new-chat-modal > div,
  #profile-settings-modal > div {
    width: 92% !important;
    max-width: 480px !important;
    max-height: 88vh !important;
    padding: 20px 16px !important;
    margin: 15px auto !important;
    overflow-y: auto !important;
  }

  /* QR Generator & Standee Print */
  #tab-qr-links [style*="grid-template-columns: 1.2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Hero Banners Responsive Padding */
  [style*="padding: 24px 32px"] {
    padding: 16px 18px !important;
  }
}

/* 3. Small Mobile Screens (<= 600px) */
@media (max-width: 600px) {
  .top-header {
    padding: 6px 0 !important;
    margin-bottom: 12px !important;
    gap: 6px !important;
  }

  .header-title h2 {
    font-size: 0.95rem !important;
    max-width: 180px !important;
  }

  #btn-install-pwa {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
  }

  #btn-install-pwa span {
    display: none !important;
  }

  .section-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .section-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* 4. Extra Small Mobile Screens (<= 480px) */
@media (max-width: 480px) {
  #header-user-email {
    display: none !important;
  }

  .header-title h2 {
    font-size: 0.9rem !important;
    max-width: 140px !important;
  }

  .btn {
    padding: 8px 12px !important;
    font-size: 0.78rem !important;
  }

  .badge {
    padding: 3px 7px !important;
    font-size: 0.65rem !important;
  }

  .auth-container {
    padding: 22px 16px !important;
  }

  .auth-container h2 {
    font-size: 1.3rem !important;
  }
}



