:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7fb;
  color: #1f2937;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f6f7fb; }
.app { max-width: 1240px; margin: 0 auto; padding: 24px; }
.header h1 { margin: 0 0 6px; font-size: 2rem; }
.header p { margin: 0 0 20px; color: #6b7280; }
.layout { display: grid; grid-template-columns: 1.2fr 0.9fr; gap: 20px; }
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}
.form-card { grid-column: 1; }
.summary-card { grid-column: 2; }
.history-card { grid-column: 1 / span 2; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 0.95rem; }
label.full { grid-column: 1 / -1; }
input, select, textarea, button {
  font: inherit;
  border-radius: 12px;
}
input, select, textarea {
  border: 1px solid #d1d5db;
  padding: 12px 14px;
  background: #fff;
}
textarea { resize: vertical; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
button {
  border: 0;
  padding: 12px 16px;
  cursor: pointer;
  background: #e5e7eb;
  font-weight: 700;
}
button.primary { background: #2563eb; color: white; }
button.danger { background: #ef4444; color: white; }
.summary-list { display: grid; gap: 10px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f9fafb;
}
.summary-row strong { font-size: 1.05rem; }
.health {
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  font-weight: 700;
}
.health.low { background: #fee2e2; color: #991b1b; }
.health.mid { background: #fef3c7; color: #92400e; }
.health.high { background: #dcfce7; color: #166534; }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.history-list { display: grid; gap: 12px; margin-top: 16px; }
.history-item {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #fafafa;
}
.history-item h3 { margin: 0 0 8px; }
.history-meta, .history-values { color: #6b7280; font-size: 0.92rem; }
.history-values { margin-top: 8px; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .form-card, .summary-card, .history-card { grid-column: auto; }
  .grid.two { grid-template-columns: 1fr; }
}
