:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --border: #e3e7ed;
  --text: #1f2a37;
  --text-muted: #5b6573;
  --icon: #4a5361;
  --primary: #1a73c9;
  --primary-soft: #e3effb;
  --danger: #c62828;
  --danger-soft: #f28b8b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  display: grid;
  grid-template-columns: 60px 1fr;
  grid-template-rows: 52px 1fr;
  height: 100vh;
}

.sidebar {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.logo {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-style: italic;
  font-size: 15px;
  color: #10233f;
  letter-spacing: -0.5px;
}

.nav-group {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.nav-group li {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--icon);
}

.nav-group li.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.nav-group li.muted {
  color: #b4bac3;
}

.nav-group.bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  width: 40px;
  gap: 6px;
}

.nav-group li.accent {
  color: var(--primary);
}

.expand {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  color: var(--icon);
}

.expand svg {
  width: 16px;
  height: 16px;
}

.header {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.patient {
  padding: 0 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.patient-name {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.patient-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sep {
  width: 1px;
  height: 12px;
  background: var(--text-muted);
}

.chips {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: 13px;
  white-space: nowrap;
  font-size: 12.5px;
}

.chip-allergy {
  background: var(--danger-soft);
  color: #fff;
}

.chip-alert {
  border: 1px solid var(--danger);
  color: var(--danger);
}

.chip-outline {
  border: 1px solid #9aa3ae;
  color: var(--text);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--icon);
}

.icon-btn.add {
  color: var(--primary);
}

.icon-btn.tree {
  color: #2e9a52;
}

.icon-btn.tree sub {
  position: absolute;
  right: -7px;
  bottom: -6px;
  font-size: 9px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 13px;
  height: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tools {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
}

.tools svg {
  width: 22px;
  height: 22px;
}

.professional {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 100%;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.prof-name {
  font-weight: 500;
}

.prof-role {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.content {
  background: var(--bg);
}

@media (max-width: 900px) {
  .chips,
  .tools {
    display: none;
  }

  .header {
    justify-content: space-between;
  }
}
