/* ===== LeadFlow Pro - Main Stylesheet ===== */
/* Version 1.0 | Dark SaaS Dashboard */

/* ===== CSS Variables ===== */
:root {
  --bg-primary:    #0d0f1a;
  --bg-secondary:  #12152b;
  --bg-card:       #161929;
  --bg-card-hover: #1c2035;
  --bg-glass:      rgba(22, 25, 41, 0.85);
  --bg-input:      #1a1e33;
  --bg-sidebar:    #0f1224;

  --accent:        #6c63ff;
  --accent-hover:  #5a52e0;
  --accent-light:  rgba(108, 99, 255, 0.15);
  --accent-2:      #00d4aa;
  --accent-3:      #ff6b6b;
  --accent-4:      #ffa94d;
  --accent-5:      #74c0fc;

  --gradient-1: linear-gradient(135deg, #6c63ff, #a78bfa);
  --gradient-2: linear-gradient(135deg, #00d4aa, #0891b2);
  --gradient-3: linear-gradient(135deg, #ff6b6b, #f97316);
  --gradient-4: linear-gradient(135deg, #ffa94d, #ffd43b);

  --text-primary:   #e2e8f0;
  --text-secondary: #8892a4;
  --text-muted:     #4a5568;
  --text-accent:    #6c63ff;

  --border:      rgba(255,255,255,0.07);
  --border-focus:rgba(108, 99, 255, 0.5);

  --sidebar-width:        260px;
  --sidebar-collapsed:    72px;
  --header-height:        64px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);
  --shadow-accent: 0 4px 20px rgba(108,99,255,0.3);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== App Layout ===== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 1000;
  transition: var(--transition);
  overflow: hidden;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--gradient-1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user-avatar {
  width: 36px; height: 36px;
  background: var(--gradient-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: capitalize;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-list {
  list-style: none;
  padding: 0 8px;
}

.nav-item { margin-bottom: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-light);
}

.nav-link.active .nav-icon { color: var(--accent); }

.nav-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.active-indicator {
  position: absolute;
  right: 8px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.nav-logout:hover { color: var(--accent-3); background: rgba(255,107,107,0.1); }

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.version-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 3px 8px;
  border-radius: 20px;
}

.sidebar-close { display: none; }
.sidebar-overlay { display: none; }

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

/* ===== Top Header ===== */
.top-header {
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 8px; }

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
}

.sidebar-toggle:hover { color: var(--text-primary); background: var(--bg-card); }

.page-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  position: relative;
  display: flex;
  align-items: center;
}

.header-icon-btn:hover { color: var(--text-primary); background: var(--bg-card); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--accent-3);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
}

.user-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.user-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.user-btn::after { display: none; }

.user-avatar {
  width: 32px; height: 32px;
  background: var(--gradient-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { display: flex; flex-direction: column; text-align: left; }
.user-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.user-role { font-size: 11px; color: var(--text-secondary); }

/* ===== User Dropdown ===== */
.user-dropdown {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  padding: 8px !important;
  min-width: 180px;
  box-shadow: var(--shadow-lg) !important;
}

.user-dropdown .dropdown-item {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.user-dropdown .dropdown-item:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
}

.user-dropdown .dropdown-item.text-danger:hover { color: var(--accent-3) !important; }
.user-dropdown .dropdown-divider { border-color: var(--border) !important; }

/* ===== Search Overlay ===== */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.search-overlay.active { display: flex; }

.search-box {
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
}

.search-box i { font-size: 20px; color: var(--text-secondary); }
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 16px;
}

.search-box input::placeholder { color: var(--text-muted); }
.btn-close-search {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 2px;
}

/* ===== Page Content ===== */
.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ===== Stat Cards ===== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent-light);
  transform: translate(30%, -30%);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-icon-1 { background: var(--accent-light); color: var(--accent); }
.stat-icon-2 { background: rgba(255,107,107,0.15); color: var(--accent-3); }
.stat-icon-3 { background: rgba(0,212,170,0.15); color: var(--accent-2); }
.stat-icon-4 { background: rgba(255,169,77,0.15); color: var(--accent-4); }
.stat-icon-5 { background: rgba(116,192,252,0.15); color: var(--accent-5); }
.stat-icon-6 { background: rgba(167,139,250,0.15); color: #a78bfa; }
.stat-icon-7 { background: rgba(52,211,153,0.15); color: #34d399; }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin-top: 8px;
}

.trend-up { color: var(--accent-2); }
.trend-down { color: var(--accent-3); }

/* ===== Cards ===== */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--text-primary) !important;
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 16px 20px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { color: var(--accent); }
.card-body { padding: 20px !important; }

/* ===== Glassmorphism Card ===== */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ===== Buttons ===== */
.btn-primary {
  background: var(--gradient-1) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--radius-md) !important;
  padding: 10px 20px !important;
  transition: var(--transition) !important;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(108,99,255,0.4) !important;
  filter: brightness(1.1);
}

.btn-success {
  background: var(--gradient-2) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--radius-md) !important;
}

