:root {
  --bg-color: #f8fafc;
  --panel-bg: rgba(255, 255, 255, 0.94);
  --border-color: rgba(226, 232, 240, 0.88);
  --text-color: #0f172a;
  --text-muted: #64748b;
  
  --primary-color: #7c3aed;
  --primary-glow: rgba(124, 58, 237, 0.25);
  --success-color: #059669;
  --success-glow: rgba(5, 150, 105, 0.2);
  --warning-color: #d97706;
  --danger-color: #e11d48;
  --indigo-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  --green-gradient: linear-gradient(135deg, #059669 0%, #34d399 100%);
  --card-shadow: 0 10px 30px -10px rgba(112, 144, 176, 0.12), 0 4px 12px -2px rgba(112, 144, 176, 0.05);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.06) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(56, 189, 248, 0.07) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-color);
  overflow-x: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Common UI Elements */
.badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-trial { background: rgba(245, 158, 11, 0.12); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-1year { background: rgba(124, 58, 237, 0.1); color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.25); }
.badge-2years { background: rgba(59, 130, 246, 0.1); color: #2563eb; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-5years { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-lifetime { background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(236, 72, 153, 0.15)); color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.3); font-weight: 800; }
.badge-completed { background: rgba(16, 185, 129, 0.1); color: #059669; border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-processing { background: rgba(124, 58, 237, 0.1); color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.25); }
.badge-pending { background: rgba(100, 116, 139, 0.1); color: #475569; border: 1px solid rgba(100, 116, 139, 0.2); }
.badge-failed { background: rgba(239, 68, 68, 0.1); color: #e11d48; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-paused { background: rgba(245, 158, 11, 0.12); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-cancelled { background: rgba(239, 68, 68, 0.1); color: #e11d48; border: 1px solid rgba(239, 68, 68, 0.25); }
.badge-scheduled { background: rgba(99, 102, 241, 0.1); color: #4f46e5; border: 1px solid rgba(99, 102, 241, 0.25); }

.btn {
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s 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: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #a855f7 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 8px 22px rgba(124, 58, 237, 0.45);
  transform: translateY(-2px);
}
.btn-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}
.btn-success:hover {
  box-shadow: 0 8px 22px rgba(5, 150, 105, 0.45);
  transform: translateY(-2px);
}
.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.3);
}
.btn-warning:hover {
  box-shadow: 0 8px 22px rgba(217, 119, 6, 0.45);
  transform: translateY(-2px);
}
.btn-danger {
  background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 8px 22px rgba(225, 29, 72, 0.45);
  transform: translateY(-2px);
}
.btn-outline {
  background: white;
  border: 1.5px solid rgba(203, 213, 225, 0.9);
  color: #334155;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.btn-outline:hover {
  background: #f8fafc;
  border-color: #7c3aed;
  color: #7c3aed;
  transform: translateY(-1px);
}
.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: radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.08) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(56, 189, 248, 0.08) 0px, transparent 50%), #f8fafc;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.auth-container {
  width: 420px;
  padding: 40px;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  box-shadow: 0 20px 40px -15px rgba(112, 144, 176, 0.2);
}
.auth-brand {
  margin-bottom: 25px;
}
.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: 800; margin-bottom: 5px; color: #0f172a; letter-spacing: -0.5px; }
.auth-container p { color: var(--text-muted); font-size: 0.9rem; }
.auth-form h3 { margin-bottom: 20px; font-weight: 700; color: #1e293b; }
.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.95);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s;
}
.input-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
  background: #ffffff;
}
.auth-switch {
  margin-top: 15px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-switch span {
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 700;
}
.otp-alert {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6d28d9;
  font-size: 0.85rem;
  font-weight: 600;
}

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

/* SIDEBAR */
.sidebar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 4px 0 24px rgba(112, 144, 176, 0.05);
  height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0 0 20px 0;
}
.sidebar-brand {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #a855f7 100%);
  color: #ffffff;
  padding: 20px;
  margin: 14px 14px 18px 14px;
  border-radius: 14px;
  box-shadow: 0 8px 20px -4px rgba(124, 58, 237, 0.4);
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}
.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: 2px;
  flex-grow: 1;
  padding: 0 10px 15px 10px;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 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: 14px 12px 4px 12px;
  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: 10px 14px;
  margin: 2px 4px;
  color: #475569;
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.nav-item i {
  font-size: 1.05rem;
  transition: transform 0.2s ease, color 0.2s ease;
  color: #64748b;
  width: 20px;
  text-align: center;
}
.nav-item:hover {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.07);
  transform: translateX(3px);
}
.nav-item:hover i {
  color: #7c3aed;
}
.nav-item.active {
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
  font-weight: 700;
  transform: none;
}
.nav-item.active i {
  color: #ffffff !important;
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding: 16px 16px 0 16px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(124, 58, 237, 0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.15rem;
  color: var(--primary-color);
  border: 1.5px solid rgba(124, 58, 237, 0.2);
}

.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: 9px;
  background: transparent;
  border: 1.5px solid rgba(225, 29, 72, 0.2);
  color: var(--danger-color);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  transition: all 0.25s;
}
.btn-logout:hover {
  background: rgba(225, 29, 72, 0.06);
  border-color: var(--danger-color);
  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: 24px;
  background: transparent;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 0;
}
.top-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  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.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab-pane.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* STATS CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 26px;
}

