/* ============================================================
   EMAIL MARKETING — MODERN DESIGN SYSTEM
   Custom CSS — No Tailwind, Pure Modern CSS
   ============================================================ */

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

/* ── CSS Variables ── */
:root {
  /* Brand Colors */
  --primary:        #6C63FF;
  --primary-dark:   #5A52E0;
  --primary-light:  #EEF0FF;
  --primary-glow:   rgba(108, 99, 255, 0.25);

  /* Accent */
  --accent:         #00D9A5;
  --accent-dark:    #00B88B;
  --accent-light:   #E6FAF6;

  /* Neutrals */
  --bg:             #F4F5FA;
  --bg-card:        #FFFFFF;
  --bg-sidebar:     #0F0E17;
  --bg-sidebar-item:#1A1927;

  /* Text */
  --text-primary:   #1A1A2E;
  --text-secondary: #6B7280;
  --text-muted:     #9CA3AF;
  --text-white:     #FFFFFF;
  --text-sidebar:   #C4C4D4;

  /* Borders */
  --border:         #E5E7EB;
  --border-focus:   #6C63FF;

  /* Status Colors */
  --success:        #10B981;
  --success-light:  #D1FAE5;
  --success-text:   #065F46;
  --warning:        #F59E0B;
  --warning-light:  #FEF3C7;
  --warning-text:   #92400E;
  --danger:         #EF4444;
  --danger-light:   #FEE2E2;
  --danger-text:    #991B1B;
  --info:           #3B82F6;
  --info-light:     #DBEAFE;
  --info-text:      #1E40AF;

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:         0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:      0 10px 40px rgba(0,0,0,0.12);
  --shadow-primary: 0 8px 24px rgba(108,99,255,0.3);

  /* Radius */
  --radius-sm:      6px;
  --radius:         12px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --radius-full:    9999px;

  /* Sidebar */
  --sidebar-w:      260px;
  --topbar-h:       64px;

  /* Transitions */
  --transition:     all 0.2s ease;
}

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

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

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

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

img { max-width: 100%; display: block; }

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F0E17 0%, #1A1927 50%, #0D1B2A 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(108,99,255,0.15) 0%, transparent 70%);
  top: -100px; left: -100px;
  border-radius: 50%;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,217,165,0.1) 0%, transparent 70%);
  bottom: -80px; right: -80px;
  border-radius: 50%;
}

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

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

.auth-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-primary);
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-logo p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

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

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

/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 7px;
}

.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  outline: none;
  appearance: none;
}

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

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

.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

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

.form-row {
  display: grid;
  gap: 16px;
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 2fr 1fr; }

/* Checkbox */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #4A42C8); transform: translateY(-1px); box-shadow: 0 12px 28px rgba(108,99,255,0.4); color: #fff; }

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16,185,129,0.3);
}
.btn-success:hover { transform: translateY(-1px); color: #fff; }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #DC2626);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,0.25);
}
.btn-danger:hover { transform: translateY(-1px); color: #fff; }

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #D97706);
  color: #fff;
}
.btn-warning:hover { transform: translateY(-1px); color: #fff; }

.btn-secondary {
  background: var(--bg);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: #EBEBEB; color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text-primary); }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: var(--radius-sm); }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 6px; }

/* ============================================================
   APP LAYOUT
   ============================================================ */

.app-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
  z-index: 100;
}

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

.sidebar-brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-brand-text h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand-text span {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 12px 8px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: var(--text-sidebar);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--bg-sidebar-item);
  color: #fff;
  text-decoration: none;
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(108,99,255,0.25), rgba(108,99,255,0.1));
  color: #fff;
  border-left: 3px solid var(--primary);
  padding-left: 9px;
}

.sidebar-link .nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active .nav-icon,
.sidebar-link:hover .nav-icon { opacity: 1; }

.sidebar-link .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

/* Sidebar User */
.sidebar-user {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  truncate: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-user-info span {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
  white-space: nowrap;
  display: block;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.06);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  color: rgba(255,255,255,0.5);
}
.sidebar-logout:hover { background: rgba(239,68,68,0.2); color: var(--danger); }
.sidebar-logout svg { width: 16px; height: 16px; }

/* ── Mobile Overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.topbar-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.topbar-menu-btn:hover { background: var(--border); }

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Page Content ── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 40px;
}

/* ============================================================
   FLASH ALERTS
   ============================================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  animation: slideDown 0.3s ease;
}

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

.alert-success { background: var(--success-light); color: var(--success-text); border: 1px solid rgba(16,185,129,0.2); }
.alert-danger   { background: var(--danger-light);  color: var(--danger-text);  border: 1px solid rgba(239,68,68,0.2); }
.alert-warning  { background: var(--warning-light); color: var(--warning-text); border: 1px solid rgba(245,158,11,0.2); }
.alert-info     { background: var(--info-light);    color: var(--info-text);    border: 1px solid rgba(59,130,246,0.2); }

.alert-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.card-body { padding: 24px; }
.card-body-sm { padding: 16px 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: var(--transition);
}

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

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon-purple { background: var(--primary-light); }
.stat-icon-green  { background: var(--accent-light); }
.stat-icon-blue   { background: var(--info-light); }
.stat-icon-red    { background: var(--danger-light); }
.stat-icon-yellow { background: var(--warning-light); }

.stat-info {}
.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}
.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

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

.page-header-left {}
.page-header-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}
.page-header-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb-sep { color: var(--border); }

/* ============================================================
   TABLES
   ============================================================ */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg);
  padding: 12px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 14px 18px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(108,99,255,0.02); }