.btn-danger {
  background: var(--gradient-3) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: var(--radius-md) !important;
}

.btn-warning {
  background: var(--gradient-4) !important;
  border: none !important;
  color: #1a1e33 !important;
  font-weight: 600;
  border-radius: var(--radius-md) !important;
}

.btn-outline {
  background: transparent !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-md) !important;
  transition: var(--transition) !important;
}

.btn-outline:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-light) !important;
}

.btn-icon {
  width: 34px; height: 34px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  color: var(--text-secondary) !important;
  font-size: 16px;
  transition: var(--transition-fast) !important;
}

.btn-icon:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-light) !important;
}

.btn-icon-danger:hover {
  border-color: var(--accent-3) !important;
  color: var(--accent-3) !important;
  background: rgba(255,107,107,0.1) !important;
}

/* ===== Forms ===== */
.form-control, .form-select {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  transition: var(--transition-fast) !important;
}

.form-control:focus, .form-select:focus {
  background: var(--bg-input) !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15) !important;
  color: var(--text-primary) !important;
}

.form-control::placeholder { color: var(--text-muted) !important; }

.form-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.input-group-text {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-md) 0 0 var(--radius-md) !important;
}

/* ===== Tables ===== */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.table thead th {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border-bottom: 1px solid var(--border) !important;
  border-top: none !important;
  padding: 12px 16px !important;
  white-space: nowrap;
}

.table tbody td {
  border-bottom: 1px solid var(--border) !important;
  padding: 12px 16px !important;
  vertical-align: middle !important;
  font-size: 13px;
  color: var(--text-primary) !important;
}

.table tbody tr:last-child td { border-bottom: none !important; }

.table tbody tr:hover td { background: var(--bg-card-hover) !important; }

.table-check { width: 40px; }

.table .form-check-input {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  cursor: pointer;
}

.table .form-check-input:checked {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
}

/* ===== Scraper Table — horizontal scroll + sticky Actions column ===== */
.scraper-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.scraper-table-wrap .table { margin: 0 !important; }

.scraper-table-wrap .table thead th:last-child,
.scraper-table-wrap .table tbody td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
}

.scraper-table-wrap .table thead th:last-child {
  background: var(--bg-secondary) !important;
  z-index: 3;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.35);
}

.scraper-table-wrap .table tbody td:last-child {
  background: var(--bg-card) !important;
  box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
}

.scraper-table-wrap .table tbody tr:hover td:last-child {
  background: var(--bg-card-hover) !important;
}

/* ===== SEO Audit Modal ===== */
.seo-score-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 20px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.seo-score-ring-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.seo-grade {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-top: 6px;
}

.seo-score-stats {
  flex: 1;
  min-width: 200px;
}

.seo-stat-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  gap: 2px;
}

.seo-chip-fail { background: rgba(239,68,68,0.12); color: #ef4444; }
.seo-chip-warn { background: rgba(245,158,11,0.12); color: #f59e0b; }
.seo-chip-pass { background: rgba(16,185,129,0.12); color: #10b981; }

.seo-send-section {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

/* ===== Badges ===== */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge-success { background: rgba(0,212,170,0.15); color: var(--accent-2); }
.badge-danger  { background: rgba(255,107,107,0.15); color: var(--accent-3); }
.badge-warning { background: rgba(255,169,77,0.15); color: var(--accent-4); }
.badge-info    { background: rgba(116,192,252,0.15); color: var(--accent-5); }
.badge-primary { background: var(--accent-light); color: var(--accent); }
.badge-secondary { background: rgba(255,255,255,0.07); color: var(--text-secondary); }

/* ===== Modals ===== */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  color: var(--text-primary) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border) !important;
  padding: 20px 24px !important;
}

.modal-title { font-weight: 600; font-size: 16px; }

.modal-footer {
  border-top: 1px solid var(--border) !important;
  padding: 16px 24px !important;
}

.modal-body { padding: 24px !important; }

.btn-close {
  filter: invert(1) !important;
  opacity: 0.6 !important;
}

.btn-close:hover { opacity: 1 !important; }

/* ===== Toasts ===== */
.lf-toast {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  min-width: 300px;
  overflow: hidden;
}

.lf-toast.toast-success { border-left: 3px solid var(--accent-2) !important; }
.lf-toast.toast-error   { border-left: 3px solid var(--accent-3) !important; }
.lf-toast.toast-warning { border-left: 3px solid var(--accent-4) !important; }
.lf-toast.toast-info    { border-left: 3px solid var(--accent-5) !important; }

.lf-toast .toast-body {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary) !important;
  font-size: 13px;
  padding: 12px 16px;
}

.lf-toast .toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--accent-2); }
.toast-error   .toast-icon { color: var(--accent-3); }
.toast-warning .toast-icon { color: var(--accent-4); }
.toast-info    .toast-icon { color: var(--accent-5); }