/* LIGHT PASTEL GRADIENT STAT CARDS */
.sample-stat-card {
  border-radius: 22px;
  padding: 22px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.sample-stat-card:hover {
  transform: translateY(-4px);
}

.sample-stat-card.card-cyan {
  background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 55%, #e0f2fe 100%) !important;
  border: 1.5px solid #7dd3fc !important;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.12) !important;
}
.sample-stat-card.card-cyan:hover {
  box-shadow: 0 16px 32px rgba(56, 189, 248, 0.22) !important;
  border-color: #38bdf8 !important;
}

.sample-stat-card.card-emerald {
  background: linear-gradient(145deg, #ffffff 0%, #ecfdf5 55%, #d1fae5 100%) !important;
  border: 1.5px solid #6ee7b7 !important;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.12) !important;
}
.sample-stat-card.card-emerald:hover {
  box-shadow: 0 16px 32px rgba(16, 185, 129, 0.22) !important;
  border-color: #34d399 !important;
}

.sample-stat-card.card-purple {
  background: linear-gradient(145deg, #ffffff 0%, #faf5ff 55%, #f3e8ff 100%) !important;
  border: 1.5px solid #d8b4fe !important;
  box-shadow: 0 10px 25px rgba(168, 85, 247, 0.12) !important;
}
.sample-stat-card.card-purple:hover {
  box-shadow: 0 16px 32px rgba(168, 85, 247, 0.22) !important;
  border-color: #c084fc !important;
}

.sample-stat-card.card-amber {
  background: linear-gradient(145deg, #ffffff 0%, #fffbeb 55%, #fef3c7 100%) !important;
  border: 1.5px solid #fde68a !important;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.12) !important;
}
.sample-stat-card.card-amber:hover {
  box-shadow: 0 16px 32px rgba(245, 158, 11, 0.22) !important;
  border-color: #fcd34d !important;
}

.sample-stat-card.card-rose {
  background: linear-gradient(145deg, #ffffff 0%, #fff1f2 55%, #ffe4e6 100%) !important;
  border: 1.5px solid #fca5a5 !important;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.12) !important;
}
.sample-stat-card.card-rose:hover {
  box-shadow: 0 16px 32px rgba(239, 68, 68, 0.22) !important;
  border-color: #f87171 !important;
}

.sample-stat-card.card-pink {
  background: linear-gradient(145deg, #ffffff 0%, #fdf2f8 55%, #fce7f3 100%) !important;
  border: 1.5px solid #fbcfe8 !important;
  box-shadow: 0 10px 25px rgba(236, 72, 153, 0.12) !important;
}
.sample-stat-card.card-pink:hover {
  box-shadow: 0 16px 32px rgba(236, 72, 153, 0.22) !important;
  border-color: #f472b6 !important;
}

.sample-stat-card.card-indigo {
  background: linear-gradient(145deg, #ffffff 0%, #eff6ff 55%, #dbeafe 100%) !important;
  border: 1.5px solid #93c5fd !important;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.12) !important;
}
.sample-stat-card.card-indigo:hover {
  box-shadow: 0 16px 32px rgba(59, 130, 246, 0.22) !important;
  border-color: #60a5fa !important;
}

.stat-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 10px 25px -5px rgba(112, 144, 176, 0.08), 0 4px 10px -2px rgba(112, 144, 176, 0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 35px -8px rgba(124, 58, 237, 0.14), 0 8px 16px -4px rgba(124, 58, 237, 0.06);
  border-color: rgba(168, 85, 247, 0.4);
}
.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.icon-purple {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(124, 58, 237, 0.35);
}
.icon-blue {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.35);
}
.icon-green {
  background: linear-gradient(135deg, #059669, #34d399);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(5, 150, 105, 0.35);
}
.icon-yellow {
  background: linear-gradient(135deg, #d97706, #fbbf24);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(217, 119, 6, 0.35);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.stat-info h3 {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.stat-info p {
  font-size: 1.7rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

/* 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;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.96) 100%);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  box-shadow: 0 12px 30px -8px rgba(112, 144, 176, 0.1);
  padding: 24px;
}
.widget-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(112, 144, 176, 0.08);
  transition: all 0.3s ease;
}
.widget-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding-bottom: 12px;
  color: #0f172a;
  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: 22px;
}
.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.slot-card {
  padding: 22px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 10px 25px -5px rgba(112, 144, 176, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.slot-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px -8px rgba(124, 58, 237, 0.12);
  border-color: rgba(168, 85, 247, 0.35);
}
.slot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}
.slot-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.slot-badge-connected { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.slot-badge-disconnected { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }
.slot-badge-connecting { background: #f5f3ff; color: #7c3aed; border: 1px solid #ddd6fe; }

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

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}
.modal-content {
  width: 480px;
  padding: 30px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}
.modal-header button {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-header button:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.qr-container {
  background: white;
  width: 250px;
  height: 250px;
  margin: 20px auto;
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}
.qr-container img { width: 100%; height: 100%; }
.qr-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f1f5f9;
  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; font-weight: 600; }
.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(124, 58, 237, 0.4);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(124, 58, 237, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

/* CAMPAIGNS & TABLE */
.campaigns-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 22px;
  width: 100%;
}
.input-wrapper {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-wrapper label { font-size: 0.85rem; color: #475569; font-weight: 700; }
.input-wrapper input, .input-wrapper textarea, select.form-control, .form-input {
  background: #ffffff;
  border: 1.5px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  color: #0f172a;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.input-wrapper input:focus, .input-wrapper textarea:focus, select.form-control:focus, .form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3.5px rgba(124, 58, 237, 0.12);
  background: #ffffff;
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); }

.table-container {
  overflow-x: auto;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}
.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.data-table.compact th, .data-table.compact td {
  padding: 8px 12px;
}
.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td { font-size: 0.88rem; color: #1e293b; }
.data-table tbody tr {
  transition: background 0.15s ease;
}
.data-table tbody tr:hover {
  background: rgba(124, 58, 237, 0.03);
}

/* CRM INBOX LAYOUT */
.crm-inbox-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 110px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  box-shadow: 0 12px 30px -8px rgba(112, 144, 176, 0.1);
}
.inbox-sidebar {
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  min-height: 0;
  height: 100%;
}
.search-bar {
  padding: 15px;
  position: relative;
}
.search-bar i { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-bar input {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  padding: 9px 14px 9px 38px;
  border-radius: 20px;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
}
.search-bar input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.chats-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.chat-list-item {
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(241, 245, 249, 0.9);
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-list-item:hover {
  background: rgba(124, 58, 237, 0.04);
}
.chat-list-item.active {
  background: rgba(124, 58, 237, 0.08);
  border-left: 4px solid var(--primary-color);
}

.inbox-conversation {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ffffff;
  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: 14px 22px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
}
.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8fafc;
}
.chat-bubble {
  max-width: 75%;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.45;
  position: relative;
}
.chat-bubble.received {
  align-self: flex-start;
  background: #ffffff;
  color: var(--text-color);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.chat-bubble.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
  color: #ffffff;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}
.chat-bubble span.time {
  display: block;
  font-size: 0.68rem;
  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 20px;
  display: flex;
  gap: 10px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  background: #ffffff;
}
.chat-footer input {
  flex-grow: 1;
  background: #ffffff;
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
  color: var(--text-color);
  padding: 10px 16px;
  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;
  }
}

/* ═══════════════════════════════════════
   SAMPLE SAAS DASHBOARD & METRIC CARDS
   ═══════════════════════════════════════ */
.dash-welcome-hero {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dash-welcome-hero:hover {
  box-shadow: 0 16px 36px -5px rgba(112, 144, 176, 0.12) !important;
}

.sample-stat-card {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.sample-stat-card:hover {
  transform: translateY(-5px) !important;
}
.sample-stat-card.card-cyan:hover {
  box-shadow: 0 18px 35px -5px rgba(56, 189, 248, 0.25) !important;
}
.sample-stat-card.card-emerald:hover {
  box-shadow: 0 18px 35px -5px rgba(16, 185, 129, 0.25) !important;
}
.sample-stat-card.card-purple:hover {
  box-shadow: 0 18px 35px -5px rgba(168, 85, 247, 0.25) !important;
}
.sample-stat-card.card-amber:hover {
  box-shadow: 0 18px 35px -5px rgba(245, 158, 11, 0.25) !important;
}

/* Sidebar Active Nav Item Polish */
.sidebar-nav .nav-item.active {
  background: linear-gradient(135deg, #a855f7 0%, #c026d3 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(192, 38, 211, 0.35) !important;
  border-radius: 12px !important;
}
.sidebar-nav .nav-item.active i {
  color: #ffffff !important;
}

/* Card Rose */
.sample-stat-card.card-rose {
  border: 2px solid #f87171 !important;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.08) !important;
}
.sample-stat-card.card-rose:hover {
  box-shadow: 0 16px 35px rgba(239, 68, 68, 0.18) !important;
  border-color: #ef4444 !important;
}

.camp-type-filter-btn {
  transition: all 0.2s ease;
}
.camp-type-filter-btn:hover {
  transform: translateY(-1px);
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 14px 18px;
  border-bottom: 1.5px solid #e2e8f0;
}
.data-table td {
  padding: 14px 18px;
  font-size: 0.85rem;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}
.data-table tr:hover td {
  background: #fbfbfe;
}

/* TOP HEADER ULTRA CRISP */
.top-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 10px 20px !important;
  margin-bottom: 20px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  border-radius: 18px !important;
  border: 1.5px solid rgba(226, 232, 240, 0.9) !important;
  box-shadow: 0 8px 25px rgba(112, 144, 176, 0.08) !important;
  flex-wrap: nowrap !important;
  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}
.header-title {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}
.header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
}

/* ===================================================
   MASTER PASTEL SAAS DESIGN SYSTEM (ATOZ MARKETING KIT)
   =================================================== */

:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-color: #f7f8fc;
  --panel-bg: rgba(255, 255, 255, 0.98);
  --border-color: rgba(226, 232, 240, 0.9);
  --border-subtle: #f1f5f9;
  --text-dark: #0f172a;
  --text-navy: #1e1b4b;
  --text-slate: #64748b;
  
  --primary-purple: #7c3aed;
  --primary-fuchsia: #c026d3;
  --accent-cyan: #0284c7;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
}

body {
  font-family: var(--font-family) !important;
  background-color: var(--bg-color) !important;
  background-image: 
    radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(56, 189, 248, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(236, 72, 153, 0.04) 0px, transparent 50%) !important;
  background-attachment: fixed !important;
  color: var(--text-dark) !important;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Master Glass Hero Banner */
.sample-hero-banner {
  background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,245,255,0.98) 50%, rgba(240,249,255,0.98) 100%) !important;
  backdrop-filter: blur(16px);
  border: 1.5px solid rgba(226, 232, 240, 0.9) !important;
  border-radius: 24px !important;
  padding: 26px 30px !important;
  margin-bottom: 24px !important;
  box-shadow: 0 10px 30px -5px rgba(147, 51, 234, 0.08) !important;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.sample-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fdf4ff;
  border: 1.5px solid #f5d0fe;
  color: #a21caf;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
}

.sample-hero-title {
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  color: #1e1b4b !important;
  margin: 0 0 6px 0 !important;
  letter-spacing: -0.5px !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sample-hero-desc {
  font-size: 0.88rem !important;
  color: #64748b !important;
  margin: 0 !important;
  max-width: 760px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
}

/* Action Pill Buttons in Hero */
.btn-pill-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 9px 20px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  box-shadow: 0 4px 16px rgba(192, 38, 211, 0.35) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
}
.btn-pill-primary:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(192, 38, 211, 0.5) !important;
}

.btn-pill-secondary {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #475569 !important;
  padding: 8px 18px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02) !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
}
.btn-pill-secondary:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
}

.btn-pill-rose {
  background: #fff1f2 !important;
  border: 1.5px solid #fecdd3 !important;
  color: #be123c !important;
  padding: 8px 18px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  transition: all 0.2s ease !important;
}
.btn-pill-rose:hover { background: #ffe4e6 !important; transform: translateY(-1px) !important; }

.btn-pill-cyan {
  background: #f0f9ff !important;
  border: 1.5px solid #bae6fd !important;
  color: #0284c7 !important;
  padding: 8px 18px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  transition: all 0.2s ease !important;
}
.btn-pill-cyan:hover { background: #e0f2fe !important; transform: translateY(-1px) !important; }

.btn-pill-emerald {
  background: #ecfdf5 !important;
  border: 1.5px solid #a7f3d0 !important;
  color: #059669 !important;
  padding: 8px 18px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  transition: all 0.2s ease !important;
}
.btn-pill-emerald:hover { background: #d1fae5 !important; transform: translateY(-1px) !important; }

.btn-pill-amber {
  background: #fffbeb !important;
  border: 1.5px solid #fde68a !important;
  color: #b45309 !important;
  padding: 8px 18px !important;
  border-radius: 20px !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7px !important;
  transition: all 0.2s ease !important;
}
.btn-pill-amber:hover { background: #fef3c7 !important; transform: translateY(-1px) !important; }

/* Preset Card Utilities */
.sample-preset-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(112, 144, 176, 0.05);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.sample-preset-card:hover {
  transform: translateY(-3px);
  border-color: #c084fc;
  box-shadow: 0 10px 25px rgba(168, 85, 247, 0.12);
}

/* Data Table Clean */
.sample-table-card {
  background: #ffffff !important;
  border: 1.5px solid rgba(226, 232, 240, 0.9) !important;
  border-radius: 22px !important;
  box-shadow: 0 10px 30px rgba(112, 144, 176, 0.08) !important;
  overflow: hidden !important;
  margin-bottom: 24px !important;
}

/* REFINED CALM SAAS NAVIGATION */
.sidebar-nav .nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 11px !important;
  padding: 9px 12px !important;
  margin: 1px 0 !important;
  color: #475569 !important;
  text-decoration: none !important;
  border-radius: 10px !important;
  transition: all 0.15s ease !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  cursor: pointer !important;
}
.sidebar-nav .nav-item:hover {
  color: #0f172a !important;
  background: #f8fafc !important;
  transform: none !important;
}
.sidebar-nav .nav-item i {
  font-size: 1rem !important;
  width: 18px !important;
  text-align: center !important;
}
.sidebar-nav .nav-item.active {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25) !important;
  font-weight: 700 !important;
}
.sidebar-nav .nav-item.active i {
  color: #ffffff !important;
}

/* CALM HERO & STAT CARDS */
.sample-stat-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  padding: 20px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.02) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.sample-stat-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04) !important;
  border-color: #cbd5e1 !important;
}
.sample-stat-card.card-cyan { border-color: #bae6fd !important; }
.sample-stat-card.card-emerald { border-color: #a7f3d0 !important; }
.sample-stat-card.card-purple { border-color: #ddd6fe !important; }
.sample-stat-card.card-amber { border-color: #fde68a !important; }
.sample-stat-card.card-rose { border-color: #fecdd3 !important; }

/* CONNECTED LAYOUT & PERFECT GRID ALIGNMENT */
.app-layout {
  display: grid !important;
  grid-template-columns: 280px 1fr !important;
  height: 100vh !important;
  overflow: hidden !important;
  background-color: #f7f8fc !important;
}

.sidebar {
  background: #ffffff !important;
  border-right: 1.5px solid #eef2f6 !important;
  box-shadow: 2px 0 16px rgba(0,0,0,0.02) !important;
  height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 0 0 16px 0 !important;
  z-index: 10 !important;
}

.content-area {
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  padding: 0 24px 30px 24px !important;
  overflow-y: auto !important;
}

.top-header {
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  margin: 14px 0 22px 0 !important;
  box-sizing: border-box !important;
}
