/* ================================================================
   InboxPilot AI — Main Stylesheet
   Design: Clean SaaS light theme | Inspired by reference dashboard
   Fonts: DM Sans (body) + Syne (headings)
================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Colors */
  --bg:           #EEF2F9;
  --bg-card:      #FFFFFF;
  --bg-sidebar:   #FFFFFF;
  --bg-hover:     #F4F7FD;
  --bg-input:     #F8FAFD;

  --primary:      #4F8EF7;
  --primary-dark: #3574E2;
  --primary-light:#EBF2FF;
  --secondary:    #7B61FF;
  --teal:         #00C9A7;
  --teal-light:   #E0FAF5;
  --amber:        #F59E0B;
  --danger:       #EF4444;
  --danger-light: #FEF2F2;
  --success:      #10B981;
  --success-light:#ECFDF5;
  --warning:      #F59E0B;
  --warning-light:#FFFBEB;
  --purple:       #8B5CF6;
  --purple-light: #F5F3FF;

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #64748B;
  --text-muted:     #94A3B8;
  --text-inverse:   #FFFFFF;

  /* Border */
  --border:         #E2E8F0;
  --border-focus:   #4F8EF7;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #4F8EF7 0%, #7B61FF 100%);
  --grad-teal:    linear-gradient(135deg, #00C9A7 0%, #4F8EF7 100%);
  --grad-warm:    linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
  --grad-sidebar-active: linear-gradient(135deg, #EBF2FF 0%, #F5F3FF 100%);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm: 0 2px 8px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.08);
  --shadow-lg: 0 8px 32px rgba(15,23,42,0.10);
  --shadow-card: 0 1px 3px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.04);

  /* Spacing */
  --sidebar-w: 220px;
  --topbar-h:  64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --trans: 0.18s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { color: var(--text-secondary); }

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

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform var(--trans);
  box-shadow: 2px 0 12px rgba(15,23,42,0.04);
}

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

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--grad-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}

.sidebar-logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.sidebar-logo-text span { color: var(--primary); }

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

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--trans);
  cursor: pointer;
  position: relative;
}

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

.nav-item.active {
  background: var(--grad-sidebar-active);
  color: var(--primary);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--grad-primary);
  border-radius: 0 3px 3px 0;
}

.nav-item svg, .nav-item .nav-icon {
  width: 18px; height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
  transition: opacity var(--trans);
}
.nav-item.active svg, .nav-item.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--trans);
}
.sidebar-user:hover { background: var(--bg-hover); }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 1rem; }

.user-info { flex: 1; min-width: 0; }
.user-name {
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 90;
  box-shadow: var(--shadow-xs);
}

.topbar-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem; font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 16px;
  gap: 8px;
  width: 240px;
  transition: all var(--trans);
}
.search-bar:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.12);
  width: 280px;
}
.search-bar input {
  border: none; background: none;
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none; width: 100%;
}
.search-bar svg { color: var(--text-muted); width: 15px; height: 15px; flex-shrink: 0; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--trans);
  color: var(--text-secondary);
  position: relative;
}
.icon-btn:hover { background: var(--bg-hover); border-color: var(--primary); color: var(--primary); }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid #fff;
}

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

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header-left h1 { font-size: 1.6rem; margin-bottom: 2px; }
.page-header-left p { font-size: 0.875rem; color: var(--text-muted); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226,232,240,0.6);
  transition: box-shadow var(--trans);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem; font-weight: 700;
  color: var(--text-primary);
}
.card-subtitle {
  font-size: 0.8rem; color: var(--text-muted); margin-top: 2px;
}

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

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(226,232,240,0.6);
  position: relative;
  overflow: hidden;
  transition: transform var(--trans), box-shadow var(--trans);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 0 0 80px;
  opacity: 0.07;
}
.stat-card.primary::after   { background: var(--primary); }
.stat-card.secondary::after { background: var(--secondary); }
.stat-card.teal::after      { background: var(--teal); }
.stat-card.amber::after     { background: var(--amber); }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.stat-icon.primary   { background: var(--primary-light); color: var(--primary); }
.stat-icon.secondary { background: var(--purple-light);  color: var(--secondary); }
.stat-icon.teal      { background: var(--teal-light);    color: var(--teal); }
.stat-icon.amber     { background: var(--warning-light); color: var(--amber); }
.stat-icon.danger    { background: var(--danger-light);  color: var(--danger); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 2rem; font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 10px;
}

.stat-change {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.78rem; font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.stat-change.up   { background: var(--success-light); color: var(--success); }
.stat-change.down { background: var(--danger-light);  color: var(--danger);  }

/* ── Progress Bars ──────────────────────────────────────────── */
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 100px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 100px;
  background: var(--grad-primary);
  transition: width 0.6s ease;
}
.progress-bar.teal    { background: var(--grad-teal); }
.progress-bar.amber   { background: var(--grad-warm); }
.progress-bar.success { background: var(--success); }
.progress-bar.danger  { background: var(--danger); }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: -4px; padding: 4px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 14px;
  border-bottom: 1px solid rgba(226,232,240,0.5);
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--trans); }
tbody tr:hover { background: var(--bg-hover); }

