/* ==========================================================================
   Email Sender Pro - Ultra High-End Enterprise SaaS Design System
   ========================================================================== */

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

:root {
  --bg-main: #0b0f19;
  --bg-sidebar: #0f172a;
  --bg-card: #162036;
  --bg-card-hover: #1e2c4a;
  --bg-input: #0f172a;
  --bg-table-head: #1e293b;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;

  --secondary: #06b6d4;
  --accent: #a855f7;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --sidebar-width: 260px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.4);
}

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

html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: #ffffff;
  font-weight: 700;
}

a { color: var(--primary-light); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #a5b4fc; }

.app-container {
  display: flex;
  min-height: 100vh;
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.15s ease;
}

.nav-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-link:hover { color: #ffffff; background: rgba(255, 255, 255, 0.05); transform: translateX(3px); }
.nav-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.25) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-left: 3px solid var(--primary);
  border-radius: 4px var(--radius-md) var(--radius-md) 4px;
}

.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090e1a;
}

.user-profile { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: #fff;
}
.user-info .name { font-size: 0.88rem; font-weight: 700; }
.user-info .role { font-size: 0.72rem; color: var(--text-dim); }
.logout-btn { color: var(--text-muted); font-size: 1.1rem; padding: 6px; }
.logout-btn:hover { color: var(--danger); }

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px 36px;
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.page-title h1 { font-size: 1.9rem; font-weight: 800; color: #ffffff; margin-bottom: 4px; }
.page-title p { color: var(--text-muted); font-size: 0.9rem; }

/* Campaign Stepper Header */
.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.step-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Featured Hero Template Banner Card */
.hero-template-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-glow);
  margin-bottom: 24px;
}

.hero-template-info h3 {
  font-size: 1.3rem;
  color: #ffffff;
  margin-bottom: 6px;
}

.hero-template-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Form Controls */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: #cbd5e1; }

.form-control, .form-select, textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus, .form-select:focus, textarea:focus {
  border-color: var(--primary);
  background: #141f38;
}

.form-select option { background: #0f172a; color: var(--text-main); padding: 8px; }
textarea { resize: vertical; min-height: 130px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.btn-launch {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
  font-size: 1.05rem;
  padding: 16px;
}

.btn-launch:hover {
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.6);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger  { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-info    { background: rgba(6, 182, 212, 0.15); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }

/* Alerts */
.alert { padding: 14px 18px; border-radius: var(--radius-md); margin-bottom: 20px; display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.alert-danger  { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* Modal Popup System */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 90%;
  max-width: 720px;
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 28px;
  transform: scale(0.95);
  transition: transform 0.2s ease;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

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

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover { color: #fff; background: var(--danger); }

/* Editor Tabs & Preview Frame */
.editor-tabs {
  display: flex;
  gap: 8px;
}

.tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active, .tab-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.preview-iframe {
  width: 100%;
  height: 480px;
  border: none;
  background: #ffffff;
}

/* Animated Striped Progress Bar System */
.progress-bar-container {
  width: 100%;
  height: 14px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--primary);
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.35) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0.35) 75%,
    transparent 75%,
    transparent
  );
  background-size: 26px 26px;
  width: 0%;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: hackerStripes 0.8s linear infinite;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.6), 0 0 24px rgba(6, 182, 212, 0.5);
  border-radius: var(--radius-full);
}

@keyframes hackerStripes {
  0% { background-position: 0 0; }
  100% { background-position: 26px 0; }
}

/* Terminal Log System */
.terminal-log {
  background: #090e1a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.84rem;
  color: #38bdf8;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  margin-top: 14px;
  line-height: 1.6;
}

.terminal-log::selection {
  background: #00ff66;
  color: #000000;
}

/* Hacker Blinking Cursor */
.blinking-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  background-color: #00ff66;
  box-shadow: 0 0 8px #00ff66;
  vertical-align: middle;
  margin-left: 4px;
  animation: blinkCursor 0.7s step-end infinite;
}

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

/* Tag Pills */
.tag-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tag-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Template Modal Grid Items */
.tpl-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.tpl-modal-item {
  background: #162036;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s ease;
}

