/* ═══════════════════════════════════════════════════════════
   BizContact – OPTION2 Design System (DESKTOP)
   Style: Health & Wellness (Soft UI Evolution + Organic Biophilic)
   ═══════════════════════════════════════════════════════════ */

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

/* ── Design Tokens ── */
:root {
  /* Colors */
  --primary: #10B981;
  --primary-dark: #059669;
  --primary-darker: #047857;
  --primary-light: #34D399;
  --primary-50: #ECFDF5;
  --primary-100: #D1FAE5;
  --primary-200: #A7F3D0;
  --primary-900: #064E3B;

  --secondary: #0891B2;
  --secondary-light: #22D3EE;
  --secondary-50: #ECFEFF;

  --accent: #8B5CF6;
  --accent-dark: #7C3AED;
  --accent-light: #A78BFA;
  --accent-50: #F5F3FF;

  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;

  --bg-body: #F0FDF9;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F7FDFB;
  --bg-sidebar: #FAFFFE;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --text-primary: #064E3B;
  --text-secondary: #047857;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --text-inverse: #FFFFFF;

  --border-color: #D1FAE5;
  --border-color-strong: #A7F3D0;
  --divider: #E5E7EB;

  /* Typography */
  --font-heading: 'Lora', 'Georgia', serif;
  --font-body: 'Raleway', 'Segoe UI', sans-serif;

  --fs-xs: 0.6875rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  --space-4xl: 64px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-pill: 100px;
  --radius-circle: 50%;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(16, 185, 129, 0.06);
  --shadow-md: 0 4px 14px rgba(16, 185, 129, 0.08);
  --shadow-lg: 0 8px 24px rgba(16, 185, 129, 0.10);
  --shadow-xl: 0 12px 40px rgba(16, 185, 129, 0.12);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(16,185,129,0.06);
  --shadow-card-hover: 0 4px 16px rgba(16,185,129,0.12), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-sidebar: 2px 0 24px rgba(16, 185, 129, 0.06);
  --shadow-fab: 0 6px 24px rgba(139, 92, 246, 0.35);

  /* Transitions */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 400ms;

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

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-body);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }

a {
  text-decoration: none;
  color: var(--primary-dark);
  transition: color var(--dur-base) var(--ease-smooth);
}
a:hover { color: var(--accent); }

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

ul, ol { list-style: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ═══════════════════════════════════════════════════════════
   DESKTOP LAYOUT: Sidebar + Content
   ═══════════════════════════════════════════════════════════ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width var(--dur-base) var(--ease-smooth);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
}

.sidebar-logo {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-sm);
  font-family: var(--font-heading);
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-brand-sub {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 400;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
}

.sidebar-section-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: var(--space-lg) var(--space-md) var(--space-sm);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 500;
  font-size: var(--fs-base);
  transition: all var(--dur-base) var(--ease-smooth);
  position: relative;
  margin-bottom: 2px;
  text-decoration: none;
}

.sidebar-item:hover {
  background: var(--primary-50);
  color: var(--primary-dark);
}

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

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
}

