:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #047857;
  --amber: #b45309;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.loginOverlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.24), transparent 30%),
    rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
}

.loginOverlay.hidden {
  display: none;
}

.loginCard {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  background: white;
  box-shadow: var(--shadow);
}

.loginCard h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.loginCard p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.loginCard input {
  margin-bottom: 14px;
}

.loginCard button {
  width: 100%;
}

.loginError {
  margin-top: 12px !important;
  color: #b91c1c !important;
  font-size: 14px;
}

button,
input,
select {
  font: inherit;
}

.hero {
  padding: 28px max(24px, calc((100vw - 1180px) / 2)) 56px;
  color: white;
  background:
    radial-gradient(circle at top right, rgba(147, 197, 253, 0.42), transparent 35%),
    linear-gradient(135deg, #0f172a, #1e3a8a 55%, #2563eb);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 64px;
}

.nav select {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  padding: 8px 14px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.eyebrow {
  margin: 0 0 12px;
  color: #bfdbfe;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(36px, 7vw, 72px);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.subtitle {
  max-width: 680px;
  margin: 22px 0 0;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.6;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: -28px auto 64px;
}

.panel,
.stat,
.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  white-space: nowrap;
}

.check input {
  width: auto;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  color: white;
  background: var(--primary);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 14px;
  margin: 18px 0;
}

.charts {
  margin-bottom: 24px;
}

.chartGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
}

.chartCard {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #f9fafb;
}

.chartCard h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.barRow {
  display: grid;
  grid-template-columns: minmax(72px, 1fr) 2fr 32px;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.barTrack {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.barFill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.donut {
  width: 112px;
  height: 112px;
  margin: 8px auto 12px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) var(--value), #e5e7eb 0);
}

.donutLabel {
  text-align: center;
  color: var(--muted);
}

.stat {
  padding: 18px;
}

.stat span {
  display: block;
  margin-bottom: 4px;
  font-size: 34px;
  font-weight: 800;
}

.stat small {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 22px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

.summary {
  color: var(--muted);
  line-height: 1.55;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  border-radius: 999px;
  padding: 6px 10px;
  color: #1e40af;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 700;
}

.meta {
  display: grid;
  gap: 8px;
  margin-top: auto;
  color: var(--muted);
  font-size: 14px;
}

.meta strong {
  color: var(--text);
}

.sectionTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0;
}

.sectionTitle h2 {
  margin: 0;
}

.snippets {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.snippet {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #f9fafb;
}

dialog {
  width: min(760px, calc(100% - 28px));
  border: 0;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

.detailGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detailItem {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.detailItem small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
}

@media (max-width: 920px) {
  .filters,
  .grid,
  .chartGrid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
