* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #f6f9fc 0%, #e9f0f8 100%);
  color: #1f2937;
  min-height: 100vh;
}

header {
  background: white;
  padding: 20px 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 16px;
}
header h1 { margin: 0; font-size: 22px; color: var(--accent, #15803d); }
header .back-link {
  font-size: 13px;
  color: #6b7280;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 4px;
}
header .back-link:hover { color: var(--accent, #15803d); }
.header-meta { font-size: 13px; color: #6b7280; }

.container { max-width: 1280px; margin: 24px auto; padding: 0 24px; }

.section {
  background: white;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.section h2 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: var(--accent, #15803d);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.section h2 .badge {
  background: color-mix(in srgb, var(--accent, #15803d) 12%, white);
  color: var(--accent, #15803d);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 500;
}

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.metric-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #15803d) 6%, white) 0%, color-mix(in srgb, var(--accent, #15803d) 3%, white) 100%);
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 4px solid var(--accent, #15803d);
}
.metric-card .label { font-size: 11px; color: #6b7280; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.metric-card .value { font-size: 26px; font-weight: 600; color: var(--accent, #15803d); }
.metric-card .sub { font-size: 11px; color: #6b7280; margin-top: 4px; }
.metric-card.warn { background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%); border-left-color: #d97706; }
.metric-card.warn .value { color: #d97706; }
.metric-card.bad { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); border-left-color: #dc2626; }
.metric-card.bad .value { color: #dc2626; }

.chart-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-top: 16px; }
.chart-box { background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.chart-box h3 { margin: 0 0 12px 0; font-size: 14px; color: #374151; }
.chart-box canvas { max-height: 260px; }

.text-list { max-height: 360px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 8px; background: #f9fafb; }
.text-list .item { padding: 10px 14px; border-bottom: 1px solid #e5e7eb; font-size: 13px; line-height: 1.5; }
.text-list .item:last-child { border-bottom: none; }
.text-list .item .meta { font-size: 11px; color: #9ca3af; margin-bottom: 4px; }

.error-state { padding: 16px; background: #fef2f2; color: #991b1b; border-radius: 8px; }
.empty-state { text-align: center; padding: 40px 20px; color: #9ca3af; }
.refresh-note { font-size: 11px; color: #9ca3af; text-align: right; margin-top: 8px; }
.refresh-note a { color: #6b7280; }

/* Landing page */
.landing-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 56px 24px;
}
.landing-wrap .brand {
  text-align: center;
  margin-bottom: 8px;
}
.landing-wrap .brand .logo {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}
.landing-wrap .brand .subtitle {
  font-size: 15px;
  color: #6b7280;
  margin-top: 6px;
}
.landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.landing-card {
  background: white;
  border-radius: 14px;
  padding: 28px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  text-decoration: none;
  color: inherit;
  border-top: 5px solid var(--accent, #15803d);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}
.landing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.landing-card .num {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent, #15803d);
  text-transform: uppercase;
}
.landing-card .title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 8px 0 10px;
  line-height: 1.4;
}
.landing-card .desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
  flex-grow: 1;
}
.landing-card .arrow {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent, #15803d);
}
.landing-footer {
  text-align: center;
  margin-top: 48px;
  font-size: 12px;
  color: #9ca3af;
}