.td-muted { color: var(--text-muted); font-size: 13px; }

/* ============================================================
   BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: var(--success-light); color: var(--success-text); }
.badge-danger  { background: var(--danger-light);  color: var(--danger-text); }
.badge-warning { background: var(--warning-light); color: var(--warning-text); }
.badge-info    { background: var(--info-light);    color: var(--info-text); }
.badge-gray    { background: #F3F4F6; color: #6B7280; }
.badge-purple  { background: var(--primary-light); color: var(--primary); }

.badge-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  font-size: 52px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ============================================================
   DIVIDERS & UTILS
   ============================================================ */

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

.text-sm   { font-size: 13px; }
.text-xs   { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary-color { color: var(--primary); }
.font-mono { font-family: 'Courier New', monospace; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }

.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

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

/* 2-col layout sidebar */
.layout-sidebar-main { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.layout-main-sidebar { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.progress-bar-success { background: linear-gradient(90deg, var(--success), var(--accent)); }

/* ============================================================
   SETUP PAGE
   ============================================================ */

.setup-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0F0E17, #1A1927);
}

.setup-topbar {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setup-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setup-topbar-brand span {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.setup-topbar-brand small {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  display: block;
}

.setup-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px;
}

.setup-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}

.setup-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.setup-card-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 20px;
}

.setup-status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.setup-status-item {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.06);
}

.setup-status-item.ok   { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); }
.setup-status-item.fail { border-color: rgba(239,68,68,0.3);  background: rgba(239,68,68,0.08); }

.setup-status-label { font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.setup-status-value { font-size: 14px; font-weight: 600; color: #fff; }
.setup-status-item.ok   .setup-status-value { color: #34D399; }
.setup-status-item.fail .setup-status-value { color: #F87171; }

.setup-btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.setup-btn {
  width: 100%;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.setup-btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.setup-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.setup-btn-success { background: linear-gradient(135deg, var(--success), #059669); color: #fff; }
.setup-btn-success:hover { opacity: 0.9; transform: translateY(-1px); }

.setup-btn-warning { background: linear-gradient(135deg, #F59E0B, #D97706); color: #fff; }
.setup-btn-warning:hover { opacity: 0.9; transform: translateY(-1px); }

.setup-btn-danger { background: linear-gradient(135deg, var(--danger), #DC2626); color: #fff; }
.setup-btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }

.setup-btn-purple { background: linear-gradient(135deg, #8B5CF6, #7C3AED); color: #fff; }
.setup-btn-purple:hover { opacity: 0.9; transform: translateY(-1px); }

.setup-btn-teal { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; }
.setup-btn-teal:hover { opacity: 0.9; transform: translateY(-1px); }

.setup-alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.setup-alert-success { background: rgba(16,185,129,0.15); color: #34D399; border: 1px solid rgba(16,185,129,0.25); }
.setup-alert-danger  { background: rgba(239,68,68,0.15);  color: #F87171; border: 1px solid rgba(239,68,68,0.25); }
.setup-alert-info    { background: rgba(59,130,246,0.15);  color: #93C5FD; border: 1px solid rgba(59,130,246,0.25); }

/* Setup Login Page */
.setup-login-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(16px);
}

.setup-login-card .form-control {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}
.setup-login-card .form-control::placeholder { color: rgba(255,255,255,0.35); }
.setup-login-card .form-control:focus { border-color: var(--primary); background: rgba(255,255,255,0.1); }
.setup-login-card .form-label { color: rgba(255,255,255,0.7); }

/* ============================================================
   QUILL EDITOR
   ============================================================ */

.ql-container.ql-snow { border-color: var(--border); border-radius: 0 0 var(--radius) var(--radius); font-family: inherit; font-size: 14px; }
.ql-toolbar.ql-snow { border-color: var(--border); border-radius: var(--radius) var(--radius) 0 0; background: var(--bg); }
.ql-editor { min-height: 260px; padding: 16px; line-height: 1.7; }
.ql-editor:focus-within { box-shadow: none; }

/* ============================================================
   BODY TYPE TOGGLE
   ============================================================ */

.body-type-toggle {
  display: inline-flex;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
}

.body-type-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  background: transparent;
}

.body-type-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   RECIPIENT COUNTER TAG
   ============================================================ */

.recipient-count-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}

/* ============================================================
   DETAIL LIST
   ============================================================ */

.detail-list { display: grid; gap: 0; }

.detail-item {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 16px;
}

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

.detail-key {
  width: 150px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-val { color: var(--text-primary); flex: 1; }

/* ============================================================
   PAGINATION
   ============================================================ */

nav[role="navigation"] { margin-top: 16px; }
nav[role="navigation"] .flex { flex-wrap: wrap; gap: 4px; }
nav[role="navigation"] span[aria-current="page"] > span,
nav[role="navigation"] span > span {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
nav[role="navigation"] a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  display: inline-block;
}
nav[role="navigation"] a:hover { background: var(--primary-light); color: var(--primary); text-decoration: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .layout-sidebar-main { grid-template-columns: 1fr; }
  .layout-main-sidebar { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .setup-status-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; }
  .topbar-menu-btn { display: flex; }
  .page-content { padding: 20px 16px 32px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  .setup-btn-grid { grid-template-columns: 1fr; }
  .setup-status-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .grid-4 { grid-template-columns: 1fr; }
}
