:root {
  --bg: #f4f7fb;
  --card: #fff;
  --text: #1a2332;
  --muted: #5b6b7c;
  --accent: #2a6fdb;
  --accent-soft: #e8f0fe;
  --danger: #c62828;
  --ok: #2e7d32;
  --border: #dbe3ee;
  --shadow: 0 8px 24px rgba(26, 35, 50, 0.06);
  --radius: 14px;
  font-family: "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(180deg, #eef3fa 0%, var(--bg) 240px);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 18px 48px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 22px;
}
.brand { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.02em; }
.brand span { color: var(--accent); }
.muted { color: var(--muted); font-size: 0.92rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.person-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.person-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(26,35,50,.1);
  text-decoration: none;
}
.person-card .name { font-size: 1.15rem; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.person-card .tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  margin-bottom: 10px;
}
.person-card .blurb {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.panel h2 { margin: 0 0 12px; font-size: 1.05rem; }
.login-box {
  max-width: 380px; margin: 10vh auto; padding: 28px;
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.login-box h1 { margin: 0 0 6px; font-size: 1.35rem; }
label { display: block; margin: 14px 0 6px; font-size: 0.9rem; color: var(--muted); }
input[type=text], input[type=password] {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); font-size: 1rem;
}
button, .btn {
  display: inline-block; margin-top: 16px; padding: 10px 16px;
  border: none; border-radius: 10px; background: var(--accent);
  color: #fff; font-size: 0.95rem; cursor: pointer;
}
button.ghost, .btn.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
}
.error { color: var(--danger); margin-top: 10px; font-size: 0.9rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative; padding: 0 0 18px 18px;
  border-left: 2px solid var(--accent-soft);
}
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
}
.timeline .when { font-weight: 600; }
.timeline .facility { color: var(--muted); font-size: 0.88rem; }
.timeline .notes { margin-top: 4px; color: var(--text); font-size: 0.92rem; white-space: pre-wrap; }
table.labs {
  width: 100%; border-collapse: collapse; font-size: 0.92rem;
}
table.labs th, table.labs td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
table.labs th { color: var(--muted); font-weight: 600; }
.flag-H { color: var(--danger); font-weight: 700; }
.flag-L { color: #ef6c00; font-weight: 700; }
.summary {
  white-space: pre-wrap; line-height: 1.55; font-size: 0.92rem; color: var(--text);
  background: #f8fafc; border-radius: 10px; padding: 12px; border: 1px dashed var(--border);
  max-height: 420px; overflow: auto;
}
.back { margin-bottom: 12px; display: inline-block; }