.sidebar-item svg {
  width: 20px; height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-item.active svg {
  opacity: 1;
}

.sidebar-item-label {
  flex: 1;
}

.sidebar-badge {
  min-width: 20px; height: 20px;
  border-radius: var(--radius-pill);
  background: var(--error);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.sidebar-badge.success {
  background: var(--success);
}

/* Sidebar Footer / User Profile */
.sidebar-footer {
  padding: var(--space-base) var(--space-xl);
  border-top: 1px solid var(--border-color);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  transition: all var(--dur-base) var(--ease-smooth);
}

.sidebar-toggle:hover {
  background: var(--primary-50);
  color: var(--primary-dark);
}

.sidebar-toggle svg {
  width: 16px; height: 16px;
  transition: transform var(--dur-base) var(--ease-smooth);
}

.sidebar-toggle-label {
  transition: opacity var(--dur-fast) var(--ease-smooth);
}

/* ── Collapsed Sidebar State ── */
.sidebar.collapsed {
  width: 68px;
}

.sidebar.collapsed ~ .main-area {
  margin-left: 68px;
}

.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-brand-sub {
  display: none;
}

.sidebar.collapsed .sidebar-section-label {
  font-size: 0;
  padding: var(--space-sm) 0;
  text-align: center;
}

.sidebar.collapsed .sidebar-section-label::after {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--border-color);
  margin: 0 auto;
}

.sidebar.collapsed .sidebar-item {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .sidebar-item-label,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-plan-badge {
  display: none;
}

.sidebar.collapsed .sidebar-item.active::before {
  height: 16px;
}

.sidebar.collapsed .sidebar-footer {
  padding: var(--space-sm);
}

.sidebar.collapsed .sidebar-user-info {
  display: none;
}

.sidebar.collapsed .sidebar-user {
  justify-content: center;
}

.sidebar.collapsed .sidebar-toggle-label {
  display: none;
}

.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: var(--space-lg) var(--space-sm);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
}

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

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

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

.sidebar-user-email {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-plan-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-100);
  color: var(--primary-dark);
}

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

/* ── Desktop Top Bar ── */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-2xl);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.topbar-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 400;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-smooth);
  color: var(--text-muted);
}

.topbar-btn:hover {
  background: var(--primary-50);
  color: var(--primary-dark);
}

.topbar-btn svg {
  width: 20px; height: 20px;
}

.topbar-btn .badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  border-radius: 100px;
  background: var(--error);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid var(--bg-body);
}

/* ── Page Content ── */
.page-content {
  flex: 1;
  padding: var(--space-2xl);
  max-width: 1200px;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-base);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: var(--space-lg) var(--space-xl);
  box-shadow: var(--shadow-card);
  transition: all var(--dur-base) var(--ease-smooth);
  cursor: default;
}

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

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 20px; height: 20px;
}

.stat-icon.green { background: var(--primary-100); color: var(--primary-dark); }
.stat-icon.teal { background: var(--secondary-50); color: var(--secondary); }
.stat-icon.violet { background: var(--accent-50); color: var(--accent); }
.stat-icon.amber { background: #FEF3C7; color: #B45309; }

.stat-change {
  font-size: var(--fs-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }

.stat-value {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.stat-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Content Header Row ── */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.content-header h2 {
  font-size: var(--fs-xl);
}

.content-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ── Search Bar (Desktop) ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 var(--space-base);
  height: 42px;
  min-width: 300px;
  box-shadow: var(--shadow-sm);
  transition: all var(--dur-base) var(--ease-smooth);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.10);
}

.search-bar svg {
  width: 16px; height: 16px;
  color: var(--text-light);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  height: 100%;
  color: var(--text-primary);
  font-size: var(--fs-sm);
}

.search-bar input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

/* ── Filter Toolbar ── */
.filter-toolbar {
  margin-bottom: var(--space-lg);
}

.filter-toolbar-inner {
  display: flex;
  align-items: flex-end;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 160px;
  max-width: 280px;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-label svg {
  color: var(--primary);
  flex-shrink: 0;
}

.filter-select {
  height: 40px;
  padding: 0 36px 0 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-smooth);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-select:hover {
  border-color: var(--primary);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.10);
}

.filter-input {
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-weight: 400;
  transition: all var(--dur-base) var(--ease-smooth);
  width: 100%;
}

.filter-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.filter-input:hover {
  border-color: var(--primary-200, #a7f3d0);
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.10);
}

.filter-submit-btn {
  height: 40px;
  padding: 0 20px;
  flex-shrink: 0;
  white-space: nowrap;
}

.filter-clear-btn {
  height: 40px;
  padding: 0 14px;
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.filter-clear-btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.06);
}

