:root {
  --bg: #f4f7fb;
  --panel: #ffffffde;
  --text: #13253a;
  --muted: #4a6078;
  --brand: #0f9d9a;
  --brand-dark: #0a6967;
  --line: #d6dee8;
  --danger: #c2354a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 10% 20%, #d8eef8 0%, transparent 30%),
    radial-gradient(circle at 80% 80%, #d2f8ed 0%, transparent 30%), var(--bg);
  min-height: 100vh;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(42px);
  opacity: 0.22;
  pointer-events: none;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: #0f9d9a;
  top: -90px;
  left: -110px;
}

.orb-2 {
  width: 340px;
  height: 340px;
  background: #f2b705;
  right: -130px;
  bottom: -120px;
}

.topbar {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #dbe4ef;
  background: #fffffff0;
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
  z-index: 10;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 16px;
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  padding: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px #0a1b2d12;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pill {
  background: #deedf5;
  color: #204868;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 12px;
}

.input:focus {
  outline: 2px solid #0f9d9a66;
  border-color: var(--brand);
}

.btn {
  border-radius: 10px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover {
  background: var(--brand-dark);
}

.btn.ghost {
  color: #245575;
  background: #d8eaf4;
  border-color: #b4d6eb;
}

.patient-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  display: grid;
  gap: 8px;
}

.patient-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  background: #fff;
}

.patient-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px #0a1b2d10;
}

.patient-item.active {
  border-color: #3ca6c4;
  background: #e8f7ff;
}

.patient-item .meta {
  color: var(--muted);
  font-size: 12px;
}

.state {
  color: var(--muted);
  padding: 12px 0;
}

.state.error {
  color: var(--danger);
}

.hidden {
  display: none;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
  padding: 12px;
  background: #fbfeff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.section {
  margin-top: 14px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid #bad5e6;
  background: #e8f4fb;
  color: #244760;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.visit-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.visit-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.visit-meta {
  color: var(--muted);
  font-size: 13px;
}

.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  font-size: 14px;
  padding-top: 6px;
}

.kv b {
  color: #244760;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .patient-list {
    max-height: 260px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

