:root {
  --bg: #07111f;
  --bg-soft: #0d1728;
  --panel: rgba(13, 23, 40, 0.82);
  --panel-strong: rgba(10, 18, 32, 0.96);
  --line: rgba(148, 163, 184, 0.16);
  --text: #e5eefc;
  --muted: #8fa4c5;
  --accent: #5eead4;
  --accent-2: #60a5fa;
  --good: #34d399;
  --warn: #f59e0b;
  --bad: #fb7185;
  --shadow: 0 28px 80px rgba(2, 8, 23, 0.45);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(94, 234, 212, 0.12), transparent 24%),
    linear-gradient(180deg, #09111f 0%, #050b16 100%);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  min-height: 100vh;
  padding: 2rem 1.2rem;
  border-right: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.8);
  backdrop-filter: blur(20px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04111e;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand-block h1,
.topbar h2,
.section-heading h3,
.hero-card h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 0.45rem;
}

.nav-link {
  padding: 0.9rem 1rem;
  border-radius: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(96, 165, 250, 0.12);
  color: var(--text);
}

.sidebar-card,
.panel,
.hero-card,
.kpi-card,
.stream-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar-card {
  padding: 1rem;
}

.sidebar-card__label {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.sidebar-card__value {
  display: block;
  margin-bottom: 0.45rem;
}

.sidebar-card__body,
.topbar__subtitle,
.hero-card p,
.kpi-card p,
.mini-stat span,
.summary-pill span,
.table-empty,
.panel-subtle {
  color: var(--muted);
}

.main-content {
  padding: 2rem;
}

.topbar,
.section-heading,
.section-heading--spread,
.filter-row,
.inline-controls,
.topbar__actions,
.hero-card__chips,
.kpi-meta,
.kpi-meta__delta,
.kpi-grid,
.analytics-grid,
.stream-cards,
.summary-strip,
.report-highlights,
.blacklist-form,
.status-cluster,
.tag-list,
.table-actions {
  display: flex;
}

.topbar,
.section-heading--spread {
  justify-content: space-between;
  gap: 1rem;
}

.topbar {
  align-items: center;
  margin-bottom: 1.5rem;
}

.topbar__subtitle {
  max-width: 56rem;
  margin: 0.5rem 0 0;
}

.topbar__actions,
.inline-controls,
.filter-row,
.hero-card__chips,
.kpi-meta,
.tag-list,
.table-actions,
.status-cluster {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button,
.input,
.select {
  border-radius: 14px;
  border: 1px solid transparent;
}

.button {
  padding: 0.82rem 1.1rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(148, 163, 184, 0.1);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #07111f;
}

.button--ghost {
  border-color: var(--line);
  background: rgba(15, 23, 42, 0.55);
}

.button--small {
  padding: 0.62rem 0.9rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1.2rem;
  margin-bottom: 1.25rem;
}

.hero-card {
  padding: 1.4rem;
}

.hero-card--feature {
  background:
    linear-gradient(145deg, rgba(96, 165, 250, 0.16), rgba(94, 234, 212, 0.08)),
    var(--panel-strong);
}

.hero-card__chips span,
.tag,
.badge,
.summary-pill {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  font-size: 0.82rem;
}

.hero-card__chips span {
  background: rgba(15, 23, 42, 0.5);
}

.kpi-grid {
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  flex: 1 1 220px;
  min-width: 220px;
  padding: 1.15rem;
}

.kpi-card h3 {
  margin: 0.4rem 0 0.5rem;
  font-size: 1.9rem;
}

.kpi-meta {
  align-items: center;
  justify-content: space-between;
}

.kpi-meta__delta {
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.tone-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.tone-dot.good,
.badge.good {
  background: rgba(52, 211, 153, 0.18);
  color: #9ff4cf;
}

.tone-dot.warn,
.badge.warn {
  background: rgba(245, 158, 11, 0.18);
  color: #ffd08a;
}

.tone-dot.neutral,
.badge.neutral {
  background: rgba(96, 165, 250, 0.18);
  color: #b7d3ff;
}

.analytics-grid {
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.analytics-grid > .panel:first-child {
  flex: 1.15;
}

.analytics-grid > .panel:last-child {
  flex: 0.9;
}

.panel {
  padding: 1.2rem;
  margin-bottom: 1.25rem;
}

.section-heading {
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h3 {
  font-size: 1.2rem;
}

.trend-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.85rem;
  align-items: end;
  min-height: 260px;
}

.trend-column {
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 0.55rem;
  min-height: 100%;
}

.trend-bars {
  display: flex;
  align-items: end;
  gap: 0.35rem;
  min-height: 190px;
}

.trend-bar {
  flex: 1;
  border-radius: 16px 16px 6px 6px;
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.95), rgba(59, 130, 246, 0.35));
}

.trend-bar--secondary {
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.95), rgba(45, 212, 191, 0.32));
}

.trend-label {
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.trend-legend {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.trend-legend span::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 0.45rem;
  border-radius: 999px;
}

.trend-legend span:first-child::before {
  background: var(--accent-2);
}

.trend-legend span:last-child::before {
  background: var(--accent);
}

.insight-list {
  display: grid;
  gap: 0.8rem;
}

.insight-item {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--line);
}

.insight-item h4,
.stream-card h4,
.mini-stat strong {
  margin: 0 0 0.4rem;
}

.insight-item p,
.stream-card p,
.mini-stat span {
  margin: 0;
}

.stream-cards {
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.stream-card {
  flex: 1 1 230px;
  min-width: 220px;
  padding: 1rem;
}

.mini-stat {
  display: grid;
  gap: 0.18rem;
}

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.32);
}

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.table th {
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(15, 23, 42, 0.55);
}

.table tr:hover td {
  background: rgba(96, 165, 250, 0.05);
}

.tag-list {
  gap: 0.35rem;
}

.tag {
  padding: 0.22rem 0.55rem;
  background: rgba(148, 163, 184, 0.08);
}

.badge,
.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.badge.high {
  background: rgba(251, 113, 133, 0.18);
  color: #ffc2cf;
}

.badge.medium {
  background: rgba(245, 158, 11, 0.18);
  color: #ffd7a1;
}

.badge.low {
  background: rgba(52, 211, 153, 0.18);
  color: #b9f7dd;
}

.summary-strip,
.report-highlights {
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.summary-pill {
  background: rgba(15, 23, 42, 0.45);
}

.blacklist-form {
  flex-wrap: wrap;
  align-items: end;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.blacklist-form label {
  display: grid;
  gap: 0.45rem;
  flex: 1 1 220px;
}

.blacklist-form span {
  color: var(--muted);
  font-size: 0.88rem;
}

.input,
.select {
  width: 100%;
  padding: 0.82rem 0.95rem;
  border-color: var(--line);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
}

.input::placeholder {
  color: #6f85a8;
}

.input:focus,
.select:focus {
  outline: 2px solid rgba(94, 234, 212, 0.25);
  border-color: rgba(94, 234, 212, 0.45);
}

.table-empty {
  padding: 1rem;
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  min-width: 220px;
  max-width: 360px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(7, 17, 31, 0.94);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (max-width: 760px) {
  .main-content,
  .sidebar {
    padding: 1rem;
  }

  .topbar,
  .section-heading--spread {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-row {
    flex-direction: column;
  }

  .trend-chart {
    gap: 0.5rem;
  }

  .table th,
  .table td {
    padding: 0.8rem 0.7rem;
  }
}