/* Keep legacy classes for backward compat */
.filter-bar {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: all var(--dur-base) var(--ease-smooth);
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.chip-count {
  background: rgba(255,255,255,0.2);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.filter-chip.active .chip-count {
  background: rgba(255,255,255,0.3);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-smooth);
  border: none;
  min-height: 40px;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}
.btn-accent:hover {
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
  transform: translateY(-1px);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.btn-lg {
  padding: 14px 32px;
  font-size: var(--fs-md);
  border-radius: var(--radius-lg);
  min-height: 48px;
}

.btn-block { width: 100%; }

.btn-google {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1.5px solid var(--divider);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  padding: 14px 28px;
  font-size: var(--fs-md);
  border-radius: var(--radius-lg);
}
.btn-google:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-200);
}
.btn-google svg { width: 20px; height: 20px; }

/* ═══════════════════════════════════════════════════════════
   CONTACT TABLE (Desktop)
   ═══════════════════════════════════════════════════════════ */

.contact-table-wrap {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

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

.contact-table thead th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.contact-table tbody tr {
  transition: background var(--dur-fast) var(--ease-smooth);
  cursor: pointer;
}

.contact-table tbody tr:hover {
  background: var(--primary-50);
}

.contact-table tbody td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  font-size: var(--fs-sm);
  vertical-align: middle;
}

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

/* Contact cell inside table */
.td-contact {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.contact-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--fs-base);
  color: #fff;
  position: relative;
}

/* Insight verified badge on avatar */
.avatar-insight-badge {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #6D28D9);
  border: 2px solid var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.avatar-insight-badge svg {
  width: 8px; height: 8px;
  color: #fff;
  stroke-width: 3;
}

.contact-avatar.green { background: linear-gradient(135deg, #10B981, #34D399); }
.contact-avatar.teal { background: linear-gradient(135deg, #0891B2, #22D3EE); }
.contact-avatar.violet { background: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.contact-avatar.amber { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.contact-avatar.rose { background: linear-gradient(135deg, #F43F5E, #FB7185); }
.contact-avatar.sky { background: linear-gradient(135deg, #0EA5E9, #38BDF8); }

.td-contact-info {
  min-width: 0;
}

.td-contact-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--fs-base);
}

.td-contact-email {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 1px;
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

.tag + .tag { margin-left: 3px; }

.tag-green { background: #D1FAE5; color: #065F46; }
.tag-blue { background: #DBEAFE; color: #1E40AF; }
.tag-purple { background: #EDE9FE; color: #5B21B6; }
.tag-amber { background: #FEF3C7; color: #92400E; }
.tag-rose { background: #FFE4E6; color: #9F1239; }

/* Source badge */
.source-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Status indicator */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
}

.status-dot::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.sent { color: var(--info); }
.status-dot.sent::before { background: var(--info); }
.status-dot.opened { color: var(--success); }
.status-dot.opened::before { background: var(--success); }
.status-dot.clicked { color: var(--warning); }
.status-dot.clicked::before { background: var(--warning); }
.status-dot.none { color: var(--text-light); }
.status-dot.none::before { background: var(--divider); }

/* Action buttons in table */
.td-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-smooth);
}

.contact-table tbody tr:hover .td-actions {
  opacity: 1;
}

.td-action-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-smooth);
}

.td-action-btn:hover {
  background: var(--primary-100);
  color: var(--primary-dark);
}

.td-action-btn svg {
  width: 16px; height: 16px;
}

/* ── Table footer / Pagination ── */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-color);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-smooth);
}

.page-btn:hover { background: var(--primary-50); color: var(--primary); }
.page-btn.active {
  background: var(--primary);
  color: #fff;
}

.page-btn svg { width: 16px; height: 16px; }

/* ── Usage bar ── */
.usage-bar-wrap {
  margin-top: var(--space-xl);
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.usage-info {
  flex: 1;
}

.usage-label {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.usage-track {
  height: 6px;
  background: var(--primary-100);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width var(--dur-slow) var(--ease-smooth);
}

.usage-text {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

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

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE (Desktop – Split Layout)
   ═══════════════════════════════════════════════════════════ */

.login-page {
  display: flex;
  min-height: 100vh;
}

/* Left panel – branding & features */
.login-left {
  flex: 1;
  background: linear-gradient(150deg, #064E3B 0%, #047857 30%, #0891B2 70%, #7C3AED 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-4xl) var(--space-4xl);
  position: relative;
  overflow: hidden;
  color: #fff;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 70%);
}

.login-left::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -100px;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.12), transparent 70%);
}

.login-left-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.login-left-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-3xl);
}

.login-left-logo-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255, 0.15);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-left-logo-icon svg {
  width: 24px; height: 24px;
  color: #fff;
}

.login-left-logo-text {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
}

.login-left h1 {
  font-size: var(--fs-4xl);
  color: #fff;
  line-height: 1.2;
  margin-bottom: var(--space-lg);
}

.login-left p.lead {
  font-size: var(--fs-lg);
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: var(--space-3xl);
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.login-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-base);
}

.login-feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
}

.login-feature-icon svg {
  width: 22px; height: 22px;
  color: #fff;
}

.login-feature-text h5 {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
}

.login-feature-text p {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
}

/* Right panel – sign in form */
.login-right {
  width: 520px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-4xl);
  background: var(--bg-body);
  position: relative;
}

.login-right::before {
  content: '';
  position: absolute;
  top: 60px; right: 60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,0.08), transparent 70%);
  pointer-events: none;
}

