:root {
  --bg: #0a0a0a;
  --bg-card: #111;
  --bg-hover: #1a1a1a;
  --border: #222;
  --text: #e5e5e5;
  --text-muted: #666;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --twitter: #1da1f2;
  --reddit: #ff4500;
  --tiktok: #00f2ea;
  --youtube: #ff0000;
  --rss: #f26522;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

[x-cloak] { display: none !important; }

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left { display: flex; align-items: center; gap: 2rem; }

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
}

.nav { display: flex; gap: 0.25rem; }

.nav button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.15s;
}

.nav button:hover { background: var(--bg-hover); color: var(--text); }
.nav button.active { background: var(--accent); color: #fff; }

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover { background: var(--bg-hover); color: var(--text); }
.btn-icon:disabled { opacity: 0.5; cursor: not-allowed; }

.icon { width: 20px; height: 20px; fill: currentColor; }
.icon.spin { animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Main */
.main { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

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

.card-title { font-size: 0.875rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.stat-card.accent { border-color: var(--accent); }
.stat-card.warning { border-color: var(--warning); }

.stat-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.bar-list { display: flex; flex-direction: column; gap: 0.75rem; }

.bar-item { display: flex; align-items: center; gap: 0.75rem; }

.bar-label { width: 80px; font-size: 0.75rem; color: var(--text-muted); text-transform: capitalize; }

.bar-track { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }

.bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.bar-fill.misinfo { background: var(--warning); }
.bar-fill.hate, .bar-fill.threat { background: var(--danger); }
.bar-fill.abuse { background: #f97316; }
.bar-fill.explicit { background: #ec4899; }
.bar-fill.spam { background: #8b5cf6; }

.bar-value { width: 50px; text-align: right; font-size: 0.875rem; font-weight: 500; }

/* Alerts */
.alert-list { display: flex; flex-direction: column; gap: 0.75rem; }

.alert-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.15s;
}

.alert-item:hover { border-color: var(--accent); background: var(--bg-hover); }

.alert-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }

.alert-content {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.alert-footer { display: flex; justify-content: space-between; align-items: center; }

.alert-author { font-size: 0.75rem; color: var(--accent); }

.engagement { font-size: 0.75rem; color: var(--text-muted); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  background: var(--bg-hover);
  color: var(--text-muted);
}

.badge.twitter { background: var(--twitter); color: #fff; }
.badge.reddit { background: var(--reddit); color: #fff; }
.badge.tiktok { background: var(--tiktok); color: #000; }
.badge.youtube { background: var(--youtube); color: #fff; }
.badge.rss { background: var(--rss); color: #fff; }

.badge.new { background: var(--accent); color: #fff; }
.badge.reviewed { background: var(--success); color: #fff; }
.badge.escalated { background: var(--warning); color: #000; }
.badge.dismissed { background: var(--text-muted); color: #fff; }

.badge.low { background: #374151; color: #9ca3af; }
.badge.medium { background: #1e40af; color: #93c5fd; }
.badge.high { background: #92400e; color: #fcd34d; }
.badge.critical { background: #991b1b; color: #fca5a5; }

.badge.misinfo { background: #78350f; color: #fde68a; }
.badge.hate { background: #7f1d1d; color: #fca5a5; }
.badge.threat { background: #7f1d1d; color: #fca5a5; }
.badge.abuse { background: #7c2d12; color: #fdba74; }
.badge.explicit { background: #831843; color: #f9a8d4; }
.badge.spam { background: #4c1d95; color: #c4b5fd; }
.badge.other { background: #374151; color: #9ca3af; }

.badge.active { background: var(--success); color: #fff; }
.badge.inactive { background: var(--text-muted); color: #fff; }

/* Tags */
.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin: 0.125rem;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.toolbar h2 { font-size: 1.25rem; font-weight: 600; }

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.filters select, .search input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
}

.filters select:focus, .search input:focus {
  outline: none;
  border-color: var(--accent);
}

.search input { width: 200px; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

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

.btn-secondary { background: var(--bg-hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-muted); }

.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.btn-sm.danger { color: var(--danger); }
.btn-sm.danger:hover { background: var(--danger); color: #fff; }

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.topic-card .keywords { margin: 1rem 0; }
.topic-card .platforms { margin-bottom: 1rem; display: flex; gap: 0.25rem; }
.topic-card .card-actions { display: flex; gap: 0.5rem; }

/* Table */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th, .table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.table tr:hover td { background: var(--bg-hover); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 200;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 1rem; font-weight: 600; }

.modal-body { padding: 1.25rem; }

.detail-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.detail-author { margin-bottom: 1rem; }
.detail-content { padding: 1rem; background: var(--bg); border-radius: var(--radius); margin-bottom: 1rem; white-space: pre-wrap; font-size: 0.875rem; }
.detail-summary { padding: 1rem; background: var(--bg); border-radius: var(--radius); margin-bottom: 1rem; border-left: 3px solid var(--accent); }
.detail-summary h4 { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.detail-stats { display: flex; gap: 1.5rem; margin-bottom: 1rem; font-size: 0.875rem; color: var(--text-muted); }
.detail-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.detail-actions select { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem; color: var(--text); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  color: var(--text);
  font-size: 0.875rem;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--accent); }

.checkbox-group { display: flex; gap: 1rem; flex-wrap: wrap; }
.checkbox-group label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; }

.form-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.5rem; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pagination button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  color: var(--text);
  cursor: pointer;
}

.pagination button:hover:not(:disabled) { border-color: var(--accent); }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

.text-muted { color: var(--text-muted); font-size: 0.75rem; }

/* Responsive */
@media (max-width: 768px) {
  .header { flex-direction: column; gap: 0.75rem; padding: 0.75rem; }
  .header-left { flex-direction: column; gap: 0.5rem; }
  .nav { width: 100%; justify-content: center; }
  .main { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { flex-direction: column; }
  .search input { width: 100%; }
}
