/* Content ROI Lite — Minimal Dark UI */
/* Brand: primary #6366F1, accent #10B981, bg-dark #0F172A */

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

:root {
  --primary:    #6366F1;
  --primary-h:  #4F46E5;
  --accent:     #10B981;
  --bg:         #0F172A;
  --bg-card:    #1E293B;
  --bg-hover:   #263245;
  --border:     #334155;
  --text:       #F1F5F9;
  --text-muted: #94A3B8;
  --green:      #10B981;
  --yellow:     #F59E0B;
  --red:        #EF4444;
  --radius:     10px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
}

html { font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Typography ─── */
h1, h2, h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: 1.2rem; }

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

/* ─── Layout ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── Nav ─── */
nav {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.logo span { color: var(--primary); }
.nav-cta {
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--primary-h); color: #fff; }

/* ─── Hero ─── */
.hero {
  padding: 6rem 0 4rem;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero h1 {
  margin-bottom: 1.25rem;
  max-width: 800px;
  margin-left: auto; margin-right: auto;
}
.hero h1 em { color: var(--primary); font-style: normal; }
.hero-sub {
  color: var(--text-muted);
  font-size: 1.2rem;
  max-width: 580px;
  margin: 0 auto 2.5rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #059669; color: #fff; }

/* ─── Demo Preview ─── */
.demo-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 860px;
  margin: 3rem auto 0;
  box-shadow: var(--shadow);
}
.demo-bar {
  background: var(--bg);
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.demo-dot { width: 12px; height: 12px; border-radius: 50%; }
.demo-dot.red { background: #EF4444; }
.demo-dot.yellow { background: #F59E0B; }
.demo-dot.green { background: #10B981; }
.demo-url {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0.5rem;
}

/* ─── Pain / Solution ─── */
.features { padding: 5rem 0; }
.section-label {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}
.section-title { margin-bottom: 0.75rem; }
.section-sub { color: var(--text-muted); max-width: 520px; margin-bottom: 3rem; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}
.feature-card h3 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-muted); font-size: 0.95rem; }

/* ─── How It Works ─── */
.how-it-works { padding: 5rem 0; border-top: 1px solid var(--border); }
.steps { display: flex; flex-direction: column; gap: 2rem; max-width: 620px; }
.step { display: flex; gap: 1.25rem; align-items: flex-start; }
.step-num {
  background: var(--primary);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.step-text h3 { margin-bottom: 0.3rem; }
.step-text p { color: var(--text-muted); font-size: 0.95rem; }

/* ─── Pricing ─── */
.pricing { padding: 5rem 0; border-top: 1px solid var(--border); text-align: center; }
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 400px;
  margin: 2.5rem auto 0;
  box-shadow: 0 0 40px rgba(99,102,241,0.15);
}
.price-tag { font-size: 3rem; font-weight: 800; margin: 0.5rem 0; }
.price-tag span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.price-desc { color: var(--text-muted); margin-bottom: 1.75rem; }
.price-features { list-style: none; text-align: left; margin-bottom: 2rem; }
.price-features li { padding: 0.4rem 0; color: var(--text-muted); font-size: 0.95rem; }
.price-features li::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* ─── CTA Banner ─── */
.cta-banner {
  padding: 5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.cta-banner h2 { margin-bottom: 1rem; }
.cta-banner p { color: var(--text-muted); margin-bottom: 2rem; font-size: 1.1rem; }

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ─────────────────────────────────────────── */
/* DASHBOARD PAGE */
/* ─────────────────────────────────────────── */

.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.5rem 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.sidebar-logo span { color: var(--primary); }
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 0.25rem; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
}
.demo-badge {
  margin-top: 2rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  padding: 0.75rem;
  font-size: 0.8rem;
  color: var(--accent);
  text-align: center;
}

.main-content { padding: 2rem 2rem 3rem; overflow-x: hidden; }

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.dash-header h1 { font-size: 1.6rem; }
.dash-header p { color: var(--text-muted); font-size: 0.9rem; }

/* ─── Summary cards ─── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.summary-card .label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.summary-card .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.summary-card .sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.summary-card.highlight { border-color: var(--primary); }
.summary-card.highlight .value { color: var(--primary); }

/* ─── Dashboard Table ─── */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.table-header h2 { font-size: 1rem; font-weight: 600; }
.table-actions { display: flex; gap: 0.75rem; align-items: center; }

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  border-radius: 6px;
}

#data-table {
  width: 100%;
  border-collapse: collapse;
}
#data-table th {
  text-align: left;
  padding: 0.85rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
#data-table th:hover { color: var(--text); }
#data-table th.sorted { color: var(--primary); }

#data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(51,65,85,0.5);
  font-size: 0.9rem;
  vertical-align: middle;
}
#data-table tr:last-child td { border-bottom: none; }
#data-table tr:hover td { background: var(--bg-hover); }

.video-title {
  font-weight: 500;
  max-width: 320px;
}
.video-date { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.views-num { font-variant-numeric: tabular-nums; }
.revenue-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.revenue-num.positive { color: var(--accent); }
.revenue-num.zero { color: var(--text-muted); }
.rpv { font-size: 0.8rem; color: var(--text-muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-utm { background: rgba(16,185,129,0.15); color: var(--accent); border: 1px solid rgba(16,185,129,0.3); }
.badge-estimated { background: rgba(245,158,11,0.15); color: #F59E0B; border: 1px solid rgba(245,158,11,0.3); }
.badge-none { background: rgba(148,163,184,0.1); color: var(--text-muted); border: 1px solid var(--border); }

/* ─── Loading / Error states ─── */
#loading-state { padding: 3rem; text-align: center; color: var(--text-muted); }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
#error-state { padding: 2rem; text-align: center; color: var(--red); display: none; }
#empty-state { padding: 3rem; text-align: center; color: var(--text-muted); display: none; }

/* ─── Toast ─── */
#toast {
  position: fixed;
  bottom: 2rem; right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1.25rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  z-index: 9999;
  max-width: 320px;
}
#toast.show { opacity: 1; pointer-events: auto; }
#toast.success { border-color: var(--accent); color: var(--accent); }
#toast.error { border-color: var(--red); color: var(--red); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .dash-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 1.25rem; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  #data-table th:nth-child(4),
  #data-table td:nth-child(4) { display: none; }
}

@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr; }
}