.login-form-wrap {
  width: 100%;
  max-width: 380px;
  animation: fadeInUp 0.7s var(--ease-smooth);
}

.login-form-heading {
  margin-bottom: var(--space-2xl);
}

.login-form-heading h2 {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-sm);
}

.login-form-heading p {
  font-size: var(--fs-base);
  color: var(--text-muted);
}

.login-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
  color: var(--text-light);
  font-size: var(--fs-sm);
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.login-info-text {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.login-stat {
  text-align: center;
  padding: var(--space-base);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.login-stat-value {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--primary-dark);
}

.login-stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.login-footer {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-light);
  line-height: 1.6;
}

.login-footer a {
  color: var(--primary);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.anim-stagger > * {
  animation: fadeInUp 0.4s var(--ease-smooth) both;
}
.anim-stagger > *:nth-child(1) { animation-delay: 0.02s; }
.anim-stagger > *:nth-child(2) { animation-delay: 0.04s; }
.anim-stagger > *:nth-child(3) { animation-delay: 0.06s; }
.anim-stagger > *:nth-child(4) { animation-delay: 0.08s; }
.anim-stagger > *:nth-child(5) { animation-delay: 0.10s; }
.anim-stagger > *:nth-child(6) { animation-delay: 0.12s; }
.anim-stagger > *:nth-child(7) { animation-delay: 0.14s; }
.anim-stagger > *:nth-child(8) { animation-delay: 0.16s; }

@keyframes floatSlow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ═══════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 10px var(--space-base);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--dur-base) var(--ease-smooth);
  font-family: var(--font-body);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.10);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-light);
}

