* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #e2e8f0; color: #1e293b; }
body.dark { background: #0f172a; color: #cbd5e1; }

/* ══════════════════════════════════════════
   SIDEBAR LAYOUT
   ══════════════════════════════════════════ */
:root {
  --sb-w: 224px;
  --sb-cw: 56px;
}

/* ── Sidebar shell ── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sb-w);
  background: #1e293b;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transition: width .2s ease;
}
.sidebar.sb-collapsed { width: var(--sb-cw); }
body.dark .sidebar { background: #0d1424; }

/* ── Brand ── */
.sb-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem 0 1rem;
  height: 56px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}
.sb-logo {
  font-size: 1.1rem; font-weight: 800;
  color: #a5b4fc; text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s;
}
.sidebar.sb-collapsed .sb-logo { display: none; }
.sidebar.sb-collapsed .sb-brand { justify-content: center; }

.sb-collapse {
  background: none; border: none;
  color: #64748b; cursor: pointer;
  font-size: 1rem; line-height: 1;
  padding: 6px 8px; border-radius: 6px;
  flex-shrink: 0;
  transition: background .15s, color .15s, transform .2s;
}
.sb-collapse:hover { background: rgba(255,255,255,.1); color: #e2e8f0; }
.sidebar.sb-collapsed .sb-collapse { transform: rotate(180deg); }

/* ── Nav scroll area ── */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

/* ── Section labels ── */
.sb-section-label {
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: #475569;
  padding: 8px 10px 4px;
  white-space: nowrap;
}
.sidebar.sb-collapsed .sb-section-label { display: none; }

/* ── Nav links ── */
.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.84rem;
  white-space: nowrap;
  margin-bottom: 2px;
  transition: background .1s, color .1s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.sb-link:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }
.sb-link.sb-active { background: rgba(99,102,241,.25); color: #a5b4fc; font-weight: 600; }

.sb-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sb-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.sidebar.sb-collapsed .sb-text { display: none; }
.sidebar.sb-collapsed .sb-link { justify-content: center; padding: 9px 0; gap: 0; }

/* ── Bottom bar ── */
.sb-bottom {
  flex-shrink: 0;
  padding: 6px;
  border-top: 1px solid rgba(255,255,255,.07);
}

/* ══════════════════════════════════════════
   MAIN CONTENT AREA
   ══════════════════════════════════════════ */
.page-wrap {
  margin-left: var(--sb-w);
  min-height: 100vh;
  transition: margin-left .2s ease;
}
body.sb-collapsed .page-wrap { margin-left: var(--sb-cw); }

/* ══════════════════════════════════════════
   MOBILE TOPBAR
   ══════════════════════════════════════════ */
.sb-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: #1e293b;
  z-index: 200;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}
body.dark .sb-topbar { background: #0d1424; }
.sb-hamburger {
  background: none; border: none;
  color: #94a3b8; font-size: 1.4rem; cursor: pointer; line-height: 1;
}

.sb-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}
.sb-overlay.sb-visible { display: block; }

/* ══════════════════════════════════════════
   MOBILE BREAKPOINT
   ══════════════════════════════════════════ */
@media (max-width: 767px) {
  .sidebar {
    width: var(--sb-w) !important;
    transform: translateX(calc(-1 * var(--sb-w)));
    transition: transform .25s ease;
    z-index: 201;
  }
  .sidebar.sb-open { transform: translateX(0); }
  /* Reset collapsed styles on mobile */
  .sidebar.sb-collapsed .sb-text { display: block !important; }
  .sidebar.sb-collapsed .sb-section-label { display: block !important; }
  .sidebar.sb-collapsed .sb-link { justify-content: flex-start !important; padding: 8px 10px !important; gap: 10px !important; }
  .sidebar.sb-collapsed .sb-logo { opacity: 1 !important; pointer-events: auto !important; }
  .sb-collapse { display: none; }
  .sb-topbar { display: flex; }
  .page-wrap { margin-left: 0 !important; padding-top: 52px; }
  body.sb-collapsed .page-wrap { margin-left: 0 !important; }
}

