/* ============================================================
   CoordScan Dashboard — Global Styles
   Dark glass-morphism theme with purple-blue-violet palette
   ============================================================ */

/* ── Design Tokens ── */
:root {
  --bg-base:        #0a0b14;
  --bg-surface:     #0f1020;
  --bg-card:        rgba(255,255,255,0.04);
  --bg-card-hover:  rgba(255,255,255,0.07);
  --bg-glass:       rgba(15,16,32,0.85);
  --border:         rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.14);

  --accent-primary: #06b6d4;
  --accent-purple:  #0ea5e9;
  --accent-violet:  #818cf8;
  --accent-blue:    #38bdf8;
  --accent-cyan:    #22d3ee;

  --high:     #34d399;
  --high-bg:  rgba(52,211,153,0.12);
  --review:   #fbbf24;
  --review-bg: rgba(251,191,36,0.12);
  --reject:   #f87171;
  --reject-bg: rgba(248,113,113,0.12);

  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  --sidebar-w: 240px;
  --header-h:  72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(129,140,248,0.15);

  --transition: 0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background Decorations ── */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(129,140,248,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129,140,248,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(120px);
  z-index: 0;
}

.bg-glow-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  left: -100px;
  background: radial-gradient(ellipse, rgba(6,182,212,0.10) 0%, transparent 70%);
}

.bg-glow-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  right: -100px;
  background: radial-gradient(ellipse, rgba(14,165,233,0.08) 0%, transparent 70%);
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-glass);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: rgba(129,140,248,0.12);
  border: 1px solid rgba(129,140,248,0.25);
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #22d3ee, #0ea5e9, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}

.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.3px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all var(--transition);
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(129,140,248,0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(129,140,248,0.2);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: rgba(129,140,248,0.2);
  color: var(--accent-primary);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
}

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

.file-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}

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

.status-empty { background: var(--text-muted); }
.status-loaded { background: var(--high); box-shadow: 0 0 6px var(--high); animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text { color: var(--text-secondary); }

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Top Header ── */
.top-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,11,20,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left { display: flex; flex-direction: column; gap: 2px; }

.page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  min-width: 200px;
  color: var(--text-secondary);
  transition: border-color var(--transition);
}

.search-bar:focus-within {
  border-color: rgba(129,140,248,0.4);
}

.search-bar input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  width: 100%;
  font-family: 'Inter', sans-serif;
}

.search-bar input::placeholder { color: var(--text-muted); }

.upload-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  box-shadow: 0 0 20px rgba(6,182,212,0.3);
}

.upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 30px rgba(6,182,212,0.45);
}

/* ── Views ── */
.view {
  padding: 28px;
  animation: fadeIn 0.25s ease;
}

.view.active { display: block; }

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

