:root{
  --bg:#0b1220;
  --panel:#121a2b;
  --border:rgba(255,255,255,.08);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.65);
  --radius:16px;
  --gap:14px;
}

*{ box-sizing:border-box }

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.page{
  padding:16px;
  max-width:1400px;
  margin:0 auto;
}

.topbar{
  padding:10px 4px 18px;
}

.topbar h1{
  margin:0;
  font-size:20px;
  font-weight:700;
}

.subtitle{
  margin-top:4px;
  font-size:13px;
  color:var(--muted);
}

/* ===== GRID ===== */
.grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--gap);
}

@media(max-width:720px){
  .grid{ grid-template-columns:1fr }
}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  min-height:320px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.card-header{
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  gap:10px;
}

.card-title{
  margin:0;
  font-size:14px;
  font-weight:700;
}

.card-meta{
  font-size:12px;
  color:var(--muted);
}

.card-body{
  flex:1;
  padding:14px;
  display:grid;
  place-items:center;
}

/* skeleton loader */
.skeleton{
  width:100%;
  height:240px;
  border-radius:12px;
  background:linear-gradient(
    90deg,
    rgba(255,255,255,.06),
    rgba(255,255,255,.12),
    rgba(255,255,255,.06)
  );
  background-size:200% 100%;
  animation:shimmer 1.2s infinite linear;
}

@keyframes shimmer{
  from{ background-position:200% 0 }
  to{ background-position:-200% 0 }
}

/* span both columns */
.span-2{ grid-column:span 2 }
@media(max-width:720px){
  .span-2{ grid-column:span 1 }
}
.chart-wrap{
  width:100%;
}

.chart-error{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.04);
  font-size: 13px;
}
.chart-controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.chip{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.75);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.chip.is-active{
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
}

.date-range{
  display:flex;
  align-items:center;
  gap:8px;
}

.date-input{
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.12);
  color: rgba(255,255,255,.88);
  padding: 6px 8px;
  border-radius: 10px;
  font-size: 12px;
}

.date-sep{ color: rgba(255,255,255,.55); font-size: 12px; }

.chart-wrap{ width:100%; position:relative; }
.chart-error{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.04);
  font-size: 13px;
}

.chart-pop{
  position:absolute;
  min-width: 200px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10, 16, 28, 0.92);
  color: rgba(255,255,255,.92);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
}

.pop-title{
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.pop-year{ font-weight: 600; color: rgba(255,255,255,.7); }

.pop-row{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  font-size: 12px;
  padding: 2px 0;
}
.pop-row span{ color: rgba(255,255,255,.65); }
.pop-row b{ font-weight: 800; }