textarea.form-input {
  resize: vertical;
  line-height: 1.6;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE (< 768px)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Sidebar: off-canvas overlay */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 100;
    box-shadow: none;
    transition: transform var(--dur-base) var(--ease-smooth);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0,0,0,0.15);
  }

  /* Overlay backdrop */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease-smooth);
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  /* Main area full width, no horizontal scroll */
  .main-area {
    margin-left: 0 !important;
    overflow-x: hidden;
  }

  .app-layout {
    overflow-x: hidden;
  }

  /* Topbar: add hamburger & adjust */
  .topbar {
    padding: 0 var(--space-base);
    height: 56px;
  }

  .topbar-title { font-size: var(--fs-lg); }
  .topbar-subtitle { display: none; }

  .search-bar {
    min-width: 0;
    flex: 1;
    height: 38px;
    display: none;
  }

  /* Compact Add Contact button */
  .btn-primary {
    padding: 8px 12px;
    min-height: 36px;
    font-size: var(--fs-xs);
  }

  /* Content header compact */
  .content-actions {
    flex-wrap: wrap;
  }

  .content-actions .btn {
    padding: 6px 12px;
    min-height: 34px;
    font-size: var(--fs-xs);
  }

  /* Page content */
  .page-content {
    padding: var(--space-base);
  }

  /* Stats grid: 2 columns, compact horizontal cards */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: var(--space-base);
  }

  .stat-card {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--radius-md);
  }

  .stat-card:hover {
    transform: none;
  }

  .stat-card-header {
    margin-bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    flex-shrink: 0;
  }

  /* Hide the change badge from header, show inline */
  .stat-card-header .stat-change {
    display: none;
  }

  .stat-value {
    font-size: var(--fs-lg);
    margin-bottom: 0;
    line-height: 1.2;
  }

  .stat-label {
    font-size: 10px;
    line-height: 1.2;
  }

  .stat-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
  }

  .stat-icon svg {
    width: 14px; height: 14px;
  }

  /* Content header */
  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .content-header h2 {
    font-size: var(--fs-lg);
  }

  /* Filter toolbar responsive */
  .filter-toolbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    max-width: none;
    min-width: 0;
  }

  .filter-submit-btn,
  .filter-clear-btn {
    width: 100%;
    justify-content: center;
  }

  /* Filter bar scroll */
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-xs);
  }
  .filter-bar::-webkit-scrollbar { display: none; }

  .filter-chip {
    padding: 5px 12px;
    font-size: var(--fs-xs);
  }

  /* Table: hide non-essential columns on mobile
     Columns: 1=checkbox, 2=Contact, 3=Phone, 4=Company, 5=Tags, 6=Source, 7=EmailStatus, 8=Actions
     Keep: Contact(2), Phone(3), Tags(5) */
  .contact-table thead th:nth-child(1),
  .contact-table tbody td:nth-child(1),
  .contact-table thead th:nth-child(4),
  .contact-table tbody td:nth-child(4),
  .contact-table thead th:nth-child(6),
  .contact-table tbody td:nth-child(6),
  .contact-table thead th:nth-child(7),
  .contact-table tbody td:nth-child(7),
  .contact-table thead th:nth-child(8),
  .contact-table tbody td:nth-child(8) {
    display: none;
  }

  .contact-table-wrap {
    overflow-x: hidden;
    max-width: 100%;
  }

  .contact-table thead th {
    padding: var(--space-sm) var(--space-md);
    font-size: 10px;
  }

  .contact-table tbody td {
    padding: var(--space-sm) var(--space-md);
  }

  .contact-avatar {
    width: 34px; height: 34px;
    font-size: var(--fs-sm);
  }

  .td-contact-name {
    font-size: var(--fs-sm);
  }

  .td-contact-email {
    font-size: 10px;
  }

  .tag {
    font-size: 9px;
    padding: 2px 6px;
  }

  /* Hide sidebar toggle on mobile (use hamburger instead) */
  .sidebar-toggle {
    display: none;
  }

  /* Pagination */
  .table-footer {
    flex-direction: column;
    gap: var(--space-sm);
    font-size: var(--fs-xs);
  }

  /* Usage bar */
  .usage-bar-wrap {
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-base);
  }

  .usage-bar-wrap .btn {
    width: 100%;
  }

  /* Bottom Navigation for Mobile */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 56px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 90;
    padding-bottom: env(safe-area-inset-bottom, 0);
    align-items: center;
    justify-content: space-around;
  }

  .mobile-bottom-nav .mob-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color var(--dur-fast) var(--ease-smooth);
    position: relative;
  }

  .mobile-bottom-nav .mob-tab.active {
    color: var(--primary);
  }

  .mobile-bottom-nav .mob-tab.active::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 20px; height: 2.5px;
    border-radius: 0 0 3px 3px;
    background: var(--primary);
  }

  .mobile-bottom-nav .mob-tab svg {
    width: 20px; height: 20px;
  }

  .mobile-bottom-nav .mob-badge {
    position: absolute;
    top: 2px; right: calc(50% - 16px);
    min-width: 14px; height: 14px;
    border-radius: 100px;
    background: var(--error);
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 1.5px solid var(--bg-body);
  }

  /* Scan Business Card - highlighted center button */
  .mob-tab-scan {
    position: relative;
  }

  .mob-scan-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -28px;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35), 0 2px 6px rgba(139, 92, 246, 0.2);
    transition: all var(--dur-base) var(--ease-smooth);
  }

  .mob-scan-btn svg {
    width: 24px; height: 24px;
    color: #fff;
    stroke: #fff;
  }

  .mob-tab-scan:active .mob-scan-btn {
    transform: scale(0.92);
  }

  .mob-tab-scan .mob-scan-btn:hover {
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.45), 0 3px 8px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
  }

  /* Increase bottom nav height for scan button */
  .mobile-bottom-nav {
    height: 60px;
    padding: 0 var(--space-sm);
  }

  /* Add bottom padding for nav */
  .page-content {
    padding-bottom: 80px;
  }

  /* Hamburger button */
  .hamburger-btn {
    display: flex;
  }

  /* ── Login Page Mobile ── */
  .login-page {
    flex-direction: column;
    min-height: 100vh;
  }

  .login-left {
    flex: none;
    width: 100%;
    padding: var(--space-2xl) var(--space-xl);
    min-height: auto;
  }

  .login-left-content {
    max-width: 100%;
  }

  .login-brand {
    margin-bottom: var(--space-base);
  }

  .login-brand-icon {
    width: 36px; height: 36px;
    font-size: var(--fs-xs);
  }

  .login-brand-name {
    font-size: var(--fs-lg);
  }

  .login-headline {
    font-size: var(--fs-xl);
    margin-bottom: var(--space-base);
  }

  .login-subtext {
    font-size: var(--fs-sm);
    margin-bottom: var(--space-lg);
  }

  .login-features {
    display: none;
  }

  .login-right {
    flex: 1;
    width: 100%;
    padding: var(--space-xl);
  }

  .login-right-inner {
    max-width: 100%;
    padding: 0;
  }

  .login-welcome {
    font-size: var(--fs-xl);
  }

  .login-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }

  .login-stat {
    padding: var(--space-sm);
  }

  .login-stat-value {
    font-size: var(--fs-md);
  }

  .login-stat-label {
    font-size: 9px;
  }

  .login-card {
    padding: var(--space-xl);
  }

  .btn-google {
    font-size: var(--fs-sm);
    padding: 12px;
  }

  /* ── New Pages Mobile ── */

  /* Email template: stack columns */
  .email-template-panel {
    grid-template-columns: 1fr !important;
  }

  /* Search panel: stack columns */
  .search-panel > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  /* Profile: stack columns */
  .page-content > div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

}