/* ── Landing ── */
.landing-center {
  min-height: calc(100vh - var(--header-h) - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.landing-icon {
  margin-bottom: 28px;
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(129,140,248,0.4));
}

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

.landing-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
  background: linear-gradient(135deg, var(--text-primary) 0%, #22d3ee 50%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.landing-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.landing-desc code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(129,140,248,0.12);
  border: 1px solid rgba(129,140,248,0.2);
  color: var(--accent-primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.landing-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #06b6d4, #0ea5e9);
  color: white;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 0 40px rgba(6,182,212,0.35);
  margin-bottom: 32px;
}

.landing-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 50px rgba(6,182,212,0.5);
}

.landing-features {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.feature-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.chip-high    { background: var(--high); }
.chip-review  { background: var(--review); }
.chip-neutral { background: var(--accent-primary); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.full-width { grid-column: 1 / -1; }

/* ── Stat Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-color, linear-gradient(90deg, var(--accent-primary), var(--accent-violet)));
}

.stat-total { --accent-color: linear-gradient(90deg, #06b6d4, #0ea5e9); }
.stat-high  { --accent-color: linear-gradient(90deg, #34d399, #10b981); }
.stat-review { --accent-color: linear-gradient(90deg, #fbbf24, #f59e0b); }
.stat-posts  { --accent-color: linear-gradient(90deg, #38bdf8, #0ea5e9); }
.stat-avg    { --accent-color: linear-gradient(90deg, #22d3ee, #06b6d4); }
.stat-max    { --accent-color: linear-gradient(90deg, #818cf8, #6366f1); }

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

.stat-icon {
  color: var(--text-muted);
  width: 22px;
  height: 22px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(135deg, var(--text-primary), #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Overview Grid ── */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 240px;
}

.donut-chart-container {
  max-width: 180px;
  height: 180px;
}

.donut-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
}

.donut-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.top-clusters-card { margin-top: 0; }

.top-clusters-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-cluster-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.top-cluster-item:hover {
  background: rgba(129,140,248,0.06);
  border-color: rgba(129,140,248,0.3);
  transform: translateX(4px);
}

.tc-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.tc-score-bar-wrapper {
  flex: 1;
}

.tc-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.tc-score-bar {
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.tc-score-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #06b6d4, #0ea5e9);
  transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

.tc-score-fill.high { background: linear-gradient(90deg, #34d399, #10b981); }
.tc-score-fill.review { background: linear-gradient(90deg, #fbbf24, #f59e0b); }

.tc-score-text {
  font-size: 14px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.tc-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-high   { background: var(--high-bg); color: var(--high); }
.badge-review { background: var(--review-bg); color: var(--review); }
.badge-not    { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* ── Clusters View ── */
.clusters-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-chips {
  display: flex;
  gap: 8px;
}

.filter-chip {
  padding: 7px 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

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

.filter-chip.active {
  background: rgba(6,182,212,0.15);
  border-color: rgba(6,182,212,0.4);
  color: var(--accent-primary);
}

.chip-high-btn.active   { background: var(--high-bg); border-color: var(--high); color: var(--high); }
.chip-review-btn.active { background: var(--review-bg); border-color: var(--review); color: var(--review); }
.chip-not-btn.active    { background: rgba(255,255,255,0.05); border-color: var(--border-strong); color: var(--text-secondary); }

.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.sort-controls select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  outline: none;
}

.clusters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.cluster-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.cluster-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--card-accent, var(--border));
  border-radius: 0 2px 2px 0;
}

.cluster-card.card-high   { --card-accent: var(--high); }
.cluster-card.card-review { --card-accent: var(--review); }
.cluster-card.card-not    { --card-accent: var(--text-muted); }

.cluster-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cluster-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cluster-rank {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.cluster-id {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.cluster-score-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.cluster-score-big {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}

.score-high   { color: var(--high); }
.score-review { color: var(--review); }
.score-not    { color: var(--text-secondary); }

.cluster-score-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.cluster-bar {
  height: 5px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.cluster-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

.cluster-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.cluster-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.cluster-stat svg { color: var(--accent-primary); opacity: 0.6; }

.load-more-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

/* ── Button Secondary ── */
.btn-secondary {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* ── Analytics ── */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Heatmap ── */
.heatmap-card { padding: 24px; }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.heatmap-gradient {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #1a1a2e 0%, #7c3aed 30%, #a78bfa 60%, #34d399 80%, #fbbf24 100%);
}

.legend-label {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 28px);
  gap: 4px;
}

.heatmap-cell {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition);
  position: relative;
  flex-shrink: 0;
}

.heatmap-cell:hover {
  transform: scale(1.3);
  z-index: 10;
}

/* ── Inspector ── */
.inspector-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  height: calc(100vh - var(--header-h) - 60px);
}

.inspector-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inspector-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.inspector-search input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  width: 100%;
  font-family: 'Inter', sans-serif;
}

.inspector-search input::placeholder { color: var(--text-muted); }

.inspector-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.inspector-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.inspector-item:hover {
  background: rgba(255,255,255,0.04);
}

.inspector-item.selected {
  background: rgba(6,182,212,0.1);
  border-color: rgba(6,182,212,0.3);
}

.insp-rank {
  font-size: 10px;
  color: var(--text-muted);
  width: 22px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.insp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.insp-dot.high   { background: var(--high); }
.insp-dot.review { background: var(--review); }
.insp-dot.not    { background: var(--text-muted); }

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

.insp-posts {
  font-size: 11.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.insp-score {
  font-size: 10.5px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.inspector-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inspector-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.detail-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.detail-section {
  margin-bottom: 22px;
}

.detail-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.score-components {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.score-comp {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.score-comp-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-comp-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.score-comp-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #06b6d4, #0ea5e9);
}

.score-comp-val {
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
}

.post-ids-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-id-chip {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.post-id-chip:hover {
  background: rgba(129,140,248,0.1);
  border-color: rgba(129,140,248,0.3);
  color: var(--accent-primary);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-md), 0 0 40px rgba(6,182,212,0.15);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.modal-close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px 0 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition);
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.modal-content { padding: 24px; }

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.modal-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-score {
  font-size: 42px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -2px;
  line-height: 1;
}

.modal-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-meta-item {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-meta-item strong { color: var(--text-primary); }

.modal-section { margin-bottom: 18px; }

.modal-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.post-id-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.modal-pill {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  color: var(--text-secondary);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Scrollbar styling ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --sidebar-w: 64px; }
  .logo-text, .nav-item span:not(.nav-icon):not(.nav-badge) { display: none; }
  .nav-badge { display: none; }
  .sidebar-footer { display: none; }
  .logo-icon { margin: 0 auto; }
  .sidebar-logo { justify-content: center; padding: 16px; }
  .nav-item { justify-content: center; }
  .inspector-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .view { padding: 16px; }
  .top-header { padding: 0 16px; }
}
