:root {
  color-scheme: light;
  --bg: #eef3f1;
  --surface: #ffffff;
  --surface-2: #f6f9f8;
  --ink: #17211f;
  --muted: #5b6b67;
  --line: #d9e2df;
  --primary: #0f766e;
  --primary-ink: #ffffff;
  --accent: #4257c9;
  --shadow: 0 18px 50px rgba(31, 48, 45, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(66, 87, 201, 0.4);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 24px;
  background: #142220;
  color: #edf7f5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #d8fff9;
  color: #10201d;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: #a8beb9;
}

nav {
  display: grid;
  gap: 6px;
  margin-top: 36px;
}

nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: #cfe0dc;
  font-weight: 650;
}

nav a.active,
nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.workspace {
  padding: 32px;
}

.topbar,
.hero-panel,
.metric-grid,
.content-grid {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
}

h2 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 4vw, 2.65rem);
  line-height: 1.1;
}

h3 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  background: var(--primary);
  color: var(--primary-ink);
  white-space: nowrap;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: end;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel p {
  max-width: 700px;
  margin-bottom: 0;
}

.status-stack {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.status-stack span,
.status-stack small,
.metric-grid span,
.metric-grid small {
  color: var(--muted);
}

.status-stack strong {
  font-size: 1.25rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-grid article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-grid article {
  display: grid;
  min-height: 132px;
  padding: 18px;
}

.metric-grid strong {
  align-self: center;
  font-size: 1.55rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  min-height: 280px;
  padding: 20px;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-head button {
  padding: 0 16px;
  background: #e6ecea;
  color: var(--ink);
}

.empty-state,
.patient-workspace {
  display: grid;
  padding: 20px;
  border-radius: 8px;
  background: var(--surface-2);
}

.empty-state {
  min-height: 166px;
  place-content: center;
  border: 1px dashed #b9c7c3;
  text-align: center;
}

.empty-state p {
  max-width: 420px;
  margin-bottom: 0;
}

.patient-workspace {
  grid-template-columns: 180px minmax(0, 1fr) 180px;
  gap: 12px;
  min-height: 180px;
  border: 1px solid var(--line);
}

.patient-workspace aside,
.patient-workspace div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.patient-workspace div {
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
}

.patient-workspace span {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: #e9f0ee;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.workflow {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.security-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(1180px, 100%);
  margin: 18px auto 0;
}

.security-strip span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 700;
}

.workflow li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-weight: 700;
}

.workflow span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #d7eee9;
  color: #0f3f39;
  font-size: 0.86rem;
}

@media (max-width: 860px) {
  .app-shell,
  .hero-panel,
  .content-grid,
  .patient-workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

  nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin-top: 16px;
    overflow-x: auto;
  }

  nav a {
    justify-content: center;
    min-width: max-content;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .hero-panel,
  .panel {
    padding: 18px;
  }
}