.td-bold { font-weight: 600; color: var(--text-primary); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
  white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.badge-success   { background: var(--success-light); color: var(--success); }
.badge-warning   { background: var(--warning-light); color: var(--warning); }
.badge-danger    { background: var(--danger-light);  color: var(--danger);  }
.badge-primary   { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: var(--bg);            color: var(--text-secondary); }
.badge-purple    { background: var(--purple-light);  color: var(--purple); }
.badge-info      { background: var(--teal-light);    color: var(--teal); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--trans);
  white-space: nowrap; font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(79,142,247,0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(79,142,247,0.45);
  color: #fff;
}

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

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }

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

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 0.95rem; }
.btn-icon { padding: 9px; }
.btn-icon.btn-sm { padding: 6px; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--trans);
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--border-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,142,247,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control.is-invalid { border-color: var(--danger); }

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

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

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Health Score Ring ───────────────────────────────────────── */
.health-ring {
  position: relative;
  width: 52px; height: 52px;
  display: inline-flex; align-items: center; justify-content: center;
}
.health-ring svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.health-ring-value {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem; font-weight: 800;
  color: var(--text-primary);
  z-index: 1;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-light); color: #065F46; border-left: 3px solid var(--success); }
.alert-danger  { background: var(--danger-light);  color: #991B1B; border-left: 3px solid var(--danger);  }
.alert-warning { background: var(--warning-light); color: #92400E; border-left: 3px solid var(--warning); }
.alert-info    { background: var(--primary-light); color: #1E40AF; border-left: 3px solid var(--primary); }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--trans);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--trans);
}
.modal-overlay.open .modal { transform: none; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: var(--bg-hover);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1.1rem;
  transition: all var(--trans);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; background: var(--bg); padding: 4px; border-radius: var(--radius-sm); width: fit-content; margin-bottom: 24px; }
.tab-btn {
  padding: 7px 18px;
  border-radius: 6px;
  border: none; background: transparent;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer; transition: all var(--trans);
  font-family: inherit;
}
.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: all var(--trans);
}
.dropdown.open .dropdown-menu { opacity: 1; pointer-events: all; transform: none; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  font-size: 0.875rem; color: var(--text-secondary);
  cursor: pointer; transition: background var(--trans);
  border: none; background: none; width: 100%; text-align: left; font-family: inherit;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger:hover { background: var(--danger-light); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3rem; margin-bottom: 16px; opacity: 0.4;
}
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; max-width: 320px; margin: 0 auto 20px; }

/* ── Loading / Skeleton ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.4s infinite;
  border-radius: 6px;
}
@keyframes skeleton-shine {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast Notifications ─────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--text-primary);
  color: #fff;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  min-width: 260px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease;
}
.toast.success { border-left: 3px solid var(--teal); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--primary); }
@keyframes toast-in { from { transform: translateX(40px); opacity: 0; } }

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.auth-left {
  flex: 1;
  background: var(--grad-primary);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px;
  position: relative; overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  top: -100px; left: -100px;
}
.auth-left::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  bottom: -80px; right: -80px;
}

.auth-brand { color: #fff; margin-bottom: 40px; z-index: 1; }
.auth-brand h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 8px; }
.auth-brand p  { font-size: 1rem; opacity: 0.85; }

.auth-features { z-index: 1; }
.auth-feature {
  display: flex; gap: 14px; align-items: flex-start;
  margin-bottom: 24px; color: rgba(255,255,255,0.9);
}
.auth-feature-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.auth-feature-text h4 { font-size: 0.95rem; color: #fff; margin-bottom: 2px; }
.auth-feature-text p  { font-size: 0.82rem; opacity: 0.75; }

.auth-right {
  width: 480px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px;
  background: var(--bg-card);
}

.auth-card-inner { width: 100%; max-width: 380px; }
.auth-card-inner h2 { font-size: 1.8rem; margin-bottom: 6px; }
.auth-card-inner .subtitle { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 32px; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-muted); font-size: 0.82rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Inbox Health Indicators ─────────────────────────────────── */
.inbox-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--trans);
}
.inbox-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

.inbox-provider-icon {
  width: 40px; height: 40px;
  border-radius: 10px; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}

/* ── Campaign Cards ──────────────────────────────────────────── */
.campaign-progress {
  display: flex; flex-direction: column; gap: 6px;
}
.campaign-progress-label {
  display: flex; justify-content: space-between;
  font-size: 0.78rem;
}
.campaign-progress-label span:first-child { color: var(--text-muted); }
.campaign-progress-label span:last-child  { color: var(--text-primary); font-weight: 600; }

/* ── Analytics Chart Area ────────────────────────────────────── */
.chart-container { position: relative; width: 100%; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; margin-top: 24px;
}
.page-link {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: var(--text-secondary);
  cursor: pointer; transition: all var(--trans); text-decoration: none;
}
.page-link:hover, .page-link.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.page-link.disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .auth-left { display: none; }
  .auth-right { width: 100%; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: none;
    box-shadow: var(--shadow-lg);
  }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .search-bar { display: none; }
  .auth-right { padding: 28px 20px; }
}

/* ── Utility Classes ─────────────────────────────────────────── */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2      { gap: 8px; }
.gap-3      { gap: 12px; }
.gap-4      { gap: 16px; }
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3     { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.mt-1       { margin-top: 4px; }
.mt-2       { margin-top: 8px; }
.mt-3       { margin-top: 12px; }
.mt-4       { margin-top: 16px; }
.mb-4       { margin-bottom: 16px; }
.mb-6       { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 0.85rem; }
.text-xs    { font-size: 0.75rem; }
.font-bold  { font-weight: 700; }
.w-full     { width: 100%; }
.hidden     { display: none; }
.truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
