/* ═══════════════════════════════════════
   7G DRIP SYSTEM — Design System
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@500;600;700;800&display=swap');

/* Firestore Loading Overlay */
#dbLoader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: #0F172A; display: flex; flex-direction: column;
  align-items: center; justify-content: center; z-index: 9999;
}
.spinner {
  width: 50px; height: 50px; border: 5px solid rgba(0,230,118,0.1);
  border-top-color: #00E676; border-radius: 50%;
  animation: spin 1s linear infinite; margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── CSS Custom Properties ── */
:root {
  --green-50: #E8F5E9;
  --green-100: #C8E6C9;
  --green-200: #A5D6A7;
  --green-300: #81C784;
  --green-400: #66BB6A;
  --green-500: #4CAF50;
  --green-600: #43A047;
  --green-700: #388E3C;
  --green-800: #2E7D32;
  --green-900: #1B5E20;

  --accent: #00E676;
  --accent-glow: rgba(0, 230, 118, 0.3);

  --bg-primary: #0A0F0D;
  --bg-secondary: #111A15;
  --bg-card: rgba(17, 26, 21, 0.8);
  --bg-card-hover: rgba(27, 40, 32, 0.9);
  --bg-sidebar: rgba(10, 15, 13, 0.95);
  --bg-input: rgba(20, 30, 24, 0.9);
  --bg-modal: rgba(0, 0, 0, 0.7);

  --border-color: rgba(76, 175, 80, 0.15);
  --border-active: rgba(0, 230, 118, 0.4);

  --text-primary: #E8F5E9;
  --text-secondary: #A5D6A7;
  --text-muted: rgba(165, 214, 167, 0.5);
  --text-dark: #0A0F0D;

  --danger: #EF5350;
  --danger-bg: rgba(239, 83, 80, 0.1);
  --warning: #FFA726;
  --info: #42A5F5;

  --sidebar-width: 260px;
  --sidebar-collapsed: 0px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--accent-glow);

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

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

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

/* ── Layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

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

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

.sidebar-brand .brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--green-500), var(--accent));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.sidebar-brand h1 {
  font-size: 1.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--green-300), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand .brand-tag {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
  font-family: 'Inter', sans-serif;
}

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  user-select: none;
}

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

.nav-item.active {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(0, 230, 118, 0.08));
  color: var(--accent);
  border-color: var(--border-active);
  box-shadow: inset 0 0 12px rgba(0, 230, 118, 0.05);
}

.nav-item .nav-icon { font-size: 1.15rem; width: 24px; text-align: center; }

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  transition: var(--transition);
  min-height: 100vh;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h2 {
  font-size: 1.75rem;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(76, 175, 80, 0.25);
  box-shadow: var(--shadow);
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-500), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

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

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(0, 230, 118, 0.08));
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.stat-card .stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--green-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Tables ── */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(76, 175, 80, 0.08);
  color: var(--text-secondary);
}

tbody tr { transition: var(--transition-fast); }
tbody tr:hover { background: var(--bg-card-hover); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-600), var(--green-800));
  color: white;
  border: 1px solid rgba(76, 175, 80, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--green-400));
  color: var(--text-dark);
}
.btn-accent:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--border-active);
  color: var(--accent);
  background: rgba(0, 230, 118, 0.05);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 83, 80, 0.2);
}
.btn-danger:hover {
  background: rgba(239, 83, 80, 0.2);
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }

/* ── Forms / Inputs ── */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--bg-modal);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 20px;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: var(--transition);
}

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

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

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

.modal-close {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  transition: var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex; justify-content: flex-end; gap: 12px;
}

/* ── Badge ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green {
  background: rgba(76, 175, 80, 0.15);
  color: var(--green-400);
  border: 1px solid rgba(76, 175, 80, 0.25);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 0.4s ease;
  font-size: 0.875rem;
}

.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

.toast-icon { font-size: 1.2rem; }
.toast.hide { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateX(100%); opacity: 0; }
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p { font-size: 0.85rem; margin-bottom: 20px; }

/* ── Page Animations ── */
.page-enter {
  animation: pageIn 0.35s ease;
}

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

/* ── Mobile Toggle ── */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 99;
  align-items: center;
  padding: 0 16px;
  justify-content: space-between;
}

.mobile-header .brand-text {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--green-300), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hamburger {
  background: none; border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

/* ── Toolbar ── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left { display: flex; align-items: center; gap: 12px; }

/* ── Form Card Grid ── */
.form-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.form-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  cursor: default;
}

.form-card:hover {
  border-color: rgba(76, 175, 80, 0.3);
  box-shadow: var(--shadow);
}

