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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f1f5f9;
  color: #1e293b;
}

/* NAV */
.navbar {
  background: #2563eb;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  color: white;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}
.navbar-nav { display: flex; gap: 8px; align-items: center; }
.nav-link {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.2s;
}
.nav-link:hover { background: rgba(255,255,255,0.15); color: white; }
.btn-nav {
  background: white;
  color: #2563eb;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 14px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-nav:hover { opacity: 0.9; }

/* HERO */
.hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #0ea5e9 100%);
  color: white;
  padding: 80px 32px;
  text-align: center;
}
.hero h1 { font-size: 48px; font-weight: 800; margin-bottom: 16px; }
.hero p { font-size: 18px; opacity: 0.9; max-width: 560px; margin: 0 auto 32px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-white {
  background: white;
  color: #2563eb;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.btn-white:hover { opacity: 0.9; }
.btn-outline-white {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.6);
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-outline-white:hover { background: rgba(255,255,255,0.15); }

/* FEATURES */
.features {
  padding: 64px 32px;
  max-width: 1100px;
  margin: 0 auto;
}
.features h2 { text-align: center; font-size: 32px; margin-bottom: 40px; color: #0f172a; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.feature-card {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature-card h3 { font-size: 18px; margin-bottom: 8px; color: #0f172a; }
.feature-card p { font-size: 14px; color: #64748b; line-height: 1.6; }

/* FORM PAGES */
.form-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.form-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.form-card h2 { font-size: 26px; font-weight: 700; margin-bottom: 6px; color: #0f172a; }
.form-card .subtitle { color: #64748b; font-size: 14px; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #374151; }
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
}
.form-group input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.consent-section { margin: 20px 0; }
.consent-section h4 { font-size: 14px; font-weight: 600; color: #374151; margin-bottom: 12px; }
.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.consent-item:hover { background: #f8fafc; }
.consent-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #2563eb;
  flex-shrink: 0;
}
.consent-item label { font-size: 14px; color: #374151; cursor: pointer; }

.btn-primary {
  width: 100%;
  background: #2563eb;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.form-footer { text-align: center; margin-top: 20px; font-size: 14px; color: #64748b; }
.form-footer a { color: #2563eb; text-decoration: none; font-weight: 500; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* DASHBOARD */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}
.sidebar {
  width: 220px;
  background: white;
  border-right: 1px solid #e5e7eb;
  padding: 24px 0;
  flex-shrink: 0;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  transition: background 0.15s;
}
.sidebar-item:hover, .sidebar-item.active {
  background: #eff6ff;
  color: #2563eb;
}
.sidebar-item .icon { width: 18px; text-align: center; }
.main-content { flex: 1; padding: 32px; overflow-auto; }

.page-title { font-size: 24px; font-weight: 700; color: #0f172a; margin-bottom: 24px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.stat-card .stat-label { font-size: 13px; color: #64748b; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: #0f172a; }
.stat-card .stat-sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }

.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}
.card h3 { font-size: 16px; font-weight: 600; color: #0f172a; margin-bottom: 16px; }

/* CONSENT TOGGLES */
.consent-toggle-list { display: flex; flex-direction: column; gap: 12px; }
.consent-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  transition: border-color 0.2s;
}
.consent-toggle-item.active { border-color: #bbf7d0; background: #f0fdf4; }
.consent-toggle-item.inactive { border-color: #fecaca; background: #fef2f2; }
.consent-info { flex: 1; }
.consent-info .purpose-name { font-size: 14px; font-weight: 500; color: #0f172a; }
.consent-info .purpose-status { font-size: 12px; color: #64748b; margin-top: 2px; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #d1d5db;
  border-radius: 24px;
  transition: 0.3s;
}
.toggle-slider:before {
  position: absolute;
  content: '';
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}
input:checked + .toggle-slider { background: #10b981; }
input:checked + .toggle-slider:before { transform: translateX(20px); }

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-danger:hover { background: #b91c1c; }

/* TABLE */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; background: #f8fafc; color: #374151; font-weight: 600; border-bottom: 2px solid #e5e7eb; }
td { padding: 12px; border-bottom: 1px solid #f1f5f9; color: #374151; }
tr:hover td { background: #f8fafc; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
}
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-blue { background: #dbeafe; color: #2563eb; }

/* ADMIN FORM */
.admin-form input, .admin-form textarea, .admin-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  margin-top: 6px;
  margin-bottom: 14px;
}
.admin-form textarea { resize: vertical; min-height: 100px; }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.admin-form label { font-size: 14px; font-weight: 500; color: #374151; }
.btn-send {
  background: #2563eb;
  color: white;
  border: none;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-send:hover { background: #1d4ed8; }

/* UNSUBSCRIBE PAGE */
.unsub-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  padding: 32px 16px;
}
.unsub-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.unsub-icon { font-size: 56px; margin-bottom: 16px; }
.unsub-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.unsub-card p { color: #64748b; font-size: 15px; line-height: 1.6; margin-bottom: 24px; }
.unsub-email { background: #f8fafc; border-radius: 8px; padding: 10px 16px; font-size: 14px; color: #374151; margin-bottom: 24px; word-break: break-all; }

/* FOOTER */
footer {
  background: #0f172a;
  color: #94a3b8;
  text-align: center;
  padding: 24px;
  font-size: 13px;
  margin-top: 40px;
}

/* EMPTY STATE */
.empty-state { text-align: center; padding: 40px; color: #94a3b8; }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* LOADER */
.loading { opacity: 0.5; pointer-events: none; }

@media (max-width: 768px) {
  .dashboard-layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e5e7eb; padding: 12px 0; display: flex; overflow-x: auto; }
  .hero h1 { font-size: 32px; }
}