/* Hide mobile-only elements on desktop */
@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none;
  }

  .sidebar-overlay {
    display: none;
  }

  .hamburger-btn {
    display: none;
  }
}

.hamburger-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--dur-base) var(--ease-smooth);
  flex-shrink: 0;
}

.hamburger-btn:hover {
  background: var(--primary-50);
  color: var(--primary-dark);
}

.hamburger-btn svg {
  width: 22px; height: 22px;
}

/* ═══════════════════════════════════════════════════════════
   TABLET (768px - 1024px)
   ═══════════════════════════════════════════════════════════ */

@media (min-width: 769px) and (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-bar {
    min-width: 200px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   ADD CONTACT FORM – Prototype OPTION2
   ═══════════════════════════════════════════════════════════ */

.add-form-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.add-form-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
}

.add-form-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.add-form-sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
}

/* Form fields */
.field {
  margin-bottom: var(--space-md);
}

.field-label {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field-label .req {
  color: var(--error);
}

.field-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  color: var(--text-primary);
  background: var(--bg-surface);
  font-family: var(--font-body);
  transition: border-color var(--dur-base) var(--ease-smooth), box-shadow var(--dur-base) var(--ease-smooth);
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
  outline: none;
}

/* Auto-fill highlight animation */
.field-input.field-filled {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.06);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  animation: fieldFillPulse 0.5s ease-out;
}

