/* ============================================================
   Njeru Executive Intelligence Dashboard
   Design System: Dark Navy + Gold (#0F172A / #D4AF37)
   ============================================================ */

:root {
  --nei-bg:        #0F172A;
  --nei-surface:   #1E293B;
  --nei-surface2:  #263248;
  --nei-border:    rgba(212,175,55,0.18);
  --nei-gold:      #D4AF37;
  --nei-gold-dim:  rgba(212,175,55,0.12);
  --nei-text:      #F1F5F9;
  --nei-muted:     #94A3B8;
  --nei-success:   #22C55E;
  --nei-warning:   #F59E0B;
  --nei-danger:    #EF4444;
  --nei-radius:    12px;
  --nei-shadow:    0 4px 24px rgba(0,0,0,0.45);
  --nei-font:      'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset & Base */
.nei-dashboard * { box-sizing: border-box; }
.nei-dashboard a { color: var(--nei-gold); text-decoration: none; }
.nei-dashboard a:hover { text-decoration: underline; }

/* Page shell */
.nei-page-wrap {
  background: var(--nei-bg);
  min-height: 100vh;
  font-family: var(--nei-font);
  color: var(--nei-text);
  padding: 0;
  margin: 0;
}

/* ── Hero ─────────────────────────────────────────────── */
.nei-hero {
  background: linear-gradient(135deg, #0F172A 0%, #1a2744 50%, #0F172A 100%);
  border-bottom: 1px solid var(--nei-border);
  padding: 60px 40px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.nei-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -20%, rgba(212,175,55,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.nei-hero-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--nei-gold);
  margin: 0 auto 20px;
  display: block;
  object-fit: cover;
  box-shadow: 0 0 32px rgba(212,175,55,0.3);
}
.nei-hero-badge {
  display: inline-block;
  background: var(--nei-gold-dim);
  color: var(--nei-gold);
  border: 1px solid var(--nei-border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.nei-hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.nei-hero h1 span { color: var(--nei-gold); }
.nei-hero-title {
  color: var(--nei-muted);
  font-size: 15px;
  margin: 0 0 24px;
  letter-spacing: 0.3px;
}
.nei-hero-bio {
  max-width: 640px;
  margin: 0 auto 28px;
  color: #CBD5E1;
  font-size: 15px;
  line-height: 1.7;
}
.nei-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--nei-gold);
  color: #0F172A;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 28px;
  border-radius: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.3px;
}
.nei-hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212,175,55,0.4);
  text-decoration: none;
}

/* ── Main Container ──────────────────────────────────── */
.nei-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 48px 24px;
}
.nei-section { margin-bottom: 56px; }
.nei-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.nei-section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.nei-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--nei-gold);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Period Selector ─────────────────────────────────── */
.nei-period-bar {
  background: var(--nei-surface);
  border: 1px solid var(--nei-border);
  border-radius: var(--nei-radius);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.nei-period-bar span { color: var(--nei-muted); font-size: 13px; margin-right: 4px; }
.nei-period-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--nei-muted);
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.nei-period-btn:hover { color: var(--nei-text); border-color: var(--nei-border); }
.nei-period-btn.active {
  background: var(--nei-gold);
  color: #0F172A;
  border-color: var(--nei-gold);
  font-weight: 700;
}

/* ── KPI Cards ───────────────────────────────────────── */
.nei-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.nei-kpi-card {
  background: var(--nei-surface);
  border: 1px solid var(--nei-border);
  border-radius: var(--nei-radius);
  padding: 24px 22px 20px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nei-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--nei-shadow);
}
.nei-kpi-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--nei-gold), transparent);
}
.nei-kpi-label {
  color: var(--nei-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.nei-kpi-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--nei-text);
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -1px;
}
.nei-kpi-value .nei-kpi-unit {
  font-size: 18px;
  font-weight: 600;
  color: var(--nei-gold);
  margin-left: 2px;
}
.nei-kpi-delta {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nei-kpi-delta.up   { color: var(--nei-success); }
.nei-kpi-delta.down { color: var(--nei-danger); }
.nei-kpi-delta.flat { color: var(--nei-muted); }

/* ── Charts ──────────────────────────────────────────── */
.nei-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .nei-chart-grid { grid-template-columns: 1fr; } }
.nei-chart-card {
  background: var(--nei-surface);
  border: 1px solid var(--nei-border);
  border-radius: var(--nei-radius);
  padding: 24px;
}
.nei-chart-card.full { grid-column: 1 / -1; }
.nei-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.nei-chart-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--nei-text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.nei-chart-container { width: 100%; height: 280px; }
.nei-chart-container.tall { height: 380px; }

