/* SarcoObesityKPI dashboard styles */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #1f2937;
  --muted: #64748b;
  --primary: #0e7490;
  --primary-soft: #e0f2fe;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);

  /* Phenotype palette (4 tones) */
  --pheno-robust: #15803d;
  --pheno-pre:    #f59e0b;
  --pheno-sarco:  #dc2626;
  --pheno-severe: #7f1d1d;
  --so-color:     #c026d3;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

header.topbar {
  background: linear-gradient(135deg, #134e4a, #0e7490);
  color: #fff;
  padding: 18px 28px;
  box-shadow: var(--shadow);
}
header.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
header.topbar .subtitle {
  font-size: 13px;
  opacity: 0.92;
  margin-top: 4px;
}

.disclaimer {
  background: #fef3c7;
  border-left: 4px solid #d97706;
  color: #78350f;
  padding: 10px 18px;
  font-size: 13px;
  margin: 0;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 80px;
}

section.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-bottom: 20px;
}
section.panel h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}
section.panel .desc {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 880px) {
  .row { grid-template-columns: 1fr; }
}

.chart-box {
  position: relative;
  width: 100%;
  height: 280px;
}
.chart-box.tall { height: 340px; }

.legend-pheno {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.legend-pheno .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

table.kpi {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.kpi th, table.kpi td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: center;
}
table.kpi th {
  background: var(--primary-soft);
  color: #0c4a6e;
  font-weight: 600;
}
table.kpi td.label {
  text-align: left;
  font-weight: 600;
  background: #f8fafc;
}
table.kpi tr.totalrow td { background: #f1f5f9; font-weight: 700; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #0c4a6e;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
  vertical-align: middle;
}
.pill.warn { background: #fef3c7; color: #78350f; }
.pill.bad  { background: #fee2e2; color: #7f1d1d; }
.pill.good { background: #dcfce7; color: #14532d; }

.kpi-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 880px) {
  .kpi-cards { grid-template-columns: repeat(2, 1fr); }
}
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.kpi-card .label { font-size: 12px; color: var(--muted); }
.kpi-card .value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 4px;
}
.kpi-card .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

footer.foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 24px 16px 40px;
}