@keyframes fieldFillPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
}

.field-input::placeholder {
  color: var(--text-light);
}

/* Icon prefix input */
.field-input-icon {
  position: relative;
}

.field-input-icon .field-input {
  padding-left: 42px;
}

.field-input-icon .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-light);
  pointer-events: none;
}

/* Field with AI Check button */
.field-with-btn {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
}

.field-with-btn .field-input-icon {
  flex: 1;
  min-width: 0;
}

.btn-ai-check {
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
  transition: all var(--dur-base) var(--ease-smooth);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-ai-check:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-ai-check svg {
  width: 14px;
  height: 14px;
}

/* Save button */
.btn-save {
  width: 100%;
  padding: 14px;
  font-size: var(--fs-base);
  font-weight: 600;
  border-radius: var(--radius-md);
  margin-top: var(--space-sm);
}

/* Divider */
.divider-or {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0;
  font-size: var(--fs-xs);
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* Scan card button */
.scan-section {
  text-align: center;
}

.scan-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-2xl);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-color-strong);
  background: var(--bg-surface-alt);
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-smooth);
  color: var(--text-muted);
  width: 100%;
}

.scan-btn:hover {
  border-color: var(--primary);
  background: var(--primary-50);
  color: var(--primary-dark);
}

.scan-btn svg {
  width: 36px;
  height: 36px;
}

.scan-btn span {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.scan-btn small {
  font-size: var(--fs-xs);
  color: var(--text-light);
  font-weight: 400;
}

@media (max-width: 768px) {
  .add-form-wrap {
    padding: var(--space-md);
  }
  .add-form-card {
    padding: var(--space-lg);
  }
  .btn-ai-check span {
    display: none;
  }
  .btn-ai-check {
    padding: 0 12px;
  }
}

/* ── AI Check Result Panel ────────────────────────────── */
.ai-result-panel {
  margin-top: var(--space-xl);
  background: var(--bg-surface);
  border: 1.5px solid var(--primary-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: aiSlideIn 0.35s var(--ease-smooth);
}

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

.ai-result-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-base);
  background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
  border-bottom: 1px solid var(--primary-200);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--primary-dark);
}

.ai-result-header svg {
  color: var(--primary);
  flex-shrink: 0;
}

.ai-result-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--dur-base) var(--ease-smooth);
  line-height: 1;
}

.ai-result-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.ai-result-body {
  padding: var(--space-base);
}

/* Avatar Profile Header */
.ai-profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-base);
  padding-bottom: var(--space-base);
  margin-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.ai-avatar-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  position: relative;
}

.ai-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-200);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ai-avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--primary-200);
}

.ai-profile-info {
  min-width: 0;
  flex: 1;
}

.ai-profile-name {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.ai-profile-link {
  font-size: var(--fs-xs);
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--dur-base) var(--ease-smooth);
}

.ai-profile-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.ai-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm) var(--space-lg);
}

.ai-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-xs) 0;
}

.ai-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ai-value {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  font-weight: 600;
  word-break: break-all;
}

.ai-value a {
  color: var(--primary-dark);
  text-decoration: underline;
  text-decoration-color: var(--primary-200);
  text-underline-offset: 2px;
}

.ai-value a:hover {
  color: var(--primary);
  text-decoration-color: var(--primary);
}

/* ── Toast Notifications ─────────────────────────────── */
.ai-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-smooth);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  max-width: 400px;
  text-align: center;
}