.form-card .form-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.form-card .form-card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.form-card .form-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.form-card .form-card-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ── Lead Detail ── */
.lead-detail-grid {
  display: grid; gap: 16px;
}

.lead-detail-item label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.lead-detail-item .detail-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  word-break: break-word;
}

/* ── Custom Fields Builder ── */
.custom-fields-list { display: flex; flex-direction: column; gap: 10px; }

.custom-field-row {
  display: flex; gap: 10px; align-items: center;
}

.custom-field-row .form-control { flex: 1; }

.custom-field-row select.form-control { max-width: 140px; }

/* ── Settings Preview ── */
.template-preview {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.template-preview .highlight {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* ═══════════ RESPONSIVE ═══════════ */

@media (max-width: 768px) {
  .mobile-header { display: flex; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }

  .main-content {
    margin-left: 0;
    padding: 76px 16px 24px;
  }

  .page-header h2 { font-size: 1.35rem; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .stat-card .stat-icon { width: 38px; height: 38px; font-size: 1.1rem; margin-bottom: 12px; }

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

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left { flex-wrap: wrap; }

  table { font-size: 0.8rem; }
  thead th, tbody td { padding: 10px 12px; }

  .modal { max-width: 100%; }

  .custom-field-row { flex-wrap: wrap; }
  .custom-field-row select.form-control { max-width: 100%; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ═══════════ PUBLIC FORM PAGE ═══════════ */

.public-form-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(76, 175, 80, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 230, 118, 0.05) 0%, transparent 50%);
}

.public-form-container {
  width: 100%;
  max-width: 520px;
}

.public-form-brand {
  text-align: center;
  margin-bottom: 24px;
}

.public-form-brand .brand-logo {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--green-500), var(--accent));
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-glow);
}

.public-form-brand h2 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.public-form-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.public-form-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.public-form-card .btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  margin-top: 8px;
}

/* Thank you page */
.thank-you {
  text-align: center;
  padding: 40px 20px;
}

.thank-you .check-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--green-500), var(--accent));
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: 20px;
  box-shadow: var(--shadow-glow);
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.thank-you h2 { margin-bottom: 8px; }
.thank-you p { color: var(--text-muted); font-size: 0.9rem; }

/* ═══════════ DASHBOARD ANALYTICS ═══════════ */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.chart-card {
  min-height: 240px;
}

/* Bar Chart (vertical) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding-top: 10px;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.bar-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  min-height: 16px;
}

.bar-track {
  flex: 1;
  width: 100%;
  max-width: 40px;
  background: var(--bg-input);
  border-radius: 6px 6px 0 0;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--green-600));
  border-radius: 6px 6px 0 0;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 2px;
}

.bar-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Horizontal Bar Chart */
.hbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hbar-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hbar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-input);
  border-radius: 6px;
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-600), var(--accent));
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hbar-value {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 28px;
  text-align: right;
}

/* Tag Ring (donut) */
.tag-chart {
  display: flex;
  align-items: center;
  gap: 24px;
}

.tag-ring-container {
  flex-shrink: 0;
}

.tag-ring {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--border-color) 0% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tag-ring-center {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tag-ring-total {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.tag-ring-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tag-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.tag-legend-item strong {
  margin-left: auto;
  color: var(--text-primary);
}

.tag-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Quick Stats */
.quick-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.quick-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quick-stat-row:last-child { border-bottom: none; }

.quick-stat-row strong {
  color: var(--text-primary);
  font-family: 'Poppins', sans-serif;
}

/* ═══════════ TAGGING ═══════════ */

/* Tag Filter Pills */
.tag-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  transition: var(--transition);
}

.tag-pill:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}

.tag-pill.active {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(0, 230, 118, 0.08));
  border-color: var(--border-active);
  color: var(--accent);
}

.tag-pill-hot.active {
  background: rgba(239, 83, 80, 0.12);
  border-color: rgba(239, 83, 80, 0.3);
  color: var(--danger);
}

.tag-pill-warm.active {
  background: rgba(255, 167, 38, 0.12);
  border-color: rgba(255, 167, 38, 0.3);
  color: var(--warning);
}

.tag-pill-cold.active {
  background: rgba(66, 165, 245, 0.12);
  border-color: rgba(66, 165, 245, 0.3);
  color: var(--info);
}

.tag-pill-count {
  background: rgba(255,255,255,0.08);
  padding: 1px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
}

/* Tag Select Dropdown */
.tag-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
  cursor: pointer;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