.tpl-modal-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Toast Notifications */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 999999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast-item { pointer-events: auto; min-width: 300px; max-width: 400px; background: #0f172a; border: 1px solid var(--border-glow); border-radius: var(--radius-md); padding: 14px 18px; color: var(--text-main); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); display: flex; align-items: center; gap: 12px; position: relative; overflow: hidden; animation: toastSlideIn 0.3s ease forwards; }
.toast-item.toast-exit { animation: toastSlideOut 0.25s ease forwards; }
.toast-icon { font-size: 1.2rem; }
.toast-content { flex: 1; font-size: 0.88rem; font-weight: 600; }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; width: 100%; animation: toastProgress 3.5s linear forwards; }
.toast-success { border-left: 4px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-success .toast-progress { background: var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-error .toast-progress { background: var(--danger); }

@keyframes toastSlideIn { 0% { opacity: 0; transform: translateX(100%); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes toastSlideOut { 0% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(100%); } }
@keyframes toastProgress { 0% { width: 100%; } 100% { width: 0%; } }

/* Responsive Layout Grid Classes */
.dashboard-main-grid,
.dashboard-charts-grid,
.campaign-form-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* Mobile Menu Button Visibility */
.mobile-menu-btn {
  display: none !important;
}

/* ==========================================================================
   COMPREHENSIVE MULTI-DEVICE RESPONSIVE SYSTEM
   ========================================================================== */

/* Tablet & Medium Laptops Breakpoint (<= 992px) */
@media (max-width: 992px) {
  .dashboard-main-grid,
  .dashboard-charts-grid,
  .campaign-form-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* Mobile Smartphones Breakpoint (<= 768px) */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: inline-flex !important;
  }

  /* Mobile Sidebar Off-Canvas Drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 270px;
    z-index: 99999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.85);
    background: #0b1120 !important;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-header .logo-text,
  .nav-link span,
  .user-info {
    display: block !important;
  }

  /* Main Content Takes 100% Full Width on Phone */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 14px 12px 90px 12px !important;
    box-sizing: border-box !important;
  }

  /* Top Bar Mobile Optimization */
  .top-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-bottom: 18px !important;
    padding-bottom: 14px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  .top-bar > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .page-title h1 {
    font-size: 1.25rem !important;
    line-height: 1.35 !important;
    word-break: break-word;
  }

  .page-title p {
    font-size: 0.8rem !important;
  }

  /* Welcome Banner Cards Mobile */
  .dashboard-welcome-admin,
  .dashboard-welcome-client {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
    padding: 16px !important;
  }

  .hero-template-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    padding: 16px !important;
  }

  .dashboard-welcome-client h2,
  .dashboard-welcome-admin h2 {
    font-size: 1.2rem !important;
  }

  /* Grids to 1 Column on Mobile */
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .stats-flex-container {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
  }

  .stat-card-item {
    padding: 12px 10px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .stat-card-item .stat-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.1rem !important;
  }

  .stat-card-item .number {
    font-size: 1.15rem !important;
  }

  .stat-card-item .label {
    font-size: 0.72rem !important;
  }

  .tpl-modal-grid {
    grid-template-columns: 1fr !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
  }

  /* Table Horizontal Touch Swiping */
  .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .custom-table {
    min-width: 600px !important;
  }

  /* Mobile Live Chat Popup Container */
  .chat-popup-container {
    width: calc(100vw - 20px) !important;
    right: 10px !important;
    bottom: 82px !important;
    height: calc(100vh - 110px) !important;
    max-height: 520px !important;
    border-radius: 20px !important;
  }

  .chat-widget-trigger {
    bottom: 16px !important;
    right: 16px !important;
    width: 56px !important;
    height: 56px !important;
    font-size: 22px !important;
  }

  .chat-widget-trigger::after {
    display: none !important;
  }

  .nav-bell-dropdown {
    right: -10px !important;
    width: calc(100vw - 30px) !important;
  }

  .chat-toast-notification {
    top: 12px !important;
    right: 10px !important;
    width: calc(100vw - 20px) !important;
    min-width: unset !important;
  }
}

/* Extra Small Phones Breakpoint (<= 480px) */
@media (max-width: 480px) {
  .main-content {
    padding: 10px 8px 90px 8px !important;
  }

  .glass-card {
    padding: 14px 12px !important;
  }

  .btn {
    padding: 8px 14px;
    font-size: 0.82rem;
  }
}

/* ==========================================================================
   Ultra-Premium Table & Stat Card System
   ========================================================================== */

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(22, 32, 54, 0.7) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.2);
}

.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #ffffff;
  flex-shrink: 0;
}