/* Landing page top nav */
nav.topnav { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-brand { font-size: 1.3rem; font-weight: 700; color: #6366f1; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.nav-links a { margin-left: 1.25rem; text-decoration: none; color: #64748b; font-size: 0.88rem; }
.nav-links a:hover { color: #6366f1; }
.dark-toggle { background: none; border: 1px solid #e2e8f0; border-radius: 20px; padding: 0.25rem 0.65rem; font-size: 0.82rem; cursor: pointer; color: #64748b; margin-left: 1rem; }

/* SEO tool */
.seo-check { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid #f1f5f9; }
body.dark .seo-check { border-color: #1e293b; }
.seo-check-icon { font-size: 1.1rem; flex-shrink: 0; }
.seo-check-label { flex: 1; font-size: 0.88rem; }
.seo-check-val { font-size: 0.8rem; color: #64748b; max-width: 280px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-score-ring { width: 100px; height: 100px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.backlink-row { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid #f1f5f9; font-size: 0.88rem; }
body.dark .backlink-row { border-color: #1e293b; }
.bl-domain { font-weight: 600; flex: 1; color: #1e293b; }
body.dark .bl-domain { color: #e2e8f0; }
.bl-score { font-weight: 800; color: #6366f1; font-size: 1.1rem; min-width: 36px; text-align: right; }
.btn { display: inline-block; padding: 0.5rem 1.2rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600; text-decoration: none; cursor: pointer; border: none; transition: all 0.15s; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-outline { background: transparent; color: #6366f1; border: 2px solid #6366f1; }
.btn-outline:hover { background: #6366f1; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.btn-green { background: #22c55e; color: #fff; }
.btn-green:hover { background: #16a34a; }

/* HERO */
.hero { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); color: #fff; padding: 6rem 2rem; text-align: center; }
.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; }
.hero p { font-size: 1.25rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2rem; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* FEATURES */
.features { padding: 5rem 2rem; max-width: 1100px; margin: 0 auto; }
.features h2 { text-align: center; font-size: 2rem; margin-bottom: 3rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.feature-card { background: #fff; border-radius: 12px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.feature-card p { color: #64748b; font-size: 0.9rem; line-height: 1.6; }

/* PRICING */
.pricing { background: #f1f5f9; padding: 5rem 2rem; }
.pricing h2 { text-align: center; font-size: 2rem; margin-bottom: 3rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; max-width: 1100px; margin: 0 auto; }
.pricing-card { background: #fff; border-radius: 12px; padding: 2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.1); text-align: center; }
.pricing-card.featured { border: 2px solid #6366f1; }
.pricing-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.price { font-size: 2.5rem; font-weight: 800; color: #6366f1; margin: 1rem 0; }
.price span { font-size: 1rem; color: #64748b; font-weight: 400; }
.pricing-card ul { list-style: none; text-align: left; margin: 1.5rem 0; }
.pricing-card ul li { padding: 0.4rem 0; font-size: 0.9rem; color: #475569; }
.pricing-card ul li::before { content: "✓ "; color: #22c55e; font-weight: 700; }

/* DASHBOARD */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem; }
footer { margin-left: 0; }
.page-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.page-sub { color: #64748b; margin-bottom: 2rem; font-size: 0.95rem; }
.card { background: #fff; border-radius: 12px; padding: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 1.5rem; }
.card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: #475569; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.8rem; }

/* SEARCH FORM */
.search-form { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; min-width: 180px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: #374151; }
.form-group input { padding: 0.6rem 0.9rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.95rem; outline: none; }
.form-group input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: 10px; padding: 1.2rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); text-align: center; }
.stat-number { font-size: 2rem; font-weight: 800; color: #6366f1; }
.stat-label { font-size: 0.8rem; color: #64748b; margin-top: 0.25rem; }

/* SEARCHES TABLE */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 0.75rem 1rem; border-bottom: 2px solid #e2e8f0; color: #64748b; font-size: 0.8rem; text-transform: uppercase; }
td { padding: 0.75rem 1rem; border-bottom: 1px solid #f1f5f9; }
tr:hover td { background: #f8fafc; }
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge-done { background: #dcfce7; color: #16a34a; }
.badge-running { background: #fef9c3; color: #ca8a04; }
.badge-failed { background: #fee2e2; color: #dc2626; }
.badge-pending { background: #f1f5f9; color: #64748b; }

/* RESULTS */
.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filter-btn { padding: 0.4rem 1rem; border-radius: 20px; border: 1px solid #d1d5db; background: #fff; font-size: 0.85rem; cursor: pointer; transition: all 0.15s; }
.filter-btn:hover, .filter-btn.active { background: #6366f1; color: #fff; border-color: #6366f1; }
.result-card { background: #fff; border-radius: 10px; padding: 1.25rem 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 0.75rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.result-info h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; }
.result-info p { font-size: 0.85rem; color: #64748b; }
.result-flags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.flag { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.72rem; font-weight: 600; background: #fee2e2; color: #dc2626; }
.flag-ok { background: #dcfce7; color: #16a34a; }
.issue-score { text-align: center; min-width: 60px; }
.issue-number { font-size: 2rem; font-weight: 800; }
.issue-number.high { color: #dc2626; }
.issue-number.mid { color: #f59e0b; }
.issue-number.low { color: #22c55e; }
.issue-label { font-size: 0.7rem; color: #64748b; }

/* BILLING */
.plan-current { display: inline-block; background: #6366f1; color: #fff; padding: 0.2rem 0.8rem; border-radius: 20px; font-size: 0.8rem; margin-left: 0.5rem; }

/* AUTH */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f1f5f9; }
.auth-card { background: #fff; border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 420px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.auth-card h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.auth-card p { color: #64748b; margin-bottom: 2rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form input { padding: 0.75rem 1rem; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.95rem; outline: none; }
.auth-form input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: #64748b; }
.auth-footer a { color: #6366f1; text-decoration: none; }
.error-msg { background: #fee2e2; color: #dc2626; padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.9rem; }

/* SPINNER */
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid #e2e8f0; border-top-color: #6366f1; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; margin-right: 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ALERT */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-warning { background: #fef9c3; color: #92400e; border: 1px solid #fde68a; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

footer { text-align: center; padding: 3rem 2rem; color: #94a3b8; font-size: 0.85rem; }

/* ── DARK MODE ── */
body.dark { background: #0f172a; color: #e2e8f0; }
body.dark nav { background: #1e293b; border-color: #334155; }
body.dark .nav-links a { color: #94a3b8; }
body.dark .card, body.dark .result-card, body.dark .stat-card, body.dark .auth-card { background: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
body.dark table th { color: #94a3b8; border-color: #334155; }
body.dark table td { border-color: #1e293b; }
body.dark tr:hover td { background: #334155; }
body.dark .form-group input, body.dark .form-group select, body.dark textarea { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark .filter-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.dark .filter-btn.active, body.dark .filter-btn:hover { background: #6366f1; color: #fff; border-color: #6366f1; }
body.dark .page-sub { color: #94a3b8; }
body.dark footer { color: #475569; }

/* ── DARK MODE TOGGLE ── */
.dark-toggle { background: none; border: 1px solid #e2e8f0; border-radius: 20px; padding: 0.3rem 0.75rem; font-size: 0.82rem; cursor: pointer; color: #64748b; transition: all .15s; margin-left: 1rem; }
body.dark .dark-toggle { border-color: #334155; color: #94a3b8; }
.dark-toggle:hover { border-color: #6366f1; color: #6366f1; }

/* ── TAGS ── */
.tag { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 20px; font-size: 0.72rem; font-weight: 600; margin: 0.1rem; cursor: pointer; transition: all .15s; }
.tag-hot { background: #fee2e2; color: #dc2626; }
.tag-warm { background: #fef9c3; color: #92400e; }
.tag-cold { background: #dbeafe; color: #1d4ed8; }
.tag-followup { background: #f3e8ff; color: #7c3aed; }
.tag-noemail { background: #f1f5f9; color: #64748b; }
.tag-add { background: #f1f5f9; color: #6366f1; border: 1px dashed #6366f1; }
body.dark .tag-noemail, body.dark .tag-add { background: #334155; color: #94a3b8; }

/* ── KANBAN / PIPELINE ── */
.pipeline-board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; min-height: 600px; }
.pipeline-col { min-width: 240px; flex: 1; background: #f1f5f9; border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
body.dark .pipeline-col { background: #1e293b; }
.pipeline-col-header { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin-bottom: 0.5rem; display: flex; justify-content: space-between; align-items: center; }
.pipeline-card { background: #fff; border-radius: 10px; padding: 0.9rem 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.08); cursor: grab; transition: box-shadow .15s; border-left: 4px solid transparent; }
body.dark .pipeline-card { background: #0f172a; }
.pipeline-card:active { cursor: grabbing; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.pipeline-card.dragging { opacity: 0.5; }
.pipeline-col.drag-over { background: #e0e7ff; }
body.dark .pipeline-col.drag-over { background: #312e81; }
.pipeline-card h4 { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.25rem; color: #0f172a; }
body.dark .pipeline-card h4 { color: #e2e8f0; }
.pipeline-card .pc-meta { font-size: 0.75rem; color: #94a3b8; }
.pipeline-card .pc-score { font-size: 1.1rem; font-weight: 700; color: #6366f1; }
.stage-new { border-left-color: #94a3b8; }
.stage-contacted { border-left-color: #3b82f6; }
.stage-interested { border-left-color: #f59e0b; }
.stage-proposal { border-left-color: #8b5cf6; }
.stage-closed { border-left-color: #22c55e; }
.stage-lost { border-left-color: #ef4444; }

/* ── MAP ── */
#lead-map { width: 100%; height: 520px; border-radius: 12px; z-index: 1; }
.map-popup h4 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.map-popup p { font-size: 0.78rem; color: #64748b; }

/* ── GRADE BADGE ── */
.grade-badge { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; font-size: 1.3rem; font-weight: 800; color: #fff; }
.grade-A { background: #22c55e; }
.grade-B { background: #84cc16; }
.grade-C { background: #f59e0b; }
.grade-D { background: #f97316; }
.grade-F { background: #ef4444; }

/* ── SEQUENCE BUILDER ── */
.seq-step { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 1rem; margin-bottom: 0.75rem; position: relative; }
body.dark .seq-step { background: #0f172a; border-color: #334155; }
.seq-step-num { position: absolute; top: -10px; left: 14px; background: #6366f1; color: #fff; border-radius: 50%; width: 22px; height: 22px; font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ── REMINDERS ── */
.reminder-card { display: flex; align-items: center; gap: 1rem; background: #fff; border-radius: 10px; padding: 1rem 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 0.75rem; border-left: 4px solid #f59e0b; }
body.dark .reminder-card { background: #1e293b; }
.reminder-card.overdue { border-left-color: #ef4444; }
.reminder-card.done { border-left-color: #22c55e; opacity: .6; }

/* ── IMPORT ── */
.upload-zone { border: 2px dashed #d1d5db; border-radius: 12px; padding: 3rem; text-align: center; color: #94a3b8; cursor: pointer; transition: all .2s; }
.upload-zone:hover, .upload-zone.drag-active { border-color: #6366f1; color: #6366f1; background: #eef2ff; }

/* ── SCORING SETTINGS ── */
.weight-row { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid #f1f5f9; }
body.dark .weight-row { border-color: #334155; }
.weight-row label { flex: 1; font-size: 0.9rem; }
.weight-row input[type=range] { width: 160px; accent-color: #6366f1; }
.weight-val { width: 32px; text-align: right; font-weight: 700; color: #6366f1; font-size: 0.9rem; }

/* ══════════════════════════════════════════
   LIGHT THEME — Sidebar & Component Overrides
   Default body is already light (#f8fafc bg, #1e293b text).
   The sidebar defaults to dark colors; override here for light.
   ══════════════════════════════════════════ */

/* ── Light sidebar shell ── */
body:not(.dark) .sidebar {
  background: #e8edf3;
  border-right: 1px solid #e2e8f0;
}

/* ── Light sidebar brand ── */
body:not(.dark) .sb-brand {
  border-bottom: 1px solid #e2e8f0;
}
body:not(.dark) .sb-logo {
  color: #6366f1;
}
body:not(.dark) .sb-collapse {
  color: #94a3b8;
}
body:not(.dark) .sb-collapse:hover {
  background: #f1f5f9;
  color: #475569;
}

/* ── Light sidebar nav links ── */
body:not(.dark) .sb-link {
  color: #475569;
}
body:not(.dark) .sb-link:hover {
  background: #e2e8f0;
  color: #1e293b;
}
body:not(.dark) .sb-link.sb-active {
  background: #e0e7ff;
  color: #4f46e5;
}

/* ── Light sidebar scrollbar ── */
body:not(.dark) .sb-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

/* ── Light sidebar section labels ── */
body:not(.dark) .sb-section-label {
  color: #94a3b8;
}

/* ── Light sidebar bottom bar ── */
body:not(.dark) .sb-bottom {
  border-top: 1px solid #e2e8f0;
}

/* ── Light mobile topbar ── */
body:not(.dark) .sb-topbar {
  background: #e8edf3;
  border-bottom: 1px solid #e2e8f0;
}
body:not(.dark) .sb-hamburger {
  color: #475569;
}

/* ── Light sidebar section divider ── */
body:not(.dark) .sb-section-divider {
  background: #e2e8f0;
}

/* ── Light form inputs (select & textarea) ── */
body:not(.dark) .form-group select,
body:not(.dark) textarea {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #1e293b;
}

/* ── Light cards ── */
body:not(.dark) .card {
  background: #e8edf3;
  border-color: #e2e8f0;
}
body:not(.dark) .card h3 {
  color: #475569;
}
body:not(.dark) .main-content {
  background: #e2e8f0;
}

/* ── Light auth wrap ── */
body:not(.dark) .auth-wrap {
  background: #e2e8f0;
}

/* ── Light upload zone ── */
body:not(.dark) .upload-zone:hover,
body:not(.dark) .upload-zone.drag-active {
  background: #eef2ff;
}

/* ── Light pipeline columns ── */
body:not(.dark) .pipeline-col {
  background: #e2e8f0;
}
body:not(.dark) .pipeline-card {
  background: #e8edf3;
}
body:not(.dark) .pipeline-card h4 {
  color: #1e293b;
}
body:not(.dark) .pipeline-col.drag-over {
  background: #e0e7ff;
}

/* ── Light reminder cards ── */
body:not(.dark) .reminder-card {
  background: #e8edf3;
}

/* ── Light sequence steps ── */
body:not(.dark) .seq-step {
  background: #e8edf3;
  border-color: #e2e8f0;
}

/* ── Light table rows ── */
body:not(.dark) table th {
  color: #64748b;
  border-color: #e2e8f0;
}
body:not(.dark) table td {
  border-color: #f1f5f9;
}
body:not(.dark) tr:hover td {
  background: #e2e8f0;
}

/* ══════════════════════════════════════════
   COMPREHENSIVE MOBILE RESPONSIVENESS
   320px (small phone) → 1440px (large desktop)
   Only OVERRIDES — no desktop styles changed.
   ══════════════════════════════════════════ */

/* ── Tablet: 768px and below ── */
@media (max-width: 768px) {
  /* Dashboard container */
  .container { padding: 1.25rem; }

  /* Page titles */
  .page-title { font-size: 1.4rem; }
  .page-sub { font-size: 0.88rem; margin-bottom: 1.25rem; }

  /* Stats grid: 2 columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

  /* Feature grid */
  .feature-grid { grid-template-columns: 1fr; }

  /* Pricing grid (global style.css version) */
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tables: horizontal scroll — wrap table in overflow container */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card { overflow-x: auto; }
  table { min-width: 500px; }

  /* Form inputs full width */
  .search-form { flex-direction: column; }
  .form-group { min-width: 100%; }

  /* Result cards stack */
  .result-card { flex-direction: column; align-items: stretch; }
  .issue-score { text-align: left; }

  /* Pipeline: horizontal scroll */
  .pipeline-board { min-height: 400px; }
  .pipeline-col { min-width: 220px; }

  /* Weight row on scoring settings */
  .weight-row { flex-wrap: wrap; }
  .weight-row input[type=range] { width: 100%; }

  /* Auth card */
  .auth-card { padding: 1.75rem; margin: 0 1rem; }

  /* Hero section */
  .hero { padding: 3.5rem 1.25rem; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1.05rem; }
}

/* ── Small phone: 640px and below ── */
@media (max-width: 640px) {
  /* Reduce base font */
  body { font-size: 0.92rem; }

  /* Further reduce container padding */
  .container { padding: 1rem 0.75rem; }

  /* Stats grid: still 2 cols */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-number { font-size: 1.6rem; }
  .stat-label { font-size: 0.72rem; }
  .stat-card { padding: 0.9rem; }

  /* Cards: single column */
  .feature-grid { grid-template-columns: 1fr; gap: 1rem; }
  .feature-card { padding: 1.25rem; }

  /* Pricing grid: single column */
  .pricing-grid { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }

  /* Buttons and badges */
  .btn { font-size: 0.85rem; padding: 0.45rem 1rem; }
  .badge { font-size: 0.7rem; }

  /* Filters wrap */
  .filters { gap: 0.5rem; }
  .filter-btn { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

  /* Table cells tighter */
  th, td { padding: 0.5rem 0.6rem; font-size: 0.82rem; }

  /* Hero */
  .hero { padding: 2.5rem 1rem; }
  .hero h1 { font-size: 1.7rem; }
  .hero p { font-size: 0.95rem; margin-bottom: 1.5rem; }
  .hero-btns { flex-direction: column; align-items: center; }
  .hero-btns .btn, .hero-btns a { width: 100%; max-width: 300px; text-align: center; }

  /* Cards: reduce padding */
  .card { padding: 1rem; margin-bottom: 1rem; }
  .card h3 { font-size: 0.75rem; }

  /* SEO score ring */
  .seo-score-ring { width: 80px; height: 80px; font-size: 1.6rem; }

  /* SEO check */
  .seo-check { flex-wrap: wrap; }
  .seo-check-val { max-width: 100%; text-align: left; }

  /* Grade badge */
  .grade-badge { width: 36px; height: 36px; font-size: 1.1rem; }

  /* Upload zone */
  .upload-zone { padding: 2rem 1rem; }

  /* Reminder cards */
  .reminder-card { padding: 0.75rem 1rem; gap: 0.75rem; }

  /* Map */
  #lead-map { height: 350px; }

  /* Sequence builder */
  .seq-step { padding: 0.75rem; }

  /* Page title */
  .page-title { font-size: 1.2rem; }
}

/* ── Very small phone: 380px and below ── */
@media (max-width: 380px) {
  .container { padding: 0.75rem 0.5rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 0.75rem; }
  .stat-number { font-size: 1.4rem; }
  .page-title { font-size: 1.1rem; }
  .card { padding: 0.75rem; }
  th, td { padding: 0.4rem; font-size: 0.78rem; }
  .hero h1 { font-size: 1.5rem; }
  .auth-card { padding: 1.25rem 1rem; }
  #lead-map { height: 280px; }
}