.tag-select-hot {
  background: rgba(239, 83, 80, 0.12);
  color: var(--danger);
  border-color: rgba(239, 83, 80, 0.25);
}

.tag-select-warm {
  background: rgba(255, 167, 38, 0.12);
  color: var(--warning);
  border-color: rgba(255, 167, 38, 0.25);
}

.tag-select-cold {
  background: rgba(66, 165, 245, 0.12);
  color: var(--info);
  border-color: rgba(66, 165, 245, 0.25);
}

.tag-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .tag-chart {
    flex-direction: column;
    align-items: flex-start;
  }
  .tag-ring { width: 100px; height: 100px; }
  .tag-ring-center { width: 66px; height: 66px; }
  .tag-ring-total { font-size: 1.1rem; }
  .bar-chart { height: 140px; }
  .tag-pills { gap: 6px; }
  .tag-pill { padding: 6px 12px; font-size: 0.75rem; }
}

/* ═══════════ DRIP CAMPAIGN ═══════════ */

.campaign-list { display: flex; flex-direction: column; gap: 0; }

/* Steps Preview (mini timeline) */
.drip-steps-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 12px 0;
  padding-left: 8px;
}

.drip-step-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  padding: 6px 0;
}

.drip-step-mini::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 22px;
  bottom: -6px;
  width: 2px;
  background: var(--border-color);
}

.drip-step-mini:last-child::before { display: none; }

.drip-step-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--border-color);
  border: 2px solid var(--bg-secondary);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.drip-step-dot.first {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.drip-step-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.drip-step-delay {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
}

.drip-step-label {
  color: var(--text-secondary);
}

/* Stats Bar */
.drip-stats-bar {
  display: flex;
  gap: 24px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.drip-stat { display: flex; flex-direction: column; align-items: center; }

.drip-stat-num {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drip-stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Step Builder */
.drip-steps-builder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drip-step-builder-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.drip-step-builder-item:hover {
  border-color: rgba(76, 175, 80, 0.3);
}

.drip-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid var(--border-color);
}

.drip-step-number {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--green-600), var(--green-800));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.drip-step-body {
  padding: 14px;
}

/* Template Grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.template-card {
  cursor: default;
}

.template-preview-mini {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  max-height: 80px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .drip-stats-bar { gap: 16px; }
  .drip-step-header { flex-wrap: wrap; }
  .template-grid { grid-template-columns: 1fr; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(76, 175, 80, 0.2);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(76, 175, 80, 0.4); }

/* ── Selection ── */
::selection {
  background: rgba(0, 230, 118, 0.3);
  color: white;
}

/* ═══════════ LANDING PAGE BUILDER ═══════════ */

.editor-layout {
  display: flex;
  gap: 0;
  height: calc(100vh - 180px);
  overflow: hidden;
}

.editor-sidebar {
  width: 280px;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.editor-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.editor-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.editor-nav-item.active {
  background: rgba(0, 230, 118, 0.1);
  border-color: rgba(0, 230, 118, 0.2);
  color: var(--accent);
}

.editor-nav-item .nav-icon {
  font-size: 1.1rem;
}

.editor-ai-panel {
  margin-top: auto;
  padding: 20px;
  background: linear-gradient(135deg, rgba(0, 230, 118, 0.1), rgba(0, 200, 83, 0.05));
  border: 1px solid rgba(0, 230, 118, 0.2);
  border-radius: var(--radius);
}

.editor-ai-panel h4 {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--accent);
}

.editor-ai-panel p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.editor-content {
  flex: 1;
  padding: 32px 40px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.01);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

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

.form-section {
  margin-bottom: 40px;
}

.form-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* Theme Options */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.theme-option {
  cursor: pointer;
  text-align: center;
}

.theme-option input {
  display: none;
}

.theme-preview {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 2px solid transparent;
  transition: var(--transition);
}

.theme-preview.dark { background: #0F172A; }
.theme-preview.light { background: #F8FAFC; border: 1px solid #E2E8F0; }
.theme-preview.forest { background: #064E3B; }

.theme-option input:checked + .theme-preview {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.2);
}

.theme-option span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.theme-option input:checked ~ span {
  color: var(--accent);
  font-weight: 600;
}

/* Benefit Inputs */
#benefitListContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.benefit-input {
  display: flex;
  gap: 10px;
}

/* Responsive Editor */
@media (max-width: 992px) {
  .editor-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .editor-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    gap: 16px;
  }
  .editor-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .editor-nav-item {
    width: auto;
    white-space: nowrap;
  }
  .editor-ai-panel {
    margin-top: 0;
  }
  .editor-content {
    padding: 20px;
  }
}