.stat-icon.primary { background: linear-gradient(135deg, var(--primary), #4f46e5); box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); }
.stat-icon.success { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4); }
.stat-icon.warning { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4); }
.stat-icon.accent  { background: linear-gradient(135deg, #a855f7, #7c3aed); box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4); }

.stat-info { display: flex; flex-direction: column; }
.stat-info .label { font-size: 0.8rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-info .value { font-size: 1.5rem; font-weight: 800; color: #ffffff; font-family: 'Outfit', sans-serif; }

/* Custom Table Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.custom-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 0.91rem;
}

.custom-table th {
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 12px 18px;
  border: none;
  text-align: left;
}

.custom-table tbody tr {
  background: rgba(15, 23, 42, 0.65);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-table tbody tr:hover {
  background: rgba(30, 44, 74, 0.7);
  transform: scale(1.004) translateY(-1px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.custom-table td {
  padding: 16px 18px;
  vertical-align: middle;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.custom-table td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
}

.custom-table td:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

/* Glowing Neon Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
}

.badge-primary {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

/* Action Buttons Styling */
.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.btn-test {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
  transition: all 0.2s ease;
}

.btn-test:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
  transform: translateY(-2px);
}

.btn-edit {
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.btn-edit:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  transition: all 0.2s ease;
}

.btn-delete:hover {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

/* User Pill & Avatar in Table */
.server-title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   FLOATING LIVE CHAT POP-UP WIDGET STYLES (Ultra High-End Commercial SaaS)
   ========================================================================== */
.chat-widget-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.45), 0 0 20px rgba(16, 185, 129, 0.2);
  z-index: 9999;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.chat-widget-trigger:hover {
  transform: scale(1.12) rotate(6deg);
  box-shadow: 0 14px 40px rgba(16, 185, 129, 0.65), 0 0 30px rgba(16, 185, 129, 0.4);
}

.chat-widget-trigger::after {
  content: '💬 Support Chat';
  position: absolute;
  right: 74px;
  top: 50%;
  transform: translateY(-50%) scale(0.9);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(16, 185, 129, 0.2);
}

.chat-widget-trigger:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) scale(1);
}

.chat-badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f172a;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.chat-popup-container {
  position: fixed;
  bottom: 98px;
  right: 24px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 27, 75, 0.96) 100%);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 35px rgba(99, 102, 241, 0.2);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(0.94);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-popup-container.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chat-popup-header {
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-status-dot {
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 12px #10b981;
  animation: dotGlow 2s infinite ease-in-out;
}

@keyframes dotGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.chat-popup-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(0, 0, 0, 0.25);
  scroll-behavior: smooth;
}

.chat-popup-body::-webkit-scrollbar {
  width: 5px;
}

.chat-popup-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.chat-message-item {
  max-width: 84%;
  display: flex;
  flex-direction: column;
  animation: chatBubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.chat-message-item.me {
  align-self: flex-end;
}

.chat-message-item.them {
  align-self: flex-start;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

/* My Messages (Client/Sender) */
.chat-message-item.me .chat-bubble {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Incoming Messages (Them) */
.chat-message-item.them .chat-bubble {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border-bottom-left-radius: 3px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/* Official Admin Support Badge Styling */
.chat-admin-official-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 6px;
  letter-spacing: 0.03em;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.chat-meta {
  font-size: 0.73rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.chat-message-item.me .chat-meta {
  text-align: right;
}

.chat-prompts-container {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  max-height: 120px;
  overflow-y: auto;
}

.chat-prompts-container::-webkit-scrollbar {
  width: 4px;
}

.chat-prompts-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.chat-prompt-chip {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 5px 11px;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.chat-prompt-chip:hover {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.chat-popup-footer {
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input-field {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  padding: 10px 16px;
  color: #ffffff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s ease;
}

.chat-input-field:focus {
  border-color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
  background: rgba(0, 0, 0, 0.6);
}

.chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: all 0.25s ease;
}

/* Incoming Chat Toast Banner Notification (Top Right Popup) */
.chat-toast-notification {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  min-width: 320px;
  max-width: 380px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.95));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(16, 185, 129, 0.3);
  display: flex;
  align-items: center;
  gap: 14px;
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-toast-notification:hover {
  transform: scale(1.03);
  border-color: #10b981;
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Top Navbar Notification Bell & Dropdown Menu */
.nav-bell-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 12px;
}

.nav-bell-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  font-size: 1.1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
}

.nav-bell-icon:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
}

.nav-bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f172a;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.6);
  animation: pulse-ring 2s infinite;
}

.nav-bell-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 330px;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.96), rgba(30, 27, 75, 0.96));
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 25px rgba(16, 185, 129, 0.2);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.nav-bell-dropdown.active {
  display: flex;
  animation: toastSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.nav-bell-header {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.nav-bell-body {
  max-height: 290px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-bell-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-bell-item:hover {
  background: rgba(16, 185, 129, 0.14);
}