/* ── Posts Table ─────────────────────────────────────── */
.nei-posts-table-wrap { overflow-x: auto; }
.nei-posts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.nei-posts-table th {
  background: var(--nei-surface2);
  color: var(--nei-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 11px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--nei-border);
  white-space: nowrap;
}
.nei-posts-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148,163,184,0.08);
  vertical-align: middle;
  color: var(--nei-text);
}
.nei-posts-table tr:hover td { background: rgba(212,175,55,0.03); }
.nei-post-title-cell { max-width: 320px; }
.nei-post-title {
  font-weight: 600;
  color: var(--nei-text);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nei-post-meta { color: var(--nei-muted); font-size: 11px; }
.nei-post-link {
  color: var(--nei-gold);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* ── Category Pills ──────────────────────────────────── */
.nei-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.nei-category-card {
  background: var(--nei-surface);
  border: 1px solid var(--nei-border);
  border-radius: var(--nei-radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nei-category-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--nei-gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.nei-category-info { flex: 1; min-width: 0; }
.nei-category-name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nei-category-stats {
  color: var(--nei-muted);
  font-size: 12px;
  display: flex;
  gap: 12px;
}

/* ── AI Insights ─────────────────────────────────────── */
.nei-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.nei-insight-card {
  background: var(--nei-surface);
  border: 1px solid var(--nei-border);
  border-left: 4px solid var(--nei-gold);
  border-radius: var(--nei-radius);
  padding: 22px 24px;
  position: relative;
}
.nei-insight-type {
  color: var(--nei-gold);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}
.nei-insight-text {
  color: #CBD5E1;
  font-size: 14px;
  line-height: 1.65;
}
.nei-insight-confidence {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nei-insight-confidence-bar {
  flex: 1;
  height: 4px;
  background: rgba(148,163,184,0.15);
  border-radius: 2px;
  overflow: hidden;
}
.nei-insight-confidence-fill {
  height: 100%;
  background: var(--nei-gold);
  border-radius: 2px;
  transition: width 1s ease;
}
.nei-insight-confidence-pct {
  color: var(--nei-muted);
  font-size: 11px;
  white-space: nowrap;
}

/* ── Contact Banner ──────────────────────────────────── */
.nei-contact-section {
  background: linear-gradient(135deg, var(--nei-surface) 0%, var(--nei-surface2) 100%);
  border: 1px solid var(--nei-border);
  border-radius: var(--nei-radius);
  padding: 48px 40px;
  text-align: center;
}
.nei-contact-section h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 10px;
}
.nei-contact-section h2 span { color: var(--nei-gold); }
.nei-contact-sub { color: var(--nei-muted); margin: 0 0 32px; font-size: 15px; }
.nei-contact-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.nei-btn-primary {
  background: var(--nei-gold);
  color: #0F172A;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nei-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212,175,55,0.4);
  text-decoration: none;
}
.nei-btn-secondary {
  background: transparent;
  color: var(--nei-gold);
  border: 1px solid var(--nei-gold);
  font-weight: 600;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nei-btn-secondary:hover {
  background: var(--nei-gold-dim);
  text-decoration: none;
}

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

/* ── Pill badges ─────────────────────────────────────── */
.nei-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.3px;
}
.nei-pill-text     { background: rgba(99,102,241,0.15); color: #818CF8; }
.nei-pill-article  { background: rgba(212,175,55,0.15); color: var(--nei-gold); }
.nei-pill-image    { background: rgba(34,197,94,0.12); color: var(--nei-success); }
.nei-pill-video    { background: rgba(239,68,68,0.12); color: var(--nei-danger); }
.nei-pill-carousel { background: rgba(245,158,11,0.12); color: var(--nei-warning); }

/* ── Not Connected State ─────────────────────────────── */
.nei-not-connected {
  text-align: center;
  padding: 80px 20px;
}
.nei-not-connected-icon {
  font-size: 64px;
  margin-bottom: 20px;
}
.nei-not-connected h2 { font-size: 24px; margin-bottom: 10px; }
.nei-not-connected p  { color: var(--nei-muted); max-width: 480px; margin: 0 auto 28px; }

/* ── Number formatting ───────────────────────────────── */
.nei-num { font-variant-numeric: tabular-nums; }

/* ── Footer ──────────────────────────────────────────── */
.nei-dashboard-footer {
  border-top: 1px solid var(--nei-border);
  padding: 28px 24px;
  text-align: center;
  color: var(--nei-muted);
  font-size: 12px;
  background: var(--nei-bg);
}
.nei-dashboard-footer a { color: var(--nei-muted); }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .nei-hero { padding: 40px 20px 36px; }
  .nei-container { padding: 32px 16px; }
  .nei-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .nei-contact-section { padding: 36px 20px; }
  .nei-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .nei-kpi-grid { grid-template-columns: 1fr; }
}