/* ===== Pagination ===== */
.pagination {
  gap: 4px;
}

.page-link {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 12px;
  font-size: 13px;
  transition: var(--transition-fast);
}

.page-link:hover {
  background: var(--bg-card-hover) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.page-item.active .page-link {
  background: var(--gradient-1) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

.page-item.disabled .page-link { opacity: 0.4; }

/* ===== Activity Timeline ===== */
.timeline { position: relative; padding-left: 24px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 8px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -20px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
}

.timeline-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.timeline-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.timeline-meta  { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ===== Progress Bar ===== */
.progress {
  background: var(--bg-secondary) !important;
  border-radius: 20px !important;
  height: 6px !important;
}

.progress-bar {
  background: var(--gradient-1) !important;
  border-radius: 20px !important;
}

/* ===== Auth Pages ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(108,99,255,0.15) 0%, transparent 60%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .brand-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  font-size: 24px;
  margin: 0 auto 12px;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

/* ===== Rating Stars ===== */
.rating-stars {
  color: var(--accent-4);
  font-size: 12px;
}

/* ===== Loading Skeleton ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-row { height: 48px; margin-bottom: 8px; }
.skeleton-stat { height: 100px; border-radius: var(--radius-lg); }

/* ===== Scraper ===== */
.search-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.scraper-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.result-count {
  font-size: 13px;
  color: var(--text-secondary);
}

.result-count strong { color: var(--text-primary); }

/* ===== Campaign Progress ===== */
.campaign-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.progress-ring-wrap {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
}

.email-queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.email-queue-item:last-child { border-bottom: none; }

.queue-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

/* ===== SMTP Test Badge ===== */
.smtp-test-result {
  display: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
}

/* ===== Bulk Selection Bar ===== */
.bulk-action-bar {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.bulk-action-bar.visible { display: flex; }

.bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* ===== Sidebar Collapsed ===== */
.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.sidebar-collapsed .brand-name,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-user-info,
.sidebar-collapsed .sidebar-footer,
.sidebar-collapsed .active-indicator {
  opacity: 0;
  pointer-events: none;
}

.sidebar-collapsed .main-content {
  margin-left: var(--sidebar-collapsed);
}

.sidebar-collapsed .nav-link { justify-content: center; padding: 10px; }
.sidebar-collapsed .sidebar-user { justify-content: center; }
.sidebar-collapsed .sidebar-header { justify-content: center; }

/* ===== Chart Container ===== */
.chart-container { position: relative; }

/* ===== Rich Text Editor ===== */
.ql-toolbar {
  background: var(--bg-secondary) !important;
  border-color: var(--border) !important;
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

.ql-container {
  background: var(--bg-input) !important;
  border-color: var(--border) !important;
  border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
  min-height: 200px;
}

.ql-editor { color: var(--text-primary) !important; min-height: 200px; }

/* ===== Template Variables ===== */
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.var-chip {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(108,99,255,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-family: monospace;
  cursor: pointer;
  transition: var(--transition-fast);
}
.var-chip:hover { background: var(--accent); color: #fff; }

/* ===== No Data State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: block;
}

.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state-text  { font-size: 13px; color: var(--text-muted); }

/* ===== Dropdown Menu ===== */
.dropdown-menu {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 6px !important;
}

.dropdown-item {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  transition: var(--transition-fast) !important;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
}

.dropdown-divider { border-color: var(--border) !important; }

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1050;
  }

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

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
  }

  .sidebar-close {
    display: flex !important;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
  }

  .main-content { margin-left: 0 !important; }

  .page-content { padding: 16px; }

  .stat-value { font-size: 22px; }
}

@media (max-width: 575.98px) {
  .top-header { padding: 0 16px; }
  .auth-card { padding: 28px 20px; }
  .page-content { padding: 12px; }
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

.fade-in { animation: fadeIn 0.4s ease forwards; }
.slide-in { animation: slideIn 0.3s ease forwards; }
.pulsing { animation: pulse 2s infinite; }

/* ===== Misc ===== */
.text-accent { color: var(--accent) !important; }
.text-success-custom { color: var(--accent-2) !important; }
.text-danger-custom  { color: var(--accent-3) !important; }
.text-warning-custom { color: var(--accent-4) !important; }
.text-muted-custom   { color: var(--text-muted) !important; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i { color: var(--accent); }

hr { border-color: var(--border) !important; }