.ai-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.ai-toast-success {
  background: linear-gradient(135deg, var(--success), #16A34A);
}

.ai-toast-error {
  background: linear-gradient(135deg, var(--error), #DC2626);
}

.ai-toast-warning {
  background: linear-gradient(135deg, var(--warning), #D97706);
}

/* ── Loading Spinner ─────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 0.8s linear infinite;
}

@media (max-width: 768px) {
  .ai-result-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE – Prototype OPTION2
   ═══════════════════════════════════════════════════════════ */

.login-page {
  display: flex;
  min-height: 100vh;
  background: var(--bg-body);
}

/* ── Left Panel: Branding & Features ── */
.login-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-4xl) var(--space-3xl);
  background: linear-gradient(165deg, #064E3B 0%, #047857 40%, #059669 70%, #0D9488 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.login-left::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

.login-left-content {
  max-width: 520px;
  position: relative;
  z-index: 1;
}

/* Logo */
.login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-3xl);
}

.login-brand-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}

.login-brand-icon svg {
  width: 22px; height: 22px;
}

.login-brand-name {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: #fff;
}

/* Headline */
.login-headline {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: var(--space-base);
  color: #fff;
}

.login-subtext {
  font-size: var(--fs-base);
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  margin-bottom: var(--space-2xl);
  max-width: 440px;
}

/* Features */
.login-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.login-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--space-base);
  padding: var(--space-base);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all var(--dur-base) var(--ease-smooth);
}

.login-feature:hover {
  background: rgba(255,255,255,0.1);
  transform: translateX(4px);
}

.login-feature-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  background: rgba(52, 211, 153, 0.2);
  color: #6EE7B7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-feature-icon svg {
  width: 20px; height: 20px;
}

.login-feature:nth-child(2) .login-feature-icon {
  background: rgba(34, 211, 238, 0.2);
  color: #67E8F9;
}

.login-feature:nth-child(3) .login-feature-icon {
  background: rgba(167, 139, 250, 0.2);
  color: #C4B5FD;
}

.login-feature-text h5 {
  font-weight: 600;
  font-size: var(--fs-base);
  color: #fff;
  margin-bottom: 2px;
  font-family: var(--font-body);
}

.login-feature-text p {
  font-size: var(--fs-sm);
  color: rgba(255,255,255,0.65);
  line-height: 1.5;
}

/* ── Right Panel: Sign In Form ── */
.login-right {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl);
  background: var(--bg-surface);
  box-shadow: -8px 0 40px rgba(0,0,0,0.06);
}

.login-right-inner {
  width: 100%;
  max-width: 360px;
}

.login-form-heading {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.login-welcome {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.login-welcome-sub {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Error */
.login-error {
  background: #FEE2E2;
  color: #DC2626;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-base);
}

/* Stats */
.login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.login-stat {
  background: var(--primary-50);
  border-radius: var(--radius-md);
  padding: var(--space-base) var(--space-sm);
  text-align: center;
  border: 1px solid var(--border-color);
}

.login-stat-value {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--primary-dark);
}

.login-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Sign in card */
.login-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-card);
}

.login-card .btn-google {
  width: 100%;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  font-size: var(--fs-xs);
  color: var(--text-light);
  font-weight: 500;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.login-info-text {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.6;
  text-align: center;
}

/* Footer */
.login-footer {
  margin-top: var(--space-2xl);
  text-align: center;
}

.login-footer p {
  font-size: var(--fs-xs);
  color: var(--text-light);
  line-height: 1.6;
}

.login-footer a {
  color: var(--primary-dark);
  font-weight: 500;
}

.login-footer a:hover {
  color: var(--accent);
}

/* ── Login Responsive ── */
@media (max-width: 960px) {
  .login-page {
    flex-direction: column;
  }
  .login-left {
    padding: var(--space-2xl);
    min-height: auto;
  }
  .login-headline {
    font-size: var(--fs-xl);
  }
  .login-features {
    display: none;
  }
  .login-right {
    flex: 1;
    width: 100%;
    padding: var(--space-xl);
  }
  .login-right-inner {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .login-left {
    padding: var(--space-xl);
  }
  .login-right {
    padding: var(--space-lg);
  }
  .login-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }
  .login-stat {
    padding: var(--space-sm);
  }
  .login-stat-value {
    font-size: var(--fs-md);
  }
  .login-stat-label {
    font-size: 9px;
  }
  .login-card {
    padding: var(--space-xl);
  }
}
